1 |
<?php |
<?php |
2 |
//$Id$ |
/** |
3 |
|
* |
4 |
|
* |
5 |
|
* @package openfoncier |
6 |
|
* @version SVN : $Id$ |
7 |
|
*/ |
8 |
|
|
9 |
include('../gen/sql/pgsql/consultation.inc.php'); |
// |
10 |
|
include "../gen/sql/pgsql/consultation.inc.php"; |
11 |
|
|
12 |
|
/*Titre de la page*/ |
13 |
|
if (isset($_GET["retour"]) && $_GET["retour"] == "suivi_retours_de_consultation") { |
14 |
|
$ent = _("suivi")." -> "._("suivi des pieces")." -> "._("retours de consultation"); |
15 |
|
$tab_title = _("saisir un retour de consultation"); |
16 |
|
} else { |
17 |
|
$ent = _("consultation"); |
18 |
|
} |
19 |
|
if (isset($idx) && $idx != ']' && trim($idx) != '') { |
20 |
|
$ent .= "-> ".$idx." "; |
21 |
|
} |
22 |
|
if (isset($idz) && trim($idz) != '') { |
23 |
|
$ent .= " ".mb_strtoupper($idz, "UTF-8")." "; |
24 |
|
} |
25 |
|
|
26 |
// |
// |
27 |
$case_type_consultation = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
$case_type_consultation = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
31 |
WHEN service.type_consultation=\'pour_information\' |
WHEN service.type_consultation=\'pour_information\' |
32 |
THEN \''._("pour information").'\' |
THEN \''._("pour information").'\' |
33 |
END'; |
END'; |
34 |
|
$case_consultation_lu = "case consultation.lu when 't' then 'Oui' else 'Non' end"; |
35 |
// SELECT |
// SELECT |
36 |
$champAffiche = array( |
$champAffiche = array( |
37 |
'consultation.consultation as "'._("consultation").'"', |
'consultation.consultation as "'._("consultation").'"', |
45 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
46 |
'instructeur.nom as "'._("instructeur").'"', |
'instructeur.nom as "'._("instructeur").'"', |
47 |
'division.code as "'._("division").'"', |
'division.code as "'._("division").'"', |
48 |
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
$case_consultation_lu." as \""._("lu")."\"", |
49 |
); |
); |
50 |
|
|
51 |
$table .= " |
$table .= " |
56 |
LEFT JOIN ".DB_PREFIXE."division |
LEFT JOIN ".DB_PREFIXE."division |
57 |
ON dossier.division=division.division"; |
ON dossier.division=division.division"; |
58 |
|
|
59 |
|
$tri= " order by consultation.date_envoi asc "; |
60 |
|
|
61 |
/** |
/** |
62 |
* Gestion particulière de l'affichage du listing des consultations dans le |
* Gestion particulière de l'affichage du listing des consultations dans le |
63 |
* contexte d'un dossier d'instruction (pour un service consulté) |
* contexte d'un dossier d'instruction (pour un service consulté) |
80 |
OR $retourformulaire == 'dossier_instruction_tous_encours' |
OR $retourformulaire == 'dossier_instruction_tous_encours' |
81 |
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
82 |
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
83 |
|
// |
84 |
|
$case_consultation_lu = "case when consultation.avis_consultation is null then '' |
85 |
|
else case consultation.lu |
86 |
|
when 't' then 'Oui' |
87 |
|
else 'Non' |
88 |
|
end |
89 |
|
end"; |
90 |
// SELECT |
// SELECT |
91 |
$champAffiche = array( |
$champAffiche = array( |
92 |
'consultation.consultation as "'._("consultation").'"', |
'consultation.consultation as "'._("id").'"', |
93 |
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
94 |
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
95 |
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
97 |
'service.libelle as "'._("service").'"', |
'service.libelle as "'._("service").'"', |
98 |
$case_type_consultation.' as "'._("type_consultation").'"', |
$case_type_consultation.' as "'._("type_consultation").'"', |
99 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
100 |
"case when consultation.avis_consultation is null then '' |
$case_consultation_lu." as \""._("lu")."\"", |
|
else case consultation.lu |
|
|
when 't' then 'Oui' |
|
|
else 'Non' |
|
|
end |
|
|
end as \""._("lu")."\"", |
|
101 |
); |
); |
102 |
// Filtre dur les données du dossier |
// Filtre dur les données du dossier |
103 |
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
104 |
// Ajout d'une action supplémentaire - ajout de consultations multiples |
// Ajout d'une action supplémentaire - ajout de consultations multiples |
105 |
$id=""; |
$tab_actions['corner']['ajouter_multiple'] = |
106 |
$lien = "../app/consultation_multiple.php?obj=$obj&idx=$idx&ret=$retourformulaire"; |
array('lien' => '../scr/sousform.php?obj='.$obj.'&action=40&idx=0', |
107 |
$right = array('list' => array($obj, $obj.'_ajouter'),'operator' => 'OR'); |
'id' => '&tri='.$tricolsf.'&objsf='.$obj.'&premiersf='.$premier.'&retourformulaire='.$retourformulaire.'&idxformulaire='.$idxformulaire.'&trisf='.$tricolsf.'&retour=tab', |
108 |
$tab_actions['corner']['ajouter_multiple'] = array ( |
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
109 |
'lien' => $lien, |
'rights' => array('list' => array($obj, $obj.'_ajouter'), 'operator' => 'OR'), |
110 |
'id' => $id, |
); |
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
|
|
'right' => $right, |
|
|
); |
|
|
// |
|
|
if (isset($f) && $f->isUserInstructeur() |
|
|
&& $f->getDivisionFromDossier($idx) != $_SESSION["division"]) { |
|
|
$tab_actions['corner'] = array(); |
|
|
} |
|
111 |
} |
} |
112 |
|
|
113 |
/** |
/** |
116 |
// On affiche le champ lu en gras |
// On affiche le champ lu en gras |
117 |
$options[] = array( |
$options[] = array( |
118 |
"type" => "condition", |
"type" => "condition", |
119 |
"field" => "case consultation.lu when 't' then 'Oui' else 'Non' end", |
"field" => $case_consultation_lu, |
120 |
"case" => array( |
"case" => array( |
121 |
"0" => array( |
"0" => array( |
122 |
"values" => array("Non", ), |
"values" => array("Non", ), |
147 |
), |
), |
148 |
); |
); |
149 |
|
|
|
?> |
|
150 |
|
/** |
151 |
|
* Gestion particulière de l'affichage du listing dans le contexte d'un dossier |
152 |
|
* d'instruction |
153 |
|
*/ |
154 |
|
include "../sql/pgsql/dossier_instruction_droit_specifique_par_division.inc.php"; |
155 |
|
|
156 |
|
?> |