Subversion Repositories Applications.projet

Rev

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