forked from Wavyzz/dolibarr
fix phpstan
This commit is contained in:
@@ -21582,48 +21582,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../htdocs/ftp/index.php
|
path: ../../htdocs/ftp/index.php
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^If condition is always false\.$#'
|
|
||||||
identifier: if.alwaysFalse
|
|
||||||
count: 2
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
|
|
||||||
identifier: argument.type
|
|
||||||
count: 8
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
|
|
||||||
identifier: argument.type
|
|
||||||
count: 8
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
|
|
||||||
identifier: argument.type
|
|
||||||
count: 8
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Variable \$canread might not be defined\.$#'
|
|
||||||
identifier: variable.undefined
|
|
||||||
count: 1
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Variable \$endhalfdaykey might not be defined\.$#'
|
|
||||||
identifier: variable.undefined
|
|
||||||
count: 1
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Variable \$starthalfdaykey might not be defined\.$#'
|
|
||||||
identifier: variable.undefined
|
|
||||||
count: 1
|
|
||||||
path: ../../htdocs/holiday/card.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: '#^If condition is always false\.$#'
|
message: '#^If condition is always false\.$#'
|
||||||
identifier: if.alwaysFalse
|
identifier: if.alwaysFalse
|
||||||
|
|||||||
@@ -1148,8 +1148,10 @@ function GETPOSTFLOAT($paramname, $rounding = '')
|
|||||||
* @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request,
|
* @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request,
|
||||||
* or 'XX:YY:ZZ' to set hour, minute, second respectively (for instance '23:59:59')
|
* or 'XX:YY:ZZ' to set hour, minute, second respectively (for instance '23:59:59')
|
||||||
* or '' means '00:00:00' (default)
|
* or '' means '00:00:00' (default)
|
||||||
* @param string $gm Passed to dol_mktime
|
* @param int|string $gm Passed to dol_mktime
|
||||||
* @return int|string Date as a timestamp, '' or false if error
|
* @return int|string Date as a timestamp, '' or false if error
|
||||||
|
*
|
||||||
|
* @see dol_mktime()
|
||||||
*/
|
*/
|
||||||
function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
|
function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
|
||||||
{
|
{
|
||||||
@@ -3647,7 +3649,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
|
|||||||
* @param int $month Month (1 to 12)
|
* @param int $month Month (1 to 12)
|
||||||
* @param int $day Day (1 to 31)
|
* @param int $day Day (1 to 31)
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @param mixed $gm True or 1 or 'gmt'=Input information are GMT values
|
* @param int|string $gm True or 1 or 'gmt'=Input information are GMT values
|
||||||
* False or 0 or 'tzserver' = local to server TZ
|
* False or 0 or 'tzserver' = local to server TZ
|
||||||
* 'auto'
|
* 'auto'
|
||||||
* 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented.
|
* 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented.
|
||||||
|
|||||||
@@ -169,10 +169,10 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
|
$date_debut = GETPOSTDATE('date_debut_', '00:00:00');
|
||||||
$date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
|
$date_fin = GETPOSTDATE('date_fin_', '00:00:00');
|
||||||
$date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1);
|
$date_debut_gmt = GETPOSTDATE('date_debut_', '00:00:00', 1);
|
||||||
$date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1);
|
$date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1);
|
||||||
$starthalfday = GETPOST('starthalfday');
|
$starthalfday = GETPOST('starthalfday');
|
||||||
$endhalfday = GETPOST('endhalfday');
|
$endhalfday = GETPOST('endhalfday');
|
||||||
$type = GETPOST('type');
|
$type = GETPOST('type');
|
||||||
@@ -325,10 +325,10 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update' && !GETPOSTISSET('savevalidator')) { // Test on permission done later
|
if ($action == 'update' && !GETPOSTISSET('savevalidator')) { // Test on permission done later
|
||||||
$date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
|
$date_debut = GETPOSTDATE('date_debut_', '00:00:00');
|
||||||
$date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
|
$date_fin = GETPOSTDATE('date_fin_', '00:00:00');
|
||||||
$date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1);
|
$date_debut_gmt = GETPOSTDATE('date_debut_', '00:00:00', 1);
|
||||||
$date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1);
|
$date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1);
|
||||||
$starthalfday = GETPOST('starthalfday');
|
$starthalfday = GETPOST('starthalfday');
|
||||||
$endhalfday = GETPOST('endhalfday');
|
$endhalfday = GETPOST('endhalfday');
|
||||||
$halfday = 0;
|
$halfday = 0;
|
||||||
@@ -1154,7 +1154,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
if (!GETPOST('date_debut_')) { // If visitor does not come from agenda
|
if (!GETPOST('date_debut_')) { // If visitor does not come from agenda
|
||||||
print $form->selectDate(-1, 'date_debut_', 0, 0, 0, '', 1, 1);
|
print $form->selectDate(-1, 'date_debut_', 0, 0, 0, '', 1, 1);
|
||||||
} else {
|
} else {
|
||||||
$tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month'), GETPOSTINT('date_debut_day'), GETPOSTINT('date_debut_year'));
|
$tmpdate = GETPOSTDATE('date_debut_', '00:00:00');
|
||||||
print $form->selectDate($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1);
|
print $form->selectDate($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1);
|
||||||
}
|
}
|
||||||
print ' ';
|
print ' ';
|
||||||
@@ -1171,7 +1171,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
if (!GETPOST('date_fin_')) {
|
if (!GETPOST('date_fin_')) {
|
||||||
print $form->selectDate(-1, 'date_fin_', 0, 0, 0, '', 1, 1);
|
print $form->selectDate(-1, 'date_fin_', 0, 0, 0, '', 1, 1);
|
||||||
} else {
|
} else {
|
||||||
$tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_fin_month'), GETPOSTINT('date_fin_day'), GETPOSTINT('date_fin_year'));
|
$tmpdate = GETPOSTDATE('date_fin_', '00:00:00');
|
||||||
print $form->selectDate($tmpdate, 'date_fin_', 0, 0, 0, '', 1, 1);
|
print $form->selectDate($tmpdate, 'date_fin_', 0, 0, 0, '', 1, 1);
|
||||||
}
|
}
|
||||||
print ' ';
|
print ' ';
|
||||||
@@ -1349,7 +1349,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
|
print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month'), GETPOSTINT('date_debut_day'), GETPOSTINT('date_debut_year'));
|
$tmpdate = GETPOSTDATE('date_debut_', '00:00:00');
|
||||||
print $form->selectDate($tmpdate ? $tmpdate : $object->date_debut, 'date_debut_');
|
print $form->selectDate($tmpdate ? $tmpdate : $object->date_debut, 'date_debut_');
|
||||||
print ' ';
|
print ' ';
|
||||||
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ? GETPOST('starthalfday') : $starthalfday));
|
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ? GETPOST('starthalfday') : $starthalfday));
|
||||||
|
|||||||
Reference in New Issue
Block a user