4 |
require_once ("../gen/obj/consultation.class.php"); |
require_once ("../gen/obj/consultation.class.php"); |
5 |
|
|
6 |
class consultation extends consultation_gen { |
class consultation extends consultation_gen { |
7 |
|
var $maj; |
8 |
function consultation($id,&$db,$debug) { |
function consultation($id,&$db,$debug) { |
9 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
10 |
}// fin constructeur |
}// fin constructeur |
11 |
|
|
|
function setValFAjout($val){ |
|
|
$this->valF['service'] = $val['service']; |
|
|
} |
|
|
function setvalF($val){ |
|
|
parent::setvalF($val); |
|
|
// cles secondaires numerique (contrainte integrite pgsql) |
|
|
if($val['avis_consultation']=='') $this->valF['avis_consultation']= null; |
|
|
} |
|
12 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
13 |
if ($validation==0) { |
if ($validation==0) { |
14 |
if ($maj == 0){ |
if ($maj == 0){ |
15 |
$form->setVal("dossier", $idxformulaire); |
$form->setVal("dossier", $idxformulaire); |
16 |
|
$form->setVal("date_envoi",date('d/m/Y')); |
17 |
} |
} |
18 |
|
else |
19 |
|
if ( $maj == 1 ) |
20 |
|
$form->setVal("date_retour",date('d/m/Y')); |
21 |
} |
} |
22 |
} |
} |
23 |
|
|
29 |
$form->setType('service', 'select'); |
$form->setType('service', 'select'); |
30 |
$form->setType('date_limite', 'hidden'); |
$form->setType('date_limite', 'hidden'); |
31 |
$form->setType('date_retour', 'hidden'); |
$form->setType('date_retour', 'hidden'); |
32 |
$form->setType('avis_decision', 'hidden'); |
$form->setType('avis_consultation', 'hidden'); |
33 |
|
$form->setType('motivation', 'hidden'); |
34 |
|
$form->setType('fichier', 'hidden'); |
35 |
|
$form->setType('lu', 'hidden'); |
36 |
|
$form->setType('date_reception', 'hidden'); |
37 |
}else{ // modify |
}else{ // modify |
38 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
$form->setType('date_envoi', 'hiddenstaticdate'); |
39 |
$form->setType('service', 'selectdisabled'); |
$form->setType('date_limite', 'hiddenstaticdate'); |
40 |
$form->setType('date_limite', 'date2'); |
$form->setType('service', 'selecthiddenstatic'); |
41 |
$form->setType('date_retour', 'date2'); |
$form->setType('date_retour', 'date2'); |
42 |
$form->setType('avis_decision', 'select'); |
$form->setType('avis_consultation', 'select'); |
43 |
|
$form->setType('motivation', 'textarea'); |
44 |
|
$form->setType('fichier', 'upload'); |
45 |
} |
} |
|
$form->setType('consultation', 'hiddenstatic'); |
|
46 |
$form->setType('dossier', 'hiddenstatic'); |
$form->setType('dossier', 'hiddenstatic'); |
47 |
} |
} |
48 |
|
$form->setType('consultation', 'hidden'); |
49 |
|
|
50 |
|
$form->setType('consultation', 'hidden'); |
51 |
} |
} |
52 |
|
|
53 |
// TRIGGER AVANT MODIFICATION DE DONNEES |
// TRIGGER AVANT MODIFICATION DE DONNEES |
58 |
$sql= "select delai from ".DB_PREFIXE."service where service ='".$this->valF['service']."'"; |
$sql= "select delai from ".DB_PREFIXE."service where service ='".$this->valF['service']."'"; |
59 |
$delai = $db->getOne($sql); |
$delai = $db->getOne($sql); |
60 |
$this->valF['date_limite'] = $this->moisdate($this->valF['date_envoi'],$delai); |
$this->valF['date_limite'] = $this->moisdate($this->valF['date_envoi'],$delai); |
61 |
$this->msg=$this->msg."<br>"._("delai")." ". |
$this->msg=$this->msg._("delai")." ". |
62 |
_("retour")." ".$delai." "._("mois")." -> ". |
_("retour")." ".$delai." "._("mois")." -> ". |
63 |
_("retour")." ".$this->valF['date_limite']."<br>"; |
_("retour")." ".$this->valF['date_limite']."<br>"; |
64 |
|
$this->valF['lu'] = true; |
65 |
} |
} |
66 |
} |
} |
67 |
|
|
103 |
$jour = $jourmax; |
$jour = $jourmax; |
104 |
return $annee."-".$mois."-".$jour ; |
return $annee."-".$mois."-".$jour ; |
105 |
} |
} |
106 |
|
|
107 |
|
// ============================================= |
108 |
|
// Ajout du fielset |
109 |
|
// Add fieldset |
110 |
|
// ============================================= |
111 |
|
function setLayout(&$form, $maj){ |
112 |
|
if ( $maj < 2 OR $maj == 3 ) { |
113 |
|
//Champs sur lequel s'ouvre le fieldset |
114 |
|
$form->setBloc('dossier','D',""); |
115 |
|
$form->setFieldset('dossier','D',_('Consultation')); |
116 |
|
|
117 |
//Date du jour par défaut dans le champ "date d'envoi" |
//Champs sur lequel se ferme le fieldset |
118 |
function setVal(&$form, $maj, $validation, &$db, $DEBUG=null){ |
$form->setFieldset('date_envoi','F',''); |
119 |
parent::setVal($form, $maj, $validation, $db, $DEBUG=null); |
$form->setBloc('date_envoi','F'); |
120 |
if ($validation==0) { |
if ( $maj == 1 OR $maj == 3 ){ |
121 |
if ($maj == 0){ |
//Champs sur lequel s'ouvre le fieldset |
122 |
$form->setVal("date_envoi", date('Y-m-d')); |
$form->setBloc('date_reception','D',""); |
123 |
|
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
124 |
|
|
125 |
|
//Champs sur lequel se ferme le fieldset |
126 |
|
$form->setFieldset('lu','F',''); |
127 |
|
$form->setBloc('lu','F'); |
128 |
} |
} |
129 |
} |
} |
130 |
|
|
131 |
} |
} |
132 |
|
|
133 |
}// fin classe |
}// fin classe |
|
?> |
|
134 |
|
?> |