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

Contents of /branches/3.14.x/obj/cerfa.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1262 - (show annotations)
Thu Feb 14 17:54:53 2013 UTC (11 years, 11 months ago) by nhaye
Original Path: trunk/obj/cerfa.class.php
File size: 6185 byte(s)
- obj/cerfa.class.php : surcharge de la méthode verifier afin qu'on ne puisse pas ajouter 2 cerfa avec la même période de validité et le même type de dossier d'instruction
- obj/demande.class.php : ajout du n° de cerfa au dossier d'instruction lors de sa création
- sql/pgsql/dossier.inc.php : ajout de l'onglet "donnees_techniques"
- sql/pgsql/donnees_techniques.form.inc.php : remise en ordre des champs, définition du tableau des surfaces
- obj/donnees_techniques.class.php : configuration du tableau des surfaces et affichage ou non des champs selon le cerfa

1 <?php
2 //$Id$
3 //gen openMairie le 13/02/2013 14:41
4
5 require_once ("../gen/obj/cerfa.class.php");
6
7 class cerfa extends cerfa_gen {
8
9 function cerfa($id,&$db,$debug) {
10 $this->constructeur($id,$db,$debug);
11 }// fin constructeur
12
13
14 function setType(&$form,$maj) {
15 parent::setType($form,$maj);
16
17 // Sais pas quoi faire de ce champ
18 $form->setType('code_cnil', 'hidden');
19
20 if($maj == 0) {
21 $form->setType('tab_surface', 'select');
22 }elseif($maj == 1) {
23 $form->setType('tab_surface', 'select');
24 }elseif($maj == 2) {
25 $form->setType('tab_surface', 'selecthiddenstatic');
26 }elseif($maj == 3) {
27 $form->setType('tab_surface', 'selecthiddenstatic');
28 }
29 }
30
31 function verifier($val, &$db, $DEBUG) {
32 parent::verifier($val, $db, $DEBUG);
33 // Vérification que les dates de validités de cerfa ne se chevauchent pas
34 $sql = "SELECT count(*) FROM ".DB_PREFIXE."cerfa
35 WHERE dossier_instruction_type=".$this->valF['dossier_instruction_type'].
36 " AND om_validite_fin >= '".$this->valF['om_validite_debut']."'".
37 " AND om_validite_debut <= '".$this->valF['om_validite_fin']."'".
38 " AND cerfa != '".$this->valF['cerfa']."'";
39 $count = $db->getOne($sql);
40 $this->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE);
41 $this->f->isDatabaseError($count);
42 if($count>0) {
43 $this->correct=false;
44 $this->addToMessage(_("Un cerfa pour ce type de dossier d'instruction
45 et sur l'interval de dates selectionnees existe deja."));
46 }
47 }
48
49 function setSelect(&$form, $maj,&$db,$debug) {
50 parent::setSelect($form, $maj,$db,$debug);
51
52 if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php"))
53 include ("../sql/".$db->phptype."/".$this->table.".form.inc.php");
54 elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc"))
55 include ("../sql/".$db->phptype."/".$this->table.".form.inc");
56
57 // parametrage du tableau de surface
58 $contenu=array();
59 $contenu[0]=array_keys($tab_surface);
60 $contenu[1]=array_values($tab_surface);
61 $form->setSelect("tab_surface",$contenu);
62
63 }
64
65 function setLayout(&$form, $maj) {
66
67 /*Fieldset Parametrage du cerfa */
68 $form->setBloc('libelle','D',"","col_12");
69 $form->setFieldset('libelle','D'
70 ,_("Parametrage du cerfa"));
71
72
73 $form->setFieldset('dossier_instruction_type','F','');
74 $form->setBloc('dossier_instruction_type','F');
75
76 /*Fieldset n°4 Projet d'aménagement */
77 $form->setBloc('am_lotiss','D',"","col_12");
78 $form->setFieldset('am_lotiss','D'
79 ,_("Projet d'amenagement"));
80 // bloc 4.1
81 $form->setBloc('am_lotiss','D',_("Nature des travaux, instalations
82 ou aménagements envisagés"),"col_12");
83
84 $form->setBloc('am_tranche_desc','F');
85
86 // bloc 4.2
87 $form->setBloc('am_lot_max_nb','D',_("Demande concernant un lotissement"),"col_12");
88
89 $form->setBloc('am_lot_vente_ant','F');
90
91 // bloc 4.3
92 $form->setBloc('am_empl_nb','D',_("Amenagement d'un camping ou
93 d'un terrain aménagé en vue de l'hébergement
94 touristique"),"col_12");
95
96 $form->setBloc('am_exist_agrand','F');
97
98 $form->setFieldset('am_coupe_autr','F','');
99
100 $form->setBloc('am_coupe_autr','F');
101
102 /*Fieldset n°5 Projet de construction */
103 $form->setBloc('co_archi_recours','D',"","col_12");
104 $form->setFieldset('co_archi_recours','D'
105 ,_("Projet de construction"));
106 // bloc 5.1
107 $form->setBloc('co_archi_recours','D',_("Architecte"),"col_12");
108
109 $form->setBloc('co_archi_recours','F');
110
111 // bloc 5.2
112 $form->setBloc('co_cstr_nouv','D',_("Nature du projet"),"col_12");
113
114 $form->setBloc('co_elec_tension','F');
115
116 // bloc 5.3
117 $form->setBloc('co_tot_log_nb','D',_("Informations complementaires"),"col_12");
118
119 $form->setBloc('co_trx_nivsup','F');
120
121 // bloc 5.4
122 $form->setBloc('co_demont_period','D',_("Construction periodiquement
123 démontee et re-installee"),"col_12");
124
125 $form->setBloc('co_demont_period','F');
126
127 // bloc 5.5
128 $form->setBloc('tab_surface','D',_("Destination des constructions
129 et tableau des surfaces"),"col_12");
130
131 $form->setBloc('tab_surface','F');
132
133 // bloc 5.6
134 $form->setBloc('co_sp_transport','D',_("Destination des constructions
135 futures en cas de realisation au benefice d'un
136 service public ou d'interet collectif"),"col_12");
137
138 $form->setBloc('co_sp_culture','F');
139
140 // bloc 5.7
141 $form->setBloc('co_statio_avt_nb','D',_("Stationnement"),"col_12");
142
143 $form->setBloc('co_statio_comm_cin_surf','F');
144
145 $form->setFieldset('co_statio_apr_surf','F','');
146
147 $form->setBloc('co_statio_apr_surf','F');
148
149
150 /*Fieldset n°6 Projet necessitant demolitions */
151 $form->setBloc('dm_constr_dates','D',"","col_12");
152 $form->setFieldset('dm_constr_dates','D'
153 ,_("Projet necessitant demolitions"));
154
155 $form->setBloc('dm_constr_dates','D',"","col_12");
156
157 $form->setBloc('dm_tot_log_nb','F');
158
159 $form->setFieldset('dm_tot_log_nb','F','');
160
161 $form->setBloc('dm_tot_log_nb','F');
162 }
163
164 }// fin classe
165 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26