mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW : Execute doActions on statistics pages (#29851)
* NEW : Execute doActions on statistics pages * Update index.php * Update index.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
acd8fdc24e
commit
2bfa92983c
|
|
@ -40,6 +40,8 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
|||
|
||||
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||
|
||||
$hookmanager->initHooks(array('propalstats', 'globalcard'));
|
||||
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$typent_id = GETPOSTINT('typent_id');
|
||||
$categ_id = GETPOSTINT('categ_id');
|
||||
|
|
@ -52,6 +54,12 @@ if ($user->socid > 0) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$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');
|
||||
}
|
||||
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear;
|
||||
$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
|||
|
||||
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||
|
||||
$hookmanager->initHooks(array('orderstats', 'globalcard'));
|
||||
|
||||
$usercanreadcustumerstatistic = $user->hasRight('commande', 'lire');
|
||||
$usercanreadsupplierstatistic = $user->hasRight('fournisseur', 'commande', 'lire');
|
||||
if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) {
|
||||
|
|
@ -73,6 +75,12 @@ if ($user->socid > 0) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$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');
|
||||
}
|
||||
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
|||
$langs->loadLangs(array('bills', 'companies', 'other'));
|
||||
|
||||
$mode = GETPOST("mode") ? GETPOST("mode") : 'customer';
|
||||
|
||||
$hookmanager->initHooks(array('invoicestats', 'globalcard'));
|
||||
|
||||
if ($mode == 'customer' && !$user->hasRight('facture', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
|
@ -64,6 +67,12 @@ if ($user->socid > 0) {
|
|||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$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');
|
||||
}
|
||||
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear;
|
||||
$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user