fix ignored phpstan (#30645)

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan
This commit is contained in:
Frédéric FRANCE 2024-08-16 20:13:02 +02:00 committed by GitHub
parent ff06dc8704
commit 97392965e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 128 additions and 119 deletions

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2019-2023 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -255,7 +256,7 @@ if (isset($current_fiscal_period)) {
'name' => 'date_start',
'type' => 'date',
'label' => $langs->trans('DateStart'),
'value' => dol_time_plus_duree($current_fiscal_period['date_end'], -1, 'm')
'value' => dol_time_plus_duree((int) $current_fiscal_period['date_end'], -1, 'm')
);
$form_question['date_end'] = array(
'name' => 'date_end',

View File

@ -423,7 +423,7 @@ if ($result) {
// Fees description -- Can be null
print '<td>';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
$trunclength = getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION', 32);
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
print '</td>';

View File

@ -3054,7 +3054,7 @@ class Adherent extends CommonObject
}
$tmp = dol_getdate($now);
$datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year'], 'tzserver'), $daysbeforeend, 'd');
$datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year'], 'tzserver'), (int) $daysbeforeend, 'd');
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent';
$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only;

View File

@ -986,9 +986,9 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
}
// Now do a correction of the suggested date
if (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "m") {
$datefrom = dol_get_first_day(dol_print_date($datefrom, "%Y"), dol_print_date($datefrom, "%m"));
$datefrom = dol_get_first_day((int) dol_print_date($datefrom, "%Y"), (int) dol_print_date($datefrom, "%m"));
} elseif (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "Y") {
$datefrom = dol_get_first_day(dol_print_date($datefrom, "%Y"));
$datefrom = dol_get_first_day((int) dol_print_date($datefrom, "%Y"));
}
}
print $form->selectDate($datefrom, '', 0, 0, 0, "subscription", 1, 1);
@ -1000,9 +1000,9 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
}
if (!$dateto) {
if (getDolGlobalInt('MEMBER_SUBSCRIPTION_SUGGEST_END_OF_MONTH')) {
$dateto = dol_get_last_day(dol_print_date($datefrom, "%Y"), dol_print_date($datefrom, "%m"));
$dateto = dol_get_last_day((int) dol_print_date($datefrom, "%Y"), (int) dol_print_date($datefrom, "%m"));
} elseif (getDolGlobalInt('MEMBER_SUBSCRIPTION_SUGGEST_END_OF_YEAR')) {
$dateto = dol_get_last_day(dol_print_date($datefrom, "%Y"));
$dateto = dol_get_last_day((int) dol_print_date($datefrom, "%Y"));
} else {
$dateto = -1; // By default, no date is suggested
}

View File

@ -1026,13 +1026,13 @@ class Asset extends CommonObject
// Get depreciation period
$depreciation_date_start = $this->date_start > $this->date_acquisition ? $this->date_start : $this->date_acquisition;
$depreciation_date_end = dol_time_plus_duree($depreciation_date_start, $fields['duration'], $fields['duration_type'] == 1 ? 'm' : ($fields['duration_type'] == 2 ? 'd' : 'y'));
$depreciation_date_end = dol_time_plus_duree((int) $depreciation_date_start, $fields['duration'], $fields['duration_type'] == 1 ? 'm' : ($fields['duration_type'] == 2 ? 'd' : 'y'));
$depreciation_amount = $fields['amount_base_depreciation_ht'];
if ($fields['duration_type'] == 2) { // Daily
$fiscal_period_start = $depreciation_date_start;
$fiscal_period_end = $depreciation_date_start;
} elseif ($fields['duration_type'] == 1) { // Monthly
$date_temp = dol_getdate($depreciation_date_start);
$date_temp = dol_getdate((int) $depreciation_date_start);
$fiscal_period_start = dol_get_first_day($date_temp['year'], $date_temp['mon'], false);
$fiscal_period_end = dol_get_last_day($date_temp['year'], $date_temp['mon'], false);
} else { // Annually

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
@ -75,7 +75,7 @@ $search_ref = GETPOST('search_ref', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET('search_startmonth') && !GETPOSTISSET('begin')) {
$search_start = dol_time_plus_duree(dol_now(), '-1', 'w');
$search_start = dol_time_plus_duree(dol_now(), -1, 'w');
$tmparray = dol_getdate($search_start);
$search_startday = $tmparray['mday'];
$search_startmonth = $tmparray['mon'];
@ -597,7 +597,7 @@ if (is_array($blocks)) {
$texttoshow .= '<br><br>'.$langs->trans("Fingerprint").' - Recalculated sha256(previoushash * data):<br>'.$checkdetail[$block->id]['calculatedsignature'];
$texttoshow .= '<br><span class="opacitymedium">'.$langs->trans("PreviousHash").'='.$checkdetail[$block->id]['previoushash'].'</span>';
//$texttoshow .= '<br>keyforsignature='.$checkdetail[$block->id]['keyforsignature'];
print $form->textwithpicto(dol_trunc($block->signature, '8'), $texttoshow, 1, 'help', '', 0, 2, 'fingerprint'.$block->id);
print $form->textwithpicto(dol_trunc($block->signature, 8), $texttoshow, 1, 'help', '', 0, 2, 'fingerprint'.$block->id);
print '</td>';
// Status

View File

@ -1,15 +1,15 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -83,19 +83,19 @@ if ($complete == 'na' || $complete == -2) {
if ($fulldayevent) {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
// For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere)
$datep = dol_mktime('00', '00', 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datef = dol_mktime('23', '59', '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datep = dol_mktime(0, 0, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datef = dol_mktime(23, 59, 59, GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel');
//print $db->idate($datep); exit;
} else {
$datep = dol_mktime($aphour, $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
$datef = dol_mktime($p2hour, $p2min, '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
$datef = dol_mktime($p2hour, $p2min, 59, GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
}
$reg = array();
if (GETPOST('datep')) {
if (GETPOST('datep') == 'now') {
$datep = dol_now();
} elseif (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { // Try to not use this. Use instead '&datep=now'
$datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1], 'tzuserrel');
$datep = dol_mktime(0, 0, 0, (int) $reg[2], (int) $reg[3], (int) $reg[1], 'tzuserrel');
}
}
@ -323,8 +323,8 @@ if (empty($reshook) && $action == 'add') {
if ($fulldayevent) {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
// For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere)
$datep = dol_mktime('00', '00', '00', GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datef = dol_mktime('23', '59', '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datep = dol_mktime(0, 0, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datef = dol_mktime(23, 59, 59, GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel');
} else {
$datep = dol_mktime(GETPOSTINT("aphour"), GETPOSTINT("apmin"), GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
$datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
@ -770,8 +770,8 @@ if (empty($reshook) && $action == 'update') {
if ($fulldayevent) {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
// For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere)
$datep = dol_mktime('00', '00', '00', GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datep = dol_mktime(0, 0, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel');
$datef = dol_mktime(23, 59, 59, GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel');
} else {
$datep = dol_mktime(GETPOST("aphour", 'int'), GETPOST("apmin", 'int'), GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel');
$datef = dol_mktime(GETPOST("p2hour", 'int'), GETPOST("p2min", 'int'), GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel');
@ -1056,8 +1056,8 @@ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes
if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
$error = 0;
$shour = dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user.
$smin = dol_print_date($object->datep, "%M", 'tzuserrel');
$shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user.
$smin = (int) dol_print_date($object->datep, "%M", 'tzuserrel');
$newdate = GETPOST('newdate', 'alpha');
if (empty($newdate) || strpos($newdate, 'dayevent_') != 0) {
@ -1065,7 +1065,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
exit;
}
$datep = dol_mktime($shour, $smin, 0, substr($newdate, 13, 2), substr($newdate, 15, 2), substr($newdate, 9, 4), 'tzuserrel');
$datep = dol_mktime($shour, $smin, 0, (int) substr($newdate, 13, 2), (int) substr($newdate, 15, 2), (int) substr($newdate, 9, 4), 'tzuserrel');
//print dol_print_date($datep, 'dayhour');exit;
if ($datep != $object->datep) {
@ -1731,8 +1731,8 @@ if ($id > 0) {
if ($listUserAssignedUpdated || $donotclearsession) {
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
$datep = dol_mktime($fulldayevent ? 0 : $aphour, $fulldayevent ? 0 : $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
$datef = dol_mktime($fulldayevent ? 23 : $p2hour, $fulldayevent ? 59 : $p2min, $fulldayevent ? 59 : 0, GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->label = GETPOST("label", "alphanohtml");

View File

@ -382,7 +382,7 @@ class ICal
// TIME LIMITED EVENT
$date = array();
if (preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})([0-9]{0,2})/', $ical_date, $date)) {
$ntime = dol_mktime($date[4], $date[5], $date[6], $date[2], $date[3], $date[1], true);
$ntime = dol_mktime((int) $date[4], (int) $date[5], (int) $date[6], (int) $date[2], (int) $date[3], (int) $date[1], true);
}
//if (empty($date[4])) print 'Error bad date: '.$ical_date.' - date1='.$date[1];

View File

@ -962,14 +962,14 @@ if ($resql) {
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$annee = (int) dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = (int) dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = (int) dol_print_date($daycursor, '%d', 'tzuserrel');
$daycursorend = $event->date_end_in_calendar;
$anneeend = dol_print_date($daycursorend, '%Y', 'tzuserrel');
$moisend = dol_print_date($daycursorend, '%m', 'tzuserrel');
$jourend = dol_print_date($daycursorend, '%d', 'tzuserrel');
$anneeend = (int) dol_print_date($daycursorend, '%Y', 'tzuserrel');
$moisend = (int) dol_print_date($daycursorend, '%m', 'tzuserrel');
$jourend = (int) dol_print_date($daycursorend, '%d', 'tzuserrel');
//var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); // Hour at greenwich
//var_dump($annee.'-'.$mois.'-'.$jour);
@ -1074,9 +1074,9 @@ if ($showbirthday) {
// Add an entry in eventarray for each day
$daycursor = $event->datep;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$annee = (int) dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = (int) dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = (int) dol_print_date($daycursor, '%d', 'tzuserrel');
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
@ -1160,9 +1160,9 @@ if ($user->hasRight("holiday", "read")) {
}
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$annee = (int) dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = (int) dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = (int) dol_print_date($daycursor, '%d', 'tzuserrel');
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
do {
@ -1445,9 +1445,9 @@ if (count($listofextcals)) {
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$annee = (int) dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = (int) dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = (int) dol_print_date($daycursor, '%d', 'tzuserrel');
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true;
@ -1883,9 +1883,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$tmpholiday = new Holiday($db);
foreach ($eventarray as $daykey => $notused) { // daykey is the 'YYYYMMDD' to show according to user
$annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
$mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
$jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
$annee = (int) dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
$mois = (int) dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
$jour = (int) dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n";
//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n";

View File

@ -924,7 +924,7 @@ print "</tr>\n";
$now = dol_now();
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
$today_start_time = dol_mktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$today_start_time = dol_mktime(0, 0, 0, (int) date('m', $now), (int) date('d', $now), (int) date('Y', $now));
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
$caction = new CActionComm($db);

View File

@ -762,9 +762,9 @@ if ($resql) {
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$annee = (int) dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = (int) dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = (int) dol_print_date($daycursor, '%d', 'tzuserrel');
//print $daycursor.' '.dol_print_date($daycursor, 'dayhour', 'gmt').' '.$event->id.' -> '.$annee.'-'.$mois.'-'.$jour.'<br>';
// Loop on each day covered by action to prepare an index to show on calendar

View File

@ -3,6 +3,7 @@
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -37,7 +38,7 @@ if (!$sortorder) {
$sortorder = "ASC";
}
if (!$sortfield) {
$sortfield = "p.name";
$sortfield = "p.lastname";
}
if ($page < 0) {
$page = 0;
@ -81,7 +82,7 @@ if ($type == "f") {
*/
$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm,";
$sql .= " p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
$sql .= " p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone";
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
$sql .= " ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
@ -97,7 +98,7 @@ if ($type == "f") {
$sql .= " AND s.fournisseur = 1";
}
if (!empty($search_lastname)) {
$sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'";
$sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
}
if (!empty($search_firstname)) {
$sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
@ -106,8 +107,8 @@ if (!empty($search_company)) {
$sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
}
if (!empty($contactname)) { // access a partir du module de recherche
$sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
$sortfield = "p.name";
$sql .= " AND (p.lastname LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
$sortfield = "p.lastname";
$sortorder = "ASC";
}
// If the internal user must only see his customers, force searching by him
@ -144,7 +145,7 @@ if ($resql) {
print '<table class="liste centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Email");
@ -171,7 +172,7 @@ if ($resql) {
print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"), "company").'</a>&nbsp;';
print '<a href="'.$urlfiche."?socid=".$obj->rowid.'">'.$obj->name."</a></td>\n";
print '<td>'.dol_print_phone($obj->email, $obj->cidp, $obj->rowid, 'AC_EMAIL').'</td>';
print '<td>'.dol_print_email($obj->email, $obj->cidp, $obj->rowid, 'AC_EMAIL').'</td>';
print '<td>'.dol_print_phone($obj->phone, $obj->country_code, $obj->cidp, $obj->rowid, 'AC_TEL').'&nbsp;</td>';

View File

@ -12,7 +12,7 @@
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
@ -206,9 +206,9 @@ if (empty($reshook)) {
12,
0,
0,
dol_print_date($date_delivery_old, '%m'),
dol_print_date($date_delivery_old, '%d'),
dol_print_date($date_delivery_old, '%Y')
(int) dol_print_date($date_delivery_old, '%m'),
(int) dol_print_date($date_delivery_old, '%d'),
(int) dol_print_date($date_delivery_old, '%Y')
);
//Calculate the difference and apply if necessary
$difference = $date_delivery - $old_date_delivery;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -190,7 +191,7 @@ if ($result < 0) {
$datamin = array();
$subtotal = 0;
$day = dol_mktime(12, 0, 0, $month, 1, $year);
$day = dol_mktime(12, 0, 0, (int) $month, 1, (int) $year);
//$textdate = strftime("%Y%m%d", $day);
$textdate = dol_print_date($day, "%Y%m%d");
$xyear = substr($textdate, 0, 4);
@ -337,7 +338,7 @@ if ($result < 0) {
$subtotal = 0;
$now = time();
$day = dol_mktime(12, 0, 0, 1, 1, $year);
$day = dol_mktime(12, 0, 0, 1, 1, (int) $year);
//$textdate = strftime("%Y%m%d", $day);
$textdate = dol_print_date($day, "%Y%m%d");
$xyear = substr($textdate, 0, 4);

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -130,7 +131,7 @@ if ($year) {
print '<td class="right">'.$langs->trans("Date").'</td>';
print '</tr>';
$files = (dol_dir_list($dir.'/'.$year, 'files', 0, '^payments-[0-9]{4}-[0-9]{2}\.pdf$', '', 'name', 'DESC', 1));
$files = (dol_dir_list($dir.'/'.$year, 'files', 0, '^payments-[0-9]{4}-[0-9]{2}\.pdf$', '', 'name', SORT_DESC, 1));
foreach ($files as $f) {
$relativepath = $f['level1name'].'/'.$f['name'];
print '<tr class="oddeven">';

View File

@ -943,9 +943,9 @@ abstract class CommonInvoice extends CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
$date_piece = dol_mktime(0, 0, 0, date('m', $datelim), date('d', $datelim), date('Y', $datelim)); // Sans les heures minutes et secondes
$date_lim_current = dol_mktime(0, 0, 0, date('m', $datelim), $cdr_decalage, date('Y', $datelim)); // Sans les heures minutes et secondes
$date_lim_next = dol_time_plus_duree($date_lim_current, 1, 'm'); // Add 1 month
$date_piece = dol_mktime(0, 0, 0, (int) date('m', $datelim), (int) date('d', $datelim), (int) date('Y', $datelim)); // Sans les heures minutes et secondes
$date_lim_current = dol_mktime(0, 0, 0, (int) date('m', $datelim), (int) $cdr_decalage, (int) date('Y', $datelim)); // Sans les heures minutes et secondes
$date_lim_next = dol_time_plus_duree((int) $date_lim_current, 1, 'm'); // Add 1 month
$diff = $date_piece - $date_lim_current;

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This file is a modified version of datepicker.php from phpBSM to fix some
* bugs, to add new features and to dramatically increase speed.
@ -142,10 +143,11 @@ print '</body></html>'."\n";
*/
function xyzToUnixTimestamp($mysqldate)
{
$year = substr($mysqldate, 0, 4);
$month = substr($mysqldate, 4, 2);
$day = substr($mysqldate, 6, 2);
$year = (int) substr($mysqldate, 0, 4);
$month = (int) substr($mysqldate, 4, 2);
$day = (int) substr($mysqldate, 6, 2);
$unixtimestamp = dol_mktime(12, 0, 0, $month, $day, $year);
return $unixtimestamp;
}

View File

@ -466,7 +466,8 @@ function dol_stringtotime($string, $gm = 1)
$gm = 'tzserver';
}
$date = dol_mktime(substr($tmp, 8, 2), substr($tmp, 10, 2), substr($tmp, 12, 2), substr($tmp, 4, 2), substr($tmp, 6, 2), substr($tmp, 0, 4), $gm);
$date = dol_mktime((int) substr($tmp, 8, 2), (int) substr($tmp, 10, 2), (int) substr($tmp, 12, 2), (int) substr($tmp, 4, 2), (int) substr($tmp, 6, 2), (int) substr($tmp, 0, 4), $gm);
return $date;
}

View File

@ -3430,7 +3430,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
$smin = (!empty($reg[5]) ? $reg[5] : '');
$ssec = (!empty($reg[6]) ? $reg[6] : '');
$time = dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true);
$time = dol_mktime((int) $shour, (int) $smin, (int) $ssec, (int) $smonth, (int) $sday, (int) $syear, true);
if ($to_gmt) {
$tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC
@ -4543,8 +4543,8 @@ function dol_user_country()
* Format address string
*
* @param string $address Address string, already formatted with dol_format_address()
* @param int $htmlid Html ID (for example 'gmap')
* @param int $element 'thirdparty'|'contact'|'member'|'user'|'other'
* @param string $htmlid Html ID (for example 'gmap')
* @param string $element 'thirdparty'|'contact'|'member'|'user'|'other'
* @param int $id Id of object
* @param int $noprint No output. Result is the function return
* @param string $charfornl Char to use instead of nl2br. '' means we use a standad nl2br.

View File

@ -1124,9 +1124,9 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
if (!empty($yearoffsettype) && !is_numeric($yearoffsettype) && $yearoffsettype != '=') { // $yearoffsettype is - or +
$currentyear = (int) date("Y", $date);
$fiscaldate = dol_mktime('0', '0', '0', $maskraz, '1', $currentyear);
$newyeardate = dol_mktime('0', '0', '0', '1', '1', $currentyear);
$nextnewyeardate = dol_mktime('0', '0', '0', '1', '1', $currentyear + 1);
$fiscaldate = dol_mktime(0, 0, 0, $maskraz, 1, $currentyear);
$newyeardate = dol_mktime(0, 0, 0, 1, 1, $currentyear);
$nextnewyeardate = dol_mktime(0, 0, 0, 1, 1, $currentyear + 1);
//echo 'currentyear='.$currentyear.' date='.dol_print_date($date, 'day').' fiscaldate='.dol_print_date($fiscaldate, 'day').'<br>';
// If after or equal of current fiscal date

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -252,7 +252,7 @@ function dol_listshmop()
/**
* Save data into a memory area shared by all users, all sessions on server
*
* @param int $memoryid Memory id of shared area ('main', 'agenda', ...)
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
* @param string $data Data to save. Must be a not null value.
* @param int $expire ttl in seconds, 0 never expire
* @return int Return integer <0 if KO, 0=Caching not available, Nb of bytes written if OK

View File

@ -2591,8 +2591,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
if (empty($project_year_filter) || !is_numeric($project_year_filter)) {
$project_year_filter = date("Y");
}
$sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day($project_year_filter, 12, false)).")";
$sql .= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter, 1, false)).")";
$sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day((int) $project_year_filter, 12, false)).")";
$sql .= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day((int) $project_year_filter, 1, false)).")";
}
}

View File

@ -4,6 +4,7 @@
* Copyright (C) 2015-2018 Charlene BENKE <charlie@patas-monkey.com>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -202,7 +203,7 @@ class pdf_paiement extends CommonDocGenerator
$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
break;
}
$sql .= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year, $month))."' AND '".$this->db->idate(dol_get_last_day($year, $month))."'";
$sql .= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day((int) $year, (int) $month))."' AND '".$this->db->idate(dol_get_last_day((int) $year, (int) $month))."'";
$sql .= " AND p.entity = ".$conf->entity;
$result = $this->db->query($sql);
if ($result) {
@ -235,7 +236,7 @@ class pdf_paiement extends CommonDocGenerator
$sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year, $month))."' AND '".$this->db->idate(dol_get_last_day($year, $month))."'";
$sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day((int) $year, (int) $month))."' AND '".$this->db->idate(dol_get_last_day((int) $year, (int) $month))."'";
if (!$user->hasRight('societe', 'client', 'voir')) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
@ -273,7 +274,7 @@ class pdf_paiement extends CommonDocGenerator
$sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year, $month))."' AND '".$this->db->idate(dol_get_last_day($year, $month))."'";
$sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day((int) $year, (int) $month))."' AND '".$this->db->idate(dol_get_last_day((int) $year, (int) $month))."'";
if (!$user->hasRight('societe', 'client', 'voir')) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -66,7 +67,7 @@ if (isset($action) && !empty($action)) {
$diroutputslash .= '/';
// Scan directory tree on disk
$disktree = dol_dir_list($conf->$element->dir_output, 'directories', 1, '', array('^temp$'), '', '', 0);
$disktree = dol_dir_list($conf->$element->dir_output, 'directories', 1, '', array('^temp$'), '', 0, 0);
// Scan directory tree in database
$sqltree = $ecmdirstatic->get_full_arbo(0);

View File

@ -202,7 +202,7 @@ if ($action == 'refreshmanual' && $permissiontoread) {
$diroutputslash .= '/';
// Scan directory tree on disk
$disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', '', 0);
$disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', 0, 0);
// Scan directory tree in database
$sqltree = $ecmdirstatic->get_full_arbo(0);

View File

@ -175,7 +175,7 @@ if ($action == 'refreshmanual') {
$diroutputslash .= '/';
// Scan directory tree on disk
$disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', '', 0);
$disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', 0, 0);
// Scan directory tree in database
$sqltree = $ecmdirstatic->get_full_arbo(0);

View File

@ -167,7 +167,7 @@ if ($action == 'refreshmanual') {
$diroutputslash .= '/';
// Scan directory tree on disk
$disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', '', 0);
$disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', 0, 0);
// Scan directory tree in database
$sqltree = $ecmdirstatic->get_full_arbo(0);

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -85,7 +85,7 @@ if (empty($ftp_port)) {
}
$ftp_user = getDolGlobalString($s_ftp_user);
$ftp_password = getDolGlobalString($s_ftp_password);
$ftp_passive = getDolGlobalString($s_ftp_passive);
$ftp_passive = getDolGlobalInt($s_ftp_passive);
// For result on connection
$ok = 0;

View File

@ -701,7 +701,7 @@ function activitytrim($product_type)
global $conf, $langs, $db;
// We display the last 3 years
$yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y"));
$yearofbegindate = (int) date('Y', dol_time_plus_duree(time(), -3, "y"));
$out = '';
// breakdown by quarter
$sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot";

View File

@ -2176,7 +2176,7 @@ class Task extends CommonObjectLine
$error = 0;
//Use 00:00 of today if time is use on task.
$now = dol_mktime(0, 0, 0, dol_print_date(dol_now(), '%m'), dol_print_date(dol_now(), '%d'), dol_print_date(dol_now(), '%Y'));
$now = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), (int) dol_print_date(dol_now(), '%d'), (int) dol_print_date(dol_now(), '%Y'));
$datec = $now;

View File

@ -295,7 +295,7 @@ if (isModEnabled('paypal')) {
// Nothing to do
dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment');
} else {
dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment');
dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, 0, '_payment');
}
dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment');
@ -554,9 +554,9 @@ if ($ispaymentok) {
}
// Now do a correction of the suggested date
if (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "m") {
$datesubscription = dol_get_first_day(dol_print_date($datesubscription, "%Y"), dol_print_date($datesubscription, "%m"));
$datesubscription = dol_get_first_day((int) dol_print_date($datesubscription, "%Y"), (int) dol_print_date($datesubscription, "%m"));
} elseif (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "Y") {
$datesubscription = dol_get_first_day(dol_print_date($datesubscription, "%Y"));
$datesubscription = dol_get_first_day((int) dol_print_date($datesubscription, "%Y"));
}
$datesubend = null;

View File

@ -11,7 +11,7 @@
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
@ -2034,7 +2034,7 @@ while ($i < $imaxinloop) {
}
}
if (!empty($arrayfields['s.url']['checked'])) {
print "<td>".dol_print_url($obj->url, '', '', 1)."</td>\n";
print "<td>".dol_print_url($obj->url, '', 0, 1)."</td>\n";
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -1362,15 +1362,15 @@ if ($action == 'create' || $action == 'presend') {
print '<div class="tagtd">';
print dol_print_phone($tab[$i]['phone'], '', '', '', 'AC_TEL').'<br>';
print dol_print_phone($tab[$i]['phone'], '', 0, 0, 'AC_TEL').'<br>';
if (!empty($tab[$i]['phone_perso'])) {
//print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' ';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', 'AC_TEL').'<br>';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', 0, 0, 'AC_TEL').'<br>';
}
if (!empty($tab[$i]['phone_mobile'])) {
//print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' ';
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', 'AC_TEL').'<br>';
print dol_print_phone($tab[$i]['phone_mobile'], '', 0, 0, 'AC_TEL').'<br>';
}
print '</div>';

View File

@ -2852,7 +2852,7 @@ class Ticket extends CommonObject
}
// Contact type
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], -1).' ('.strtolower($info_sendto['libelle']).')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
}
}
@ -2933,7 +2933,7 @@ class Ticket extends CommonObject
$sendto[$info_sendto['email']] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
}
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], -1).' ('.strtolower($info_sendto['libelle']).')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
}
}

View File

@ -74,7 +74,6 @@ parameters:
- '#expects int<0, 1>#'
- '#color.* expects int, string#'
- '#imap.* expects int, string#'
- '#dol.* expects int, string#'
- '#convert.* expects int, string#'
- '#\(\) expects int, string#'
- '#run_sql expects int, string#'

View File

@ -99,10 +99,10 @@ $sql .= ", ".MAIN_DB_PREFIX."contratdet AS cd";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product AS p ON p.rowid = cd.fk_product";
$sql .= " WHERE s.rowid = c.fk_soc AND c.rowid = cd.fk_contrat AND c.statut > 0 AND cd.statut < 5";
if (is_numeric($duration_value2)) {
$sql .= " AND cd.date_fin_validite >= '".$db->idate(dol_time_plus_duree($now, $duration_value2, "d"))."'";
$sql .= " AND cd.date_fin_validite >= '".$db->idate(dol_time_plus_duree($now, (int) $duration_value2, "d"))."'";
}
if (is_numeric($duration_value)) {
$sql .= " AND cd.date_fin_validite < '".$db->idate(dol_time_plus_duree($now, $duration_value, "d"))."'";
$sql .= " AND cd.date_fin_validite < '".$db->idate(dol_time_plus_duree($now, (int) $duration_value, "d"))."'";
}
if ($targettype == 'contacts') {
$sql .= " AND s.rowid = sp.fk_soc";

View File

@ -1,10 +1,11 @@
#!/usr/bin/env php
<?php
/*
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -94,7 +95,7 @@ $sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE f.fk_statut = 1 AND f.paye = 0";
$sql .= " AND f.fk_soc = s.rowid";
if (is_numeric($duration_value)) {
$sql .= " AND f.date_lim_reglement < '".$db->idate(dol_time_plus_duree($now, $duration_value, "d"))."'";
$sql .= " AND f.date_lim_reglement < '".$db->idate(dol_time_plus_duree($now, (int) $duration_value, "d"))."'";
}
$sql .= " AND sc.fk_soc = s.rowid";
$sql .= " AND sc.fk_user = u.rowid";