diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1b8582ddc2e..3d737cd1763 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-2023 Frédéric France * Copyright (C) 2021-2023 Waël Almoman * * This program is free software; you can redistribute it and/or modify @@ -53,11 +53,11 @@ $result = restrictedArea($user, 'adherent'); * Actions */ +$userid = GETPOST('userid', 'int'); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; $zone = GETPOST('areacode', 'int'); - $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid); @@ -95,7 +95,7 @@ if ($conf->use_javascript_ajax) { $boxgraph .='
'; $boxgraph .=''; - $boxgraph .=''; + $boxgraph .=''; $boxgraph .='
'.$langs->trans("Statistics").($numberyears ? ' ('.$year-$numberyears.' - '.$year.')' : '').'
'.$langs->trans("Statistics").($numberyears ? ' ('.($year-$numberyears).' - '.$year.')' : '').'
'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php'; diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 07c1e0ba016..046c7031ece 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015-2020 Frederic France + * Copyright (C) 2015-2023 Frederic France * Copyright (C) 2021-2023 Waël Almoman * * This program is free software; you can redistribute it and/or modify @@ -88,10 +88,11 @@ class box_members_by_type extends ModeleBoxes require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php'; $staticmember = new Adherent($this->db); + $now = dol_now(); $year = date('Y'); $numberyears = getDolGlobalInt("MAIN_NB_OF_YEAR_IN_MEMBERSHIP_WIDGET_GRAPH"); - $this->info_box_head = array('text' => $langs->trans("BoxTitleMembersByType").($numberyears ? ' ('.$year-$numberyears.' - '.$year.')' : '')); + $this->info_box_head = array('text' => $langs->trans("BoxTitleMembersByType").($numberyears ? ' ('.($year-$numberyears).' - '.$year.')' : '')); if ($user->rights->adherent->lire) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php'; @@ -117,13 +118,13 @@ class box_members_by_type extends ModeleBoxes 'text' => $labelstatus, ); // Up to date - $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, dol_now() + 86400, 1); + $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, $now + 86400, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="10%" title="'.dol_escape_htmltag($labelstatus).'"', 'text' => $labelstatus, ); // Expired - $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, dol_now() - 86400, 1); + $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, $now - 86400, 1); $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax100" width="10%" title="'.dol_escape_htmltag($labelstatus).'"', 'text' => $labelstatus diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cd2a69cf3d3..210fcb202e8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7728,7 +7728,7 @@ class Form $out = ''; $outarray = array(); - $selectFields = " p.rowid, p.ref, p.firstname, p.lastname"; + $selectFields = " p.rowid, p.ref, p.firstname, p.lastname, p.fk_adherent_type"; $sql = "SELECT "; $sql .= $selectFields;