diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 75b4e9fafba..13eefc2f78a 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -18696,12 +18696,6 @@ parameters: count: 4 path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php - - message: '#^Variable \$text might not be defined\.$#' identifier: variable.undefined @@ -18768,12 +18762,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: '#^Variable \$from might not be defined\.$#' identifier: variable.undefined @@ -21546,6 +21534,12 @@ parameters: count: 1 path: ../../htdocs/ftp/index.php + - + message: '#^If condition is always false\.$#' + identifier: if.alwaysFalse + count: 1 + path: ../../htdocs/holiday/card.php + - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -27714,12 +27708,6 @@ parameters: count: 1 path: ../../htdocs/projet/admin/project.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/projet/admin/website.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d70f3f1e187..38f173c0a35 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3649,7 +3649,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') * @param int $month Month (1 to 12) * @param int $day Day (1 to 31) * @param int $year Year - * @param int|string $gm True or 1 or 'gmt'=Input information are GMT values + * @param bool|int|string $gm True or 1 or 'gmt'=Input information are GMT values * False or 0 or 'tzserver' = local to server TZ * 'auto' * 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented. diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 8a19e1a3a5e..29595dc17a2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -85,11 +85,11 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +$canread = 0; if (($id > 0) || $ref) { $object->fetch($id, $ref); // Check current user can read this leave request - $canread = 0; if ($user->hasRight('holiday', 'readall')) { $canread = 1; } @@ -542,6 +542,9 @@ if (empty($reshook)) { } elseif ($object->halfday == 0 || $object->halfday == 2) { $starthalfdaykey = "Morning"; $endhalfdaykey = "Afternoon"; + } else { + $starthalfdaykey = ""; + $endhalfdaykey = ""; } $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; @@ -1650,9 +1653,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print '
'; print ''; // ancre - $includedocgeneration = 0; - // Documents + /* $includedocgeneration = 0; if ($includedocgeneration) { $objref = dol_sanitizeFileName($object->ref); $relativepath = $objref.'/'.$objref.'.pdf'; @@ -1661,7 +1663,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $genallowed = ($user->hasRight('holiday', 'read') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'readall'); // If you can read, you can build the PDF to read content $delallowed = ($user->hasRight('holiday', 'write') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'writeall_advance'); // If you can create/edit, you can remove a file on card print $formfile->showdocuments('holiday:Holiday', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); - } + } */ // Show links to link elements //$tmparray = $form->showLinkToObjectBlock($object, null, array('myobject'), 1);