/[openfoncier]/trunk/app/commission_tableau_dossier_possible.php
ViewVC logotype

Annotation of /trunk/app/commission_tableau_dossier_possible.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2120 - (hide annotations)
Thu Aug 1 14:26:30 2013 UTC (11 years, 6 months ago) by softime
File size: 11899 byte(s)
- Tous les nouveaux profil on été ajoutés : QUALIFICATEUR, DIVISIONNAIRE, CHEF DE SERVICE, SERVICE 
  CONSULTÉ INTERNE, VISUALISATION DA et DI, et VISUALISATION DA.

- Modification des droits d'accès et d'actions des profils : INSTRUCTEUR, CELLULE SUIVI, SERVICE CONSULTÉ,
  GUICHET UNIQUE.

- Création de /sql/pgsql/dossier_autorisation_avis.inc.php pour l'affichage des DA pour le profil SERVICE CONSULTE

- Création de /sql/pgsql/dossier_autorisation_qualifier.inc.php pour l'affichage des DA pour le profil QUALIFICATEUR

- Création du widget app/widget_infos_profil.php générique à tous les profil

- Création du widget app/widget_redirection.php pour rediriger le Tableau de bord

- Traductions

1 vpihour 1351 <?php
2     /**
3     * Ajoute un dossier à la commision passée en paramètre
4     *
5     * @package openfoncier
6 fmichon 1512 * @version SVN : $Id$
7 vpihour 1351 */
8    
9 fmichon 1519 //
10 vpihour 1351 require_once "../obj/utils.class.php";
11 softime 2120 $f = new utils("nohtml", "dossier_commission_possible");
12 vpihour 1351
13 fmichon 1519 $idx = ( isset($_GET['idx']) ) ? $_GET['idx'] : "" ;
14 vpihour 1351
15 fmichon 1519
16    
17    
18 vpihour 1351 //Si l'identifiant de la commission a été fourni, ainsi que le numéro de dossier
19     if ( is_numeric($idx) && $idx != "" ){
20    
21     // Vérifie que le dossier existe
22     $sql = "SELECT
23     dossier_commission.dossier as \"dossier\",
24 softime 2112 dossier.dossier_libelle as \"dossier_libelle\",
25 vpihour 1351 CASE WHEN demandeur.qualite='particulier'
26     THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom))
27     ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination))
28     END as \"demandeur\",
29     TRIM(CONCAT(dossier.terrain_adresse_voie_numero,' ',
30 softime 2061 dossier.terrain_adresse_voie,' ',
31 vpihour 1351 dossier.terrain_adresse_lieu_dit,' ',
32     dossier.terrain_adresse_code_postal,' ',
33     dossier.terrain_adresse_localite,' ',
34     dossier.terrain_adresse_bp,' ',
35     dossier.terrain_adresse_cedex
36     )) as \"terrain\",
37     instructeur.nom as \"instructeur\",
38     dossier_commission.motivation as \"motivation\",
39     to_char(dossier_commission.date_souhaitee,'DD/MM/YYYY') as \"date_souhaitee\",
40     to_char(dossier.date_limite,'DD/MM/YYYY') as \"date_limite\",
41     etat.libelle as \"etat\"
42     FROM
43     ".DB_PREFIXE."dossier_commission
44     JOIN
45     ".DB_PREFIXE."dossier
46     ON
47     dossier_commission.dossier = dossier.dossier
48     LEFT JOIN
49     ".DB_PREFIXE."etat
50     ON
51     dossier.etat = etat.etat
52     JOIN
53     ".DB_PREFIXE."lien_dossier_demandeur
54     ON
55     dossier.dossier = lien_dossier_demandeur.dossier
56     JOIN
57     ".DB_PREFIXE."demandeur
58     ON
59     lien_dossier_demandeur.demandeur = demandeur.demandeur AND
60     lien_dossier_demandeur.petitionnaire_principal IS TRUE
61     JOIN
62     ".DB_PREFIXE."instructeur
63     ON
64     dossier.instructeur = instructeur.instructeur
65     WHERE
66     dossier_commission.commission = ".$idx;
67     $res = $f->db->query($sql);
68 fmichon 1519 $f->addToLog("app/commission_tableau_dossier_possible.php : db->query(\"".$sql."\");", VERBOSE_MODE);
69 vpihour 1351 $f->isDatabaseError($res);
70    
71 vpihour 1366 //Dossier ajoutable
72     $sqlAjout = "SELECT
73     dossier_commission.dossier as \"dossier\",
74 softime 2112 dossier.dossier_libelle as \"dossier_libelle\",
75 vpihour 1366 CASE WHEN demandeur.qualite='particulier'
76     THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom))
77     ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination))
78     END as \"demandeur\",
79     TRIM(CONCAT(dossier.terrain_adresse_voie_numero,' ',
80 softime 2061 dossier.terrain_adresse_voie,' ',
81 vpihour 1366 dossier.terrain_adresse_lieu_dit,' ',
82     dossier.terrain_adresse_code_postal,' ',
83     dossier.terrain_adresse_localite,' ',
84     dossier.terrain_adresse_bp,' ',
85     dossier.terrain_adresse_cedex
86     )) as \"terrain\",
87     instructeur.nom as \"instructeur\",
88     dossier_commission.motivation as \"motivation\",
89     to_char(dossier_commission.date_souhaitee,'DD/MM/YYYY') as \"date_souhaitee\",
90     to_char(dossier.date_limite,'DD/MM/YYYY') as \"date_limite\",
91     etat.libelle as \"etat\"
92     FROM
93     ".DB_PREFIXE."dossier_commission
94     JOIN
95     ".DB_PREFIXE."dossier
96     ON
97     dossier_commission.dossier = dossier.dossier
98     LEFT JOIN
99     ".DB_PREFIXE."etat
100     ON
101     dossier.etat = etat.etat
102     JOIN
103     ".DB_PREFIXE."lien_dossier_demandeur
104     ON
105     dossier.dossier = lien_dossier_demandeur.dossier
106     JOIN
107     ".DB_PREFIXE."demandeur
108     ON
109     lien_dossier_demandeur.demandeur = demandeur.demandeur AND
110     lien_dossier_demandeur.petitionnaire_principal IS TRUE
111     JOIN
112     ".DB_PREFIXE."instructeur
113     ON
114     dossier.instructeur = instructeur.instructeur
115     WHERE
116 vpihour 1398 dossier_commission.commission IS NULL AND
117     dossier_commission.commission_type =
118     (
119     SELECT
120     commission_type
121     FROM
122     ".DB_PREFIXE."commission
123     WHERE commission.commission = ".$idx."
124     ) ";
125 fmichon 1519
126 vpihour 1366 $resAjout = $f->db->query($sqlAjout);
127 fmichon 1519 $f->addToLog("app/commission_tableau_dossier_possible.php : db->query(\"".$sqlAjout."\");", VERBOSE_MODE);
128 vpihour 1366 $f->isDatabaseError($resAjout);
129    
130 vpihour 1351 // Affiche des données résultats
131 vpihour 1366 if ( $res->numrows() > 0 || $resAjout->numrows() > 0 ){
132 vpihour 1351
133     //Affichage du tableau
134     echo '<table class="tab-tab">';
135    
136     // Entête de tableau
137     echo '<thead>';
138     echo '<tr class="ui-tabs-nav ui-accordion ui-state-default tab-title">';
139     echo '<th class="title col-0 firstcol">';
140     echo '<span class="name">';
141     echo '</span>';
142     echo '</th>';
143     echo '<th class="title col-0 firstcol">';
144     echo '<span class="name">';
145     echo _('dossier');
146     echo '</span>';
147     echo '</th>';
148     echo '<th class="title col-0 firstcol">';
149     echo '<span class="name">';
150     echo _('demandeur');
151     echo '</span>';
152     echo '</th>';
153     echo '<th class="title col-0 firstcol">';
154     echo '<span class="name">';
155     echo _('terrain');
156     echo '</span>';
157     echo '</th>';
158     echo '<th class="title col-0 firstcol">';
159     echo '<span class="name">';
160     echo _('instructeur');
161     echo '</span>';
162     echo '</th>';
163     echo '<th class="title col-0 firstcol">';
164     echo '<span class="name">';
165     echo _('motivation');
166     echo '</span>';
167     echo '</th>';
168     echo '<th class="title col-0 firstcol">';
169     echo '<span class="name">';
170     echo _('date_souhaitee');
171     echo '</span>';
172     echo '</th>';
173     echo '<th class="title col-0 firstcol">';
174     echo '<span class="name">';
175     echo _('date_limite');
176     echo '</span>';
177     echo '</th>';
178     echo '<th class="title col-0 firstcol">';
179     echo '<span class="name">';
180     echo _('etat');
181     echo '</span>';
182     echo '</th>';
183     echo '</tr>';
184     echo '</thead>';
185    
186     echo '<tbody>';
187    
188     // Données dans le tableau
189     while($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
190    
191     echo '<tr class="tab-data odd">';
192    
193     // Icône de visualisation
194     // Checkbox
195     echo '<td class="icons">';
196     echo '<input type="checkbox" checked="checked" name="dossier[]" value="'.$row['dossier'].'"/>';
197     echo '</td>';
198    
199     // Numéro de dossier
200     echo '<td class="col-1 firstcol">';
201 softime 2112 echo $row['dossier_libelle'];
202 vpihour 1351 echo '</td>';
203    
204     // Nom du pétitionnaire
205     echo '<td class="col-1">';
206     echo $row['demandeur'];
207     echo '</td>';
208    
209     // Adresse du terrain
210     echo '<td class="col-2 lastcol">';
211     echo $row['terrain'];
212     echo '</td>';
213    
214     // Instructeur
215     echo '<td class="col-2 lastcol">';
216     echo $row['instructeur'];
217     echo '</td>';
218    
219     // Motication
220     echo '<td class="col-2 lastcol">';
221     echo $row['motivation'];
222     echo '</td>';
223    
224     // date_souhaitee
225     echo '<td class="col-2 lastcol">';
226     echo $f->formatDate($row['date_souhaitee']);
227     echo '</td>';
228    
229     // date_limite
230     echo '<td class="col-2 lastcol">';
231     echo $f->formatDate($row['date_limite']);
232     echo '</td>';
233    
234     // Etat
235     echo '<td class="col-2 lastcol">';
236     echo $f->formatDate($row['etat']);
237     echo '</td>';
238    
239     echo "</tr>";
240     }
241    
242     //Ajout des données au tableau
243 vpihour 1366 while($row=& $resAjout->fetchRow(DB_FETCHMODE_ASSOC)){
244 vpihour 1351
245     echo '<tr class="tab-data odd">';
246    
247     // Icône de visualisation
248     // Checkbox
249     echo '<td class="icons">';
250     echo '<input type="checkbox" name="dossier[]" value="'.$row['dossier'].'"/>';
251     echo '</td>';
252    
253     // Numéro de dossier
254     echo '<td class="col-1 firstcol">';
255 softime 2112 echo $row['dossier_libelle'];
256 vpihour 1351 echo '</td>';
257    
258     // Nom du pétitionnaire
259     echo '<td class="col-1">';
260     echo $row['demandeur'];
261     echo '</td>';
262    
263     // Adresse du terrain
264     echo '<td class="col-2 lastcol">';
265     echo $row['terrain'];
266     echo '</td>';
267    
268     // Instructeur
269     echo '<td class="col-2 lastcol">';
270     echo $row['instructeur'];
271     echo '</td>';
272    
273     // Motication
274     echo '<td class="col-2 lastcol">';
275     echo $row['motivation'];
276     echo '</td>';
277    
278     // date_souhaitee
279     echo '<td class="col-2 lastcol">';
280     echo $f->formatDate($row['date_souhaitee']);
281     echo '</td>';
282    
283     // date_limite
284     echo '<td class="col-2 lastcol">';
285     echo $f->formatDate($row['date_limite']);
286     echo '</td>';
287    
288     // Etat
289     echo '<td class="col-2 lastcol">';
290     echo $f->formatDate($row['etat']);
291     echo '</td>';
292    
293     echo "</tr>";
294     }
295    
296     echo '</tbody>';
297    
298     echo '</table>';
299    
300     //bouton de validation
301     echo "\t<div class=\"formControls\">\n";
302     echo "\t\t<input type=\"button\"
303     class=\"om-button ui-button ui-widget ui-state-default ui-corner-all\"
304     value=\""._("Ajouter ces dossiers a l'ordre du jour")."\"
305     name=\"validation\"
306     onclick=\"updateCommission(".$idx.", '#tabs-2');\" />\n";
307     echo "\t</div>\n";
308     }
309 vpihour 1365 else{
310 vpihour 1398 echo _("Aucune demande de passage pour ce type de commission.");
311 vpihour 1365 }
312 vpihour 1351 }
313 fmichon 1521
314     ?>

Properties

Name Value
svn:keywords Id

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26