3 |
//gen openMairie le 08/11/2012 14:00 |
//gen openMairie le 08/11/2012 14:00 |
4 |
|
|
5 |
include('../gen/sql/pgsql/demande.inc.php'); |
include('../gen/sql/pgsql/demande.inc.php'); |
6 |
|
// Titre |
7 |
|
if (isset($idx_dossier) && $idx_dossier != ']' && trim($idx_dossier) != '') { |
8 |
|
$ent = _("Demande sur dossier existant")." -> ".$idx_dossier; |
9 |
|
} else { |
10 |
|
$ent = _("Demande pour nouveau dossier"); |
11 |
|
} |
12 |
|
//TABLE |
13 |
|
/*Champs du début de la requête*/ |
14 |
|
$table = DB_PREFIXE."demande |
15 |
|
INNER JOIN ".DB_PREFIXE."lien_demande_demandeur |
16 |
|
ON lien_demande_demandeur.demande=demande.demande |
17 |
|
AND lien_demande_demandeur.petitionnaire_principal IS TRUE |
18 |
|
INNER JOIN ".DB_PREFIXE."demandeur |
19 |
|
ON lien_demande_demandeur.demandeur=demandeur.demandeur |
20 |
|
LEFT JOIN ".DB_PREFIXE."arrondissement |
21 |
|
ON demande.arrondissement=arrondissement.arrondissement |
22 |
|
LEFT JOIN ".DB_PREFIXE."demande_type |
23 |
|
ON demande.demande_type=demande_type.demande_type |
24 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
25 |
|
ON demande.dossier_autorisation=dossier_autorisation.dossier_autorisation |
26 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
27 |
|
ON demande.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
28 |
|
LEFT JOIN ".DB_PREFIXE."dossier |
29 |
|
ON demande.dossier_instruction=dossier.dossier |
30 |
|
LEFT JOIN ".DB_PREFIXE."instruction |
31 |
|
ON demande.instruction_recepisse=instruction.instruction "; |
32 |
|
/* Test SQL pour récupérer les bons champs selon la qualité du demandeur : |
33 |
|
* particulier ou personne morale*/ |
34 |
|
$case_demandeur = "CASE WHEN demandeur.qualite='particulier' |
35 |
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
36 |
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
37 |
|
END"; |
38 |
|
|
39 |
|
/*Supression du bouton d'ajout de nouvelle demande à partir du formulaire*/ |
40 |
|
$tab_actions['corner']['ajouter'] = NULL; |
41 |
|
|
42 |
|
/*Liste des champs affichés dans le tableau de résultat*/ |
43 |
|
$champAffiche = array( |
44 |
|
'demande.demande as "'._("demande").'"', |
45 |
|
'demande.dossier_instruction as "'._("dossier").'"', |
46 |
|
$case_demandeur.' as "'._("nom").'"', |
47 |
|
'TRIM(CONCAT(demande.terrain_adresse_voie_numero,\' \', |
48 |
|
demande.complement,\' \', |
49 |
|
demande.terrain_adresse_lieu_dit,\' \', |
50 |
|
demande.terrain_adresse_code_postal,\' \', |
51 |
|
demande.terrain_adresse_localite,\' \', |
52 |
|
demande.terrain_adresse_bp,\' \', |
53 |
|
demande.terrain_adresse_cedex |
54 |
|
)) as "'._("terrain").'"', |
55 |
|
'dossier_autorisation_type_detaille.libelle as "'._("nature_dossier").'"', |
56 |
|
'to_char(demande.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"', |
57 |
|
'arrondissement.libelle as "'._("arrondissement").'"', |
58 |
|
); |
59 |
|
|
60 |
// Recherche avancee |
/* Recherche avancée */ |
61 |
$champs = array(); |
$champs = array(); |
62 |
|
|
63 |
$champs['dossier_instruction'] = array( |
$champs['dossier_instruction'] = array( |
64 |
'table' => 'dossier', |
'table' => 'dossier', |
65 |
'colonne' => 'dossier', |
'colonne' => 'dossier', |
66 |
'type' => 'text', |
'type' => 'text', |
67 |
'libelle' => _('dossier_instruction')); |
'libelle' => _('dossier')); |
68 |
|
|
69 |
|
|
70 |
$champs['particulier_nom'] = |
$champs['particulier_nom'] = |
71 |
array('colonne' => 'particulier_nom', |
array('colonne' => array('particulier_nom', 'personne_morale_denomination'), |
72 |
'table' => 'demandeur', |
'table' => 'demandeur', |
73 |
'libelle' => _('petitionnaire'), |
'libelle' => _('petitionnaire'), |
74 |
'type' => 'text' |
'type' => 'text' |
75 |
); |
); |
76 |
|
|
77 |
$champs['adresse'] = array( |
$champs['adresse'] = array( |
78 |
'table' => 'demandeur', |
'table' => 'demande', |
79 |
'colonne' => 'TRIM(CONCAT(demandeur.terrain_adresse_voie_numero,\' \', |
'colonne' => array('terrain_adresse_voie_numero','complement', |
80 |
demandeur.complement,\' \', |
'terrain_adresse_lieu_dit', 'terrain_adresse_code_postal', |
81 |
demandeur.terrain_adresse_lieu_dit,\' \', |
'terrain_adresse_localite', 'terrain_adresse_bp', |
82 |
demandeur.terrain_adresse_code_postal,\' \', |
'terrain_adresse_cedex'), |
|
demandeur.terrain_adresse_localite,\' \', |
|
|
demandeur.terrain_adresse_bp,\' \', |
|
|
demandeur.terrain_adresse_cedex |
|
|
))', |
|
83 |
'type' => 'text', |
'type' => 'text', |
84 |
'libelle' => _('terrain')); |
'libelle' => _('adresse')); |
85 |
|
|
86 |
$champs['arrondissement'] = |
$champs['arrondissement'] = |
87 |
array('colonne' => 'arrondissement', |
array('colonne' => 'arrondissement', |
106 |
$options[] = array('type' => 'search', |
$options[] = array('type' => 'search', |
107 |
'display' => true, |
'display' => true, |
108 |
'advanced' => $champs, |
'advanced' => $champs, |
109 |
'absolute_object' => 'dossier_autorisation', |
'absolute_object' => 'demande', |
110 |
'export' => array("csv")); |
'export' => array("csv")); |
111 |
|
/*Fin recherche avancée*/ |
112 |
|
|
113 |
|
/*Sous-formulaire non affichés*/ |
114 |
$sousformulaire = NULL; |
$sousformulaire = NULL; |
115 |
?> |
?> |