1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 07/12/2012 17:34 |
4 |
|
5 |
require_once ("../gen/obj/dossier_commission.class.php"); |
6 |
|
7 |
class dossier_commission extends dossier_commission_gen { |
8 |
|
9 |
function dossier_commission($id,&$db,$debug) { |
10 |
$this->constructeur($id,$db,$debug); |
11 |
}// fin constructeur |
12 |
|
13 |
function setType(&$form,$maj) { |
14 |
parent::setType($form, $maj); |
15 |
|
16 |
//En ajout ou modification pour l'instructeur |
17 |
if ( $maj < 2 && |
18 |
( |
19 |
$this->retourformulaire=='dossier' |
20 |
|| $this->retourformulaire=='dossier_instruction' |
21 |
|| $this->retourformulaire=='dossier_instruction_mes_encours' |
22 |
|| $this->retourformulaire=='dossier_instruction_tous_encours' |
23 |
|| $this->retourformulaire=='dossier_instruction_mes_clotures' |
24 |
|| $this->retourformulaire=='dossier_instruction_tous_clotures' |
25 |
) ){ |
26 |
|
27 |
$form->setType('dossier','hiddenstatic'); |
28 |
$form->setType('commission','hidden'); |
29 |
$form->setType('avis','hidden'); |
30 |
} |
31 |
|
32 |
// En consultation et modification pour la cellule suivi |
33 |
if ( $maj == 1 && $this->retourformulaire == 'commission'){ |
34 |
|
35 |
$form->setType('dossier','hiddenstatic'); |
36 |
$form->setType('commission_type','hiddenstatic'); |
37 |
$form->setType('date_souhaitee','hiddenstaticdate'); |
38 |
$form->setType('motivation','hiddenstatic'); |
39 |
$form->setType('commission','hiddenstatic'); |
40 |
$form->setType('lu','hidden'); |
41 |
} |
42 |
|
43 |
if ( $maj == 3 && $this->retourformulaire == 'commission'){ |
44 |
|
45 |
$form->setType('lu','hidden'); |
46 |
} |
47 |
// |
48 |
if ($this->getParameter("retourformulaire") == "dossier" |
49 |
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
50 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
51 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
52 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
53 |
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures") { |
54 |
// |
55 |
$form->setType('dossier', 'hidden'); |
56 |
} |
57 |
} |
58 |
|
59 |
|
60 |
function setLib(&$form, $maj) { |
61 |
// |
62 |
parent::setLib($form, $maj); |
63 |
// |
64 |
$form->setLib($this->clePrimaire, _("id")); |
65 |
} |
66 |
|
67 |
// la demande de commission est mis à lu par défaut |
68 |
function triggerajouter($id,&$db,$val,$DEBUG) { |
69 |
|
70 |
$this->valF['lu'] = TRUE; |
71 |
} |
72 |
|
73 |
// Si la commission rend son avis, la demande de commission est non lu pour que |
74 |
// l'instructeur soit notifié |
75 |
function triggermodifier($id,&$db,$val,$DEBUG) { |
76 |
|
77 |
if ( $val['avis'] != "" ){ |
78 |
|
79 |
$this->valF['lu'] = FALSE; |
80 |
} |
81 |
} |
82 |
|
83 |
// Met la date au bon format |
84 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
85 |
// |
86 |
$this->retourformulaire = $retourformulaire; |
87 |
// En mode AJOUTER |
88 |
if ($maj == 0) { |
89 |
// On positionne la date du jour par défaut |
90 |
$form->setVal('date_souhaitee', date("d/m/Y")); |
91 |
// Afficher le numéro de dossier d'instruction |
92 |
if($retourformulaire =='dossier' |
93 |
|| $retourformulaire =='dossier_instruction' |
94 |
|| $retourformulaire =='dossier_instruction_mes_encours' |
95 |
|| $retourformulaire =='dossier_instruction_tous_encours' |
96 |
|| $retourformulaire =='dossier_instruction_mes_clotures' |
97 |
|| $retourformulaire =='dossier_instruction_tous_clotures'){ |
98 |
$form->setVal('dossier', $idxformulaire); |
99 |
} |
100 |
} |
101 |
} |
102 |
|
103 |
//Surcharge du bouton retour de la gestion des commissions afin de retourner directement vers le tableau |
104 |
function retoursousformulaire($idxformulaire, $retourformulaire, $val, |
105 |
$objsf, $premiersf, $tricolsf, $validation, |
106 |
$idx, $maj, $retour) { |
107 |
|
108 |
if( $maj = 1 && $retourformulaire === "commission") { |
109 |
|
110 |
echo "\n<a class=\"retour\" "; |
111 |
echo "href=\"#\" "; |
112 |
|
113 |
echo "onclick=\"ajaxIt('".$objsf."', '"; |
114 |
echo "../scr/soustab.php?obj=dossier_commission&idxformulaire=" |
115 |
.$val['commission']. |
116 |
"&retourformulaire=commission');\""; |
117 |
echo "\" "; |
118 |
echo ">"; |
119 |
// |
120 |
echo _("Retour"); |
121 |
// |
122 |
echo "</a>\n"; |
123 |
|
124 |
} else { |
125 |
parent::retoursousformulaire($idxformulaire, $retourformulaire, $val, |
126 |
$objsf, $premiersf, $tricolsf, $validation, |
127 |
$idx, $maj, $retour); |
128 |
} |
129 |
} |
130 |
}// fin classe |
131 |
?> |