1 |
nhaye |
5043 |
<?php |
2 |
|
|
/** |
3 |
|
|
* Gestion des plaignants. |
4 |
|
|
* |
5 |
|
|
* @package openads |
6 |
|
|
* @version SVN : $Id$ |
7 |
|
|
*/ |
8 |
|
|
require_once("../obj/demandeur.class.php"); |
9 |
|
|
|
10 |
|
|
|
11 |
|
|
/** |
12 |
|
|
* Les plaignants héritent des demandeurs. |
13 |
|
|
*/ |
14 |
|
|
class plaignant extends demandeur { |
15 |
|
|
|
16 |
|
|
/** |
17 |
|
|
* Constructeur. |
18 |
|
|
* |
19 |
|
|
* @param string $id Identifiant du plaignant. |
20 |
|
|
* @param database $db Instance de base de données. |
21 |
|
|
* @param boolean $debug Flag de debug. |
22 |
|
|
*/ |
23 |
|
|
function __construct($id, $db, $debug) { |
24 |
|
|
$this->constructeur($id, $db, $debug); |
25 |
|
|
} |
26 |
|
|
|
27 |
nhaye |
5051 |
/** |
28 |
|
|
* Cache les champs de notification, fréquent et type_demandeur. |
29 |
|
|
* |
30 |
|
|
* @param formulaire $form Instance de la classe om_formulaire. |
31 |
|
|
* @param integer $maj Identifiant de l'action. |
32 |
|
|
*/ |
33 |
|
|
function setType(&$form, $maj) { |
34 |
|
|
parent::setType($form, $maj); |
35 |
|
|
|
36 |
|
|
$form->setType('type_demandeur', 'hidden'); |
37 |
|
|
$form->setType('notification', 'hidden'); |
38 |
|
|
$form->setType('frequent', 'hidden'); |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
/** |
42 |
|
|
* Mise en page. |
43 |
|
|
* |
44 |
|
|
* @param formulaire $form Instance de la classe om_formulaire. |
45 |
|
|
* @param integer $maj Identifiant de l'action. |
46 |
|
|
*/ |
47 |
|
|
function setLayout(&$form, $maj){ |
48 |
|
|
if ( $maj < 2 OR $maj == 3 ) { |
49 |
|
|
|
50 |
|
|
$form->setBloc( |
51 |
|
|
'particulier_civilite', |
52 |
|
|
'D', |
53 |
|
|
"", |
54 |
|
|
"particulier_fields" |
55 |
|
|
); |
56 |
|
|
|
57 |
|
|
$form->setFieldset( |
58 |
|
|
'particulier_civilite', |
59 |
|
|
'D', |
60 |
|
|
_("Etat civil"), |
61 |
|
|
"group" |
62 |
|
|
); |
63 |
|
|
$form->setBloc( |
64 |
|
|
'particulier_nom', |
65 |
|
|
'D', |
66 |
|
|
"", |
67 |
|
|
"group" |
68 |
|
|
); |
69 |
|
|
$form->setBloc('particulier_prenom', 'F'); |
70 |
|
|
$form->setBloc( |
71 |
|
|
'particulier_date_naissance', |
72 |
|
|
'D', |
73 |
|
|
"", |
74 |
|
|
"group" |
75 |
|
|
); |
76 |
|
|
$form->setBloc('particulier_commune_naissance', 'F'); |
77 |
|
|
$form->setFieldset( |
78 |
|
|
'particulier_departement_naissance', |
79 |
|
|
'F' |
80 |
|
|
); |
81 |
|
|
|
82 |
|
|
$form->setBloc('particulier_departement_naissance', 'F'); |
83 |
|
|
|
84 |
|
|
$form->setBloc( |
85 |
|
|
'personne_morale_denomination', |
86 |
|
|
'D', |
87 |
|
|
"", |
88 |
|
|
"personne_morale_fields" |
89 |
|
|
); |
90 |
|
|
|
91 |
|
|
$form->setFieldset( |
92 |
|
|
'personne_morale_denomination', |
93 |
|
|
'D', |
94 |
|
|
_("Personne morale") |
95 |
|
|
); |
96 |
|
|
|
97 |
|
|
$form->setBloc( |
98 |
|
|
'personne_morale_denomination', |
99 |
|
|
'D', |
100 |
|
|
"", |
101 |
|
|
"group" |
102 |
|
|
); |
103 |
|
|
$form->setBloc('personne_morale_raison_sociale', 'F'); |
104 |
|
|
|
105 |
|
|
$form->setBloc( |
106 |
|
|
'personne_morale_siret', |
107 |
|
|
'D', |
108 |
|
|
"", |
109 |
|
|
"group" |
110 |
|
|
); |
111 |
|
|
$form->setBloc( |
112 |
|
|
'personne_morale_categorie_juridique', |
113 |
|
|
'F' |
114 |
|
|
); |
115 |
|
|
|
116 |
|
|
$form->setBloc('personne_morale_civilite', 'D', ""); |
117 |
|
|
$form->setBloc('personne_morale_civilite', 'F'); |
118 |
|
|
|
119 |
|
|
$form->setBloc('personne_morale_nom', 'D', "", "group"); |
120 |
|
|
$form->setBloc('personne_morale_prenom', 'F'); |
121 |
|
|
|
122 |
|
|
$form->setFieldset('personne_morale_prenom', 'F'); |
123 |
|
|
|
124 |
|
|
$form->setBloc('personne_morale_prenom', 'F'); |
125 |
|
|
|
126 |
|
|
$form->setFieldset('numero', 'D', _("Adresse"), ""); |
127 |
|
|
|
128 |
|
|
$form->setBloc('numero', 'D', "", "group"); |
129 |
|
|
$form->setBloc('voie', 'F'); |
130 |
|
|
|
131 |
|
|
$form->setBloc('complement', 'D', ""); |
132 |
|
|
$form->setBloc('complement', 'F'); |
133 |
|
|
|
134 |
|
|
$form->setBloc('lieu_dit', 'D', "", "group"); |
135 |
|
|
$form->setBloc('localite', 'F'); |
136 |
|
|
|
137 |
|
|
$form->setBloc('code_postal', 'D', "", "group"); |
138 |
|
|
$form->setBloc('cedex', 'F'); |
139 |
|
|
|
140 |
|
|
$form->setBloc('pays', 'D', "", "", "group"); |
141 |
|
|
$form->setBloc('division_territoriale', 'F'); |
142 |
|
|
$form->setFieldset('division_territoriale', 'F'); |
143 |
|
|
|
144 |
|
|
$form->setFieldset('telephone_fixe', 'D', _("Coordonnees"), ""); |
145 |
|
|
$form->setBloc('telephone_fixe', 'D', "", "group"); |
146 |
|
|
$form->setBloc('indicatif', 'F'); |
147 |
|
|
|
148 |
|
|
$form->setBloc('courriel', 'D', "", "group"); |
149 |
|
|
$form->setBloc('notification', 'F'); |
150 |
|
|
|
151 |
|
|
$form->setFieldset('notification', 'F'); |
152 |
|
|
} |
153 |
|
|
} |
154 |
|
|
|
155 |
|
|
/** |
156 |
|
|
* Met le champ type_demandeur à plaignant par défaut. |
157 |
|
|
* |
158 |
|
|
* @param formulaire $form Instance de la classe om_formulaire. |
159 |
|
|
* @param integer $maj Identifiant de l'action. |
160 |
|
|
* @param integer $validation Nombre de validation du formulaire. |
161 |
|
|
* @param database $db Instance de la classe om_database. |
162 |
|
|
*/ |
163 |
|
|
function setVal(&$form, $maj, $validation, &$db) { |
164 |
|
|
if ($maj == 0 ) { |
165 |
|
|
$form->setVal("type_demandeur", "plaignant"); |
166 |
|
|
} |
167 |
|
|
} |
168 |
|
|
|
169 |
|
|
/* |
170 |
|
|
* Met le champ type_demandeur à plaignant par défaut |
171 |
|
|
*/ |
172 |
|
|
function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) { |
173 |
|
|
parent::setValSousFormulaire($form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, $dnu1, $dnu2); |
174 |
|
|
$form->setVal("type_demandeur", "plaignant"); |
175 |
|
|
if ($maj == 0 ) { |
176 |
|
|
// Récupération des infos du demandeur passé en paramètre |
177 |
|
|
if ($this->getParameter('idx_demandeur') != "") { |
178 |
|
|
include '../sql/pgsql/delegataire.form.inc.php'; |
179 |
|
|
$sql = "SELECT ".implode(", ", $champs)." |
180 |
|
|
FROM ".DB_PREFIXE."demandeur ". |
181 |
|
|
"WHERE demandeur=".$this->getParameter('idx_demandeur'); |
182 |
|
|
$res = $this->db->query($sql); |
183 |
|
|
$this->f->addToLog( |
184 |
|
|
"setValSousFormulaire() : db->query(\"".$sql."\")", |
185 |
|
|
VERBOSE_MODE |
186 |
|
|
); |
187 |
|
|
if ( database::isError($res)) { |
188 |
|
|
die(); |
189 |
|
|
} |
190 |
|
|
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
191 |
|
|
foreach ($row as $key => $value) { |
192 |
|
|
$form->setVal($key, $value); |
193 |
|
|
} |
194 |
|
|
$form->setVal("frequent", "f"); |
195 |
|
|
} |
196 |
|
|
} |
197 |
|
|
} |
198 |
nhaye |
5043 |
} |