| Line 17... |
Line 17... |
| 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: projetControleur.class.php,v 1.2 2005-09-23 13:58:07 ddelon Exp $
|
22 |
// CVS : $Id: projetControleur.class.php,v 1.3 2005-09-26 20:18:27 ddelon Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
* Application projet
|
24 |
* Application projet
|
| 25 |
*
|
25 |
*
|
| 26 |
* La classe controleur projet
|
26 |
* La classe controleur projet
|
| 27 |
*
|
27 |
*
|
| Line 29... |
Line 29... |
| 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-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
| 34 |
*@version $Revision: 1.2 $
|
34 |
*@version $Revision: 1.3 $
|
| 35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
| 36 |
*/
|
36 |
*/
|
| Line 37... |
Line 37... |
| 37 |
|
37 |
|
| 38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 187... |
Line 187... |
| 187 |
{
|
187 |
{
|
| 188 |
if ($this->_action == '') {
|
188 |
if ($this->_action == '') {
|
| 189 |
return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
|
189 |
return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
|
| 190 |
}
|
190 |
}
|
| Line -... |
Line 191... |
| - |
|
191 |
|
| 191 |
|
192 |
|
| 192 |
// Si il n'y a pas d'action mais un projet, on transmet par défaut l'action PROJET_VOIR
|
193 |
// Si il n'y a pas d'action mais un projet, on transmet par défaut l'action PROJET_VOIR
|
| 193 |
if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
|
194 |
if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
|
| 194 |
$this->_action = PROJET_ACTION_VOIR_RESUME ;
|
195 |
$this->_action = PROJET_ACTION_VOIR_RESUME ;
|
| 195 |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
|
196 |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
|
| - |
|
197 |
}
|
| 196 |
}
|
198 |
|
| 197 |
if ($this->_id_document != "") {
|
199 |
if ($this->_id_document != "") {
|
| 198 |
$this->_url->addQueryString (PROJET_VARIABLE_ID_DOCUMENT, $this->_id_document) ;
|
200 |
$this->_url->addQueryString (PROJET_VARIABLE_ID_DOCUMENT, $this->_id_document) ;
|
| 199 |
}
|
201 |
}
|
| 200 |
$retour = '' ;
|
202 |
$retour = '' ;
|
| Line -... |
Line 203... |
| - |
|
203 |
if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
|
| 201 |
if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
|
204 |
|
| 202 |
|
205 |
|
| 203 |
switch ($this->_action) {
|
206 |
switch ($this->_action) {
|
| 204 |
case PROJET_DEFAUT :
|
207 |
case PROJET_DEFAUT :
|
| 205 |
$retour .= $this->mesProjets() ;
|
208 |
$retour .= $this->mesProjets() ;
|
| Line 414... |
Line 417... |
| 414 |
if ($statut == '') $statut = 0 ;
|
417 |
if ($statut == '') $statut = 0 ;
|
| 415 |
}
|
418 |
}
|
| 416 |
}
|
419 |
}
|
| Line 417... |
Line 420... |
| 417 |
|
420 |
|
| 418 |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
|
421 |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
|
| 419 |
$ligne_tableau = array ($projet->getId(), $statut, '<a href="'.PROJET_CHEMIN_ATELIERS.$projet->getId().'">'.$projet->getTitre().'</a>') ;
|
422 |
$ligne_tableau = array ($projet->getId(), $statut, '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>') ;
|
| 420 |
if ($auth) {
|
423 |
if ($auth) {
|
| 421 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
|
424 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
|
| 422 |
array_push ($ligne_tableau, '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.
|
425 |
array_push ($ligne_tableau, '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.
|
| 423 |
PROJET_SE_DESINSCRIRE_CONFIRMATION.'\');">'.PROJET_SE_DESINSCRIRE.'</a>') ;
|
426 |
PROJET_SE_DESINSCRIRE_CONFIRMATION.'\');">'.PROJET_SE_DESINSCRIRE.'</a>') ;
|
| Line 460... |
Line 463... |
| 460 |
// La liste
|
463 |
// La liste
|
| Line 461... |
Line 464... |
| 461 |
|
464 |
|
| 462 |
foreach ($projetNonParticipantListe as $projet) {
|
465 |
foreach ($projetNonParticipantListe as $projet) {
|
| 463 |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
|
466 |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
|
| 464 |
$ligne_projet = array (
|
467 |
$ligne_projet = array (
|
| 465 |
'<a href="'.PROJET_CHEMIN_ATELIERS.$projet->getId().'">'.$projet->getTitre().'</a>' // le nom du projet
|
468 |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' // le nom du projet
|
| 466 |
) ;
|
469 |
) ;
|
| 467 |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
|
470 |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
|
| Line 468... |
Line 471... |
| 468 |
if ($auth) array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ;
|
471 |
if ($auth) array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ;
|
| Line 676... |
Line 679... |
| 676 |
{
|
679 |
{
|
| 677 |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
|
680 |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
|
| 678 |
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&', '&', $this->_url->getURL())) ;
|
681 |
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&', '&', $this->_url->getURL())) ;
|
| 679 |
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
|
682 |
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
|
| 680 |
if ($formulaire_projet->validate()) {
|
683 |
if ($formulaire_projet->validate()) {
|
| 681 |
|
- |
|
| 682 |
$projet = new projet ($this->_db) ;
|
684 |
$projet = new projet ($this->_db) ;
|
| 683 |
$projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
|
685 |
$projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
|
| 684 |
if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
|
686 |
if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
|
| 685 |
return 'erreur' ;
|
687 |
return 'erreur' ;
|
| 686 |
}
|
688 |
}
|