Add LSformElement :: supannEtuInscription
[ldapsaisie.git] / public_html / includes / class / class.LSformElement_supannEtuInscription.php
1 <?php
2 /*******************************************************************************
3  * Copyright (C) 2007 Easter-eggs
4  * http://ldapsaisie.labs.libre-entreprise.org
5  *
6  * Author: See AUTHORS file in top-level directory.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License version 2
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20
21 ******************************************************************************/
22
23 LSsession :: loadLSclass('LSformElement');
24 LSsession :: loadLSclass('LSformElement_supannCompositeAttribute');
25 LSsession :: loadLSaddon('supann');
26
27 /**
28  * Element supannEtuInscription d'un formulaire pour LdapSaisie
29  *
30  * Cette classe définis les éléments supannEtuInscription des formulaires.
31  * Elle étant la classe LSformElement_supannCompositeAttribute.
32  *
33  * @author Benjamin Renard <brenard@easter-eggs.com>
34  */
35
36 class LSformElement_supannEtuInscription extends LSformElement_supannCompositeAttribute {
37
38         function LSformElement_supannEtuInscription (&$form, $name, $label, $params,&$attr_html){
39                 $this -> components = array (
40                         'etab' => array (
41                                 'label' => _('Organism'),
42                                 'type' => 'table',
43                                 'table' => 'codeEtablissement',
44                                 'required' => true,
45                         ),
46                         'anneeinsc' => array (
47                                 'label' => _('Registration year'),
48                                 'type' => 'text',
49                                 'required' => true,
50                                 'check_data' => array (
51                                         'integer' => array (
52                                                 'msg' => _('Registration year must be an integer'),
53                                                 'params' => array (
54                                                         'positive' => true,
55                                                         'min' => 1970
56                                                 )
57                                         ),
58                                 )
59                         ),
60                         'regimeinsc' => array (
61                                 'label' => _('Registration regime'),
62                                 'type' => 'table',
63                                 'table' => 'etuRegimeInscription',
64                                 'required' => true
65                         ),
66                         'sectdisc' => array (
67                                 'label' => _('Discipline sector'),
68                                 'type' => 'table',
69                                 'table' => 'etuSecteurDisciplinaire',
70                                 'required' => true
71                         ),
72                         'typedip' => array (
73                                 'label' => _('Diploma type'),
74                                 'type' => 'table',
75                                 'table' => 'etuTypeDiplome',
76                                 'required' => true
77                         ),
78                         'cursusann' => array (
79                                 'label' => _('Cursus & Year'),
80                                 'type' => 'text',
81                                 'check_data' => array (
82                                         'regex' => array (
83                                                 'params' => array (
84                                                         'regex' => '/^[LMDXB][0-9]?$/'
85                                                 )
86                                         ),
87                                 ),
88                                 'required' => true
89                         ),
90                         'affect' => array (
91                                 'label' => _('Entity'),
92                                 'type' => 'codeEntite',
93                                 'required' => false
94                         ),
95                         'diplome' => array (
96                                 'label' => _('Diploma'),
97                                 'type' => 'table',
98                                 'table' => 'etuDiplome',
99                                 'required' => false
100                         ),
101                         'etape' => array (
102                                 'label' => _('Step'),
103                                 'type' => 'table',
104                                 'table' => 'etuEtape',
105                                 'required' => false
106                         ),
107                         'eltpedago' => array (
108                                 'label' => _('Pedagogical element'),
109                                 'type' => 'table',
110                                 'table' => 'etuElementPedagogique',
111                                 'required' => false
112                         )
113                 );
114                 return parent::LSformElement ($form, $name, $label, $params,$attr_html);
115         }
116
117 }