[openads-Commits] r8583 - branches/4.10.0-develop_interface_erp/obj

0 views
Skip to first unread message

sof...@adullact.net

unread,
Feb 20, 2019, 12:14:48 PM2/20/19
to openmairi...@googlegroups.com
Author: softime
Date: 2019-02-20 18:14:46 +0100 (Wed, 20 Feb 2019)
New Revision: 8583

Modified:
branches/4.10.0-develop_interface_erp/obj/dossier.class.php
Log:
* Correction gestion type de la case ?\195?\160 cocher ERP

Modified: branches/4.10.0-develop_interface_erp/obj/dossier.class.php
===================================================================
--- branches/4.10.0-develop_interface_erp/obj/dossier.class.php 2019-02-20 17:14:12 UTC (rev 8582)
+++ branches/4.10.0-develop_interface_erp/obj/dossier.class.php 2019-02-20 17:14:46 UTC (rev 8583)
@@ -2022,39 +2022,6 @@
$all_fields['geom'] = 'hidden';
}

- //Gestion de l'interfaçage ERP
-
- //Si on est en mode édition du DI
- if ($crud === 'update'){
- //Si l'option option_referentiel erp est activée
- if ($this->f->is_option_referentiel_erp_enabled($this->getVal('om_collectivite')) === true){
- //On paramètre le champ en static par défaut
- $all_fields['erp'] = 'checkboxhiddenstatic' ;
- //Si on est sur un dossier AT
- if (isset ($parameters['erp__dossier__nature__at']) === true){
- if ($this->f->getDATCode($this->getVal($this->clePrimaire)) == $this->f->getParameter('erp__dossier__nature__at')){
-
- $all_fields['erp'] = 'checkbox' ;
- }
- }
- //Si on est sur un dossier PC
- if (isset ($parameters['erp__dossier__nature__pc']) === true){
- // Si on est sur un dossier PC
- if ($this->f->getDATCode($this->getVal($this->clePrimaire)) == $this->f->getParameter('erp__dossier__nature__pc')){
- $erp_di_pc = $parameters['erp__dossier__type_di__pc'];
- $erp_di_pc = explode(";", $erp_di_pc);
- //Si le DI du PC est dans la liste des DI possibles
- if (is_array($erp_di_pc) === true) {
- if (in_array($this->getVal("dossier_instruction_type"),$erp_di_pc) === true){
- //On active la checkbox
- $all_fields['erp'] = 'checkbox' ;
- }
- }
- }
- }
- }
- }
-
//
// Gestion du contexte
//
@@ -2210,6 +2177,30 @@
//
$all_fields['date_depot'] = 'date';
}
+ // Gestion de la case à cocher ERP en cas d'interfaçage avec le
+ // référentiel ERP
+ if ($this->f->is_option_referentiel_erp_enabled($this->getVal('om_collectivite')) === true) {
+ // Par défaut la case à cocher ERP est non modifiable
+ $all_fields['erp'] = 'checkboxhiddenstatic';
+ // Si le type du dossier d'instruction en cours est présent
+ // dans les paramètres autorisant l'interfaçage avec le référentiel ERP
+ if (isset($parameters['erp__dossier__nature__at']) === true
+ && $this->f->getDATCode($this->getVal($this->clePrimaire)) == $parameters['erp__dossier__nature__at']) {
+ //
+ $all_fields['erp'] = 'checkbox';
+ }
+ if (isset($parameters['erp__dossier__nature__pc']) === true
+ && $this->f->getDATCode($this->getVal($this->clePrimaire)) == $parameters['erp__dossier__nature__pc']
+ && isset($parameters['erp__dossier__type_di__pc']) === true) {
+ //
+ $erp_di_pc = explode(";", $parameters['erp__dossier__type_di__pc']);
+ if (is_array($erp_di_pc) === true
+ && in_array($this->getVal("dossier_instruction_type"), $erp_di_pc) === true) {
+ //
+ $all_fields['erp'] = 'checkbox';
+ }
+ }
+ }
}
}
// MODIFIER, SUPPRIMER, CONSULTER

Reply all
Reply to author
Forward
0 new messages