From 6c7a5cebdfc37ce02c3acf0088a62793fd16c087 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 13 Mar 2018 09:34:50 +0100 Subject: [PATCH 1/4] 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/4] 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/4] 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 af09a3714b3ea937730cb171b008635429d94bc8 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 13 Mar 2018 17:12:03 +0100 Subject: [PATCH 4/4] 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'));