Subversion Repositories Applications.projet

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 ddelon 1
<?php
2
// +------------------------------------------------------------------------------------------------------+
3
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
4
// +------------------------------------------------------------------------------------------------------+
5
// | This library is free software; you can redistribute it and/or                                        |
6
// | modify it under the terms of the GNU General Public                                                  |
7
// | License as published by the Free Software Foundation; either                                         |
8
// | version 2.1 of the License, or (at your option) any later version.                                   |
9
// |                                                                                                      |
10
// | This library is distributed in the hope that it will be useful,                                      |
11
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
12
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
13
// | General Public License for more details.                                                             |
14
// |                                                                                                      |
15
// | You should have received a copy of the GNU General Public                                            |
16
// | License along with this library; if not, write to the Free Software                                  |
17
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
18
// +------------------------------------------------------------------------------------------------------+
11 alexandre_ 19
// CVS : $Id: HTML_formulaireInscriptionProjet.class.php,v 1.2 2005-09-27 16:40:23 alexandre_tb Exp $
2 ddelon 20
/**
21
* Application projet
22
*
23
* La classe HTML_formulaireInscriptionProjet
24
* Elle se base sur la table projet_statut_utilisateur
25
*
26
*@package projet
27
//Auteur original :
28
*@author        Alexandre Granier <alexandre@tela-botanica.org>
29
//Autres auteurs :
30
*@author        Aucun
31
*@copyright     Tela-Botanica 2000-2004
11 alexandre_ 32
*@version       $Revision: 1.2 $
2 ddelon 33
// +------------------------------------------------------------------------------------------------------+
34
*/
35
 
36
 
37
// +------------------------------------------------------------------------------------------------------+
38
// |                                            ENTETE du PROGRAMME                                       |
39
// +------------------------------------------------------------------------------------------------------+
40
 
41
require_once 'HTML/QuickForm/radio.php';
42
 
43
/**
44
 * class HTML_formulaireInscriptionProjet
45
 *
46
 */
47
class HTML_formulaireInscriptionProjet extends HTML_QuickForm
48
{
49
     /*** Attributes: ***/
50
 
51
    /**
52
     *
53
     *
54
     * @return void
55
     * @access public
56
     */
57
    function HTML_formulaireInscriptionProjet( $formName = '',  $method = 'post',  $action = '',  $target = '_self',  $attributes = '',  $trackSubmit = false )
58
    {
59
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
60
    } // end of member function HTML_formulaireInscriptionProjet
61
 
62
    /**
63
     *
64
     *
65
     * @return void
66
     * @access public
67
     */
68
    function construitFormulaire(& $projet )
69
    {
70
         $squelette =& $this->defaultRenderer();
71
        $squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
72
 
73
        $modele_element_debut = '<li class="groupe_formulaire">'."\n".'<span class="inscription_label1">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
74
                                        "\n".'{element}'."\n".''."\n".
75
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
76
                                        ''."\n" ;
77
        $modele_element_fin = "\n".'<span class="inscription_label2">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
78
                                        "\n".'{element}'."\n".''."\n".
79
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
80
                                        '</li>'."\n" ;
81
 
82
        $squelette->setElementTemplate( '<li class="liste_inscription">'."\n".'<span class="inscription_label">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
83
                                        "\n".'{element}'."\n".''."\n".
84
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
85
                                        '</li>'."\n");
86
        $squelette->setElementTemplate( '<ul><li class="groupe_bouton">{element}', 'annuler');
87
        $squelette->setElementTemplate( '{element}</li></ul>', 'valider');
88
 
89
        $squelette->setRequiredNoteTemplate("\n".'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'."\n");
90
 
91
        if ($projet->avoirListe()) {
92
            $this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_LISTE_NORMAL, 2) ;
93
            $this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_PAS_DE_MAIL, 1) ;
94
 
95
            // Indisponible pour le moment
96
            //$this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_LISTE_RESUME, 2) ;
97
        }
98
        $this->addElement ('hidden', 'id_projet', $projet->getId()) ;
99
        $url_annuler = new Net_URL($this->getAttribute('action')) ;
100
        $url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
101
        $url_annuler->removeQueryString(PROJET_VARIABLE_ID_PROJET) ;
102
        // on fait un groupe avec les boutons pour les mettres sur la même ligne
103
        $buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
104
                            preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
105
                                                                                                            // qui remplacent deux fois les & par des &amp;
106
                                                                                                            // ce qui fait échouer le lien
107
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider_inscription_projet', PROJET_S_INSCRIRE_AU_PROJET);
108
        $this->addGroup($buttons, null, null, '&nbsp;');
109
 
110
    } // end of member function construitFormulaire
111
 
112
 
113
} // end of HTML_formulaireInscriptionProjet
114
?>