/[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 1038 - (hide annotations)
Tue Dec 11 10:26:42 2012 UTC (12 years, 1 month ago) by vpihour
File size: 3799 byte(s)
Correction de la recherche avancée avec ajout de la nouvelle fonctionnalité.
Ajout du prénom du pétitionnaire si c'est un particulier et de la raison sociale si c'est une personne morale

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 1034 //TABLE
8     $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    
27 vpihour 1038 $case_demandeur = "CASE WHEN demandeur.qualite='particulier'
28     THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom))
29     ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination))
30     END";
31    
32 vpihour 1034 // SELECT
33     $champAffiche = array(
34     'demande.demande as "'._("demande").'"',
35 vpihour 1038 $case_demandeur.' as "'._("petitionaire principal").'"',
36 vpihour 1034 'TRIM(CONCAT(demande.terrain_adresse_voie_numero,\' \',
37     demande.complement,\' \',
38     demande.terrain_adresse_lieu_dit,\' \',
39     demande.terrain_adresse_code_postal,\' \',
40     demande.terrain_adresse_localite,\' \',
41     demande.terrain_adresse_bp,\' \',
42     demande.terrain_adresse_cedex
43     )) as "'._("adresse du terrain").'"',
44     'dossier_autorisation_type_detaille.libelle as "'._("dossier_autorisation_type_detaille").'"',
45     'to_char(demande.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"',
46     'arrondissement.libelle as "'._("arrondissement").'"',
47     );
48    
49 fmichon 1005 // Recherche avancee
50     $champs = array();
51    
52     $champs['dossier_instruction'] = array(
53     'table' => 'dossier',
54     'colonne' => 'dossier',
55     'type' => 'text',
56     'libelle' => _('dossier_instruction'));
57    
58    
59     $champs['particulier_nom'] =
60 vpihour 1034 array('colonne' => array('particulier_nom', 'personne_morale_denomination'),
61 fmichon 1005 'table' => 'demandeur',
62     'libelle' => _('petitionnaire'),
63     'type' => 'text'
64     );
65    
66     $champs['adresse'] = array(
67 vpihour 1034 'table' => 'demande',
68     'colonne' => array('terrain_adresse_voie_numero','complement',
69     'terrain_adresse_lieu_dit', 'terrain_adresse_code_postal',
70     'terrain_adresse_localite', 'terrain_adresse_bp',
71     'terrain_adresse_cedex'),
72 fmichon 1005 'type' => 'text',
73 vpihour 1038 'libelle' => _('adresse'));
74 fmichon 1005
75     $champs['arrondissement'] =
76     array('colonne' => 'arrondissement',
77     'table' => 'demande',
78     'libelle' => _('arrondissement'),
79     'type' => 'select'
80     );
81    
82     $champs['dossier_autorisation_type_detaille'] = array(
83     'table' => 'demande',
84     'colonne' => 'dossier_autorisation_type_detaille',
85     'type' => 'select',
86     'libelle' => _('nature du dossier'));
87    
88     $champs['date_demande'] =
89     array('colonne' => 'date_demande',
90     'table' => 'demande',
91     'libelle' => _('date_demande'),
92     'type' => 'date',
93     'where' => 'intervaldate');
94    
95     $options[] = array('type' => 'search',
96     'display' => true,
97     'advanced' => $champs,
98 vpihour 1034 'absolute_object' => 'demande',
99 fmichon 1005 'export' => array("csv"));
100    
101     $sousformulaire = NULL;
102 vpihour 632 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26