Subversion Repositories Applications.projet

Rev

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

Rev 130 Rev 133
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.9 2006-07-05 09:44:36 alexandre_tb Exp $
22
// CVS : $Id: resume.php,v 1.10 2006-09-15 12:34:59 alexandre_tb 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.9 $
34
*@version       $Revision: 1.10 $
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
 
47
 
47
// création de l'objet projet courant
48
// création de l'objet projet courant
48
$projet = new projet ($this->_db, $this->_id_projet) ;
49
$projet = new projet ($this->_db, $this->_id_projet) ;
49
 
50
 
50
// récupération de la liste des documents associés
51
// récupération de la liste des documents associés
51
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
52
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
52
						PROJET_CHEMIN_ICONES, $this->_id_projet) ;
53
						PROJET_CHEMIN_ICONES, $this->_id_projet) ;
53
 
54
 
54
// création de la vue liste de document, on nettoie l'url
55
// création de la vue liste de document, on nettoie l'url
55
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
56
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
56
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
57
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
57
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
58
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
58
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
59
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
59
 
60
 
60
// réglage de paramètres de la vue
61
// réglage de paramètres de la vue
61
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
62
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
62
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
63
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
63
 
64
 
64
 
65
 
65
// vérification des droits de l'utilisateur
66
// vérification des droits de l'utilisateur
66
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
67
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
67
 
68
 
68
if ($this->_auth->getAuth()) {
69
if ($this->_auth->getAuth()) {
69
	$droits = PROJET_DROIT_AUCUN;
70
	$droits = PROJET_DROIT_AUCUN;
70
    $participant = new participe($this->_db) ;
71
    $participant = new participe($this->_db) ;
71
    $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
72
    $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
72
    $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
73
    $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
73
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
74
    if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
74
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
75
    $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
75
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
76
    if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
76
    if ($isAdm) $isCoord = true ;
77
    if ($isAdm) $isCoord = true ;
77
    
78
    
78
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
79
    $statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
79
    // si participant, on ajoute le champs visibilite
80
    // si participant, on ajoute le champs visibilite
80
    
81
    
81
    if ($statut !='' || $isAdm) {
82
    if ($statut !='' || $isAdm) {
82
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
83
        array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
83
        $visible = true ;
84
        $visible = true ;
84
    } else {
85
    } else {
85
 	   $visible = false ;
86
 	   $visible = false ;
86
    }
87
    }
87
	// récupération de la liste des documents associés
88
	// récupération de la liste des documents associés
88
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
89
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
89
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
90
						PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
90
 
91
 
91
    
92
    
92
    // si chef de projet ou si propriétaire d'au moins 1 document
93
    // si chef de projet ou si propriétaire d'au moins 1 document
93
    $proprietaire_un_document = false ;
94
    $proprietaire_un_document = false ;
94
 
95
 
95
    foreach ($liste_documents as $document) {
96
    foreach ($liste_documents as $document) {
96
        if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
97
        if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
97
            $proprietaire_un_document = true ;
98
            $proprietaire_un_document = true ;
98
            $droits = PROJET_DROIT_PROPRIETAIRE ;
99
            $droits = PROJET_DROIT_PROPRIETAIRE ;
99
        }
100
        }
100
    }
101
    }
101
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
102
    if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
102
        array_push ($entete_liste, PROJET_ACTION) ;
103
        array_push ($entete_liste, PROJET_ACTION) ;
103
    }
104
    }
104
} else {
105
} else {
105
    $droits = PROJET_DROIT_AUCUN ;
106
    $droits = PROJET_DROIT_AUCUN ;
106
    // récupération de la liste des documents associés
107
    // récupération de la liste des documents associés
107
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
108
	$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, 
108
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
109
						PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
109
    
110
    
110
}
111
}
111
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
112
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
112
 
113
 
113
$vue_liste_document->construitEntete($entete_liste) ;
114
$vue_liste_document->construitEntete($entete_liste) ;
114
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
115
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
115
 
116
 
116
$wiki_res = '' ;
117
$wiki_res = '' ;
117
// Les wikinis associés au projet
118
// Les wikinis associés au projet
118
if ($projet->getWikini()) {
119
if ($projet->getWikini()) {
119
	$url = $GLOBALS['_GEN_commun']['url'] ;
120
	$url = $GLOBALS['_GEN_commun']['url'] ;
120
	
121
	
121
	$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
122
	$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
122
	$link=$this->_url->getURL();
123
	$link=$this->_url->getURL();
123
 
124
 
124
    $wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$projet->getWikini().')' ;
125
    $wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$projet->getWikini().')' ;
125
    $wiki_res .= '</div>' ;
126
    $wiki_res .= '</div>' ;
126
} else {
127
} else {
127
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
128
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
128
}
129
}
129
// On charge les listes de discussion du projet
130
// On charge les listes de discussion du projet
130
// Pour le moment seul ezmlm est supportée
131
// Pour le moment seul ezmlm est supportée
131
 
132
 
132
$projet->getListesAssociees();
133
$projet->getListesAssociees();
133
$sortie_liste = '' ;
134
$sortie_liste = '' ;
134
 
135
 
135
$liste_ext_res = '' ;
136
$liste_ext_res = '' ;
136
if ($projet->avoirListe()) {
137
if ($projet->avoirListe()) {
137
    ob_start() ;
138
    ob_start() ;
138
    foreach ($projet->_listes_associes as $info_liste) {
139
    foreach ($projet->_listes_associes as $info_liste) {
139
        $liste = new ezmlm_php() ;
140
        $liste = new ezmlm_php() ;
140
        // Paramétrage de la liste
141
        // Paramétrage de la liste
141
        
142
        
142
        $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
143
        $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
143
        
144
        
144
        $liste->listname = $info_liste->getNom() ;
145
        $liste->listname = $info_liste->getNom() ;
145
        $liste->listdomain = $info_liste->getDomaine();
146
        $liste->listdomain = $info_liste->getDomaine();
146
    
147
    
147
        if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
148
        if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
148
            $liste->set_action($GLOBALS['action']) ;
149
            $liste->set_action($GLOBALS['action']) ;
149
            $liste->set_actionargs($GLOBALS['actionargs']) ;
150
            $liste->set_actionargs($GLOBALS['actionargs']) ;
150
        } else {
151
        } else {
151
            $liste->set_action('list_info') ;
152
            $liste->set_action('list_info') ;
152
        }
153
        }
153
        $liste->sendheaders	= false;
154
        $liste->sendheaders	= false;
154
        $liste->sendbody        = false;
155
        $liste->sendbody        = false;
155
        $liste->sendfooters    = false;
156
        $liste->sendfooters    = false;
156
        $liste->forcehref = $this->_url->getURL() ;
157
        $liste->forcehref = $this->_url->getURL() ;
157
        
158
        
158
        
159
        
159
 
160
 
160
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
161
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
161
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
162
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
162
            switch ($liste->action) {
163
            switch ($liste->action) {
163
                case "list_info":
164
                case "list_info":
164
                    $this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
165
                    $this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
165
        		    $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
166
        		    $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
166
            									$info_liste->getNom(), $GLOBALS['lang'], 
167
            									$info_liste->getNom(), $GLOBALS['lang'], 
167
            									$this->_url->getURL()) ;
168
            									$this->_url->getURL()) ;
168
			
169
			
169
                    $xml_parser->reset() ;
170
                    $xml_parser->reset() ;
170
					$xml_parser->setAction ('derniers_messages');
171
					$xml_parser->setAction ('derniers_messages');
171
                    $xml_parser->load();
172
                    $xml_parser->load();
172
                    ob_start ();
173
                    ob_start ();
173
                    $xml_parser->parse() ;
174
                    $xml_parser->parse() ;
174
                    $derniers_messages = ob_get_contents() ;
175
                    $derniers_messages = ob_get_contents() ;
175
                    ob_end_clean();
176
                    ob_end_clean();
176
                    echo $derniers_messages ;
177
                    echo $derniers_messages ;
177
                    break;
178
                    break;
178
            }
179
            }
179
        } else {
180
        } else {
180
            print PROJET_MESSAGE_LISTE_PRIVEE;
181
            print PROJET_MESSAGE_LISTE_PRIVEE;
181
        }
182
        }
182
            $sortie_liste = ob_get_contents() ;
183
            $sortie_liste = ob_get_contents() ;
183
            ob_end_clean() ;
184
            ob_end_clean() ;
184
    }
185
    }
185
}
186
}
186
 
187
 
187
// Site internet associé
188
// Site internet associé
188
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
189
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
189
if ($projet->getEspaceInternet() != '') {
190
if ($projet->getEspaceInternet() != '') {
190
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
191
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
191
} else {
192
} else {
192
    $sortie_web .= PROJET_PAS_DE_SITE ;
193
    $sortie_web .= PROJET_PAS_DE_SITE ;
193
}
194
}
194
 
195
 
195
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
196
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
196
$listes_ext = new liste_externe ($this->_db) ;
197
$listes_ext = new liste_externe ($this->_db) ;
197
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
198
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
198
 
199
 
199
if (count ($tableau_liste) != 0) {
200
if (count ($tableau_liste) != 0) {
200
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
201
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
201
    for ($i = 0; $i < count ($tableau_liste); $i++) {
202
    for ($i = 0; $i < count ($tableau_liste); $i++) {
202
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
203
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
203
        //$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
204
        //$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
204
        //$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
205
        //$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
205
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
206
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
206
        //$liste_ext_res .= '<br />'."\n" ;
207
        //$liste_ext_res .= '<br />'."\n" ;
207
    }
208
    }
208
}
209
}
209
 
210
 
210
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
211
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
211
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
212
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
212
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
213
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
213
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
214
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
214
$retour .= $wiki_res ;
215
$retour .= $wiki_res ;
215
$retour .= $sortie_web ;
216
$retour .= $sortie_web ;
216
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
217
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
217
$retour .= $liste_ext_res.$sortie_liste ;
218
$retour .= $liste_ext_res.$sortie_liste ;
218
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
219
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
219
$retour .= $vue_liste_document->toHTML() ;
220
$retour .= $vue_liste_document->toHTML() ;
220
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
221
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
221
//$retour .= $sortie_liste ;
222
//$retour .= $sortie_liste ;
222
 
223
 
223
 
224
 
224
?>
225
?>