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 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
ddelon |
22 |
// CVS : $Id: HTML_listeProjet.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
|
2 |
ddelon |
23 |
/**
|
|
|
24 |
* Application projet
|
|
|
25 |
*
|
|
|
26 |
* La classe controleur projet
|
|
|
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-2004
|
6 |
ddelon |
34 |
*@version $Revision: 1.2 $
|
2 |
ddelon |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
// | ENTETE du PROGRAMME |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
|
|
|
43 |
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php' ;
|
|
|
44 |
|
|
|
45 |
/**
|
|
|
46 |
* class HTML_listeProjet
|
|
|
47 |
*
|
|
|
48 |
*/
|
|
|
49 |
class HTML_listeProjet extends HTML_Liste
|
|
|
50 |
{
|
|
|
51 |
/*** Attributes: ***/
|
|
|
52 |
/**
|
|
|
53 |
* 0 mode normal 1 mode modification, rajoute un formulaire pour modifier le statut
|
|
|
54 |
* d'un utilisateur.
|
|
|
55 |
* @access private
|
|
|
56 |
*/
|
|
|
57 |
var $_mode;
|
|
|
58 |
/**
|
|
|
59 |
* Un objet PEAR::Net_URL
|
|
|
60 |
* @access private
|
|
|
61 |
*/
|
|
|
62 |
var $_url;
|
|
|
63 |
|
|
|
64 |
/**
|
|
|
65 |
*
|
|
|
66 |
*
|
|
|
67 |
* @param bool utilise_pager Indique si les résultats sont divisés en page.
|
|
|
68 |
* @return void
|
|
|
69 |
* @access public
|
|
|
70 |
*/
|
|
|
71 |
function HTML_listeProjet( $utilise_pager = false )
|
|
|
72 |
{
|
|
|
73 |
HTML_Liste::HTML_Liste($utilise_pager, array ('class' => 'table_cadre')) ;
|
|
|
74 |
} // end of member function HTML_listeProjet
|
|
|
75 |
|
|
|
76 |
/**
|
|
|
77 |
*
|
|
|
78 |
*
|
|
|
79 |
* @return void
|
|
|
80 |
* @access public
|
|
|
81 |
*/
|
6 |
ddelon |
82 |
function __construct($utilise_pager = false)
|
2 |
ddelon |
83 |
{
|
6 |
ddelon |
84 |
$this->HTML_listeProjet($utilise_pager);
|
2 |
ddelon |
85 |
|
|
|
86 |
} // end of member function __cosntruct
|
|
|
87 |
|
|
|
88 |
/**
|
|
|
89 |
*
|
|
|
90 |
*
|
|
|
91 |
* @param Array label_entete Un tableau contenant les labels pour l'entête de la liste.
|
|
|
92 |
* @return void
|
|
|
93 |
* @access public
|
|
|
94 |
*/
|
|
|
95 |
function construitEntete( $label_entete )
|
|
|
96 |
{
|
|
|
97 |
$this->addRow ($label_entete, '', 'TH') ;
|
|
|
98 |
} // end of member function construitEntete
|
|
|
99 |
|
|
|
100 |
/**
|
|
|
101 |
*
|
|
|
102 |
*
|
|
|
103 |
* @param Array label_liste Un tableau à double dimension contenant les valeurs de la liste. du type
|
|
|
104 |
* 0 =>'label', 'label2',
|
|
|
105 |
* 1 => ...
|
|
|
106 |
* @return void
|
|
|
107 |
* @access public
|
|
|
108 |
*/
|
|
|
109 |
function construitListe( $label_liste, $tableau_statut = '' )
|
|
|
110 |
{
|
|
|
111 |
for ($i = 0; $i < count ($label_liste) ; $i++) {
|
|
|
112 |
if ($this->_mode == 1) {
|
|
|
113 |
$id_projet = array_shift ($label_liste[$i]) ;
|
|
|
114 |
$id_statut = array_shift ($label_liste[$i]) ;
|
|
|
115 |
$id_statut = array_pop ($label_liste[$i]) ;
|
|
|
116 |
}
|
|
|
117 |
|
|
|
118 |
$this->addRow ($label_liste[$i]) ;
|
|
|
119 |
|
|
|
120 |
if ($this->_mode == 1 && $id_statut < 3) {
|
|
|
121 |
$this->_url->addQueryString ('identifiant_projet', $id_projet) ;
|
|
|
122 |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
|
|
|
123 |
$select = '<form action="'.$this->_url->getURL().'" method="post" class="magali">'."\n" ;
|
|
|
124 |
$select .= '<select name="statut" onchange="javascript:this.form.submit();">' ;
|
|
|
125 |
foreach ($tableau_statut as $cle =>$element_statut) {
|
|
|
126 |
$select .= '<option value="'.$cle.'"' ;
|
|
|
127 |
if ($cle == $id_statut) {
|
|
|
128 |
$select .= ' selected="selected"' ;
|
|
|
129 |
}
|
|
|
130 |
$select .= '>'.$element_statut.'</option>'."\n" ;
|
|
|
131 |
}
|
|
|
132 |
$select .= '</select>'."\n".'</form>'."\n" ;
|
|
|
133 |
if ($id_statut != PROJET_PAS_DE_LISTE) $this->setCellContents($i+1, 2, $select) ;
|
|
|
134 |
}
|
|
|
135 |
}
|
|
|
136 |
$this->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire')) ;
|
|
|
137 |
|
|
|
138 |
} // end of member function construitListe
|
|
|
139 |
|
|
|
140 |
/**
|
|
|
141 |
*
|
|
|
142 |
*
|
|
|
143 |
* @return void
|
|
|
144 |
* @access public
|
|
|
145 |
*/
|
|
|
146 |
function setModeModification( )
|
|
|
147 |
{
|
|
|
148 |
$this->_mode = 1 ;
|
|
|
149 |
} // end of member function setModeModification
|
|
|
150 |
|
|
|
151 |
/**
|
|
|
152 |
*
|
|
|
153 |
*
|
|
|
154 |
* @param Net_URL url Un objet PEAR::Net_URL
|
|
|
155 |
* @return void
|
|
|
156 |
* @access public
|
|
|
157 |
*/
|
|
|
158 |
function setURL(& $url )
|
|
|
159 |
{
|
|
|
160 |
$this->_url = $url ;
|
|
|
161 |
} // end of member function setURL
|
|
|
162 |
|
|
|
163 |
} // end of HTML_listeProjet
|
|
|
164 |
?>
|