From 7dd95914e801bfa8d3eff13eb4d728b277d3348d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 May 2025 00:02:59 +0200 Subject: [PATCH] Clean code --- htdocs/core/class/html.form.class.php | 27 +++++++++++++++++---- htdocs/core/lib/functions.lib.php | 29 +++++++++++++++++------ htdocs/core/tpl/objectline_create.tpl.php | 8 +++---- htdocs/main.inc.php | 3 ++- htdocs/societe/card.php | 6 +++-- 5 files changed, 55 insertions(+), 18 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5414bf897d9..fa9900f93b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9498,6 +9498,8 @@ class Form } } + $out .= ''; + // We need a hidden field because when using the multiselect, if we unselect all, there is no // variable submitted at all, so no way to make a difference between variable not submitted and variable // submitted to nothing. @@ -9544,21 +9546,35 @@ class Form } $out .= '' . "\n"; + // Add js code to add the edit button and go back + if (getDolGlobalString('CATEGORY_EDIT_IN_POPUP_NOT_IN_MENU')) { + $jsonclose = 'doJsCodeAfterPopupClose'.$htmlname.'()'; + $s = dolButtonToOpenUrlInDialogPopup($htmlname, $langs->transnoentitiesnoconv("Tags"), img_picto('', 'add', 'class="editfielda"'), '/categories/categorie_list.php?type='.Categorie::TYPE_CUSTOMER, '', '', '', $jsonclose); + $out .= $s; + $out .=''; + } + + $out .= ''; + // Add code for jquery to use multiselect if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { $out .= "\n" . ''; $out .= "\n" . '