1 |
mbroquet |
3730 |
<?php |
2 |
nhaye |
5254 |
/** |
3 |
|
|
* DBFORM - 'regle' - Surcharge gen. |
4 |
|
|
* |
5 |
|
|
* Ce script permet de définir la classe 'regle'. |
6 |
|
|
* |
7 |
|
|
* @package openads |
8 |
|
|
* @version SVN : $Id$ |
9 |
|
|
*/ |
10 |
mbroquet |
3730 |
|
11 |
nhaye |
5254 |
require_once "../gen/obj/regle.class.php"; |
12 |
|
|
|
13 |
mbroquet |
3730 |
class regle extends regle_gen { |
14 |
|
|
|
15 |
nhaye |
5254 |
/** |
16 |
|
|
* Constructeur. |
17 |
|
|
*/ |
18 |
|
|
function __construct($id, &$dnu1 = null, $dnu2 = null) { |
19 |
|
|
$this->constructeur($id); |
20 |
|
|
} |
21 |
mbroquet |
3730 |
|
22 |
|
|
function setType(&$form,$maj) { |
23 |
|
|
if ($maj < 2) { //ajouter et modifier |
24 |
|
|
$form->setType('sens', 'select'); |
25 |
|
|
$form->setType('ordre', 'select'); |
26 |
|
|
$form->setType('controle', 'hiddenstatic'); |
27 |
|
|
$form->setType('libelle', 'hiddenstatic'); |
28 |
|
|
$form->setType('id', 'hiddenstatic'); |
29 |
|
|
$form->setType('champ', 'select'); |
30 |
|
|
$form->setType('operateur', 'select');; |
31 |
|
|
if ($maj==1){ //modifier |
32 |
|
|
$form->setType('regle', 'hiddenstatic'); |
33 |
|
|
}else |
34 |
|
|
$form->setType('regle', 'hidden'); |
35 |
|
|
}else{ // supprimer |
36 |
|
|
$form->setType('regle', 'hiddenstatic'); |
37 |
|
|
$form->setType('id', 'hiddenstatic'); |
38 |
|
|
} |
39 |
|
|
} |
40 |
|
|
|
41 |
softime |
6929 |
function setSelect(&$form, $maj, &$db = null, $debug = null) { |
42 |
mbroquet |
3730 |
// |
43 |
|
|
$contenu=array(); |
44 |
|
|
$contenu[0]=array('plus','moins'); |
45 |
|
|
$contenu[1]=array(_('plus'), _('moins')); |
46 |
|
|
$form->setSelect("sens",$contenu); |
47 |
|
|
// |
48 |
|
|
$contenu=array(); |
49 |
softime |
4760 |
$contenu[0]=array('terrain_surface', |
50 |
mbroquet |
3730 |
'lot', |
51 |
|
|
'date_notification_delai', |
52 |
|
|
'date_rejet'); |
53 |
softime |
4760 |
$contenu[1]=array(_('terrain_surface'), |
54 |
mbroquet |
3730 |
_('lot'), |
55 |
|
|
_('date_notification_delai'), |
56 |
|
|
_('date_rejet') |
57 |
|
|
); |
58 |
|
|
$form->setSelect("champ",$contenu); |
59 |
|
|
// |
60 |
|
|
$contenu=array(); |
61 |
|
|
$contenu[0]=array('1','2','3','4','5','6','7','8','9'); |
62 |
|
|
$contenu[1]=array('1 '._('regle'), |
63 |
|
|
'2 '._('regle'), |
64 |
|
|
'3 '._('regle'), |
65 |
|
|
'4 '._('regle'), |
66 |
|
|
'5 '._('regle'), |
67 |
|
|
'6 '._('regle'), |
68 |
|
|
'7 '._('regle'), |
69 |
|
|
'8 '._('regle'), |
70 |
|
|
'9 '._('regle'),); |
71 |
|
|
$form->setSelect("ordre",$contenu); |
72 |
|
|
// |
73 |
|
|
$contenu=array(); |
74 |
|
|
$contenu[0]=array('==','!=','>','<','<=','>='); |
75 |
|
|
$contenu[1]=array(_('egal'),_('different'),'>','<','<=','>='); |
76 |
|
|
$form->setSelect("operateur",$contenu); |
77 |
|
|
} |
78 |
|
|
|
79 |
softime |
6929 |
function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$db = null, $DEBUG = null) { |
80 |
|
|
if ($validation==0) { |
81 |
|
|
if ($maj == 0){ |
82 |
|
|
$form->setVal('id', $idxformulaire); |
83 |
|
|
$form->setVal('controle', $retourformulaire); |
84 |
|
|
} |
85 |
|
|
} |
86 |
|
|
} |
87 |
mbroquet |
3730 |
|
88 |
nhaye |
5254 |
} |
89 |
mbroquet |
3730 |
|
90 |
nhaye |
5254 |
?> |