diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index d3178ee3df3..cb61d66b90d 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -91,16 +91,18 @@ print load_fiche_titre($langs->trans("MembersArea"), $resultboxes['selectboxlist $boxgraph = ''; if ($conf->use_javascript_ajax) { + $year = date('Y'); + $numberyears = empty(getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH")) ? 2 : getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH"); + $boxgraph .='
'; $boxgraph .=''; - $boxgraph .=''; + $boxgraph .=''; $boxgraph .='
'.$langs->trans("Statistics").'
'.$langs->trans("Statistics").' ('.$year-$numberyears.' - '.$year.')
'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php'; $stats = new AdherentStats($db, 0, $userid); // Show array - $numberyears = empty(getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH")) ? 2 : getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH"); $sumMembers = $stats->countMembersByTypeAndStatus($numberyears); $total = $sumMembers['total']['members_draft'] + $sumMembers['total']['members_pending'] + $sumMembers['total']['members_uptodate'] + $sumMembers['total']['members_expired'] + $sumMembers['total']['members_excluded'] + $sumMembers['total']['members_resiliated']; diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 17984f6d4e6..1fc6590fd99 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -88,13 +88,15 @@ class box_members_by_type extends ModeleBoxes require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php'; $staticmember = new Adherent($this->db); - $this->info_box_head = array('text' => $langs->trans("BoxTitleMembersByType", $max)); + $year = date('Y'); + $numberyears = empty(getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH")) ? 2 : getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH"); + + $this->info_box_head = array('text' => $langs->trans("BoxTitleMembersByType").' ('.$year-$numberyears.' - '.$year.')'); if ($user->rights->adherent->lire) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php'; $stats = new AdherentStats($this->db, $user->socid, $user->id); // Show array - $numberyears = empty(getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH")) ? 2 : getDolGlobalInt("MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH"); $sumMembers = $stats->countMembersByTypeAndStatus($numberyears); if ($sumMembers) { $line = 0;