Subversion Repositories Applications.projet

Rev

Rev 11 | Rev 70 | 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
// +------------------------------------------------------------------------------------------------------+
49 ddelon 22
// CVS : $Id: resume.php,v 1.3 2005-10-21 21:42:04 ddelon 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
49 ddelon 34
*@version       $Revision: 1.3 $
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
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()) {
49 ddelon 104
	$url = $GLOBALS['_GEN_commun']['url'] ;
105
	$url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
106
	$link=$url->getURL();
107
 
108
  //  $wiki_res .= '<div><a href="'.PROJET_URL_WIKINI.'wakka.php?wiki=PagePrincipale&wikini='.$projet->getWikini().'" target="_blank">'.PROJET_URL_WIKINI.'</a>' ;
109
    $wiki_res .= '<div><a href="'.$link.'">'.PROJET_WIKI_ASSOCIE.'</a>' ;
2 ddelon 110
    $wiki_res .= '</div>' ;
111
} else {
112
    $wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
113
}
114
// On charge les listes de discussion du projet
115
// Pour le moment seul ezmlm est supportée
116
 
117
$projet->getListesAssociees();
118
$sortie_liste = '' ;
119
 
120
$liste_ext_res = '' ;
121
if ($projet->avoirListe()) {
122
    ob_start() ;
123
    foreach ($projet->_listes_associes as $info_liste) {
124
        $liste = new ezmlm_php() ;
125
        // Paramétrage de la liste
126
 
127
        $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
128
 
129
        $liste->listname = $info_liste->getNom() ;
130
        $liste->listdomain = $info_liste->getDomaine();
131
 
132
        if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
133
            $liste->set_action($GLOBALS['action']) ;
134
            $liste->set_actionargs($GLOBALS['actionargs']) ;
135
        } else {
136
            $liste->set_action('list_info') ;
137
        }
138
        $liste->sendheaders	= false;
139
        $liste->sendbody        = false;
140
        $liste->sendfooters    = false;
141
        $liste->forcehref = $this->_url->getURL() ;
142
 
143
 
144
 
145
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
146
            $this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
147
            switch ($liste->action) {
148
                case "list_info":
149
                    $info = new ezmlm_listinfo();
150
 
151
                    if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
152
 
153
                    $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM) ;
154
                    $info->forcehref = $this->_url->getURL();
155
                    $info->listdir = $liste->listdir ;
156
                    $info->listname = $info_liste->getNom();
157
                    $info->listdomain = $info_liste->getDomaine() ;
158
                    $info->show_recentmsgs() ;
159
                    break;
160
            }
161
        } else {
162
            print PROJET_MESSAGE_LISTE_PRIVEE;
163
        }
164
            $sortie_liste = ob_get_contents() ;
165
            ob_end_clean() ;
166
    }
167
}
168
 
169
// Site internet associé
170
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
171
if ($projet->getEspaceInternet() != '') {
172
    $sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
173
} else {
174
    $sortie_web .= PROJET_PAS_DE_SITE ;
175
}
176
 
177
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
178
$listes_ext = new liste_externe ($this->_db) ;
179
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
180
 
181
if (count ($tableau_liste) != 0) {
182
    $liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
183
    for ($i = 0; $i < count ($tableau_liste); $i++) {
184
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
185
        //$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
186
        //$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" ;
188
        //$liste_ext_res .= '<br />'."\n" ;
189
    }
190
}
191
 
192
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
193
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
194
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
195
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
196
$retour .= $wiki_res ;
197
$retour .= $sortie_web ;
198
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
199
$retour .= $liste_ext_res.$sortie_liste ;
200
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
201
$retour .= $vue_liste_document->toHTML() ;
202
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
203
//$retour .= $sortie_liste ;
204
 
205
 
206
?>