Add condition for normal traitment on empty hook result.

Note : The normal case on 'formObjectOptions' is currently nothing more (no extrafields,...).
This commit is contained in:
Alexis Algoud 2013-03-01 11:38:24 +01:00
parent 2d36423310
commit 49f712546f

View File

@ -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 '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';