Subversion Repositories Applications.projet

Rev

Rev 272 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
431 mathias 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
// +------------------------------------------------------------------------------------------------------+
19
// CVS : $Id: HTML_formulaireInscriptionProjet.class.php,v 1.3 2007-11-21 09:42:50 alexandre_tb Exp $
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
32
*@version       $Revision: 1.3 $
33
// +------------------------------------------------------------------------------------------------------+
34
*/
35
 
36
 
37
// +------------------------------------------------------------------------------------------------------+
38
// |                                            ENTETE du PROGRAMME                                       |
39
// +------------------------------------------------------------------------------------------------------+
40
 
41
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/radio.php';
42
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php';
43
 
44
/**
45
 * class HTML_formulaireInscriptionProjet
46
 *
47
 */
48
class HTML_formulaireInscriptionProjet extends HTML_QuickForm
49
{
50
     /*** Attributes: ***/
51
 
52
    /**
53
     *
54
     *
55
     * @return void
56
     * @access public
57
     */
58
    function HTML_formulaireInscriptionProjet( $formName = '',  $method = 'post',  $action = '',  $target = '_self',  $attributes = '',  $trackSubmit = false )
59
    {
60
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
61
    } // end of member function HTML_formulaireInscriptionProjet
62
 
63
    /**
64
     *
65
     *
66
     * @return void
67
     * @access public
68
     */
69
    function construitFormulaire(& $projet )
70
    {
71
         $squelette =& $this->defaultRenderer();
72
        $squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
73
 
74
        $modele_element_debut = '<li class="groupe_formulaire">'."\n".'<span class="inscription_label1">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
75
                                        "\n".'{element}'."\n".''."\n".
76
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
77
                                        ''."\n" ;
78
        $modele_element_fin = "\n".'<span class="inscription_label2">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
79
                                        "\n".'{element}'."\n".''."\n".
80
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
81
                                        '</li>'."\n" ;
82
 
83
        $squelette->setElementTemplate( '<li class="liste_inscription">'."\n".'<span class="inscription_label">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
84
                                        "\n".'{element}'."\n".''."\n".
85
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
86
                                        '</li>'."\n");
87
        $squelette->setElementTemplate( '<ul><li class="groupe_bouton">{element}', 'annuler');
88
        $squelette->setElementTemplate( '{element}</li></ul>', 'valider');
89
 
90
        $squelette->setRequiredNoteTemplate("\n".'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'."\n");
91
 
92
        if ($projet->avoirListe()) {
93
            $this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_LISTE_NORMAL, 2) ;
94
            $this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_PAS_DE_MAIL, 1) ;
95
 
96
            // Indisponible pour le moment
97
            //$this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_LISTE_RESUME, 2) ;
98
        }
99
        $this->addElement ('hidden', 'id_projet', $projet->getId()) ;
100
        $url_annuler = new Net_URL($this->getAttribute('action')) ;
101
        $url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
102
        $url_annuler->removeQueryString(PROJET_VARIABLE_ID_PROJET) ;
103
        // on fait un groupe avec les boutons pour les mettres sur la même ligne
104
        $buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
105
                            preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
106
                                                                                                            // qui remplacent deux fois les & par des &amp;
107
                                                                                                            // ce qui fait échouer le lien
108
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider_inscription_projet', PROJET_S_INSCRIRE_AU_PROJET);
109
        $this->addGroup($buttons, null, null, '&nbsp;');
110
 
111
    } // end of member function construitFormulaire
112
 
113
 
114
} // end of HTML_formulaireInscriptionProjet
115
?>