Subversion Repositories Applications.papyrus

Rev

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

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