Fix scrutinizer

This commit is contained in:
Laurent Destailleur 2022-06-12 11:17:11 +02:00
parent a62b5a10fe
commit 559ec051ab
6 changed files with 48 additions and 26 deletions

View File

@ -1659,13 +1659,13 @@ abstract class CommonObject
// phpcs:enable // phpcs:enable
global $conf; global $conf;
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) { if (empty($this->socid) && empty($this->fk_soc) && empty($force_thirdparty_id)) {
return 0; return 0;
} }
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : $this->fk_thirdparty); $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : 0);
if ($force_thirdparty_id) { if ($force_thirdparty_id) {
$idtofetch = $force_thirdparty_id; $idtofetch = $force_thirdparty_id;
} }

View File

@ -4362,6 +4362,7 @@ class Form
print ' selected'; print ' selected';
} }
print '>'; print '>';
$value = '';
if ($format == 0) { if ($format == 0) {
$value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
} elseif ($format == 1) { } elseif ($format == 1) {
@ -9374,16 +9375,16 @@ class Form
/** /**
* Return select list of groups * Return select list of groups
* *
* @param string $selected Id group preselected * @param string $selected Id group preselected
* @param string $htmlname Field name in form * @param string $htmlname Field name in form
* @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @param string $exclude Array list of groups id to exclude * @param string|array $exclude Array list of groups id to exclude
* @param int $disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param string $include Array list of groups id to include * @param string|array $include Array list of groups id to include
* @param int $enableonly Array list of groups id to be enabled. All other must be disabled * @param int $enableonly Array list of groups id to be enabled. All other must be disabled
* @param string $force_entity '0' or Ids of environment to force * @param string $force_entity '0' or Ids of environment to force
* @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter)
* @param string $morecss More css to add to html component * @param string $morecss More css to add to html component
* @return string * @return string
* @see select_dolusers() * @see select_dolusers()
*/ */

View File

@ -116,6 +116,7 @@ class FormMail extends Form
* @var int|string|array * @var int|string|array
*/ */
public $withto; // Show recipient emails public $withto; // Show recipient emails
public $withreplyto;
/** /**
* @var int|string 0 = Do not Show free text for recipient emails * @var int|string 0 = Do not Show free text for recipient emails
@ -1672,6 +1673,8 @@ class FormMail extends Form
/** /**
* ModelMail * ModelMail
*
* Object of table llx_c_email_templates
*/ */
class ModelMail class ModelMail
{ {
@ -1685,6 +1688,16 @@ class ModelMail
*/ */
public $label; public $label;
/**
* @var int Owner of email template
*/
public $fk_user;
/**
* @var int Is template private
*/
public $private;
/** /**
* @var string Model mail topic * @var string Model mail topic
*/ */
@ -1702,4 +1715,9 @@ class ModelMail
* @var string Module the template is dedicated for * @var string Module the template is dedicated for
*/ */
public $module; public $module;
/**
* @var int Position of template in a combo list
*/
public $position;
} }

View File

@ -847,6 +847,7 @@ class Notify
$mimefilename_list[] = $ref.".pdf"; $mimefilename_list[] = $ref.".pdf";
} }
$message = '';
$message .= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message .= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
$message .= "\n"; $message .= "\n";
$message .= $mesg; $message .= $mesg;

View File

@ -12,6 +12,7 @@
/** /**
* A class containing functions for computing diffs and formatting the output. * A class containing functions for computing diffs and formatting the output.
* We can compare 2 strings or 2 files (as one string or line by line)
*/ */
class Diff class Diff
{ {
@ -236,7 +237,7 @@ class Diff
* within 'span' elements, deletions are contained within 'del' elements, and * within 'span' elements, deletions are contained within 'del' elements, and
* insertions are contained within 'ins' elements. The parameters are: * insertions are contained within 'ins' elements. The parameters are:
* *
* @param string $diff the diff array * @param array $diff the diff array
* @param string $separator the separator between lines; this optional parameter defaults to '<br>' * @param string $separator the separator between lines; this optional parameter defaults to '<br>'
* @return string HTML string * @return string HTML string
*/ */
@ -275,7 +276,7 @@ class Diff
/** /**
* Returns a diff as an HTML table. The parameters are: * Returns a diff as an HTML table. The parameters are:
* *
* @param string $diff the diff array * @param array $diff the diff array
* @param string $indentation indentation to add to every line of the generated HTML; this optional parameter defaults to '' * @param string $indentation indentation to add to every line of the generated HTML; this optional parameter defaults to ''
* @param string $separator the separator between lines; this optional parameter defaults to '<br>' * @param string $separator the separator between lines; this optional parameter defaults to '<br>'
* @return string HTML string * @return string HTML string
@ -287,7 +288,8 @@ class Diff
// loop over the lines in the diff // loop over the lines in the diff
$index = 0; $index = 0;
while ($index < count($diff)) { $nbdiff = count($diff);
while ($index < $nbdiff) {
// determine the line type // determine the line type
switch ($diff[$index][1]) { switch ($diff[$index][1]) {
// display the content on the left and right // display the content on the left and right
@ -365,7 +367,7 @@ class Diff
* Returns the content of the cell, for use in the toTable function. The * Returns the content of the cell, for use in the toTable function. The
* parameters are: * parameters are:
* *
* @param string $diff the diff array * @param array $diff the diff array
* @param string $indentation indentation to add to every line of the generated HTML * @param string $indentation indentation to add to every line of the generated HTML
* @param string $separator the separator between lines * @param string $separator the separator between lines
* @param string $index the current index, passes by reference * @param string $index the current index, passes by reference

View File

@ -507,16 +507,16 @@ if ($mode == 'grid') {
); );
} }
} }
// Add measure from extrafields }
if ($object->isextrafieldmanaged) { // Add measure from extrafields
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if ($object->isextrafieldmanaged) {
if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$arrayofyaxis['te.'.$key] = array( if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) {
'label' => $extrafields->attributes[$object->table_element]['label'][$key], $arrayofyaxis['te.'.$key] = array(
'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], 'label' => $extrafields->attributes[$object->table_element]['label'][$key],
'table' => $object->table_element 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key],
); 'table' => $object->table_element
} );
} }
} }
} }