Fix missing hook then can't interact with actions
This commit is contained in:
parent
a3b746bcb9
commit
c961a397c4
@ -61,42 +61,52 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('levycard','globalcard'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == "new")
|
$parameters = array('socid' => $socid);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
if ($object->id > 0)
|
if ($action == "new")
|
||||||
{
|
{
|
||||||
$db->begin();
|
if ($object->id > 0)
|
||||||
|
|
||||||
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
|
|
||||||
if ($result > 0)
|
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->begin();
|
||||||
|
|
||||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
|
||||||
}
|
if ($result > 0)
|
||||||
else
|
{
|
||||||
{
|
$db->commit();
|
||||||
$db->rollback();
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
$action='';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == "delete")
|
if ($action == "delete")
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
{
|
||||||
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
|
if ($object->id > 0)
|
||||||
if ($result == 0)
|
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
|
||||||
exit;
|
if ($result == 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user