/[openfoncier]/trunk/sql/pgsql/demande.inc.php
ViewVC logotype

Annotation of /trunk/sql/pgsql/demande.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1059 - (hide annotations)
Thu Dec 13 16:03:03 2012 UTC (12 years, 1 month ago) by vpihour
File size: 4169 byte(s)
Correction d'un bug mineur

1 vpihour 632 <?php
2     //$Id$
3     //gen openMairie le 08/11/2012 14:00
4    
5     include('../gen/sql/pgsql/demande.inc.php');
6 fmichon 1005
7 vpihour 1058 /*Champs du début de la requête*/
8 vpihour 1034 $table = DB_PREFIXE."demande
9     INNER JOIN ".DB_PREFIXE."lien_demande_demandeur
10     ON lien_demande_demandeur.demande=demande.demande
11     AND lien_demande_demandeur.petitionnaire_principal IS TRUE
12     INNER JOIN ".DB_PREFIXE."demandeur
13     ON lien_demande_demandeur.demandeur=demandeur.demandeur
14     LEFT JOIN ".DB_PREFIXE."arrondissement
15     ON demande.arrondissement=arrondissement.arrondissement
16     LEFT JOIN ".DB_PREFIXE."demande_type
17     ON demande.demande_type=demande_type.demande_type
18     LEFT JOIN ".DB_PREFIXE."dossier_autorisation
19     ON demande.dossier_autorisation=dossier_autorisation.dossier_autorisation
20     LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille
21     ON demande.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille
22     LEFT JOIN ".DB_PREFIXE."dossier
23     ON demande.dossier_instruction=dossier.dossier
24     LEFT JOIN ".DB_PREFIXE."instruction
25     ON demande.instruction_recepisse=instruction.instruction ";
26 vpihour 1058 /* Test SQL pour récupérer les bons champs selon la qualité du demandeur :
27     * particulier ou personne morale*/
28 vpihour 1038 $case_demandeur = "CASE WHEN demandeur.qualite='particulier'
29     THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom))
30     ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination))
31     END";
32    
33 vpihour 1049 /*Supression du bouton d'ajout de nouvelle demande à partir du formulaire*/
34     $tab_actions['corner']['ajouter'] = NULL;
35    
36 vpihour 1058 /*Liste des champs affichés dans le tableau de résultat*/
37 vpihour 1034 $champAffiche = array(
38 vpihour 1059 'demande.demande as "'._("demande").'"',
39 vpihour 1056 'demande.dossier_instruction as "'._("dossier").'"',
40     $case_demandeur.' as "'._("nom").'"',
41 vpihour 1034 'TRIM(CONCAT(demande.terrain_adresse_voie_numero,\' \',
42     demande.complement,\' \',
43     demande.terrain_adresse_lieu_dit,\' \',
44     demande.terrain_adresse_code_postal,\' \',
45     demande.terrain_adresse_localite,\' \',
46     demande.terrain_adresse_bp,\' \',
47     demande.terrain_adresse_cedex
48 vpihour 1056 )) as "'._("terrain").'"',
49     'dossier_autorisation_type_detaille.libelle as "'._("nature_dossier").'"',
50 vpihour 1034 'to_char(demande.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"',
51     'arrondissement.libelle as "'._("arrondissement").'"',
52     );
53    
54 vpihour 1058 /* Recherche avancée */
55 fmichon 1005 $champs = array();
56    
57     $champs['dossier_instruction'] = array(
58     'table' => 'dossier',
59     'colonne' => 'dossier',
60     'type' => 'text',
61 vpihour 1056 'libelle' => _('dossier'));
62 fmichon 1005
63    
64     $champs['particulier_nom'] =
65 vpihour 1034 array('colonne' => array('particulier_nom', 'personne_morale_denomination'),
66 fmichon 1005 'table' => 'demandeur',
67     'libelle' => _('petitionnaire'),
68     'type' => 'text'
69     );
70    
71     $champs['adresse'] = array(
72 vpihour 1034 'table' => 'demande',
73     'colonne' => array('terrain_adresse_voie_numero','complement',
74     'terrain_adresse_lieu_dit', 'terrain_adresse_code_postal',
75     'terrain_adresse_localite', 'terrain_adresse_bp',
76     'terrain_adresse_cedex'),
77 fmichon 1005 'type' => 'text',
78 vpihour 1038 'libelle' => _('adresse'));
79 fmichon 1005
80     $champs['arrondissement'] =
81     array('colonne' => 'arrondissement',
82     'table' => 'demande',
83     'libelle' => _('arrondissement'),
84     'type' => 'select'
85     );
86    
87     $champs['dossier_autorisation_type_detaille'] = array(
88     'table' => 'demande',
89     'colonne' => 'dossier_autorisation_type_detaille',
90     'type' => 'select',
91     'libelle' => _('nature du dossier'));
92    
93     $champs['date_demande'] =
94     array('colonne' => 'date_demande',
95     'table' => 'demande',
96     'libelle' => _('date_demande'),
97     'type' => 'date',
98     'where' => 'intervaldate');
99    
100     $options[] = array('type' => 'search',
101     'display' => true,
102     'advanced' => $champs,
103 vpihour 1034 'absolute_object' => 'demande',
104 fmichon 1005 'export' => array("csv"));
105 vpihour 1058 /*Fin recherche avancée*/
106    
107     /*Sous-formulaire non affichés*/
108 fmichon 1005 $sousformulaire = NULL;
109 vpihour 632 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26