/[openfoncier]/trunk/obj/bailleur.class.php
ViewVC logotype

Annotation of /trunk/obj/bailleur.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8989 - (hide annotations)
Thu Oct 31 15:09:51 2019 UTC (5 years, 3 months ago) by softime
File size: 6335 byte(s)
* Merge de la branche d'intégration 4.12.0-develop vers le trunk

1 softime 6976 <?php
2     /**
3 softime 7996 * DBFORM - 'bailleur' - Surcharge obj.
4     *
5 softime 6976 * @package openads
6     * @version SVN : $Id$
7     */
8     require_once("../obj/demandeur.class.php");
9    
10    
11     /**
12     * Les bailleurs héritent des demandeurs.
13     */
14     class bailleur extends demandeur {
15    
16     /**
17     *
18     */
19 softime 7996 protected $_absolute_class_name = "bailleur";
20 softime 6976
21     /**
22 softime 7013 * Définition des actions disponibles sur la classe.
23     *
24     * @return void
25     */
26     function init_class_actions() {
27    
28     parent::init_class_actions();
29    
30     // ACTION - 003 - consulter
31     //
32     $this->class_actions[3]["condition"] = "is_user_from_allowed_collectivite";
33    
34    
35     // ACTION - 110 - recuperer_frequent
36     // Récupère les bailleurs fréquents
37     $this->class_actions[110] = array(
38     "identifier" => "recuperer_frequent",
39     "view" => "formulaire",
40     "method" => "modifier",
41     "button" => "valider",
42     "permission_suffix" => "modifier",
43     );
44     }
45    
46    
47     /**
48 softime 6976 * Cache les champs de notification, fréquent et type_demandeur.
49     *
50     * @param formulaire $form Instance de la classe om_formulaire.
51     * @param integer $maj Identifiant de l'action.
52     */
53     function setType(&$form, $maj) {
54     parent::setType($form, $maj);
55    
56     $form->setType('type_demandeur', 'hidden');
57     $form->setType('notification', 'hidden');
58 softime 7013
59     //
60     if($maj == 3) {
61     // En consultation le bouton "Sauvegarder" n'a pas lieu d'être
62     $form->setType('frequent','hidden');
63     }
64    
65     // Champs disabled pour la modif du bailleur frequent
66     if ($maj==110 || $maj==1) { //modifier
67     if($this->getVal('frequent') == 't') {
68     $form->setType('qualite','selecthiddenstatic');
69     $form->setType('particulier_nom','static');
70     $form->setType('particulier_prenom','static');
71     $form->setType('particulier_date_naissance','datestatic');
72     $form->setType('particulier_commune_naissance','static');
73     $form->setType('particulier_departement_naissance','static');
74 softime 7996 $form->setType('particulier_pays_naissance','static');
75 softime 7013 $form->setType('personne_morale_denomination','static');
76     $form->setType('personne_morale_raison_sociale','static');
77     $form->setType('personne_morale_siret','static');
78     $form->setType('personne_morale_categorie_juridique','static');
79     $form->setType('personne_morale_nom','static');
80     $form->setType('personne_morale_prenom','static');
81     $form->setType('numero','static');
82     $form->setType('voie','static');
83     $form->setType('complement','static');
84     $form->setType('lieu_dit','static');
85     $form->setType('localite','static');
86     $form->setType('code_postal','static');
87     $form->setType('bp','static');
88     $form->setType('cedex','static');
89     $form->setType('pays','static');
90     $form->setType('division_territoriale','static');
91     $form->setType('telephone_fixe','static');
92     $form->setType('telephone_mobile','static');
93     $form->setType('fax','static');
94     $form->setType('indicatif','static');
95     $form->setType('courriel','static');
96     $form->setType('notification','checkboxstatic');
97     $form->setType('particulier_civilite','selecthiddenstatic');
98     $form->setType('personne_morale_civilite','selecthiddenstatic');
99     $form->setType('om_collectivite','selecthiddenstatic');
100     // on masque le bouton "Sauvegarder"
101     $form->setType('frequent','hidden');
102     }
103     }// fin modifier
104 softime 6976 }
105    
106     /**
107 softime 8989 * SETTER_FORM - setVal (setVal).
108     *
109     * @return void
110 softime 6976 */
111 softime 8989 function setVal(&$form, $maj, $validation, &$dnu1 = null, $dnu2 = null) {
112     // parent::setVal($form, $maj, $validation);
113     if ($maj == 0) {
114     $form->setVal("type_demandeur", "bailleur");
115 softime 6976 }
116     }
117 softime 8989
118     /**
119     * SETTER_FORM - setValsousformulaire (setVal).
120     *
121     * @return void
122 softime 6976 */
123     function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) {
124 softime 8989 parent::setValsousformulaire($form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire);
125     //
126 softime 6976 $form->setVal("type_demandeur", "bailleur");
127     }
128 softime 7013
129     /**
130     * Permet de définir le libellé des champs.
131     *
132     * @param object $form Instance de la classe om_formulaire.
133     * @param integer $maj Identifiant de l'action.
134     */
135     public function setLib(&$form, $maj) {
136     parent::setLib($form, $maj);
137    
138     // Libellé pour la sauvegarde du bailleur en fréquent
139     $form->setLib('frequent',"<span class=\"om-form-button copy-16\"
140     title=\""._("Sauvegarder ce bailleur")."\">"._("Sauvegarder (bailleur fréquent)")."</span>");
141    
142     }
143    
144    
145     /**
146     * Surcharge du bouton pour empécher l'utilisateur de modifier un fréquent
147     * Et ajout d'un bouton pour vider le formulaire
148     */
149     function boutonsousformulaire($datasubmit, $maj, $val=null) {
150     if($maj == 0 OR $this->getVal('frequent') != 't') {
151     if (!$this->correct) {
152     //
153     switch ($maj) {
154     case 0:
155     $bouton = _("Ajouter");
156     break;
157     case 1:
158     $bouton = _("Modifier");
159     break;
160     case 2:
161     $bouton = _("Supprimer");
162     break;
163     }
164     //
165     echo "<input type=\"button\" value=\"".$bouton."\" ";
166 softime 7996 echo "onclick=\"affichersform('".$this->get_absolute_class_name()."', '$datasubmit', this.form);\" ";
167 softime 7013 echo "class=\"om-button\" />";
168     }
169     }
170     if(!$this->correct) {
171     echo '<span class="om-form-button erase-bailleur delete-16" '.
172     'title="Supprimer le contenu">'._("Vider le formulaire").'</span>';
173     }
174     }
175    
176    
177 softime 6976 }

Properties

Name Value
svn:executable *
svn:keywords Id

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26