1 |
<?php |
<?php |
2 |
//$Id$ |
//$Id$ |
|
//gen openMairie le 10/02/2011 20:32 |
|
|
include('../gen/sql/pgsql/consultation.inc.php'); |
|
|
$table=DB_PREFIXE."consultation inner join ".DB_PREFIXE."service on consultation.service=service.service"; |
|
|
$champAffiche=array("consultation", |
|
|
"consultation.service", |
|
|
"libelle", |
|
|
"to_char(date_envoi,'DD/MM/YYYY') as date_envoi", |
|
|
"to_char(date_retour,'DD/MM/YYYY') as date_retour", |
|
|
"to_char(date_limite,'DD/MM/YYYY') as date_limite", |
|
|
"avis"); |
|
|
$champRecherche=array("libelle"); |
|
|
if(isset($idx)) |
|
|
$selection=" where dossier ='".$idx."'"; |
|
|
else |
|
|
$selection=""; |
|
|
// ============================================================================= |
|
|
// href particulier pour edition d etat |
|
|
// ============================================================================= |
|
3 |
|
|
4 |
$href[3]['lien'] = "../pdf/pdfetat.php?idx="; |
include('../gen/sql/pgsql/consultation.inc.php'); |
|
$href[3]['id']= "&obj=consultation"; |
|
|
$href[3]['lib']= "<span class=\"om-icon om-icon-16 om-icon-fix pdf-16\" title=\"". |
|
|
_("Edition")."\">"._("Edition")."</span>"; |
|
5 |
|
|
6 |
// probleme lies a la gestion par nature |
// SELECT |
7 |
|
$champAffiche = array( |
8 |
|
'consultation.consultation as "'._("consultation").'"', |
9 |
|
'consultation.dossier as "'._("dossier").'"', |
10 |
|
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
11 |
|
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
12 |
|
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
13 |
|
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
14 |
|
'service.libelle as "'._("service").'"', |
15 |
|
'avis_consultation.libelle as "'._("avis_consultation").'"', |
16 |
|
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
17 |
|
); |
18 |
|
|
19 |
if ($retourformulaire== 'service'){ |
/** |
20 |
$href[0] = array("lien" => "#", "id" => "", "lib" => "", ); |
* Gestion particulière de l'affichage du listing des consultations dans le |
21 |
$href[1] = array("lien" => "", "id" => "", "lib" => "", ); |
* contexte d'un dossier d'instruction (pour un service consulté) |
22 |
$href[2] = array("lien" => "#", "id" => "", "lib" => "", ); |
*/ |
23 |
|
if ($retourformulaire == 'service') { |
24 |
|
// Actions en coin : ajouter |
25 |
|
$tab_actions['corner']['ajouter'] = NULL; |
26 |
|
// Actions a gauche : consulter |
27 |
|
$tab_actions['left']['consulter'] = NULL; |
28 |
$selection=" where consultation.service ='".$idx."'"; |
$selection=" where consultation.service ='".$idx."'"; |
29 |
} |
} |
30 |
|
|
31 |
|
/** |
32 |
|
* Gestion particulière de l'affichage du listing des consultations dans le |
33 |
|
* contexte d'un dossier d'instruction (pour l'instructeur) |
34 |
|
*/ |
35 |
|
if ($retourformulaire == 'dossier' |
36 |
|
OR $retourformulaire == 'dossier_instruction' |
37 |
|
OR $retourformulaire == 'dossier_instruction_mes_encours' |
38 |
|
OR $retourformulaire == 'dossier_instruction_tous_encours' |
39 |
|
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
40 |
|
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
41 |
|
// SELECT |
42 |
|
$champAffiche = array( |
43 |
|
'consultation.consultation as "'._("consultation").'"', |
44 |
|
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
45 |
|
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
46 |
|
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
47 |
|
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
48 |
|
'service.libelle as "'._("service").'"', |
49 |
|
'avis_consultation.libelle as "'._("avis_consultation").'"', |
50 |
|
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
51 |
|
); |
52 |
|
// Filtre dur les données du dossier |
53 |
|
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
54 |
|
// Ajout d'une action supplémentaire - ajout de consultations multiples |
55 |
|
$id=""; |
56 |
|
$lien = "../app/consultation_multiple.php?obj=$obj&idx=$idx&ret=$retourformulaire"; |
57 |
|
$right = array('list' => array($obj, $obj.'_ajouter'),'operator' => 'OR'); |
58 |
|
$tab_actions['corner']['ajouter_multiple'] = array ( |
59 |
|
'lien' => $lien, |
60 |
|
'id' => $id, |
61 |
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
62 |
|
'right' => $right, |
63 |
|
); |
64 |
|
} |
65 |
|
|
66 |
|
/** |
67 |
|
* Options |
68 |
|
*/ |
69 |
|
// On affiche le champ lu en gras |
70 |
|
$options[] = array( |
71 |
|
"type" => "condition", |
72 |
|
"field" => "case consultation.lu when 't' then 'Oui' else 'Non' end", |
73 |
|
"case" => array( |
74 |
|
"0" => array( |
75 |
|
"values" => array("Non", ), |
76 |
|
"style" => "non_lu", |
77 |
|
), |
78 |
|
), |
79 |
|
); |
80 |
|
|
81 |
?> |
?> |