2
0
forked from Wavyzz/dolibarr

fix phpstan

This commit is contained in:
Frédéric France
2024-12-03 21:30:01 +01:00
parent 64fd4d7f66
commit b2c3ec675b
3 changed files with 13 additions and 23 deletions

View File

@@ -18696,12 +18696,6 @@ parameters:
count: 4 count: 4
path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php 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\.$#' message: '#^Variable \$text might not be defined\.$#'
identifier: variable.undefined identifier: variable.undefined
@@ -18768,12 +18762,6 @@ parameters:
count: 1 count: 1
path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php 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\.$#' message: '#^Variable \$from might not be defined\.$#'
identifier: variable.undefined identifier: variable.undefined
@@ -21546,6 +21534,12 @@ 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: 1
path: ../../htdocs/holiday/card.php
- -
message: '#^If condition is always false\.$#' message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse identifier: if.alwaysFalse
@@ -27714,12 +27708,6 @@ parameters:
count: 1 count: 1
path: ../../htdocs/projet/admin/project.php 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\.$#' message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType identifier: function.alreadyNarrowedType

View File

@@ -3649,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 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 * 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.

View File

@@ -85,11 +85,11 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
$canread = 0;
if (($id > 0) || $ref) { if (($id > 0) || $ref) {
$object->fetch($id, $ref); $object->fetch($id, $ref);
// Check current user can read this leave request // Check current user can read this leave request
$canread = 0;
if ($user->hasRight('holiday', 'readall')) { if ($user->hasRight('holiday', 'readall')) {
$canread = 1; $canread = 1;
} }
@@ -542,6 +542,9 @@ if (empty($reshook)) {
} elseif ($object->halfday == 0 || $object->halfday == 2) { } elseif ($object->halfday == 0 || $object->halfday == 2) {
$starthalfdaykey = "Morning"; $starthalfdaykey = "Morning";
$endhalfdaykey = "Afternoon"; $endhalfdaykey = "Afternoon";
} else {
$starthalfdaykey = "";
$endhalfdaykey = "";
} }
$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
@@ -1650,9 +1653,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print '<div class="fichecenter"><div class="fichehalfleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre print '<a name="builddoc"></a>'; // ancre
$includedocgeneration = 0;
// Documents // Documents
/* $includedocgeneration = 0;
if ($includedocgeneration) { if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref); $objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref.'/'.$objref.'.pdf'; $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 $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 $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); 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 // Show links to link elements
//$tmparray = $form->showLinkToObjectBlock($object, null, array('myobject'), 1); //$tmparray = $form->showLinkToObjectBlock($object, null, array('myobject'), 1);