strftime is deprecated in php 8.1

This commit is contained in:
Frédéric FRANCE 2022-10-31 10:42:40 +01:00
parent 840428200c
commit 754881a6ef
28 changed files with 29 additions and 29 deletions

View File

@ -40,7 +40,7 @@ if ($user->socid > 0) {
}
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -42,7 +42,7 @@ if ($user->socid > 0) {
}
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -47,7 +47,7 @@ if ($user->socid > 0) {
}
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -52,7 +52,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -65,7 +65,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -62,7 +62,7 @@ if ($userid > 0) {
}
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -64,7 +64,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -74,7 +74,7 @@ llxHeader('', $langs->trans("PurchasesJournal"), '', '', 0, 0, '', '', $morequer
$form = new Form($db);
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0) {

View File

@ -77,7 +77,7 @@ $morequery = '&date_startyear='.$date_startyear.'&date_startmonth='.$date_startm
llxHeader('', $langs->trans("SellsJournal"), '', '', 0, 0, '', '', $morequery);
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0) {

View File

@ -39,7 +39,7 @@ $local = GETPOST('localTaxType', 'int');
// Date range
$year = GETPOST("year", "int");
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year_start = $year_current;
} else {
$year_current = $year;

View File

@ -38,7 +38,7 @@ $localTaxType = GETPOST('localTaxType', 'int');
// Date range
$year = GETPOST("year", "int");
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year_start = $year_current;
} else {
$year_current = $year;

View File

@ -49,7 +49,7 @@ $local = GETPOST('localTaxType', 'int');
// Date range
$year = GETPOST("year", "int");
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year_start = $year_current;
} else {
$year_current = $year;

View File

@ -59,7 +59,7 @@ $nbofyear = 1;
// Date range
$year = GETPOST('year', 'int');
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$month_current = strftime("%m", dol_now());
$year_start = $year_current - ($nbofyear - 1);
} else {

View File

@ -371,7 +371,7 @@ print '</tr>';
$now_show_delta = 0;
$minyear = substr($minyearmonth, 0, 4);
$maxyear = substr($maxyearmonth, 0, 4);
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$nowyearmonth = strftime("%Y-%m", dol_now());
$maxyearmonth = max($maxyearmonth, $nowyearmonth);
$now = dol_now();

View File

@ -310,7 +310,7 @@ print '</tr>';
$now_show_delta = 0;
$minyear = substr($minyearmonth, 0, 4);
$maxyear = substr($maxyearmonth, 0, 4);
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$nowyearmonth = strftime("%Y-%m", dol_now());
$maxyearmonth = max($maxyearmonth, $nowyearmonth);
$now = dol_now();

View File

@ -304,7 +304,7 @@ function getDefaultDatesForTransfer()
$date_end = dol_get_last_day($year_end, $month_end);
}
} elseif ($periodbydefaultontransfer == 1) {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$pastmonth = strftime("%m", dol_now());
$pastmonthyear = $year_current;
if ($pastmonth == 0) {
@ -312,7 +312,7 @@ function getDefaultDatesForTransfer()
$pastmonthyear--;
}
} else {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0) {

View File

@ -41,7 +41,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -54,7 +54,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'expensereport', $id, '');
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -43,7 +43,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -106,7 +106,7 @@ if ($id > 0) {
/* ************************************************************************** */
print "<div class=\"graph\">\n";
$year = strftime("%Y", time());
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$file = $conf->stock->dir_temp.'/entrepot-'.$entrepot->id.'-'.($year).'.png';

View File

@ -52,7 +52,7 @@ if ($page < 0) {
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$year = strftime("%Y", time());
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
/*

View File

@ -41,7 +41,7 @@ if ($user->socid > 0) {
$action = '';
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year', 'int') > 0 ? GETPOST('year', 'int') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -44,7 +44,7 @@ if ($user->socid > 0) {
$action = '';
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -36,7 +36,7 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
$userid = GETPOST('userid', 'int');
$socid = GETPOST('socid', 'int');
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -459,7 +459,7 @@ if ($id > 0) {
// Create
if ($action == 'create') {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0) {

View File

@ -51,7 +51,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'salaries', '', '', '');
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -45,7 +45,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$nowyear = strftime("%Y", dol_now());
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;

View File

@ -45,7 +45,7 @@ if (!$user->admin) {
// Date range
$year = GETPOST("year");
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
$month_current = strftime("%m", dol_now());
$year_start = $year_current;
} else {