Merge pull request #12924 from aspangaro/12.0_a9

NEW: Add hook on margin list page
This commit is contained in:
Laurent Destailleur 2020-01-26 22:34:12 +01:00 committed by GitHub
commit 009264a46b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View File

@ -74,6 +74,9 @@ if ($user->rights->margins->read->all) {
} }
$result = restrictedArea($user, 'margins'); $result = restrictedArea($user, 'margins');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new User($db);
$hookmanager->initHooks(array('marginagentlist'));
/* /*
* Actions * Actions
@ -205,8 +208,11 @@ if ($result)
else // value is 'costprice' or 'pmp' else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice'; $labelcostprice = 'CostPrice';
$moreforfilter = '';
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if ($agentid > 0) if ($agentid > 0)
@ -300,6 +306,7 @@ if ($result)
} }
} }
print "</table>"; print "</table>";
print '</div>';
} }
else else
{ {

View File

@ -62,6 +62,9 @@ if (!empty($_POST['startdatemonth']))
if (!empty($_POST['enddatemonth'])) if (!empty($_POST['enddatemonth']))
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Societe($db);
$hookmanager->initHooks(array('margincustomerlist'));
/* /*
* View * View
@ -255,8 +258,11 @@ if ($result)
else // value is 'costprice' or 'pmp' else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice'; $labelcostprice = 'CostPrice';
$moreforfilter = '';
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if (!empty($client)) { if (!empty($client)) {
@ -360,6 +366,7 @@ if ($result)
print "</tr>\n"; print "</tr>\n";
print "</table>"; print "</table>";
print '</div>';
} }
else else
{ {

View File

@ -76,6 +76,9 @@ if (!empty($_POST['startdatemonth']))
if (!empty($_POST['enddatemonth'])) if (!empty($_POST['enddatemonth']))
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Product($db);
$hookmanager->initHooks(array('marginproductlist'));
/* /*
* View * View