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',"", "particulier_fields"); |
34 |
|
|
|
35 |
fmichon |
1495 |
$form->setFieldset('particulier_civilite','D',_("Etat civil"),"group"); |
36 |
nhaye |
1425 |
$form->setBloc('particulier_nom','D',"","group"); |
37 |
|
|
$form->setBloc('particulier_prenom','F'); |
38 |
|
|
$form->setBloc('particulier_date_naissance','D',"","group"); |
39 |
|
|
$form->setBloc('particulier_commune_naissance','F'); |
40 |
|
|
$form->setFieldset('particulier_departement_naissance','F'); |
41 |
nhaye |
828 |
|
42 |
|
|
$form->setBloc('particulier_departement_naissance','F'); |
43 |
|
|
|
44 |
|
|
$form->setBloc('personne_morale_denomination','D',"", "personne_morale_fields"); |
45 |
|
|
|
46 |
nhaye |
1425 |
|
47 |
nhaye |
828 |
|
48 |
nhaye |
1425 |
$form->setFieldset('personne_morale_denomination','D',_("Personne morale")); |
49 |
|
|
|
50 |
|
|
$form->setBloc('personne_morale_denomination','D',"","group"); |
51 |
|
|
$form->setBloc('personne_morale_raison_sociale','F'); |
52 |
|
|
|
53 |
|
|
$form->setBloc('personne_morale_siret','D',"","group"); |
54 |
|
|
$form->setBloc('personne_morale_categorie_juridique','F'); |
55 |
|
|
|
56 |
|
|
$form->setBloc('personne_morale_civilite','D',""); |
57 |
|
|
$form->setBloc('personne_morale_civilite','F'); |
58 |
|
|
|
59 |
|
|
$form->setBloc('personne_morale_nom','D',"", "group"); |
60 |
|
|
$form->setBloc('personne_morale_prenom','F'); |
61 |
|
|
|
62 |
|
|
$form->setFieldset('personne_morale_prenom','F'); |
63 |
nhaye |
828 |
|
64 |
|
|
$form->setBloc('personne_morale_prenom','F'); |
65 |
|
|
|
66 |
nhaye |
1425 |
$form->setFieldset('numero','D',_("Adresse"), ""); |
67 |
nhaye |
828 |
|
68 |
|
|
$form->setBloc('numero','D',"","group"); |
69 |
|
|
$form->setBloc('voie','F'); |
70 |
|
|
|
71 |
|
|
$form->setBloc('complement','D',""); |
72 |
|
|
$form->setBloc('complement','F'); |
73 |
|
|
|
74 |
|
|
$form->setBloc('lieu_dit','D',"","group"); |
75 |
|
|
$form->setBloc('localite','F'); |
76 |
|
|
|
77 |
|
|
$form->setBloc('code_postal','D',"","group"); |
78 |
|
|
$form->setBloc('cedex','F'); |
79 |
|
|
|
80 |
|
|
$form->setBloc('pays','D',"", "","group"); |
81 |
|
|
$form->setBloc('division_territoriale','F'); |
82 |
nhaye |
1425 |
$form->setFieldset('division_territoriale','F'); |
83 |
|
|
|
84 |
|
|
$form->setFieldset('telephone_fixe','D',_("Coordonnees"), ""); |
85 |
nhaye |
828 |
$form->setBloc('telephone_fixe','D',"", "group"); |
86 |
|
|
$form->setBloc('indicatif','F'); |
87 |
nhaye |
1425 |
|
88 |
|
|
$form->setBloc('courriel','D',"", "group"); |
89 |
|
|
$form->setBloc('notification','F'); |
90 |
|
|
|
91 |
|
|
$form->setFieldset('notification','F'); |
92 |
nhaye |
828 |
} |
93 |
|
|
} |
94 |
|
|
|
95 |
|
|
/* |
96 |
vpihour |
795 |
* Met le champ type_demandeur à delegataire par défaut |
97 |
|
|
*/ |
98 |
|
|
function setVal(&$form, $maj, $validation, &$db) { |
99 |
|
|
if($maj == 0 ) { |
100 |
|
|
$form->setVal("type_demandeur","delegataire"); |
101 |
|
|
} |
102 |
|
|
} |
103 |
nhaye |
819 |
/* |
104 |
|
|
* Met le champ type_demandeur à delegataire par défaut |
105 |
|
|
*/ |
106 |
|
|
function setValSousFormulaire(&$form, $maj, $validation, &$db) { |
107 |
nhaye |
1048 |
parent::setValSousFormulaire($form, $maj, $validation, $db); |
108 |
|
|
$form->setVal("type_demandeur","delegataire"); |
109 |
nhaye |
819 |
if($maj == 0 ) { |
110 |
nhaye |
1048 |
// Récupération des infos du demandeur passé en paramètre |
111 |
|
|
if($this->getParameter('idx_demandeur') != "") { |
112 |
|
|
include '../sql/pgsql/delegataire.form.inc.php'; |
113 |
|
|
$sql = "SELECT ".implode(", ",$champs)." FROM ".DB_PREFIXE."demandeur ". |
114 |
|
|
"WHERE demandeur=".$this->getParameter('idx_demandeur'); |
115 |
|
|
$res = $this->db->query($sql); |
116 |
vpihour |
1777 |
$this->f->addToLog("setValSousFormulaire() : db->query(\"".$sql."\")", VERBOSE_MODE); |
117 |
|
|
if ( database::isError($res)){ |
118 |
|
|
die(); |
119 |
|
|
} |
120 |
nhaye |
1048 |
$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 |
|
|
?> |