Subversion Repositories Applications.projet

Rev

Rev 88 | Rev 113 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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