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 |
|
49 |
// la demande de commission est mis à lu par défaut |
50 |
function triggerajouter($id,&$db,$val,$DEBUG) { |
51 |
|
52 |
$this->valF['lu'] = TRUE; |
53 |
} |
54 |
|
55 |
// Si la commission rend son avis, la demande de commission est non lu pour que |
56 |
// l'instructeur soit notifié |
57 |
function triggermodifier($id,&$db,$val,$DEBUG) { |
58 |
|
59 |
if ( $val['avis'] != "" ){ |
60 |
|
61 |
$this->valF['lu'] = FALSE; |
62 |
} |
63 |
} |
64 |
|
65 |
// Met la date au bon format |
66 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
67 |
// |
68 |
$this->retourformulaire = $retourformulaire; |
69 |
// En mode AJOUTER |
70 |
if ($maj == 0) { |
71 |
// On positionne la date du jour par défaut |
72 |
$form->setVal('date_souhaitee', date("d/m/Y")); |
73 |
// Afficher le numéro de dossier d'instruction |
74 |
if($retourformulaire =='dossier' |
75 |
|| $retourformulaire =='dossier_instruction' |
76 |
|| $retourformulaire =='dossier_instruction_mes_encours' |
77 |
|| $retourformulaire =='dossier_instruction_tous_encours' |
78 |
|| $retourformulaire =='dossier_instruction_mes_clotures' |
79 |
|| $retourformulaire =='dossier_instruction_tous_clotures'){ |
80 |
$form->setVal('dossier', $idxformulaire); |
81 |
} |
82 |
} |
83 |
} |
84 |
|
85 |
//Surcharge du bouton retour de la gestion des commissions afin de retourner directement vers le tableau |
86 |
function retoursousformulaire($idxformulaire, $retourformulaire, $val, |
87 |
$objsf, $premiersf, $tricolsf, $validation, |
88 |
$idx, $maj, $retour) { |
89 |
|
90 |
if( $maj = 1 && $retourformulaire === "commission") { |
91 |
|
92 |
echo "\n<a class=\"retour\" "; |
93 |
echo "href=\"#\" "; |
94 |
|
95 |
echo "onclick=\"ajaxIt('".$objsf."', '"; |
96 |
echo "../scr/soustab.php?obj=dossier_commission&idxformulaire=" |
97 |
.$val['commission']. |
98 |
"&retourformulaire=commission');\""; |
99 |
echo "\" "; |
100 |
echo ">"; |
101 |
// |
102 |
echo _("Retour"); |
103 |
// |
104 |
echo "</a>\n"; |
105 |
|
106 |
} else { |
107 |
parent::retoursousformulaire($idxformulaire, $retourformulaire, $val, |
108 |
$objsf, $premiersf, $tricolsf, $validation, |
109 |
$idx, $maj, $retour); |
110 |
} |
111 |
} |
112 |
}// fin classe |
113 |
?> |