Subversion Repositories Applications.projet

Rev

Rev 150 | Rev 252 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 208
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU General Public                                                  |
9
// | modify it under the terms of the GNU General Public                                                  |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | General Public License for more details.                                                             |
16
// | General Public License for more details.                                                             |
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.11 2006-12-11 14:50:57 alexandre_tb Exp $
22
// CVS : $Id: resume.php,v 1.12 2007-04-19 15:34:35 neiluj Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Action resume
26
* Action resume
27
*
27
*
28
*@package projet
28
*@package projet
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.11 $
34
*@version       $Revision: 1.12 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
// RAPPEL IMPORTANT
42
// RAPPEL IMPORTANT
43
// On se situe dans la méthode run() de la classe projetControleur
43
// On se situe dans la méthode run() de la classe projetControleur
44
//
44
//
45
 
45
 
46
$retour = '';
46
$retour = '';
47
 
47
 
48
// création de l'objet projet courant
48
// création de l'objet projet courant
-
 
49
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
-
 
50
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
49
$projet = new projet ($this->_db, $this->_id_projet) ;
51
$projet = new projet ($this->_db, $this->_id_projet) ;
50
 
52
 
51
// récupération de la liste des documents associés
53
// récupération de la liste des documents associés
52
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
54
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
53
						PROJET_CHEMIN_ICONES, $this->_id_projet) ;
55
						PROJET_CHEMIN_ICONES, $this->_id_projet) ;
54
 
56
 
55
// création de la vue liste de document, on nettoie l'url
57
// création de la vue liste de document, on nettoie l'url
56
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
58
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
57
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
59
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
58
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
60
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
59
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
61
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
60
 
62
 
61
// réglage de paramètres de la vue
63
// réglage de paramètres de la vue
62
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
64
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
63
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
65
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
64
 
66
 
65
 
67
 
66
// vérification des droits de l'utilisateur
68
// vérification des droits de l'utilisateur
67
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
69
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
68
 
70
 
69
if ($this->_auth->getAuth()) {
71
if ($this->_auth->getAuth()) {
70
	$droits = PROJET_DROIT_AUCUN;
72
	$droits = PROJET_DROIT_AUCUN;
71
    $participant = new participe($this->_db) ;
73
    $participant = new participe($this->_db) ;
72
    $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
74
    $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
73
    $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
75
    $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
74
    $isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
76
    $isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
75
    if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
77
    if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
76
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
78
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
77
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
79
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
78
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
80
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
79
    if ($isAdm) $isCoord = true ;
81
    if ($isAdm) $isCoord = true ;
80
    
82
    
81
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
83
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
82
    // si participant, on ajoute le champs visibilite
84
    // si participant, on ajoute le champs visibilite
83
    
85
    
84
    if ($statut !='' || $isAdm) {
86
    if ($statut !='' || $isAdm) {
85
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
87
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
86
        $visible = true ;
88
        $visible = true ;
87
    } else {
89
    } else {
88
 	   $visible = false ;
90
 	   $visible = false ;
89
    }
91
    }
90
	// récupération de la liste des documents associés
92
	// récupération de la liste des documents associés
91
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
93
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
92
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
94
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
93
 
95
 
94
    
96
    
95
    // si chef de projet ou si propriétaire d'au moins 1 document
97
    // si chef de projet ou si propriétaire d'au moins 1 document
96
    $proprietaire_un_document = false ;
98
    $proprietaire_un_document = false ;
97
 
99
 
98
    foreach ($liste_documents as $document) {
100
    foreach ($liste_documents as $document) {
99
        if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
101
        if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
100
            $proprietaire_un_document = true ;
102
            $proprietaire_un_document = true ;
101
            $droits = PROJET_DROIT_PROPRIETAIRE ;
103
            $droits = PROJET_DROIT_PROPRIETAIRE ;
102
        }
104
        }
103
    }
105
    }
104
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
106
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
105
        array_push ($entete_liste, PROJET_ACTION) ;
107
        array_push ($entete_liste, PROJET_ACTION) ;
106
    }
108
    }
107
} else {
109
} else {
108
    $droits = PROJET_DROIT_AUCUN ;
110
    $droits = PROJET_DROIT_AUCUN ;
109
    // récupération de la liste des documents associés
111
    // récupération de la liste des documents associés
110
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
112
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
111
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
113
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
112
    
114
    
113
}
115
}
114
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
116
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
115
 
117
 
116
$vue_liste_document->construitEntete($entete_liste) ;
118
$vue_liste_document->construitEntete($entete_liste) ;
117
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
119
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
118
 
120
 
119
$wiki_res = '' ;
121
$wiki_res = '' ;
120
// Les wikinis associés au projet
122
// Les wikinis associés au projet
121
if ($projet->getWikini()) {
123
if ($projet->getWikini()) {
122
	$url = $GLOBALS['_GEN_commun']['url'] ;
124
	$url = $GLOBALS['_GEN_commun']['url'] ;
123
	
125
	
124
	$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
126
	$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
125
	$link=$this->_url->getURL();
127
	$link=$this->_url->getURL();
126
 
128
 
127
    $wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$projet->getWikini().')' ;
129
    $wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$projet->getWikini().')' ;
128
    $wiki_res .= '</div>' ;
130
    $wiki_res .= '</div>' ;
129
} else {
131
} else {
130
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
132
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
131
}
133
}
132
// On charge les listes de discussion du projet
134
// On charge les listes de discussion du projet
133
// Pour le moment seul ezmlm est supportée
135
// Pour le moment seul ezmlm est supportée
134
 
136
 
135
$projet->getListesAssociees();
137
$projet->getListesAssociees();
136
$sortie_liste = '' ;
138
$sortie_liste = '' ;
137
 
139
 
138
$liste_ext_res = '' ;
140
$liste_ext_res = '' ;
139
if ($projet->avoirListe()) {
141
if ($projet->avoirListe()) {
140
    ob_start() ;
142
    ob_start() ;
-
 
143
    include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
141
    foreach ($projet->_listes_associes as $info_liste) {
144
    foreach ($projet->_listes_associes as $info_liste) {
142
        $liste = new ezmlm_php() ;
145
        $liste = new ezmlm_php() ;
143
        // Paramétrage de la liste
146
        // Paramétrage de la liste
144
        
147
        
145
        $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
148
        $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
146
        
149
        
147
        $liste->listname = $info_liste->getNom() ;
150
        $liste->listname = $info_liste->getNom() ;
148
        $liste->listdomain = $info_liste->getDomaine();
151
        $liste->listdomain = $info_liste->getDomaine();
149
    
152
    
150
        if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
153
        if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
151
            $liste->set_action($GLOBALS['action']) ;
154
            $liste->set_action($GLOBALS['action']) ;
152
            $liste->set_actionargs($GLOBALS['actionargs']) ;
155
            $liste->set_actionargs($GLOBALS['actionargs']) ;
153
        } else {
156
        } else {
154
            $liste->set_action('list_info') ;
157
            $liste->set_action('list_info') ;
155
        }
158
        }
156
        $liste->sendheaders	= false;
159
        $liste->sendheaders	= false;
157
        $liste->sendbody        = false;
160
        $liste->sendbody        = false;
158
        $liste->sendfooters    = false;
161
        $liste->sendfooters    = false;
159
        $liste->forcehref = $this->_url->getURL() ;
162
        $liste->forcehref = $this->_url->getURL() ;
160
        
163
        
161
        
164
        
162
 
165
 
163
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
166
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
164
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
167
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
165
            switch ($liste->action) {
168
            switch ($liste->action) {
166
                case "list_info":
169
                case "list_info":
167
                    $this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
170
                    $this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
168
        		    $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
171
        		    $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
169
            									$info_liste->getNom(), $GLOBALS['lang'], 
172
            									$info_liste->getNom(), $GLOBALS['lang'], 
170
            									$this->_url->getURL()) ;
173
            									$this->_url->getURL()) ;
171
			
174
			
172
                    $xml_parser->reset() ;
175
                    $xml_parser->reset() ;
173
					$xml_parser->setAction ('derniers_messages');
176
					$xml_parser->setAction ('derniers_messages');
174
                    $xml_parser->load();
177
                    $xml_parser->load();
175
                    ob_start ();
178
                    ob_start ();
176
                    $xml_parser->parse() ;
179
                    $xml_parser->parse() ;
177
                    $derniers_messages = ob_get_contents() ;
180
                    $derniers_messages = ob_get_contents() ;
178
                    ob_end_clean();
181
                    ob_end_clean();
179
                    echo $derniers_messages ;
182
                    echo $derniers_messages ;
180
                    break;
183
                    break;
181
            }
184
            }
182
        } else {
185
        } else {
183
            print PROJET_MESSAGE_LISTE_PRIVEE;
186
            print PROJET_MESSAGE_LISTE_PRIVEE;
184
        }
187
        }
185
            $sortie_liste = ob_get_contents() ;
188
            $sortie_liste = ob_get_contents() ;
186
            ob_end_clean() ;
189
            ob_end_clean() ;
187
    }
190
    }
188
}
191
}
189
 
192
 
190
// Site internet associé
193
// Site internet associé
191
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
194
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
192
if ($projet->getEspaceInternet() != '') {
195
if ($projet->getEspaceInternet() != '') {
193
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
196
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
194
} else {
197
} else {
195
    $sortie_web .= PROJET_PAS_DE_SITE ;
198
    $sortie_web .= PROJET_PAS_DE_SITE ;
196
}
199
}
197
 
200
 
198
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
201
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
199
$listes_ext = new liste_externe ($this->_db) ;
202
$listes_ext = new liste_externe ($this->_db) ;
200
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
203
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
201
 
204
 
202
if (count ($tableau_liste) != 0) {
205
if (count ($tableau_liste) != 0) {
203
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
206
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
204
    for ($i = 0; $i < count ($tableau_liste); $i++) {
207
    for ($i = 0; $i < count ($tableau_liste); $i++) {
205
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
208
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
206
        //$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
209
        //$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
207
        //$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
210
        //$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
208
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
211
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
209
        //$liste_ext_res .= '<br />'."\n" ;
212
        //$liste_ext_res .= '<br />'."\n" ;
210
    }
213
    }
211
}
214
}
212
 
215
 
213
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
216
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
214
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
217
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
215
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
218
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
216
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
219
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
217
$retour .= $wiki_res ;
220
$retour .= $wiki_res ;
218
$retour .= $sortie_web ;
221
$retour .= $sortie_web ;
219
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
222
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
220
$retour .= $liste_ext_res.$sortie_liste ;
223
$retour .= $liste_ext_res.$sortie_liste ;
221
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
224
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
222
$retour .= $vue_liste_document->toHTML() ;
225
$retour .= $vue_liste_document->toHTML() ;
223
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
226
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
224
//$retour .= $sortie_liste ;
227
//$retour .= $sortie_liste ;
225
 
228
 
226
 
229
 
227
?>
230
?>