1 |
fraynaud |
3 |
<?php |
2 |
fmichon |
1549 |
/** |
3 |
|
|
* |
4 |
|
|
* |
5 |
|
|
* @package openfoncier |
6 |
|
|
* @version SVN : $Id$ |
7 |
|
|
*/ |
8 |
vpihour |
1133 |
|
9 |
fmichon |
1549 |
// |
10 |
|
|
include "../gen/sql/pgsql/evenement.form.inc.php"; |
11 |
|
|
|
12 |
|
|
// |
13 |
|
|
$sep = (isset($_GET['action']) && ($_GET['action'] == 1 || $_GET['action'] == 0 )) ? ';' : ',' ; |
14 |
|
|
|
15 |
|
|
// |
16 |
|
|
$champs = array( |
17 |
vpihour |
1133 |
"evenement.evenement", |
18 |
fmichon |
1540 |
"evenement.libelle", |
19 |
fmichon |
1543 |
"evenement.type", |
20 |
fmichon |
1540 |
"array_to_string(array_agg(transition.etat ORDER BY transition.etat), '$sep') as etats_depuis_lequel_l_evenement_est_disponible", |
21 |
fmichon |
1506 |
"array_to_string(array_agg(dossier_instruction_type ORDER BY dossier_instruction_type), '$sep') as dossier_instruction_type", |
22 |
fmichon |
1540 |
"evenement.restriction", |
23 |
|
|
"evenement.action", |
24 |
|
|
"evenement.etat", |
25 |
|
|
"evenement.delai", |
26 |
|
|
"evenement.accord_tacite", |
27 |
fmichon |
1543 |
"evenement.delai_notification", |
28 |
|
|
"evenement.avis_decision", |
29 |
fmichon |
1544 |
"evenement.lettretype", |
30 |
|
|
"evenement.consultation", |
31 |
fmichon |
1540 |
"evenement.evenement_suivant_tacite", |
32 |
|
|
"evenement.evenement_retour_ar", |
33 |
nhaye |
1564 |
"evenement.evenement_retour_signature", |
34 |
fmichon |
1506 |
); |
35 |
vpihour |
1133 |
|
36 |
fmichon |
1549 |
// |
37 |
|
|
$tableSelect = " |
38 |
|
|
".DB_PREFIXE."evenement |
39 |
|
|
LEFT JOIN ".DB_PREFIXE."lien_dossier_instruction_type_evenement |
40 |
fmichon |
1540 |
ON lien_dossier_instruction_type_evenement.evenement=evenement.evenement |
41 |
fmichon |
1549 |
LEFT JOIN ".DB_PREFIXE."transition |
42 |
fmichon |
1540 |
ON transition.evenement=evenement.evenement"; |
43 |
vpihour |
1133 |
|
44 |
fmichon |
1549 |
// |
45 |
|
|
$selection = " GROUP BY evenement.evenement, evenement.libelle "; |
46 |
vpihour |
1133 |
|
47 |
fmichon |
1549 |
// FKEY - OM_LETTRETYPE |
48 |
|
|
$sql_om_lettretype = " |
49 |
|
|
SELECT |
50 |
|
|
id, |
51 |
|
|
(id||' '||libelle) as lib |
52 |
|
|
FROM ".DB_PREFIXE."om_lettretype |
53 |
|
|
ORDER BY lib"; |
54 |
fmichon |
1502 |
|
55 |
|
|
$sql_action="SELECT action.action, action.libelle as lib FROM ".DB_PREFIXE."action ORDER BY lib"; |
56 |
|
|
$sql_etat="SELECT etat.etat, etat.libelle as lib FROM ".DB_PREFIXE."etat ORDER BY lib"; |
57 |
|
|
$sql_avis_decision="SELECT avis_decision.avis_decision, avis_decision.libelle as lib FROM ".DB_PREFIXE."avis_decision ORDER BY lib"; |
58 |
|
|
$sql_evenement_retour_ar="SELECT evenement.evenement, evenement.libelle as lib FROM ".DB_PREFIXE."evenement ORDER BY lib"; |
59 |
|
|
$sql_evenement_suivant_tacite="SELECT evenement.evenement, evenement.libelle as lib FROM ".DB_PREFIXE."evenement ORDER BY lib"; |
60 |
nhaye |
1569 |
$sql_evenement_retour_signature="SELECT evenement.evenement, evenement.libelle as lib FROM ".DB_PREFIXE."evenement ORDER BY lib"; |
61 |
fmichon |
1502 |
|
62 |
nhaye |
1569 |
|
63 |
fmichon |
1549 |
// LIAISON NaN - DOSSIER_INSTRUCTION_TYPE (LIEN_DOSSIER_INSTRUCTION_TYPE_EVENEMENT) |
64 |
|
|
$sql_dossier_instruction_type = " |
65 |
|
|
SELECT |
66 |
|
|
dossier_instruction_type.dossier_instruction_type, |
67 |
|
|
CONCAT(dossier_autorisation_type_detaille.code,' - ',dossier_instruction_type.code,' - ',dossier_instruction_type.libelle) as lib |
68 |
|
|
FROM ".DB_PREFIXE."dossier_instruction_type |
69 |
|
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
70 |
|
|
ON dossier_instruction_type.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
71 |
|
|
ORDER BY dossier_autorisation_type_detaille.code"; |
72 |
|
|
$sql_dossier_instruction_type_by_id = " |
73 |
|
|
SELECT |
74 |
|
|
dossier_instruction_type.dossier_instruction_type, |
75 |
|
|
CONCAT(dossier_autorisation_type_detaille.code,' - ',dossier_instruction_type.code,' - ',dossier_instruction_type.libelle) as lib |
76 |
|
|
FROM ".DB_PREFIXE."dossier_instruction_type |
77 |
|
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
78 |
|
|
ON dossier_instruction_type.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
79 |
|
|
WHERE dossier_instruction_type IN (<idx>) |
80 |
|
|
ORDER BY dossier_autorisation_type_detaille.code"; |
81 |
|
|
|
82 |
|
|
// LIAISON NaN - ETAT (TRANSITION) |
83 |
|
|
$sql_etats_depuis_lequel_l_evenement_est_disponible = " |
84 |
|
|
SELECT |
85 |
|
|
etat.etat, |
86 |
|
|
etat.libelle as lib |
87 |
fmichon |
1540 |
FROM ".DB_PREFIXE."etat |
88 |
|
|
ORDER BY lib"; |
89 |
fmichon |
1549 |
$sql_etats_depuis_lequel_l_evenement_est_disponible_by_id = " |
90 |
|
|
SELECT |
91 |
|
|
etat.etat, |
92 |
|
|
etat.libelle as lib |
93 |
fmichon |
1540 |
FROM ".DB_PREFIXE."etat |
94 |
|
|
WHERE etat.etat IN (<idx>) |
95 |
|
|
ORDER BY lib"; |
96 |
|
|
|
97 |
fmichon |
1549 |
?> |