Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Dec 3, 2024
1 parent 64fd4d7 commit b2c3ec6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
24 changes: 6 additions & 18 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 6 additions & 4 deletions htdocs/holiday/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
// 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;
}
Expand Down Expand Up @@ -542,6 +542,9 @@
} elseif ($object->halfday == 0 || $object->halfday == 2) {
$starthalfdaykey = "Morning";
$endhalfdaykey = "Afternoon";
} else {
$starthalfdaykey = "";
$endhalfdaykey = "";
}

$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
Expand Down Expand Up @@ -1650,9 +1653,8 @@
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre

$includedocgeneration = 0;

// Documents
/* $includedocgeneration = 0;
if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref.'/'.$objref.'.pdf';
Expand All @@ -1661,7 +1663,7 @@
$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);
Expand Down

0 comments on commit b2c3ec6

Please sign in to comment.