Subversion Repositories Applications.projet

Rev

Rev 208 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 208 Rev 294
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: description.php,v 1.3 2007-04-19 15:34:35 neiluj Exp $
22
// CVS : $Id: description.php,v 1.4 2008-08-25 15:02:35 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Action description
26
* Action description
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2005
33
*@copyright     Tela-Botanica 2000-2005
34
*@version       $Revision: 1.3 $
34
*@version       $Revision: 1.4 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
Line 40... Line 40...
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
// RAPPEL IMPORTANT
42
// RAPPEL IMPORTANT
Line 43... Line 43...
43
// On se situe dans la méthode run() de la classe projetControleur
43
// On se situe dans la methode run() de la classe projetControleur
44
//
44
//
-
 
45
 
45
 
46
// creation de l'objet projet courant
Line -... Line 47...
-
 
47
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
-
 
48
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
-
 
49
$projet = new projet ($this->_db, $this->_id_projet) ;
-
 
50
 
-
 
51
if ($this->_auth->getAuth()) {
-
 
52
	$loggue = true;
-
 
53
	$droits = PROJET_DROIT_AUCUN;
-
 
54
    $participant = new participe($this->_db) ;
-
 
55
    $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
-
 
56
    $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
-
 
57
    $isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
-
 
58
    if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
-
 
59
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
-
 
60
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
-
 
61
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
-
 
62
    if ($isAdm) $isCoord = true ;
-
 
63
 
-
 
64
            
-
 
65
    switch ($participant->getStatut($id_u, $this->_id_projet))
-
 
66
    {
-
 
67
    	case PROJET_DROIT_AUCUN : 
-
 
68
    		$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
-
 
69
    		$lien_inscription = $this->_url->getURL();
-
 
70
    		$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
-
 
71
    		$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
46
// création de l'objet projet courant
72
    		$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
-
 
73
    		$lien_inscription = $this->_url->getURL();
-
 
74
    		$label_url_inscription = 'S\'inscrire &agrave; ce projet'; 
-
 
75
    		$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> <div id="projet_lien_inscription">
-
 
76
    <a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>
-
 
77
  </div>';
-
 
78
    	break;
-
 
79
    	case PROJET_DROIT_CONTRIBUTEUR : 
-
 
80
    		$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
-
 
81
			$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
-
 
82
			
-
 
83
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
-
 
84
			$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
47
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
85
			
-
 
86
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
-
 
87
            $bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
-
 
88
    	break;
-
 
89
    	case PROJET_DROIT_COORDINATEUR : 
-
 
90
    		$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
-
 
91
			$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
-
 
92
			
-
 
93
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
-
 
94
			$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
-
 
95
			
-
 
96
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
-
 
97
            $bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
-
 
98
			
-
 
99
    		
-
 
100
    	break;
48
$projet = new projet ($this->_db, $this->_id_projet) ;
101
    	case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
-
 
102
    		GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
-
 
103
			GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
-
 
104
				'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
-
 
105
				'element = $(\'projet_lien_login\');'."\n".
-
 
106
				'element.addEvent(
-
 
107
					\'click\', function() {
-
 
108
						fx.start({
-
 
109
							\'height\' : \'320px\'
-
 
110
						})
-
 
111
					}
-
 
112
				)});');
-
 
113
			$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
-
 
114
			$lien_login = '#';
-
 
115
    	break;
-
 
116
    }
-
 
117
    
-
 
118
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
-
 
119
    // si participant, on ajoute le champs visibilite
-
 
120
    
-
 
121
    if ($statut !='' || $isAdm) {
-
 
122
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
-
 
123
        $visible = true ;
-
 
124
    } else {
-
 
125
 	   $visible = false ;
-
 
126
    }
-
 
127
	// recuperation de la liste des documents associes
-
 
128
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
-
 
129
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
-
 
130
 
-
 
131
    
-
 
132
    // si chef de projet ou si proprietaire d'au moins 1 document
-
 
133
    $proprietaire_un_document = false ;
49
 
134
 
-
 
135
    foreach ($liste_documents as $document) {
-
 
136
        if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
-
 
137
            $proprietaire_un_document = true ;
-
 
138
            $droits = PROJET_DROIT_PROPRIETAIRE ;
-
 
139
        }
-
 
140
    }
-
 
141
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
-
 
142
        array_push ($entete_liste, PROJET_ACTION) ;
-
 
143
    }
-
 
144
} else {
-
 
145
    $droits = PROJET_DROIT_AUCUN ;
50
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
146
    // recuperation de la liste des documents associes
-
 
147
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
-
 
148
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
-
 
149
	$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
-
 
150
	$label_url_inscription = 'S\'inscrire &agrave; ce projet';
-
 
151
	
-
 
152
	GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
-
 
153
	GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
51
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
154
	GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
-
 
155
			'animatedcollapse.init();' ."\n");
52
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
156
	$lien_login = '#';    
-
 
157
}
-
 
158
 
-
 
159
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DESCRIPTION;
-
 
160
 
-
 
161
ob_start();
-
 
162
include_once PROJET_CHEMIN_APPLI.'/squelettes/description.tpl.html';
-
 
163
$retour .= ob_get_contents();
-
 
164
ob_end_clean();
-
 
165
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
166
*
53
$retour .= '<h2>'.PROJET_DESCRIPTION.'</h2>' ;
167
* $Log: not supported by cvs2svn $
54
$retour .= '<div>'.$projet->getDescription().'</div>'."\n" ;
168
*