From 6c7a5cebdfc37ce02c3acf0088a62793fd16c087 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 13 Mar 2018 09:34:50 +0100 Subject: [PATCH 1/6] FIX check verif exped on delete order --- htdocs/commande/class/commande.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index de3a47d36d4..b450a6ad16b 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3126,6 +3126,7 @@ class Commande extends CommonOrder if ($result < 0) $error++; // End call triggers } + if($this->nb_expedition()!=0)$error++; //TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail if (! $error) From 51229a602f136f5aa9c654af6edcf43edf8588e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Mar 2018 09:51:45 +0100 Subject: [PATCH 2/6] Update commande.class.php --- htdocs/commande/class/commande.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b450a6ad16b..6c156997995 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3126,7 +3126,8 @@ class Commande extends CommonOrder if ($result < 0) $error++; // End call triggers } - if($this->nb_expedition()!=0)$error++; + + if ($this->nb_expedition() != 0) $error++; //TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail if (! $error) From dcd3387a30cd57c59ab2f94d38dd2574452c647d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Mar 2018 09:53:21 +0100 Subject: [PATCH 3/6] Update commande.class.php --- htdocs/commande/class/commande.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6c156997995..429566e054d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3127,8 +3127,12 @@ class Commande extends CommonOrder // End call triggers } - if ($this->nb_expedition() != 0) $error++; - + if ($this->nb_expedition() != 0) + { + $this->errors[] = $langs->trans('SomeShipmentExists'); + $error++; + } + //TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail if (! $error) { From 4f6f0b302ef10d90ab9bdac16e6f57d73d7168d1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 13 Mar 2018 10:28:44 +0100 Subject: [PATCH 4/6] FIX for nondisplay of fk_element 's id in REST API response the fk_element don't display when the call is made with REST API (reason non found) --- htdocs/comm/action/class/actioncomm.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9e0a0d6321d..f5209421694 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -164,6 +164,7 @@ class ActionComm extends CommonObject // Properties for links to other objects var $fk_element; // Id of record + var $elementid; // Id of record alternative for API var $elementtype; // Type of record. This if property ->element of object linked to. // Ical @@ -547,7 +548,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_author, a.fk_user_mod,"; $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; - $sql.= " a.fk_element, a.elementtype,"; + $sql.= " a.fk_element as elementid, a.elementtype,"; $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; $sql.= " s.nom as socname,"; @@ -621,7 +622,8 @@ class ActionComm extends CommonObject $this->societe->id = $obj->fk_soc; // deprecated $this->contact->id = $obj->fk_contact; // deprecated - $this->fk_element = $obj->fk_element; + $this->fk_element = $obj->elementid; + $this->elementid = $obj->elementid; $this->elementtype = $obj->elementtype; $this->fetchResources(); From 17b7c6268e81a0a13e1bc74e99e6efa9b489b3a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Mar 2018 15:29:52 +0100 Subject: [PATCH 5/6] FIX avoid "Array" on screen --- htdocs/projet/element.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 2b753a50468..8b791b7a9c7 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1137,9 +1137,12 @@ foreach ($listofreferent as $key => $value) print ' '; print ''; } - else // error + else { - print $elementarray; + if (! is_array($elementarray)) // error + { + print $elementarray; + } } print ""; print "
\n"; From af09a3714b3ea937730cb171b008635429d94bc8 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 13 Mar 2018 17:12:03 +0100 Subject: [PATCH 6/6] FIX reverse field to have object loaded in doaction --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 42abde0e09b..204eff383d5 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -73,7 +73,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartycard','globalcard')); -if ($action == 'view' && $object->fetch($socid)<=0) +if ($object->fetch($socid)<=0 && $action == 'view') { $langs->load("errors"); print($langs->trans('ErrorRecordNotFound'));