1 |
mbroquet |
3730 |
<?php |
2 |
|
|
//$Id: regle.class.php 4418 2015-02-24 17:30:28Z tbenita $ |
3 |
|
|
//gen openMairie le 10/02/2011 20:38 |
4 |
|
|
require_once ("../gen/obj/regle.class.php"); |
5 |
|
|
|
6 |
|
|
class regle extends regle_gen { |
7 |
|
|
|
8 |
|
|
function regle($id,&$db,$debug) { |
9 |
|
|
$this->constructeur($id,$db,$debug); |
10 |
|
|
}// fin constructeur |
11 |
|
|
|
12 |
|
|
function setType(&$form,$maj) { |
13 |
|
|
if ($maj < 2) { //ajouter et modifier |
14 |
|
|
$form->setType('sens', 'select'); |
15 |
|
|
$form->setType('ordre', 'select'); |
16 |
|
|
$form->setType('controle', 'hiddenstatic'); |
17 |
|
|
$form->setType('libelle', 'hiddenstatic'); |
18 |
|
|
$form->setType('id', 'hiddenstatic'); |
19 |
|
|
$form->setType('champ', 'select'); |
20 |
|
|
$form->setType('operateur', 'select');; |
21 |
|
|
if ($maj==1){ //modifier |
22 |
|
|
$form->setType('regle', 'hiddenstatic'); |
23 |
|
|
}else |
24 |
|
|
$form->setType('regle', 'hidden'); |
25 |
|
|
}else{ // supprimer |
26 |
|
|
$form->setType('regle', 'hiddenstatic'); |
27 |
|
|
$form->setType('id', 'hiddenstatic'); |
28 |
|
|
} |
29 |
|
|
} |
30 |
|
|
|
31 |
|
|
function setSelect(&$form, $maj,$db,$debug) { |
32 |
|
|
// |
33 |
|
|
$contenu=array(); |
34 |
|
|
$contenu[0]=array('plus','moins'); |
35 |
|
|
$contenu[1]=array(_('plus'), _('moins')); |
36 |
|
|
$form->setSelect("sens",$contenu); |
37 |
|
|
// |
38 |
|
|
$contenu=array(); |
39 |
|
|
$contenu[0]=array('shon', |
40 |
|
|
'shob', |
41 |
|
|
'terrain_surface', |
42 |
|
|
'lot', |
43 |
|
|
'hauteur', |
44 |
|
|
'piece_nombre', |
45 |
|
|
'batiment_nombre', |
46 |
|
|
'logement_nombre', |
47 |
|
|
'date_notification_delai', |
48 |
|
|
'date_rejet'); |
49 |
|
|
$contenu[1]=array(_('shon'), |
50 |
|
|
_('shob'), |
51 |
|
|
_('terrain_surface'), |
52 |
|
|
_('lot'), |
53 |
|
|
_('hauteur'), |
54 |
|
|
_('piece_nombre'), |
55 |
|
|
_('batiment_nombre'), |
56 |
|
|
_('logement_nombre'), |
57 |
|
|
_('date_notification_delai'), |
58 |
|
|
_('date_rejet') |
59 |
|
|
); |
60 |
|
|
$form->setSelect("champ",$contenu); |
61 |
|
|
// |
62 |
|
|
$contenu=array(); |
63 |
|
|
$contenu[0]=array('1','2','3','4','5','6','7','8','9'); |
64 |
|
|
$contenu[1]=array('1 '._('regle'), |
65 |
|
|
'2 '._('regle'), |
66 |
|
|
'3 '._('regle'), |
67 |
|
|
'4 '._('regle'), |
68 |
|
|
'5 '._('regle'), |
69 |
|
|
'6 '._('regle'), |
70 |
|
|
'7 '._('regle'), |
71 |
|
|
'8 '._('regle'), |
72 |
|
|
'9 '._('regle'),); |
73 |
|
|
$form->setSelect("ordre",$contenu); |
74 |
|
|
// |
75 |
|
|
$contenu=array(); |
76 |
|
|
$contenu[0]=array('==','!=','>','<','<=','>='); |
77 |
|
|
$contenu[1]=array(_('egal'),_('different'),'>','<','<=','>='); |
78 |
|
|
$form->setSelect("operateur",$contenu); |
79 |
|
|
} |
80 |
|
|
|
81 |
|
|
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
82 |
|
|
if ($validation==0) { |
83 |
|
|
if ($maj == 0){ |
84 |
|
|
$form->setVal('id', $idxformulaire); |
85 |
|
|
$form->setVal('controle', $retourformulaire); |
86 |
|
|
} |
87 |
|
|
} |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
}// fin classe |
93 |
|
|
?> |