diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b39facd16a4..1f64741385f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1659,13 +1659,13 @@ abstract class CommonObject // phpcs:enable 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; } 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) { $idtofetch = $force_thirdparty_id; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c5c9f7164ec..ca5be02b1d9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4362,6 +4362,7 @@ class Form print ' selected'; } print '>'; + $value = ''; if ($format == 0) { $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 1) { @@ -9374,16 +9375,16 @@ class Form /** * Return select list of groups * - * @param string $selected Id group preselected - * @param string $htmlname Field name in form - * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * @param string $exclude Array list of groups id to exclude - * @param int $disabled If select list must be disabled - * @param string $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 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 string $morecss More css to add to html component + * @param string $selected Id group preselected + * @param string $htmlname Field name in form + * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @param string|array $exclude Array list of groups id to exclude + * @param int $disabled If select list must be disabled + * @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 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 string $morecss More css to add to html component * @return string * @see select_dolusers() */ diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ad6a6c12508..9d87b63cbb8 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -116,6 +116,7 @@ class FormMail extends Form * @var int|string|array */ public $withto; // Show recipient emails + public $withreplyto; /** * @var int|string 0 = Do not Show free text for recipient emails @@ -1672,6 +1673,8 @@ class FormMail extends Form /** * ModelMail + * + * Object of table llx_c_email_templates */ class ModelMail { @@ -1685,6 +1688,16 @@ class ModelMail */ public $label; + /** + * @var int Owner of email template + */ + public $fk_user; + + /** + * @var int Is template private + */ + public $private; + /** * @var string Model mail topic */ @@ -1702,4 +1715,9 @@ class ModelMail * @var string Module the template is dedicated for */ public $module; + + /** + * @var int Position of template in a combo list + */ + public $position; } diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 452d066886e..0a06730bbcb 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -847,6 +847,7 @@ class Notify $mimefilename_list[] = $ref.".pdf"; } + $message = ''; $message .= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message .= "\n"; $message .= $mesg; diff --git a/htdocs/core/class/utils_diff.class.php b/htdocs/core/class/utils_diff.class.php index e18418d78a6..9abc1d899fe 100644 --- a/htdocs/core/class/utils_diff.class.php +++ b/htdocs/core/class/utils_diff.class.php @@ -12,6 +12,7 @@ /** * 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 { @@ -236,7 +237,7 @@ class Diff * within 'span' elements, deletions are contained within 'del' elements, and * 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 '
' * @return string HTML string */ @@ -275,7 +276,7 @@ class Diff /** * 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 $separator the separator between lines; this optional parameter defaults to '
' * @return string HTML string @@ -287,7 +288,8 @@ class Diff // loop over the lines in the diff $index = 0; - while ($index < count($diff)) { + $nbdiff = count($diff); + while ($index < $nbdiff) { // determine the line type switch ($diff[$index][1]) { // 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 * 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 $separator the separator between lines * @param string $index the current index, passes by reference diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 476b1d5a4da..46b885bd60a 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -507,16 +507,16 @@ if ($mode == 'grid') { ); } } - // Add measure from extrafields - if ($object->isextrafieldmanaged) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - 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'))) { - $arrayofyaxis['te.'.$key] = array( - 'label' => $extrafields->attributes[$object->table_element]['label'][$key], - 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], - 'table' => $object->table_element - ); - } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + 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'))) { + $arrayofyaxis['te.'.$key] = array( + 'label' => $extrafields->attributes[$object->table_element]['label'][$key], + 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], + 'table' => $object->table_element + ); } } }