1 |
mbroquet |
3730 |
<?php |
2 |
nhaye |
5254 |
/** |
3 |
|
|
* DBFORM - 'service' - Surcharge gen. |
4 |
|
|
* |
5 |
|
|
* Ce script permet de définir la classe 'service'. |
6 |
|
|
* |
7 |
|
|
* @package openads |
8 |
|
|
* @version SVN : $Id$ |
9 |
|
|
*/ |
10 |
mbroquet |
3730 |
|
11 |
nhaye |
5254 |
require_once "../gen/obj/service.class.php"; |
12 |
|
|
|
13 |
mbroquet |
3730 |
class service extends service_gen { |
14 |
|
|
|
15 |
softime |
8989 |
/** |
16 |
|
|
* Clause select pour la requête de sélection des données de l'enregistrement. |
17 |
|
|
* |
18 |
|
|
* @return array |
19 |
|
|
*/ |
20 |
|
|
function get_var_sql_forminc__champs() { |
21 |
|
|
return array( |
22 |
|
|
"service", |
23 |
|
|
"abrege", |
24 |
|
|
"libelle", |
25 |
|
|
"adresse", |
26 |
|
|
"adresse2", |
27 |
|
|
"cp", |
28 |
|
|
"ville", |
29 |
|
|
"email", |
30 |
|
|
"notification_email", |
31 |
|
|
"delai_type", |
32 |
|
|
"delai", |
33 |
|
|
"consultation_papier", |
34 |
|
|
"om_validite_debut", |
35 |
|
|
"om_validite_fin", |
36 |
|
|
"om_collectivite", |
37 |
|
|
"type_consultation", |
38 |
softime |
10573 |
"edition", |
39 |
|
|
"service_type", |
40 |
|
|
"generate_edition", |
41 |
|
|
"uid_platau_acteur", |
42 |
softime |
11585 |
"accepte_notification_email", |
43 |
softime |
8989 |
); |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
/** |
47 |
|
|
* |
48 |
|
|
* @return string |
49 |
|
|
*/ |
50 |
|
|
function get_var_sql_forminc__sql_edition() { |
51 |
|
|
return "SELECT om_etat.om_etat, om_etat.libelle FROM ".DB_PREFIXE."om_etat WHERE id LIKE 'consultation_%' ORDER BY om_etat.libelle ASC"; |
52 |
|
|
} |
53 |
|
|
|
54 |
mbroquet |
3730 |
function setType(&$form,$maj) { |
55 |
|
|
parent::setType($form,$maj); |
56 |
|
|
if ($maj < 2) { |
57 |
|
|
$form->setType('type_consultation', 'select'); |
58 |
|
|
$form->setType('edition', 'select'); |
59 |
|
|
$form->setType('delai_type', 'select'); |
60 |
softime |
10573 |
$form->setType('service_type', 'select'); |
61 |
mbroquet |
3730 |
} |
62 |
softime |
10573 |
if ($maj == 2 || $maj == 3) { |
63 |
|
|
$form->setType('service_type', 'selectstatic'); |
64 |
|
|
} |
65 |
mbroquet |
3730 |
} |
66 |
|
|
|
67 |
softime |
8989 |
/** |
68 |
|
|
* SETTER_FORM - setSelect. |
69 |
|
|
* |
70 |
|
|
* @return void |
71 |
|
|
*/ |
72 |
|
|
function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) { |
73 |
|
|
parent::setSelect($form, $maj); |
74 |
mbroquet |
3730 |
|
75 |
|
|
$contenu=array(); |
76 |
|
|
|
77 |
|
|
$contenu[0]=array( |
78 |
|
|
'avec_avis_attendu', |
79 |
|
|
'pour_conformite', |
80 |
|
|
'pour_information', |
81 |
|
|
); |
82 |
|
|
|
83 |
|
|
$contenu[1]=array( |
84 |
softime |
18876 |
__('Avec avis attendu'), |
85 |
|
|
__('Pour conformite'), |
86 |
|
|
__('Pour information'), |
87 |
mbroquet |
3730 |
|
88 |
|
|
); |
89 |
|
|
$form->setSelect("type_consultation",$contenu); |
90 |
|
|
|
91 |
|
|
// |
92 |
|
|
$contenu = array(); |
93 |
|
|
$contenu[0] = array('mois','jour'); |
94 |
softime |
18876 |
$contenu[1] = array(__('mois'), __('jour')); |
95 |
mbroquet |
3730 |
$form->setSelect("delai_type", $contenu); |
96 |
softime |
10573 |
|
97 |
|
|
// service_type |
98 |
|
|
$contenu = array(); |
99 |
softime |
13137 |
$contenu[0] = array(PLATAU, 'openads', ); |
100 |
softime |
10573 |
$contenu[1] = array(__("Plat'AU"), __('openADS'), ); |
101 |
|
|
$form->setSelect("service_type", $contenu); |
102 |
mbroquet |
3730 |
} |
103 |
|
|
|
104 |
softime |
8989 |
/** |
105 |
|
|
* SETTER_FORM - setVal (setVal). |
106 |
|
|
* |
107 |
|
|
* @return void |
108 |
|
|
*/ |
109 |
|
|
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
110 |
|
|
parent::setVal($form, $maj, $validation); |
111 |
|
|
// |
112 |
|
|
if ($maj > 1) { |
113 |
mbroquet |
3730 |
//Traitement des données pour l'affichage du select |
114 |
|
|
$temp = $this->val[array_search('type_consultation', array_keys($form->val))]; |
115 |
softime |
8989 |
if (strcmp($temp, 'pour_information') == 0) { |
116 |
softime |
18876 |
$temp = __('Pour information'); |
117 |
softime |
8989 |
} elseif (strcmp($temp, 'avec_avis_attendu') == 0) { |
118 |
softime |
18876 |
$temp = __('Avec avis attendu'); |
119 |
softime |
8989 |
} elseif (strcmp($temp, 'pour_conformite') == 0) { |
120 |
softime |
18876 |
$temp = __('Pour conformite'); |
121 |
mbroquet |
3730 |
} |
122 |
|
|
$form->setVal('type_consultation', $temp); |
123 |
|
|
} |
124 |
|
|
} |
125 |
|
|
|
126 |
|
|
function setLib(&$form,$maj) { |
127 |
|
|
// |
128 |
|
|
parent::setLib($form, $maj); |
129 |
softime |
10207 |
$form->setLib("edition", __("type d'edition de la consultation")); |
130 |
|
|
$form->setLib("email", __("liste de diffusion")); |
131 |
softime |
11585 |
$form->setLib("accepte_notification_email", __("peut recevoir une notification d'instruction")); |
132 |
mbroquet |
3730 |
} |
133 |
nhaye |
5254 |
|
134 |
softime |
10573 |
/** |
135 |
|
|
* SURCHARGE |
136 |
|
|
* |
137 |
|
|
* Configuration du formulaire (VIEW formulaire et VIEW sousformulaire). |
138 |
|
|
* |
139 |
|
|
* @param formulaire $form Instance formulaire. |
140 |
|
|
* @param integer $maj Identifant numérique de l'action. |
141 |
|
|
* |
142 |
|
|
* @return void |
143 |
|
|
*/ |
144 |
|
|
function setTaille(&$form, $maj) { |
145 |
|
|
parent::setTaille($form, $maj); |
146 |
|
|
|
147 |
|
|
$form->setTaille("uid_platau_acteur", 11); |
148 |
|
|
} |
149 |
|
|
|
150 |
|
|
/** |
151 |
|
|
* SURCHARGE |
152 |
|
|
* |
153 |
|
|
* Configuration du formulaire (VIEW formulaire et VIEW sousformulaire). |
154 |
|
|
* |
155 |
|
|
* @param formulaire $form Instance formulaire. |
156 |
|
|
* @param integer $maj Identifant numérique de l'action. |
157 |
|
|
* |
158 |
|
|
* @return void |
159 |
|
|
*/ |
160 |
|
|
function setMax(&$form, $maj) { |
161 |
|
|
parent::setMax($form, $maj); |
162 |
|
|
|
163 |
|
|
$form->setMax("uid_platau_acteur", 11); |
164 |
|
|
} |
165 |
|
|
|
166 |
|
|
// XXX WIP |
167 |
|
|
public function get_json_data() { |
168 |
|
|
$val = array_combine($this->champs, $this->val); |
169 |
|
|
foreach ($val as $key => $value) { |
170 |
|
|
$val[$key] = strip_tags($value); |
171 |
|
|
} |
172 |
|
|
return $val; |
173 |
|
|
} |
174 |
|
|
|
175 |
nhaye |
5254 |
} |
176 |
|
|
|
177 |
softime |
7996 |
|