10 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
11 |
}// fin constructeur |
}// fin constructeur |
12 |
|
|
13 |
|
// {{{ Gestion de la confidentialité des données spécifiques |
14 |
|
|
15 |
|
/** |
16 |
|
* Surcharge pour gérer les actions disponibles dans le portlet |
17 |
|
*/ |
18 |
|
function checkAccessibility() { |
19 |
|
// |
20 |
|
parent::checkAccessibility(); |
21 |
|
// Si l'utilisateur est un intructeur qui en correspond pas à la |
22 |
|
// division du dossier |
23 |
|
if ($this->f->isUserInstructeur() |
24 |
|
&& isset($this->f->om_utilisateur["division"]) |
25 |
|
&& $this->f->om_utilisateur["division"] != $this->getDivisionFromDossier()) { |
26 |
|
// |
27 |
|
$this->actions_sup = array(); |
28 |
|
$this->setParameter("actions", array()); |
29 |
|
} |
30 |
|
// Si une action 'lu' est présente et que le champ lu est à true |
31 |
|
// on supprime l'action |
32 |
|
if (isset($this->actions_sup["lu"]) |
33 |
|
&& isset($this->val[array_search("lu", $this->champs)]) |
34 |
|
&& $this->val[array_search("lu", $this->champs)]== "t") { |
35 |
|
unset($this->actions_sup["lu"]); |
36 |
|
} |
37 |
|
} |
38 |
|
|
39 |
|
/** |
40 |
|
* Cette méthode permet de récupérer la division d'un dossier |
41 |
|
*/ |
42 |
|
function getDivisionFromDossier() { |
43 |
|
// Si on se trouve en mode MODIFIER ou SUPPRIMER ou CONSULTER alors on |
44 |
|
// récupère le numéro de dossier dans la consultation et on en retourne |
45 |
|
// sa division |
46 |
|
if ($this->getParameter("maj") == 1 || $this->getParameter("maj") == 2 |
47 |
|
|| $this->getParameter("maj") == 3) { |
48 |
|
// |
49 |
|
if (!isset($this->val[array_search("dossier", $this->champs)])) { |
50 |
|
return NULL; |
51 |
|
} |
52 |
|
// |
53 |
|
$sql = "select division from ".DB_PREFIXE."dossier "; |
54 |
|
$sql .= " where dossier='".$this->val[array_search("dossier", $this->champs)]."'"; |
55 |
|
// |
56 |
|
$division = $this->db->getOne($sql); |
57 |
|
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
58 |
|
database::isError($division); |
59 |
|
// |
60 |
|
return $division; |
61 |
|
} elseif ($this->getParameter("maj") == 0 |
62 |
|
&& ($this->getParameter("retourformulaire") == "dossier" |
63 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction" |
64 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_encours" |
65 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_encours" |
66 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_mes_clotures" |
67 |
|
|| $this->getParameter("retourformulaire") == "dossier_instruction_tous_clotures")) { |
68 |
|
// Si on se trouve en mode AJOUTER et en sous formulaire alors on |
69 |
|
// récupère le numéro de dossier dans les paramètres de sous |
70 |
|
// formulaires et on en retourne sa division |
71 |
|
$sql = "select division from ".DB_PREFIXE."dossier "; |
72 |
|
$sql .= " where dossier='".$this->getParameter("idxformulaire")."'"; |
73 |
|
// |
74 |
|
$division = $this->db->getOne($sql); |
75 |
|
$this->addToLog("getDivisionFromDossier(): db->getone(\"".$sql."\")", VERBOSE_MODE); |
76 |
|
database::isError($division); |
77 |
|
// |
78 |
|
return $division; |
79 |
|
} else { |
80 |
|
return NULL; |
81 |
|
} |
82 |
|
|
83 |
|
} |
84 |
|
|
85 |
|
// }}} |
86 |
|
|
87 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
88 |
parent::setType($form, $maj); |
parent::setType($form, $maj); |
89 |
|
|