From 9ddb8a5b0b47c7d7057ad4074f553cfa86d047ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Jul 2019 14:41:29 +0200 Subject: [PATCH] Fix tooltip to say closed project are not visibles --- htdocs/core/class/html.formprojet.class.php | 8 ++++---- htdocs/expensereport/card.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index b4c0c4295c9..057f977fadb 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -60,7 +60,7 @@ class FormProjets * @param int $maxlength Maximum length of label * @param int $option_only Return only html options lines without the select tag * @param int $show_empty Add an empty line - * @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable) + * @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable). Use a negative value to not show the "discarded" tooltip. * @param int $forcefocus Force focus on field (works with javascript only) * @param int $disabled Disabled * @param int $mode 0 for HTML mode and 1 for JSON mode @@ -100,13 +100,13 @@ class FormProjets } else { - $out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss); + $out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss); } - if ($discard_closed) + if ($discard_closed > 0) { if (class_exists('Form')) { - if (empty($form)) $form=new Form($this->db); + if (! is_object($form)) $form=new Form($this->db); $out.=$form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden")); } } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 94754a71c7f..58273a67ebe 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2441,7 +2441,7 @@ else print ''; print ''; print ''.$langs->trans('Date').''; - if (! empty($conf->projet->enabled)) print ''.$langs->trans('Project').''; + if (! empty($conf->projet->enabled)) print ''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print ''.$langs->trans('CarCategory').''; print ''.$langs->trans('Type').''; print ''.$langs->trans('Description').''; @@ -2469,7 +2469,7 @@ else if (! empty($conf->projet->enabled)) { print ''; - $formproject->select_projects(-1, $fk_projet, 'fk_projet', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + $formproject->select_projects(-1, $fk_projet, 'fk_projet', 0, 0, 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; }