Merge pull request #23145 from FliyFly/scrutinizermonthreception

fix(scrutinizer)
This commit is contained in:
Laurent Destailleur 2022-12-10 17:05:48 +01:00 committed by GitHub
commit 71da74121d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/reception/class/receptionstats.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$year = GETPOST("year", 'int');
$socid = GETPOST("socid", 'int');
$userid = GETPOST("userid", 'int');
// Security check
if ($user->socid) {
@ -49,9 +51,8 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
$mesg = '';
print load_fiche_titre($langs->trans("StatisticsOfReceptions").' '.GETPOST("year", 'int'), $mesg);
$stats = new ReceptionStats($db);
$data = $stats->getNbReceptionByMonth(GETPOST("year", 'int'));
$stats = new ReceptionStats($db, $socid, '', ($userid > 0 ? $userid : 0));
$data = $stats->getNbByMonth($year);
dol_mkdir($conf->reception->dir_temp);