Subversion Repositories Applications.projet

Rev

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

Rev 252 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: resume.php,v 1.13 2007-08-28 10:33:50 alexandre_tb Exp $
22
// CVS : $Id: resume.php,v 1.14 2008-08-25 15:02:49 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Action resume
26
* Action resume
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.13 $
34
*@version       $Revision: 1.14 $
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
//
Line 44... Line 45...
44
//
45
 
45
 
46
$retour = '';
46
$retour = '';
47
$loggue = false;
47
 
48
 
-
 
49
// creation de l'objet projet courant
Line -... Line 50...
-
 
50
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
-
 
51
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
-
 
52
$projet = new projet ($this->_db, $this->_id_projet) ;
-
 
53
		
-
 
54
 
-
 
55
/** Bloc resume avec lien resume */
-
 
56
$resume = $projet->getResume();
-
 
57
$bouton_resume = '';
48
// création de l'objet projet courant
58
$bouton_s_inscrire_au_projet = '';
49
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
59
 
50
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
60
 
Line 51... Line 61...
51
$projet = new projet ($this->_db, $this->_id_projet) ;
61
$lien_inscription = '';
52
 
62
 
53
// récupération de la liste des documents associés
63
// recuperation de la liste des documents associes
54
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
64
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
55
						PROJET_CHEMIN_ICONES, $this->_id_projet) ;
65
						PROJET_CHEMIN_ICONES, $this->_id_projet) ;
56
 
-
 
-
 
66
 
57
// création de la vue liste de document, on nettoie l'url
67
// creation de la vue liste de document, on nettoie l'url
58
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
68
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
59
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
69
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
Line -... Line 70...
-
 
70
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
-
 
71
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
Line 60... Line 72...
60
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
72
$bouton_deposer_doc = '';
61
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
73
// reglage de parametres de la vue
Line 62... Line 74...
62
 
74
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
-
 
75
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
63
// réglage de paramètres de la vue
76
 
64
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
77
$bouton_poster = ''; 
65
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
78
$bouton_desinscription_projet = '';
66
 
79
 
67
 
80
// verification des droits de l'utilisateur
Line 78... Line 91...
78
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
91
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
79
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
92
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
80
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
93
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
81
    if ($isAdm) $isCoord = true ;
94
    if ($isAdm) $isCoord = true ;
Line -... Line 95...
-
 
95
    
-
 
96
	include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
-
 
97
	$projet->getListesAssociees();
-
 
98
	foreach ($projet->_listes_associes as $info_liste) {
-
 
99
	    $inscription_liste = new inscription_liste($this->_db) ;
-
 
100
	    if ($inscription_liste->getStatutInscrit($info_liste->getId(),  $this->_auth) == 0) {
-
 
101
	        $action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
-
 
102
	        $label_inscription = 'S\'inscrire &agrave; la liste' ;
-
 
103
	    } else {
-
 
104
	        // L'action envoyer un mail
-
 
105
	        $action_inscription = PROJET_ENVOYER_UN_MAIL ;
-
 
106
	        $label_inscription = PROJET_ECRIRE_LISTE ;
-
 
107
	    }
-
 
108
	}
-
 
109
            
-
 
110
    switch ($participant->getStatut($id_u, $this->_id_projet))
-
 
111
    {
-
 
112
    	case PROJET_DROIT_AUCUN : 
-
 
113
    		$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
-
 
114
    		$lien_inscription = $this->_url->getURL();
-
 
115
    		$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
-
 
116
    		$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
-
 
117
    		$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
-
 
118
    		$lien_inscription = $this->_url->getURL();
-
 
119
    		$label_url_inscription = 'S\'inscrire &agrave; ce projet'; 
-
 
120
    		
-
 
121
    	break;
-
 
122
    	case PROJET_DROIT_CONTRIBUTEUR : 
-
 
123
    		$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
-
 
124
			$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
-
 
125
			$bouton_deposer_doc .= '<br style="clear:both" />';
-
 
126
			
-
 
127
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
-
 
128
			$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
-
 
129
			$bouton_desinscription_projet .= '<br style="clear:both" />';
-
 
130
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
-
 
131
            $bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
-
 
132
    	break;
-
 
133
    	case PROJET_DROIT_COORDINATEUR || PROJET_DROIT_ADMINISTRATEUR : 
-
 
134
    		$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
-
 
135
			$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
-
 
136
			$bouton_resume .= '<br style="clear:both" />';
-
 
137
			$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
-
 
138
			$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
-
 
139
			$bouton_deposer_doc .= '<br style="clear:both" />';
-
 
140
			
-
 
141
			if ($projet->avoirListe()) {
-
 
142
				$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
-
 
143
            	$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
-
 
144
            	
-
 
145
			}
-
 
146
    		
-
 
147
    	break;
-
 
148
    	case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
-
 
149
    		GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
-
 
150
			GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
-
 
151
				'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
-
 
152
				'element = $(\'projet_lien_login\');'."\n".
-
 
153
				'element.addEvent(
-
 
154
					\'click\', function() {
-
 
155
						fx.start({
-
 
156
							\'height\' : \'320px\'
-
 
157
						})
-
 
158
					}
-
 
159
				)});');
-
 
160
			$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
-
 
161
			$lien_login = '#';
-
 
162
    	break;
-
 
163
    }
-
 
164
    $bouton_poster .= '<br style="clear:both" />';
82
    
165
    
83
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
166
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
Line 84... Line 167...
84
    // si participant, on ajoute le champs visibilite
167
    // si participant, on ajoute le champs visibilite
85
    
168
    
86
    if ($statut !='' || $isAdm) {
169
    if ($statut !='' || $isAdm) {
87
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
170
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
88
        $visible = true ;
171
        $visible = true ;
89
    } else {
172
    } else {
90
 	   $visible = false ;
173
 	   $visible = false ;
91
    }
174
    }
92
	// récupération de la liste des documents associés
175
	// recuperation de la liste des documents associes
Line 93... Line 176...
93
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
176
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
94
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
177
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
Line 95... Line 178...
95
 
178
 
96
    
179
    
97
    // si chef de projet ou si propriétaire d'au moins 1 document
180
    // si chef de projet ou si proprietaire d'au moins 1 document
Line 106... Line 189...
106
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
189
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
107
        array_push ($entete_liste, PROJET_ACTION) ;
190
        array_push ($entete_liste, PROJET_ACTION) ;
108
    }
191
    }
109
} else {
192
} else {
110
    $droits = PROJET_DROIT_AUCUN ;
193
    $droits = PROJET_DROIT_AUCUN ;
111
    // récupération de la liste des documents associés
194
    // recuperation de la liste des documents associes
112
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
195
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
113
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
196
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
-
 
197
	$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
-
 
198
	$label_url_inscription = 'S\'inscrire &agrave; ce projet';
114
    
199
	
-
 
200
	GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
-
 
201
	GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
-
 
202
	GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
-
 
203
			'animatedcollapse.init();' ."\n");
-
 
204
	$lien_login = '#';
115
}
205
}
116
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
206
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
Line 117... Line 207...
117
 
207
 
118
$vue_liste_document->construitEntete($entete_liste) ;
208
$vue_liste_document->construitEntete($entete_liste) ;
Line 119... Line 209...
119
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
209
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
120
 
210
 
121
$wiki_res = '' ;
211
$wiki_res = '' ;
122
// Les wikinis associés au projet
212
// Les wikinis associes au projet
Line 123... Line 213...
123
if ($projet->getWikini()) {
213
if ($projet->getWikini()) {
124
	$url = $GLOBALS['_GEN_commun']['url'] ;
214
	$url = $GLOBALS['_GEN_commun']['url'] ;
Line 130... Line 220...
130
    $wiki_res .= '</div>' ;
220
    $wiki_res .= '</div>' ;
131
} else {
221
} else {
132
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
222
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
133
}
223
}
134
// On charge les listes de discussion du projet
224
// On charge les listes de discussion du projet
135
// Pour le moment seul ezmlm est supportée
225
// Pour le moment seul ezmlm est supportee
Line 136... Line 226...
136
 
226
 
137
$projet->getListesAssociees();
227
$projet->getListesAssociees();
Line -... Line 228...
-
 
228
$sortie_liste = '' ;
138
$sortie_liste = '' ;
229
 
139
 
230
 
140
$liste_ext_res = '' ;
231
$liste_ext_res = '' ;
141
if ($projet->avoirListe()) {
232
if ($projet->avoirListe()) {
142
    ob_start() ;
233
    ob_start() ;
Line 188... Line 279...
188
            $sortie_liste = ob_get_contents() ;
279
            $sortie_liste = ob_get_contents() ;
189
            ob_end_clean() ;
280
            ob_end_clean() ;
190
    }
281
    }
191
}
282
}
Line 192... Line 283...
192
 
283
 
193
// Site internet associé
284
// Site internet associe
194
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
285
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
195
if ($projet->getEspaceInternet() != '') {
286
if ($projet->getEspaceInternet() != '') {
196
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
287
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'">'.$projet->getEspaceInternet().'</a>'."\n" ;
197
} else {
288
} else {
198
    $sortie_web .= PROJET_PAS_DE_SITE ;
289
    $sortie_web .= PROJET_PAS_DE_SITE ;
Line 199... Line 290...
199
}
290
}
Line 204... Line 295...
204
 
295
 
205
if (count ($tableau_liste) != 0) {
296
if (count ($tableau_liste) != 0) {
206
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
297
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
207
    for ($i = 0; $i < count ($tableau_liste); $i++) {
298
    for ($i = 0; $i < count ($tableau_liste); $i++) {
208
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
-
 
209
        //$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
-
 
210
        //$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
299
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
211
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
-
 
212
        //$liste_ext_res .= '<br />'."\n" ;
300
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
-
 
301
    }
-
 
302
    $avoir_liste_externe = true;
-
 
303
} else {
213
    }
304
	$avoir_liste_externe = false;
-
 
305
}
Line 214... Line 306...
214
}
306
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
215
 
-
 
216
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
-
 
217
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
-
 
218
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
-
 
219
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
307
 
220
$retour .= $wiki_res ;
308
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre();
-
 
309
ob_start();
221
$retour .= $sortie_web ;
310
include_once PROJET_CHEMIN_APPLI.'/squelettes/resume.tpl.html';
222
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
-
 
223
$retour .= $liste_ext_res.$sortie_liste ;
311
 
224
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
312
$retour .= ob_get_contents();
-
 
313
ob_end_clean();
225
$retour .= $vue_liste_document->toHTML('', '') ;
314
/* +--Fin du code ----------------------------------------------------------------------------------------+
226
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
315
*
-
 
316
* $Log: not supported by cvs2svn $
-
 
317
*
Line 227... Line 318...
227
//$retour .= $sortie_liste ;
318
* +-- Fin du code ----------------------------------------------------------------------------------------+
228
 
319
*/