From f39bf7a43cbb0329a573e3c41bcf373be2de50c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Mar 2023 19:09:31 +0100 Subject: [PATCH] Debug v17 --- htdocs/adherents/class/adherent.class.php | 4 ++++ htdocs/core/boxes/box_birthdays.php | 5 +++-- htdocs/core/boxes/box_birthdays_members.php | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c17a8c1207b..05063303e75 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2229,6 +2229,7 @@ class Adherent extends CommonObject $label .= '
'; $label .= img_picto('', $this->picto).' '.$langs->trans("Member").''; + $label .= ' '.$this->getLibStatut(4); if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; @@ -2236,6 +2237,9 @@ class Adherent extends CommonObject if (!empty($this->login)) { $label .= '
'.$langs->trans('Login').': '.$this->login; } + if (!empty($this->email)) { + $label .= '
'.$langs->trans('Email').': '.$this->email; + } if (!empty($this->firstname) || !empty($this->lastname)) { $label .= '
'.$langs->trans('Name').': '.$this->getFullName($langs); } diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 52ca0bc6359..1f5c7e4add7 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -88,15 +88,16 @@ class box_birthdays extends ModeleBoxes $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, date_format(u.birth, '%d') as daya, 'birth' as typea, u.email, u.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.entity IN (".getEntity('user').")"; - $sql .= " AND u.statut = 1"; + $sql .= " AND u.statut = ".User::STATUS_ENABLED; $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0); $sql .= ' UNION '; $sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, date_format(u.dateemployment, '%d') as daya, 'employment' as typea, u.email, u.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.entity IN (".getEntity('user').")"; - $sql .= " AND u.statut = 1"; + $sql .= " AND u.statut = ".User::STATUS_ENABLED; $sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0); $sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year + $sql .= $this->db->plimit($max, 0); dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 1db11d492ed..21d6178aad3 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -85,7 +85,7 @@ class box_birthdays_members extends ModeleBoxes if ($user->rights->adherent->lire) { $tmparray = dol_getdate(dol_now(), true); - $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, date_format(u.birth, '%d') as daya"; + $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, date_format(u.birth, '%d') as daya, u.email, u.statut as status, u.datefin"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as u"; $sql .= " WHERE u.entity IN (".getEntity('adherent').")"; $sql .= " AND u.statut = ".Adherent::STATUS_VALIDATED; @@ -104,9 +104,16 @@ class box_birthdays_members extends ModeleBoxes $memberstatic->id = $objp->rowid; $memberstatic->firstname = $objp->firstname; $memberstatic->lastname = $objp->lastname; + $memberstatic->email = $objp->email; + $memberstatic->status = $objp->status; + $memberstatic->statut = $memberstatic->status; + $memberstatic->datefin = $this->db->jdate($objp->datefin); + //$memberstatic->need_subscription = 1; $dateb = $this->db->jdate($objp->birth); $age = date('Y', dol_now()) - date('Y', $dateb); + $typea = ''; + $this->info_box_contents[$line][] = array( 'td' => '', 'text' => $memberstatic->getNomUrl(1), @@ -118,6 +125,12 @@ class box_birthdays_members extends ModeleBoxes 'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears') ); + $this->info_box_contents[$line][] = array( + 'td' => 'class="center nowraponall"', + 'text' => $typea, + 'asis' => 1 + ); + /*$this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', 'text' => $memberstatic->LibStatut($objp->status, 3)