/[openfoncier]/branches/3.14.x/obj/architecte.class.php
ViewVC logotype

Annotation of /branches/3.14.x/obj/architecte.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3538 - (hide annotations)
Mon Jul 6 14:53:08 2015 UTC (9 years, 7 months ago) by nhaye
File size: 5518 byte(s)
Correction des tests suite à la modification des droits sur instructeur

1 fraynaud 3 <?php
2     //$Id$
3     //gen openMairie le 10/02/2011 20:30
4     require_once ("../gen/obj/architecte.class.php");
5    
6     class architecte extends architecte_gen {
7    
8 fraynaud 4 function architecte($id,&$db,$debug) {
9     $this->constructeur($id,$db,$debug);
10     }// fin constructeur
11 fraynaud 3
12 vpihour 2113 function checkAccessibility() {
13     //
14     parent::checkAccessibility();
15     //Affiche le bouton dans le portail d'action pour rendre un architecte non
16     //fréquent si on est dans le contexte d'un objet architecte_frequent
17 nhaye 3479 if ($this->getVal('frequent') != 't'){
18 vpihour 2113 $this->actions_sup['frequent'] = NULL;
19 nhaye 3479 }
20 vpihour 2113 }
21    
22     /**
23     * Ajout des blocs pour la gestion des architectes fréquents
24     */
25 fraynaud 4 function setType(&$form,$maj) {
26     parent::setType($form,$maj);
27 nhaye 3529 if ($maj == 0 || $maj == 1) { //ajouter et modifier [add and modify]
28 fraynaud 4 $form->setType('email', 'mail');
29     }
30 vpihour 2113
31 nhaye 3529 // Si modification d'un fréquent
32 vpihour 2113 if($this->getVal('frequent') == 't' AND $maj == 1 ) {
33 nhaye 3529 $form->setType('frequent','hidden');
34 vpihour 2113 }
35 fraynaud 4 }
36 vpihour 2113
37     function setLayout(&$form, $maj){
38    
39     $form->setBloc('architecte','D',"", "alignForm");
40     //
41     $form->setBloc('architecte','DF',"", "group");
42     //
43     $form->setBloc('architecte','F');
44    
45     if($this->getVal('frequent') != 't' || $maj == 0 ) {
46     $form->setBloc('nom','D',"","group alignForm civilite_architecte ".($maj<2 ? "search_fields ":""));
47     } else {
48     $form->setBloc('nom','D',"","group alignForm");
49     }
50    
51     //$form->setBloc('nom','D',"", "group civilite_architecte ".($maj<2 ? "search_fields":""));
52     $form->setBloc('prenom','F');
53    
54     $form->setBloc('adresse1','D',"", "adresse_architecte alignForm");
55     //
56     $form->setBloc('adresse1','DF',"", "group");
57     $form->setBloc('adresse2','DF',"", "group");
58     $form->setBloc('cp','DF',"", "group");
59     $form->setBloc('ville','DF',"", "group");
60     $form->setBloc('pays','DF',"", "group");
61     //
62     $form->setBloc('pays','F');
63    
64     $form->setBloc('inscription','D',"", "complement_architecte alignForm");
65     //
66     $form->setBloc('inscription','DF',"", "group");
67 softime 2617 $form->setBloc('conseil_regional','DF',"", "group");
68 vpihour 2113 $form->setBloc('nom_cabinet','DF',"", "group");
69     $form->setBloc('telephone','DF',"", "group");
70     $form->setBloc('fax','DF',"", "group");
71     $form->setBloc('email','DF',"", "group");
72     $form->setBloc('note','DF',"", "group");
73     //
74     $form->setBloc('note','F');
75     }
76    
77     function setVal(&$form, $maj, $validation, &$db) {
78     parent::setVal($form, $maj, $validation, $db);
79     $form->setVal("pays","France");
80     }
81    
82     function setLib(&$form,$maj) {
83     //
84     parent::setLib($form, $maj);
85     $form->setLib('frequent',"<span class=\"om-form-button copy-16\"
86     title=\""._("Sauvegarder cet architecte")."\">"._("Sauvegarder (architecte frequent)")."</span>");
87 fraynaud 4
88     }
89 vpihour 2113
90     /**
91     * Ajout d'un champs caché permettant de linker l'id du demandeur
92     * recement ajouté
93     **/
94     function sousFormSpecificContent($maj) {
95     $id_architecte = $this->getVal("architecte");
96     if(isset($this->valF["architecte"]) AND !empty($this->valF["architecte"])) {
97     echo "<input id=\"id_retour\" name=\"idRetour\" type=\"hidden\" value=\"".
98     $this->valF["architecte"]."\" />";
99     } elseif(isset($id_architecte) AND !empty($id_architecte) AND $maj == 1) {
100     echo "<input id=\"id_retour\" name=\"idRetour\" type=\"hidden\" value=\"".
101     $this->getVal("architecte")."\" />";
102     }
103     }
104    
105     /**
106     * Synthèse de l'architecte pour le formulaire des données techniques
107     */
108     function afficherSynthese() {
109    
110     $nom = $this->getVal('nom');
111     $prenom = $this->getVal('prenom');
112    
113     //Affichage du bouton pour ajout si dans un objet qui n'est pas en BDD
114 nhaye 3538 if ( $this->getParameter("maj") === 0 ){
115 vpihour 2113 printf ("<span class=\"om-form-button add-16 add_architecte\"
116     onclick=\"popupIt('architecte',
117     '../scr/sousform.php?obj=architecte&action=0'+
118     '&retourformulaire=donnees_techniques', 860, 'auto',
119     getObjId, 'architecte');\"".
120     ">");
121     printf(_("Saisir un(e) architecte"));
122     }
123     //Affichage du bouton de suppression sinon
124     else {
125     //
126     printf ("<span class=\"om-form-button delete-16 add_architecte\"
127     onclick=\"setDataFrequent('','architecte');\"".
128     "title=\"");
129     printf(_("Supprimer"));
130     printf("\">");
131     printf("&nbsp;");
132     printf("</span>");
133     //
134     printf ("<span class=\"om-form-button edit-16 add_architecte\"
135     onclick=\"popupIt('architecte',
136     '../scr/sousform.php?obj=architecte&action=1&idx=".$this->getVal($this->clePrimaire)."'+
137     '&retourformulaire=donnees_techniques', 860, 'auto',
138     getObjId, '".$this->clePrimaire."');\"".
139     "title=\"");
140     printf(_("editer"));
141     printf("\">");
142     printf("%s %s",$nom,$prenom);
143     }
144     printf ("</span>");
145     }
146 fraynaud 4
147 fraynaud 3 }// fin classe
148     ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26