21 |
$form->setType('dossier_instruction_type','select_multiple'); |
$form->setType('dossier_instruction_type','select_multiple'); |
22 |
} |
} |
23 |
|
|
24 |
|
//Ajout du type select multiple sur dossier_instruction_type |
25 |
if ($maj==2){ //supprimer |
if ($maj==2){ //supprimer |
26 |
|
|
27 |
$form->setType('dossier_instruction_type','select_multiple_static'); |
$form->setType('dossier_instruction_type','select_multiple_static'); |
95 |
$this->init_select($form, $db, $maj, $debug, "dossier_instruction_type", |
$this->init_select($form, $db, $maj, $debug, "dossier_instruction_type", |
96 |
$sql_dossier_instruction_type, $sql_dossier_instruction_type_by_id, false); |
$sql_dossier_instruction_type, $sql_dossier_instruction_type_by_id, false); |
97 |
} |
} |
98 |
|
|
99 |
|
//Nombre de dossier_instruction_type affiché |
100 |
function setTaille(&$form, $maj) { |
function setTaille(&$form, $maj) { |
101 |
|
|
102 |
parent::setTaille($form, $maj); |
parent::setTaille($form, $maj); |
103 |
$form->setTaille("dossier_instruction_type", 5); |
$form->setTaille("dossier_instruction_type", 5); |
104 |
} |
} |
105 |
|
|
106 |
|
//Nombre de dossier_instruction_type maximum |
107 |
function setMax(&$form, $maj) { |
function setMax(&$form, $maj) { |
108 |
|
|
109 |
parent::setMax($form, $maj); |
parent::setMax($form, $maj); |
122 |
if ( is_array($dossier_instruction_type) && count($dossier_instruction_type) > 0 ){ |
if ( is_array($dossier_instruction_type) && count($dossier_instruction_type) > 0 ){ |
123 |
|
|
124 |
$nb_tr = 0; |
$nb_tr = 0; |
125 |
//Va créer autant de transition que d'événements choisis |
/* Va créer autant de lien_dossier_instruction_type_evenement |
126 |
|
* que de dossier_instruction_type choisis */ |
127 |
foreach( $dossier_instruction_type as $value ){ |
foreach( $dossier_instruction_type as $value ){ |
128 |
|
|
129 |
//Test si la valeur par défaut est sélectionnée |
//Test si la valeur par défaut est sélectionnée |
135 |
'dossier_instruction_type' => $value |
'dossier_instruction_type' => $value |
136 |
); |
); |
137 |
|
|
138 |
//Ajoute une nouvelle transition |
//Ajoute un nouveau lien_dossier_instruction_type_evenement |
139 |
$this->addDossierInstructionType($donnees, $db, $DEBUG); |
$this->addLienDossierInstructionType($donnees, $db, $DEBUG); |
140 |
|
|
141 |
$nb_tr++; |
$nb_tr++; |
142 |
} |
} |
197 |
'dossier_instruction_type' => $value |
'dossier_instruction_type' => $value |
198 |
); |
); |
199 |
|
|
200 |
//Ajoute une nouvelle transition |
//Ajoute un nouveau lien_dossier_instruction_type_evenement |
201 |
$this->addDossierInstructionType($donnees, $db, $DEBUG); |
$this->addLienDossierInstructionType($donnees, $db, $DEBUG); |
202 |
|
|
203 |
$nb_tr++; |
$nb_tr++; |
204 |
} |
} |
205 |
} |
} |
206 |
|
|
207 |
//Message de confirmation de création de(s) transition(s). |
//Message de confirmation de création de(s) lien_dossier_instruction_type_evenement. |
208 |
if ( $nb_tr > 0 ){ |
if ( $nb_tr > 0 ){ |
209 |
|
|
210 |
$this->addToMessage("Mise à jour des liaisons realisee avec succes."); |
$this->addToMessage("Mise à jour des liaisons realisee avec succes."); |
214 |
|
|
215 |
//Ajoute un nouveau lien_dossier_instruction_type_evenement |
//Ajoute un nouveau lien_dossier_instruction_type_evenement |
216 |
// $data array de données |
// $data array de données |
217 |
function addDossierInstructionType($data, $db, $DEBUG){ |
function addLienDossierInstructionType($data, $db, $DEBUG){ |
218 |
|
|
219 |
require_once '../obj/lien_dossier_instruction_type_evenement.class.php'; |
require_once '../obj/lien_dossier_instruction_type_evenement.class.php'; |
220 |
|
|
255 |
//Suppression de toutes les lien_dossier_instruction_type_evenement avec evenement |
//Suppression de toutes les lien_dossier_instruction_type_evenement avec evenement |
256 |
function triggersupprimer($id, &$db, $val, $DEBUG){ |
function triggersupprimer($id, &$db, $val, $DEBUG){ |
257 |
|
|
258 |
//Supprime toutes les transitions liées à l'état |
//Supprime toutes les lien_dossier_instruction_type_evenement liées à l'evenement |
259 |
$this->deleteAllLienDossierInstructionTypeEvenementEvenement($id, $db, $DEBUG); |
$this->deleteAllLienDossierInstructionTypeEvenementEvenement($id, $db, $DEBUG); |
260 |
} |
} |
261 |
|
|
262 |
/* Surcharge de la fonction cleSecondaire pour qu'elle ne vérifie pas le lien avec |
/* Surcharge de la fonction cleSecondaire pour qu'elle ne vérifie pas le lien avec |
263 |
* transition qui sera supprimé juste après*/ |
* lien_dossier_instruction_type_evenement qui sera supprimé juste après*/ |
264 |
function cleSecondaire($id, &$db = NULL, $val = array(), $DEBUG = false) { |
function cleSecondaire($id, &$db = NULL, $val = array(), $DEBUG = false) { |
265 |
|
|
266 |
// Verification de la cle secondaire : bible |
// Verification de la cle secondaire : bible |
279 |
$this->rechercheTable($db, "transition", "evenement", $id); |
$this->rechercheTable($db, "transition", "evenement", $id); |
280 |
} |
} |
281 |
|
|
282 |
|
//Affichage des dossier_instruction_type anciennement liés |
283 |
function setVal(&$form, $maj, $validation, &$db) { |
function setVal(&$form, $maj, $validation, &$db) { |
284 |
|
|
285 |
parent::setVal($form, $maj, $validation, $db); |
parent::setVal($form, $maj, $validation, $db); |