Skip to content
Snippets Groups Projects
Commit 2d3915b8 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix hook implementation on some thirdparty pages

parent 932c3f91
Branches
Tags 3.7.3
No related merge requests found
......@@ -49,6 +49,21 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="f.datef";
$object = new Societe($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('thirdpartymargins','globalcard'));
/*
* Actions
*/
$parameters=array('id'=>$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');
/*
* View
......
......@@ -56,11 +56,23 @@ if (! $sortfield) $sortfield="c.lastname";
$now=dol_now();
$object = new Societe($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('thirdpartynotification','globalcard'));
/*
* Actions
*/
$parameters=array('id'=>$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))
{
// Add a notification
if ($action == 'add')
{
......@@ -116,6 +128,7 @@ if ($action == 'delete')
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"];
$db->query($sql);
}
}
......@@ -150,7 +163,7 @@ if ($result > 0)
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print '<tr><td>'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
......
......@@ -49,11 +49,23 @@ if ($user->societe_id)
$socid = $user->societe_id;
$result = restrictedArea($user, 'societe', $socid, '&societe');
$object = new Societe($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('thirdpartycustomerprice','globalcard'));
/*
* Actions
*/
$parameters=array('id'=>$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 ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->rights->produit->creer || $user->rights->service->creer)) {
$update_child_soc = GETPOST('updatechildprice');
......@@ -113,6 +125,7 @@ if ($action == 'update_customer_price_confirm' && ! $_POST ["cancel"] && ($user-
$action = '';
}
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment