Merge pull request #27527 from W1W1-M/fix-resource-phpstan

Fix resource phpstan
This commit is contained in:
Laurent Destailleur 2024-01-15 11:28:45 +01:00 committed by GitHub
commit 3a8b3f9158
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View file

@ -2425,7 +2425,7 @@ class Form
$events = array();
$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
$out .= $formresources->select_resource_list('', $htmlname, '', 1, 1, 0, $events, '', 2, null);
$out .= $formresources->select_resource_list(0, $htmlname, '', 1, 1, 0, $events, '', 2, null);
//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
$out .= '<br>';

View file

@ -32,7 +32,7 @@ $out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline
$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
$events = array();
$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
$out .= $formresources->select_resource_list('', 'fk_resource', '', 1, 1, 0, $events, '', 2, null);
$out .= $formresources->select_resource_list(0, 'fk_resource', '', 1, 1, 0, $events, '', 2, null);
$out .= '</div>';
$out .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block marginleftonly"><label for="resbusy">'.$langs->trans('Busy').'</label> ';

View file

@ -502,12 +502,12 @@ class Dolresource extends CommonObject
/**
* Load resource objects into $this->lines
*
* @param string $sortorder sort order
* @param string $sortfield sort field
* @param int $limit limit page
* @param int $offset page
* @param array $filter filter output
* @return int Return integer <0 if KO, Number of lines loaded if OK
* @param string $sortorder sort order
* @param string $sortfield sort field
* @param int $limit limit page
* @param int $offset page
* @param array $filter filter output
* @return int Return integer <0 if KO, Number of lines loaded if OK
*/
public function fetchAll($sortorder, $sortfield, $limit, $offset, $filter = [])
{

View file

@ -65,21 +65,21 @@ class FormResource
/**
* Output html form to select a resource
*
* @param int $selected Preselected resource id
* @param string $htmlname Name of field in form
* @param string $filter Optional filters criteras (example: 's.rowid <> x')
* @param int $selected Preselected resource id
* @param string $htmlname Name of field in form
* @param array $filter Optional filters criteria (example: 's.rowid <> x')
* @param int $showempty Add an empty field
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $showtype Show third party type in combo list (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param string $filterkey Filter on key value
* @param int $outputmode 0=HTML select string, 1=Array, 2=without form tag
* @param int $limit Limit number of answers
* @param string $morecss More css
* @param bool $multiple add [] in the name of element and add 'multiple' attribute
* @param bool $multiple add [] in the name of element and add 'multiple' attribute
* @return string|array HTML string with
*/
public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false)
public function select_resource_list($selected = 0, $htmlname = 'fk_resource', $filter = [], $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false)
{
// phpcs:enable
global $conf, $user, $langs;