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 |
|
|
"edition" |
39 |
|
|
); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
/** |
43 |
|
|
* |
44 |
|
|
* @return string |
45 |
|
|
*/ |
46 |
|
|
function get_var_sql_forminc__sql_edition() { |
47 |
|
|
return "SELECT om_etat.om_etat, om_etat.libelle FROM ".DB_PREFIXE."om_etat WHERE id LIKE 'consultation_%' ORDER BY om_etat.libelle ASC"; |
48 |
|
|
} |
49 |
|
|
|
50 |
mbroquet |
3730 |
function setType(&$form,$maj) { |
51 |
|
|
parent::setType($form,$maj); |
52 |
|
|
if ($maj < 2) { |
53 |
|
|
$form->setType('type_consultation', 'select'); |
54 |
|
|
$form->setType('edition', 'select'); |
55 |
|
|
$form->setType('delai_type', 'select'); |
56 |
|
|
} |
57 |
|
|
} |
58 |
|
|
|
59 |
softime |
8989 |
/** |
60 |
|
|
* SETTER_FORM - setSelect. |
61 |
|
|
* |
62 |
|
|
* @return void |
63 |
|
|
*/ |
64 |
|
|
function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) { |
65 |
|
|
parent::setSelect($form, $maj); |
66 |
mbroquet |
3730 |
|
67 |
|
|
$contenu=array(); |
68 |
|
|
|
69 |
|
|
$contenu[0]=array( |
70 |
|
|
'avec_avis_attendu', |
71 |
|
|
'pour_conformite', |
72 |
|
|
'pour_information', |
73 |
|
|
); |
74 |
|
|
|
75 |
|
|
$contenu[1]=array( |
76 |
|
|
_('Avec avis attendu'), |
77 |
|
|
_('Pour conformite'), |
78 |
|
|
_('Pour information'), |
79 |
|
|
|
80 |
|
|
); |
81 |
|
|
$form->setSelect("type_consultation",$contenu); |
82 |
|
|
|
83 |
|
|
// |
84 |
|
|
$contenu = array(); |
85 |
|
|
$contenu[0] = array('mois','jour'); |
86 |
|
|
$contenu[1] = array(_('mois'), _('jour')); |
87 |
|
|
$form->setSelect("delai_type", $contenu); |
88 |
|
|
} |
89 |
|
|
|
90 |
softime |
8989 |
/** |
91 |
|
|
* SETTER_FORM - setVal (setVal). |
92 |
|
|
* |
93 |
|
|
* @return void |
94 |
|
|
*/ |
95 |
|
|
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
96 |
|
|
parent::setVal($form, $maj, $validation); |
97 |
|
|
// |
98 |
|
|
if ($maj > 1) { |
99 |
mbroquet |
3730 |
//Traitement des données pour l'affichage du select |
100 |
|
|
$temp = $this->val[array_search('type_consultation', array_keys($form->val))]; |
101 |
softime |
8989 |
if (strcmp($temp, 'pour_information') == 0) { |
102 |
mbroquet |
3730 |
$temp = _('Pour information'); |
103 |
softime |
8989 |
} elseif (strcmp($temp, 'avec_avis_attendu') == 0) { |
104 |
mbroquet |
3730 |
$temp = _('Avec avis attendu'); |
105 |
softime |
8989 |
} elseif (strcmp($temp, 'pour_conformite') == 0) { |
106 |
mbroquet |
3730 |
$temp = _('Pour conformite'); |
107 |
|
|
} |
108 |
|
|
$form->setVal('type_consultation', $temp); |
109 |
|
|
} |
110 |
|
|
} |
111 |
|
|
|
112 |
|
|
function setLib(&$form,$maj) { |
113 |
|
|
// |
114 |
|
|
parent::setLib($form, $maj); |
115 |
|
|
$form->setLib("edition",_("type d'edition de la consultation")); |
116 |
|
|
} |
117 |
nhaye |
5254 |
|
118 |
|
|
} |
119 |
|
|
|
120 |
softime |
7996 |
|