30 |
function dossier($id,&$db,$DEBUG) { |
function dossier($id,&$db,$DEBUG) { |
31 |
$this->constructeur($id,$db,$DEBUG); |
$this->constructeur($id,$db,$DEBUG); |
32 |
} // fin constructeur |
} // fin constructeur |
33 |
|
|
34 |
/*Mutateur pour ma variable dossier_instruction_type*/ |
/*Mutateur pour ma variable dossier_instruction_type*/ |
35 |
public function getDossierInstructionType(){ |
public function getDossierInstructionType(){ |
36 |
return $this->dossier_instruction_type; |
return $this->dossier_instruction_type; |
56 |
$this->actions_sup = array(); |
$this->actions_sup = array(); |
57 |
$this->setParameter("actions", array()); |
$this->setParameter("actions", array()); |
58 |
} |
} |
59 |
|
|
60 |
|
/* |
61 |
|
* Si une action 'rapport_instruction' est présente et |
62 |
|
* que le le rapport d'instruction existe déjà, lien vers l'objet en modification |
63 |
|
* sinon, lien vers un script qui va créer le nouvel objet et |
64 |
|
* rediriger l'utilisateur vers l'objet en modification. |
65 |
|
*/ |
66 |
|
|
67 |
|
// Vérifie si un rapport d'instruction existe déjà |
68 |
|
if ( isset($this->actions_sup["rapport_instruction"]) ) { |
69 |
|
|
70 |
|
// Requête de vérification |
71 |
|
$sql = "SELECT |
72 |
|
rapport_instruction |
73 |
|
FROM |
74 |
|
".DB_PREFIXE."rapport_instruction |
75 |
|
WHERE |
76 |
|
dossier_instruction = '".$this->getParameter('idx')."'"; |
77 |
|
|
78 |
|
// Ajout au log |
79 |
|
$this->f->addToLog("checkAccessibility(): db->query(\"".$sql."\");", VERBOSE_MODE); |
80 |
|
|
81 |
|
// Exécution de la requête |
82 |
|
$res=$this->f->db->query($sql); |
83 |
|
$this->f->isDatabaseError($res); |
84 |
|
|
85 |
|
/* |
86 |
|
* S'il n'y a pas de rapport d'instruction, redirection vers un script |
87 |
|
* de création, puis vers l'objet. |
88 |
|
* */ |
89 |
|
if ( $res->numrows() == 0 ){ |
90 |
|
|
91 |
|
$this->actions_sup["rapport_instruction"]["lien"] = |
92 |
|
'../app/rapport_instruction.php?idx='; |
93 |
|
} |
94 |
|
// S'il a déjà été créé, lien vers l'objet en modification |
95 |
|
elseif ( $res->numrows() > 0 ){ |
96 |
|
|
97 |
|
$row = & $res->fetchRow(DB_FETCHMODE_ASSOC); |
98 |
|
$this->actions_sup["rapport_instruction"]["lien"] = |
99 |
|
'../scr/form.php?obj=rapport_instruction&action=1&idx='. |
100 |
|
$row['rapport_instruction'].'&idD='; |
101 |
|
} |
102 |
|
|
103 |
|
} |
104 |
} |
} |
105 |
|
|
106 |
/** |
/** |