This commit is contained in:
Laurent Destailleur 2025-12-07 16:28:00 +01:00
parent 0a03dae12e
commit c3b56f928f
2 changed files with 8 additions and 10 deletions

View file

@ -48,7 +48,7 @@ class box_members_last_subscriptions extends ModeleBoxes
*/
public function __construct($db, $param = '')
{
global $conf, $user;
global $user;
$this->db = $db;
@ -72,7 +72,7 @@ class box_members_last_subscriptions extends ModeleBoxes
*/
public function loadBox($max = 5)
{
global $user, $langs, $conf;
global $user, $langs;
$langs->load("boxes");
$this->max = $max;
@ -140,10 +140,10 @@ class box_members_last_subscriptions extends ModeleBoxes
'asis' => 1,
);
$daterange = get_date_range($this->db->jdate($obj->date_start), $this->db->jdate($obj->date_end));
$daterange = get_date_range($this->db->jdate($obj->date_start), $this->db->jdate($obj->date_end), '', null, 0);
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone" title="'.dol_escape_htmltag($daterange).'"',
'text' => $daterange,
'text' => '<span class="opacitymedium small">'.$daterange.'</span>',
);
$this->info_box_contents[$line][] = array(

View file

@ -10989,7 +10989,7 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = n
* @param int $date_end End date
* @param string $format Output date format ('day', 'dayhour', ...)
* @param Translate $outputlangs Output language
* @param integer $withparenthesis 1=Add parenthesis, 0=no parenthesis
* @param integer $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis
* @return string String
*/
function get_date_range($date_start, $date_end, $format = '', $outputlangs = null, $withparenthesis = 1)
@ -11003,13 +11003,13 @@ function get_date_range($date_start, $date_end, $format = '', $outputlangs = nul
}
if ($date_start && $date_end) {
$out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
$out .= ($withparenthesis ? ($withparenthesis == 1 ? ' ' : '').'(' : '') . $outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
}
if ($date_start && !$date_end) {
$out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
$out .= ($withparenthesis ? ($withparenthesis == 1 ? ' ' : '').'(' : '') . $outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
}
if (!$date_start && $date_end) {
$out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
$out .= ($withparenthesis ? ($withparenthesis == 1 ? ' ' : '').'(' : '') . $outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
}
return $out;
@ -11025,8 +11025,6 @@ function get_date_range($date_start, $date_end, $format = '', $outputlangs = nul
*/
function dolGetFirstLastname($firstname, $lastname, $nameorder = -1)
{
global $conf;
$ret = '';
// If order not defined, we use the setup
if ($nameorder < 0) {