1 |
nhaye |
787 |
<?php |
2 |
|
|
//$Id$ |
3 |
|
|
|
4 |
|
|
require_once ("../obj/demandeur.class.php"); |
5 |
|
|
|
6 |
vpihour |
795 |
/* |
7 |
|
|
* Classe qui hérite de la classe demandeur |
8 |
|
|
*/ |
9 |
nhaye |
787 |
class delegataire extends demandeur { |
10 |
|
|
|
11 |
|
|
function delegataire($id,&$db,$debug) { |
12 |
|
|
$this->constructeur($id,$db,$debug); |
13 |
|
|
}// fin constructeur |
14 |
|
|
|
15 |
vpihour |
795 |
/* |
16 |
vpihour |
799 |
* Cache les champs de notification, fréquent et type_demandeur. |
17 |
vpihour |
795 |
*/ |
18 |
|
|
function setType(&$form,$maj) { |
19 |
|
|
parent::setType($form,$maj); |
20 |
|
|
|
21 |
|
|
$form->setType('type_demandeur', 'hidden'); |
22 |
|
|
$form->setType('notification', 'hidden'); |
23 |
|
|
$form->setType('frequent', 'hidden'); |
24 |
nhaye |
828 |
} |
25 |
vpihour |
795 |
|
26 |
|
|
/* |
27 |
nhaye |
828 |
* Ajout du fielset |
28 |
|
|
* Add fieldset |
29 |
|
|
*/ |
30 |
|
|
function setLayout(&$form, $maj){ |
31 |
|
|
if ( $maj < 2 OR $maj == 3 ) { |
32 |
|
|
|
33 |
|
|
$form->setBloc('particulier_civilite','D',"", "bloc_demandeur"); |
34 |
|
|
$form->setBloc('particulier_civilite','D',"", "particulier_fields"); |
35 |
|
|
|
36 |
|
|
$form->setBloc('particulier_civilite','D',""); |
37 |
|
|
$form->setBloc('particulier_civilite','F'); |
38 |
|
|
|
39 |
|
|
$form->setBloc('particulier_nom','D',"","group"); |
40 |
|
|
$form->setBloc('particulier_prenom','F'); |
41 |
|
|
|
42 |
|
|
$form->setBloc('particulier_date_naissance','D',"","group"); |
43 |
|
|
$form->setBloc('particulier_commune_naissance','F'); |
44 |
|
|
|
45 |
|
|
$form->setBloc('particulier_departement_naissance','D',""); |
46 |
|
|
$form->setBloc('particulier_departement_naissance','F'); |
47 |
|
|
|
48 |
|
|
$form->setBloc('particulier_departement_naissance','F'); |
49 |
|
|
|
50 |
|
|
$form->setBloc('personne_morale_denomination','D',"", "personne_morale_fields"); |
51 |
|
|
|
52 |
|
|
$form->setBloc('personne_morale_denomination','D',"","group"); |
53 |
|
|
$form->setBloc('personne_morale_denomination','D',"", ""); |
54 |
|
|
$form->setBloc('personne_morale_denomination','F'); |
55 |
|
|
$form->setBloc('personne_morale_raison_sociale','F'); |
56 |
|
|
|
57 |
|
|
$form->setBloc('personne_morale_siret','D',""); |
58 |
|
|
$form->setBloc('personne_morale_siret','F'); |
59 |
|
|
|
60 |
|
|
$form->setBloc('personne_morale_categorie_juridique','D',""); |
61 |
|
|
$form->setBloc('personne_morale_categorie_juridique','F'); |
62 |
|
|
|
63 |
|
|
$form->setBloc('personne_morale_civilite','D',""); |
64 |
|
|
$form->setBloc('personne_morale_civilite','F'); |
65 |
|
|
|
66 |
|
|
$form->setBloc('personne_morale_nom','D',"", "group"); |
67 |
|
|
$form->setBloc('personne_morale_nom','D',"", ""); |
68 |
|
|
$form->setBloc('personne_morale_nom','F'); |
69 |
|
|
$form->setBloc('personne_morale_prenom','F'); |
70 |
|
|
|
71 |
|
|
$form->setBloc('personne_morale_prenom','F'); |
72 |
|
|
|
73 |
|
|
$form->setBloc('numero','D',""); |
74 |
|
|
|
75 |
|
|
$form->setBloc('numero','D',"","group"); |
76 |
|
|
$form->setBloc('voie','F'); |
77 |
|
|
|
78 |
|
|
$form->setBloc('complement','D',""); |
79 |
|
|
$form->setBloc('complement','F'); |
80 |
|
|
|
81 |
|
|
$form->setBloc('lieu_dit','D',"","group"); |
82 |
|
|
$form->setBloc('localite','F'); |
83 |
|
|
|
84 |
|
|
$form->setBloc('code_postal','D',"","group"); |
85 |
|
|
$form->setBloc('cedex','F'); |
86 |
|
|
|
87 |
|
|
$form->setBloc('pays','D',"", "","group"); |
88 |
|
|
$form->setBloc('division_territoriale','F'); |
89 |
|
|
|
90 |
|
|
$form->setBloc('telephone_fixe','D',"", "group"); |
91 |
|
|
$form->setBloc('indicatif','F'); |
92 |
|
|
|
93 |
|
|
$form->setBloc('frequent','F'); |
94 |
|
|
$form->setBloc('frequent','F'); |
95 |
|
|
} |
96 |
|
|
} |
97 |
|
|
|
98 |
|
|
/* |
99 |
vpihour |
795 |
* Met le champ type_demandeur à delegataire par défaut |
100 |
|
|
*/ |
101 |
|
|
function setVal(&$form, $maj, $validation, &$db) { |
102 |
|
|
if($maj == 0 ) { |
103 |
|
|
$form->setVal("type_demandeur","delegataire"); |
104 |
|
|
} |
105 |
|
|
} |
106 |
nhaye |
819 |
/* |
107 |
|
|
* Met le champ type_demandeur à delegataire par défaut |
108 |
|
|
*/ |
109 |
|
|
function setValSousFormulaire(&$form, $maj, $validation, &$db) { |
110 |
nhaye |
1048 |
parent::setValSousFormulaire($form, $maj, $validation, $db); |
111 |
|
|
$form->setVal("type_demandeur","delegataire"); |
112 |
nhaye |
819 |
if($maj == 0 ) { |
113 |
nhaye |
1048 |
// Récupération des infos du demandeur passé en paramètre |
114 |
|
|
if($this->getParameter('idx_demandeur') != "") { |
115 |
|
|
include '../sql/pgsql/delegataire.form.inc.php'; |
116 |
|
|
$sql = "SELECT ".implode(", ",$champs)." FROM ".DB_PREFIXE."demandeur ". |
117 |
|
|
"WHERE demandeur=".$this->getParameter('idx_demandeur'); |
118 |
|
|
$res = $this->db->query($sql); |
119 |
|
|
$this->f->isDatabaseError(); |
120 |
|
|
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
121 |
|
|
foreach ($row as $key => $value) { |
122 |
|
|
$form->setVal($key, $value); |
123 |
|
|
} |
124 |
|
|
$form->setVal("frequent","f"); |
125 |
|
|
} |
126 |
nhaye |
819 |
} |
127 |
|
|
} |
128 |
nhaye |
787 |
}// fin classe |
129 |
|
|
?> |