1 |
<?php |
2 |
/** |
3 |
* DBFORM - 'avocat' - Surcharge obj. |
4 |
* |
5 |
* @package openads |
6 |
* @version SVN : $Id: avocat.class.php 6565 2017-04-21 16:14:15Z softime $ |
7 |
*/ |
8 |
require_once("../obj/demandeur.class.php"); |
9 |
|
10 |
|
11 |
/** |
12 |
* Les avodats héritent des demandeurs. |
13 |
*/ |
14 |
class avocat extends demandeur { |
15 |
|
16 |
/** |
17 |
* |
18 |
*/ |
19 |
protected $_absolute_class_name = "avocat"; |
20 |
|
21 |
// {{{ Gestion de la confidentialité des données spécifiques |
22 |
|
23 |
/** |
24 |
* Définition des actions disponibles sur la classe. |
25 |
* |
26 |
* @return void |
27 |
*/ |
28 |
function init_class_actions() { |
29 |
|
30 |
parent::init_class_actions(); |
31 |
|
32 |
// ACTION - 003 - consulter |
33 |
// |
34 |
$this->class_actions[3]["condition"] = "is_user_from_allowed_collectivite"; |
35 |
|
36 |
|
37 |
// ACTION - 110 - recuperer_frequent |
38 |
// Finalise l'enregistrement |
39 |
$this->class_actions[110] = array( |
40 |
"identifier" => "recuperer_frequent", |
41 |
"view" => "formulaire", |
42 |
"method" => "modifier", |
43 |
"button" => "valider", |
44 |
"permission_suffix" => "modifier", |
45 |
); |
46 |
} |
47 |
|
48 |
//}}} |
49 |
|
50 |
/** |
51 |
* Cache les champs de notification, fréquent et type_demandeur. |
52 |
* |
53 |
* @param formulaire $form Instance de la classe om_formulaire. |
54 |
* @param integer $maj Identifiant de l'action. |
55 |
*/ |
56 |
function setType(&$form, $maj) { |
57 |
parent::setType($form, $maj); |
58 |
|
59 |
$form->setType('type_demandeur', 'hidden'); |
60 |
$form->setType('notification', 'hidden'); |
61 |
|
62 |
if($maj == 3) { |
63 |
// En consultation le bouton "Sauvegarder" n'a pas lieu d'être |
64 |
$form->setType('frequent','hidden'); |
65 |
// Gestion de la catégorie de personne |
66 |
if ($this->getVal('qualite') == 'particulier') { |
67 |
$form->setType('personne_morale_denomination','hidden'); |
68 |
$form->setType('personne_morale_raison_sociale','hidden'); |
69 |
$form->setType('personne_morale_siret','hidden'); |
70 |
$form->setType('personne_morale_categorie_juridique','hidden'); |
71 |
$form->setType('personne_morale_nom','hidden'); |
72 |
$form->setType('personne_morale_prenom','hidden'); |
73 |
$form->setType('personne_morale_civilite','hidden'); |
74 |
} else { |
75 |
$form->setType('particulier_civilite','hidden'); |
76 |
$form->setType('particulier_nom','hidden'); |
77 |
$form->setType('particulier_prenom','hidden'); |
78 |
$form->setType('particulier_date_naissance','hidden'); |
79 |
$form->setType('particulier_commune_naissance','hidden'); |
80 |
$form->setType('particulier_departement_naissance','hidden'); |
81 |
$form->setType('particulier_pays_naissance','hidden'); |
82 |
} |
83 |
} |
84 |
|
85 |
// Champs disabled pour la modif d'avocat frequents |
86 |
if ($maj==110 or $maj==1) { //modifier |
87 |
if($this->getVal('frequent') == 't') { |
88 |
$form->setType('qualite','selecthiddenstatic'); |
89 |
$form->setType('particulier_nom','static'); |
90 |
$form->setType('particulier_prenom','static'); |
91 |
$form->setType('particulier_date_naissance','datestatic'); |
92 |
$form->setType('particulier_commune_naissance','static'); |
93 |
$form->setType('particulier_departement_naissance','static'); |
94 |
$form->setType('personne_morale_denomination','static'); |
95 |
$form->setType('personne_morale_raison_sociale','static'); |
96 |
$form->setType('personne_morale_siret','static'); |
97 |
$form->setType('personne_morale_categorie_juridique','static'); |
98 |
$form->setType('personne_morale_nom','static'); |
99 |
$form->setType('personne_morale_prenom','static'); |
100 |
$form->setType('numero','static'); |
101 |
$form->setType('voie','static'); |
102 |
$form->setType('complement','static'); |
103 |
$form->setType('lieu_dit','static'); |
104 |
$form->setType('localite','static'); |
105 |
$form->setType('code_postal','static'); |
106 |
$form->setType('bp','static'); |
107 |
$form->setType('cedex','static'); |
108 |
$form->setType('pays','static'); |
109 |
$form->setType('division_territoriale','static'); |
110 |
$form->setType('telephone_fixe','static'); |
111 |
$form->setType('telephone_mobile','static'); |
112 |
$form->setType('fax','static'); |
113 |
$form->setType('indicatif','static'); |
114 |
$form->setType('courriel','static'); |
115 |
$form->setType('notification','checkboxstatic'); |
116 |
$form->setType('particulier_civilite','selecthiddenstatic'); |
117 |
$form->setType('personne_morale_civilite','selecthiddenstatic'); |
118 |
$form->setType('om_collectivite','selecthiddenstatic'); |
119 |
// on masque le bouton "Sauvegarder" |
120 |
$form->setType('frequent','hidden'); |
121 |
} |
122 |
}// fin modifier |
123 |
|
124 |
$form->setType('type_demandeur', 'hidden'); |
125 |
} |
126 |
|
127 |
/** |
128 |
* SETTER_FORM - setVal (setVal). |
129 |
* |
130 |
* @return void |
131 |
*/ |
132 |
function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) { |
133 |
// parent::setVal($form, $maj, $validation); |
134 |
// |
135 |
if ($maj == 0) { |
136 |
$form->setVal("type_demandeur", "avocat"); |
137 |
} |
138 |
} |
139 |
|
140 |
function setLib(&$form,$maj) { |
141 |
//libelle des champs |
142 |
parent::setLib($form, $maj); |
143 |
$form->setLib('frequent',"<span class=\"om-form-button copy-16\" |
144 |
title=\""._("Sauvegarder cet avocat")."\">"._("Sauvegarder (avocat fréquent)")."</span>"); |
145 |
|
146 |
} |
147 |
|
148 |
/** |
149 |
* SETTER_FORM - setValsousformulaire (setVal). |
150 |
* |
151 |
* @return void |
152 |
*/ |
153 |
function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) { |
154 |
parent::setValsousformulaire($form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire); |
155 |
// |
156 |
$form->setVal("type_demandeur", "avocat"); |
157 |
} |
158 |
|
159 |
} |