From 49f712546fdd73346002307372f7a86ad1d57541 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 1 Mar 2013 11:38:24 +0100 Subject: [PATCH] Add condition for normal traitment on empty hook result. Note : The normal case on 'formObjectOptions' is currently nothing more (no extrafields,...). --- htdocs/societe/commerciaux.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 43d01d4c662..5f0f7af2410 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -60,7 +60,7 @@ if($_GET["socid"] && $_GET["commid"]) $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); - $soc->add_commercial($user, $_GET["commid"]); + if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]); header("Location: commerciaux.php?socid=".$soc->id); exit; @@ -87,7 +87,7 @@ if($_GET["socid"] && $_GET["delcommid"]) $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); - $soc->del_commercial($user, $_GET["delcommid"]); + if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]); header("Location: commerciaux.php?socid=".$soc->id); exit; @@ -181,7 +181,10 @@ if ($_GET["socid"]) $parameters=array('socid'=>$soc->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook - + if (empty($reshook)) { + + null; // actions in normal case + } print ''; print img_object($langs->trans("ShowUser"),"user").' ';