From a2cb9eaaeb7f82f9fc190d25d39d87cf32081ae6 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 19 Dec 2024 15:39:14 +0100 Subject: [PATCH 1/8] WIP : add inputs.php file --- .../tools/ui/class/documentation.class.php | 9 ++ htdocs/admin/tools/ui/components/inputs.php | 127 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 htdocs/admin/tools/ui/components/inputs.php diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index 584f6c36a7f..71ae17b9061 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -145,6 +145,15 @@ class Documentation 'DocSetEventMessageContextualVariations' => '#seteventmessagesection-contextvariations', ) ), + 'Inputs' => array( + 'url' => dol_buildpath($baseUrl.'/components/inputs.php', 1), + 'icon' => 'fas fa-comments pictofixedwidth', + 'submenu' => array(), + 'summary' => array( + 'DocBasicUsage' => '#seteventmessagesection-basicusage', + 'DocSetEventMessageContextualVariations' => '#seteventmessagesection-contextvariations', + ) + ), ), 'summary' => array( 'keySum' => '#keySum' diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php new file mode 100644 index 00000000000..806dfddaeae --- /dev/null +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -0,0 +1,127 @@ + + * + * This program and files/directory inner it is free software: you can + * redistribute it and/or modify it under the terms of the + * GNU Affero General Public License (AGPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AGPL for more details. + * + * You should have received a copy of the GNU AGPL + * along with this program. If not, see . + */ + +$res=0; +if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; +endif; +if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; +endif; +if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; +endif; + + +// Protection if external user +if ($user->socid > 0) : accessforbidden(); +endif; + +// Includes +dol_include_once('admin/tools/ui/class/documentation.class.php'); + +// Load documentation translations +$langs->load('uxdocumentation'); + +$action = GETPOST('action', 'alpha'); + +//if ($action == 'displayeventmessage') { +// setEventMessages($langs->trans('DocSetEventMessageUnique'), null); +//} elseif ($action == 'displayeventmessages') { +// $messageArray = [$langs->trans('DocSetEventMessage', '1'), +// $langs->trans('DocSetEventMessage', '2'), +// $langs->trans('DocSetEventMessage', '3')]; +// setEventMessages(null, $messageArray); +//} elseif ($action == 'displayeventmessageok') { +// setEventMessages($langs->trans('DocSetEventMessageOK'), null); +//} elseif ($action == 'displayeventmessagewarning') { +// setEventMessages($langs->trans('DocSetEventMessageWarning'), null, 'warnings'); +//} elseif ($action == 'displayeventmessageerror') { +// setEventMessages($langs->trans('DocSetEventMessageError'), null, 'errors'); +//} + +// +$documentation = new Documentation($db); + +// Output html head + body - Param is Title +$documentation->docHeader('Inputs'); + +// Set view for menu and breadcrumb +// Menu must be set in constructor of documentation class +$documentation->view = array('Components','Inputs'); + +// Output sidebar +$documentation->showSidebar(); ?> + +
+ + showBreadCrumb(); ?> + +
+ +

trans('DocInputsTitle'); ?>

+

trans('DocInputsMainDescription'); ?>

+ + + showSummary(); ?> + + +
+

trans('DocBasicUsage'); ?>

+

trans('DocinputsDescription'); ?>

+
+ Available Input + +

+ Disabled Input + +
+ Input label', + '', + '', + 'Disabled Input', + '', + ); + echo $documentation->showCode($lines); ?> + + +
+

trans('DocBasicUsage'); ?>

+

trans('DocinputsDescription'); ?>

+
+ Available Input + + Disabled Input + +
+ Input label', + '', + ); + echo $documentation->showCode($lines); ?> + +
+ +
+ +docFooter(); + +?> From 41fae65ec85761fde5d9e9ee01f349fef8a7c86f Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 10 Jan 2025 11:10:46 +0100 Subject: [PATCH 2/8] Wip --- htdocs/admin/tools/ui/components/inputs.php | 130 +++++++++++++++++--- htdocs/product/card.php | 2 +- htdocs/societe/card.php | 2 +- 3 files changed, 115 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php index 806dfddaeae..0c452fe583f 100644 --- a/htdocs/admin/tools/ui/components/inputs.php +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -91,35 +91,131 @@ $documentation->showSidebar(); ?>
Input label', + 'Available Input', '', '', 'Disabled Input', '', ); echo $documentation->showCode($lines); ?> +
- -
-

trans('DocBasicUsage'); ?>

-

trans('DocinputsDescription'); ?>

-
- Available Input - - Disabled Input - -
+ + +
+

trans('DocSelectInputUsage'); ?>

+

trans('DocinputsDescription'); ?>

+
+ Select with empty value Input label', - '', - ); - echo $documentation->showCode($lines); ?> - + $values = ['1' => 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectarray('htmlnameselectwithemptyvalue', $values, 'idselectwithemptyvalue', 1, 0, 0, '', 0, 0, 0, '', 'minwidth200'); + ?> +

+ Select within empty value + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectarray('htmlnameselectwithinemptyvalue', $values, 'idnameselectwithinemptyvalue', 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'); + ?> +
+ value) or array(key=>array(\'label\'=>..., \'data-...\'=>..., \'disabled\'=>..., \'css\'=>...)),', + ' * @param string|string[]|int $id Preselected key or array of preselected keys for multiselect. Use \'ifone\' to autoselect record if there is only one record.,', + ' * @param int<0,1>|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is \'\' or " ", If \'Placeholder string\': key is -1 and value is the string), <0 to add an empty value with key that is this value.,', + ' * @param int<0,1> $key_in_label 1 to show key into label with format "[key] value",', + ' * @param int<0,1> $value_as_key 1 to use value as key,', + ' * @param string $moreparam Add more parameters onto the select tag. For example "style=\"width: 95%\"" to avoid select2 component to go over parent container,', + ' * @param int<0,1> $translate 1=Translate and encode value,', + ' * @param int $maxlen Length maximum for labels,', + ' * @param int<0,1> $disabled Html select box is disabled,', + ' * @param string $sort \'ASC\' or \'DESC\' = Sort on label, \'\' or \'NONE\' or \'POS\' = Do not sort, we keep original order,', + ' * @param string $morecss Add more class to css styles,', + ' * @param int $addjscombo Add js combo,', + ' * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set,', + ' * @param int $disablebademail 1=Check if a not valid email, 2=Check string \'---\', and if found into value, disable and colorize entry,', + ' * @param int $nohtmlescape No html escaping (not recommended, use \'data-html\' if you need to use label with HTML content).,', + ' * @return string HTML select string.,', + ' */', + '', + 'Select with empty value', + 'print $form->selectarray(\'htmlnameselectwithemptyvalue\', $values, \'idselectwithemptyvalue\', 1, 0, 0, \'\', 0, 0, 0, \'\', \'minwidth200\');', + '', + 'Select within empty value', + 'print $form->selectarray(\'htmlnameselectwithinemptyvalue\', $values, \'idnameselectwithinemptyvalue\', 0,0, 0, \'\', 0, 0, 0, \'\', \'minwidth200\');', + + ); + echo $documentation->showCode($lines); ?> +
+ + +
+

trans('DocCheckboxInputUsage'); ?>

+

trans('DocCheckboxInputDescription'); ?>

+
+ + + +

+ + + +
+ ', + '', + '', + ' ', + '', + '', + '', + ); + echo $documentation->showCode($lines); ?> +
+ + + +
+'; + docFooter(); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 38976910f29..8c83332f1be 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1526,7 +1526,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // SellBy / EatBy mandatory list if (!empty($sellOrEatByMandatoryList)) { print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).''; - print $form->selectarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, GETPOSTINT('sell_or_eat_by_mandatory')); + print $form->selecarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, GETPOSTINT('sell_or_eat_by_mandatory')); print ''; } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 9e149817d83..cfe9e887fc7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1496,7 +1496,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { - print ''; + print ''; } if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) From 40c63c1178138b14319a3a3877e70aaba9d6d218 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 10 Jan 2025 13:46:50 +0100 Subject: [PATCH 3/8] Add multiselect, wysiwyg and radio button --- htdocs/admin/tools/ui/components/inputs.php | 91 ++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php index 0c452fe583f..6f962fd461c 100644 --- a/htdocs/admin/tools/ui/components/inputs.php +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -32,6 +32,7 @@ endif; // Includes dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; // Load documentation translations $langs->load('uxdocumentation'); @@ -155,7 +156,7 @@ $documentation->showSidebar(); ?> echo $documentation->showCode($lines); ?> - +

trans('DocCheckboxInputUsage'); ?>

trans('DocCheckboxInputDescription'); ?>

@@ -181,9 +182,97 @@ $documentation->showSidebar(); ?> echo $documentation->showCode($lines); ?>
+ +
+

trans('DocCheckboxInputUsage'); ?>

+

trans('DocCheckboxInputDescription'); ?>

+
+
+ showCode($lines); ?> +
+ +
+

trans('DocMultiSelectInputUsage'); ?>

+

trans('DocMultiSelectInputDescription'); ?>

+
+ Multiselect + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->multiselectarray('categories', $values, GETPOST('categories', 'array'), 0, 0, 'minwidth200', 0, 0); + ?> +
+ $array Array(key=>value) or Array(key=>array(\'id\'=>key, \'label\'=>value, \'color\'=> , \'picto\'=> , \'labelhtml\'=> ))', + ' * @param string[] $selected Array of keys preselected', + ' * @param int<0,1> $key_in_label 1 to show key like in "[key] value"', + ' * @param int<0,1> $value_as_key 1 to use value as key', + ' * @param string $morecss Add more css style', + ' * @param int<0,1> $translate Translate and encode value', + ' * @param int|string $width Force width of select box. May be used only when using jquery couch. Example: 250, \'95%\'', + ' * @param string $moreattrib Add more options on select component. Example: \'disabled\'', + ' * @param string $elemtype Type of element we show (\'category\', ...). Will execute a formatting function on it. To use in readonly mode if js component support HTML formatting.', + ' * @param string $placeholder String to use as placeholder', + ' * @param int<-1,1> $addjscombo Add js combo', + ' * @return string HTML multiselect string', + ' * @see selectarray(), selectArrayAjax(), selectArrayFilter()', + ' */', + '', + 'Multiselect', + 'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);' + ); + echo $documentation->showCode($lines); ?> +
+ +
+

trans('DocEditorInputUsage'); ?>

+

trans('DocEditorInputDescription'); ?>

+
+ Create(); + ?> +
+ $readonly 0=Read/Edit, 1=Read only', + ' * @param array{x?:string,y?:string,find?:string} $poscursor Array for initial cursor position array(\'x\'=>x, \'y\'=>y).', + ' * array(\'find\'=> \'word\') can be used to go to line were the word has been found', + ' */', + '', + '$doleditor = new DolEditor(\'desc\', GETPOST(\'desc\', \'restricthtml\'), \'\', 160, \'dolibarr_details\', \'\', false, true, getDolGlobalString(\'FCKEDITOR_ENABLE_DETAILS\'), ROWS_4, \'90%\');', + 'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);' + ); + echo $documentation->showCode($lines); ?> +
From c0d39e08ae1abdd5eb076887a829fddda8df9a9c Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 13 Feb 2025 15:49:32 +0100 Subject: [PATCH 4/8] Add element and reorganize --- .../tools/ui/class/documentation.class.php | 4 +- htdocs/admin/tools/ui/components/inputs.php | 191 +++++++++--------- htdocs/langs/en_US/uxdocumentation.lang | 10 + 3 files changed, 105 insertions(+), 100 deletions(-) diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index 71ae17b9061..4f598b32c17 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -150,8 +150,8 @@ class Documentation 'icon' => 'fas fa-comments pictofixedwidth', 'submenu' => array(), 'summary' => array( - 'DocBasicUsage' => '#seteventmessagesection-basicusage', - 'DocSetEventMessageContextualVariations' => '#seteventmessagesection-contextvariations', + 'DocBasicUsage' => '#setinputssection-basicusage', + 'DocHelperFunctionsInputUsage' => '#setinputssection-helperfunctions', ) ), ), diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php index 6f962fd461c..36ffde765e8 100644 --- a/htdocs/admin/tools/ui/components/inputs.php +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -39,21 +39,6 @@ $langs->load('uxdocumentation'); $action = GETPOST('action', 'alpha'); -//if ($action == 'displayeventmessage') { -// setEventMessages($langs->trans('DocSetEventMessageUnique'), null); -//} elseif ($action == 'displayeventmessages') { -// $messageArray = [$langs->trans('DocSetEventMessage', '1'), -// $langs->trans('DocSetEventMessage', '2'), -// $langs->trans('DocSetEventMessage', '3')]; -// setEventMessages(null, $messageArray); -//} elseif ($action == 'displayeventmessageok') { -// setEventMessages($langs->trans('DocSetEventMessageOK'), null); -//} elseif ($action == 'displayeventmessagewarning') { -// setEventMessages($langs->trans('DocSetEventMessageWarning'), null, 'warnings'); -//} elseif ($action == 'displayeventmessageerror') { -// setEventMessages($langs->trans('DocSetEventMessageError'), null, 'errors'); -//} - // $documentation = new Documentation($db); @@ -82,7 +67,8 @@ $documentation->showSidebar(); ?>

trans('DocBasicUsage'); ?>

-

trans('DocinputsDescription'); ?>

+ +

trans('DocClassicInputsDescription'); ?>

Available Input @@ -99,13 +85,38 @@ $documentation->showSidebar(); ?> '', ); echo $documentation->showCode($lines); ?> + + +

trans('DocCheckboxInputsDescription'); ?>

+
+ + + +
+ ', + '', + '', + ); + echo $documentation->showCode($lines); ?> + + +

trans('DocRadioInputsDescription'); ?>

+
+ Radio Input +
+ Radio Input' + ); + echo $documentation->showCode($lines); ?>
- - -
-

trans('DocSelectInputUsage'); ?>

-

trans('DocinputsDescription'); ?>

+ +
+

trans('DocHelperFunctionsInputUsage'); ?>

+

trans('DocSelectInputsDescription'); ?>

Select with empty value showSidebar(); ?> ); echo $documentation->showCode($lines); ?> -
- -
-

trans('DocCheckboxInputUsage'); ?>

-

trans('DocCheckboxInputDescription'); ?>

-
- - - -

- - - -
- ', - '', - '', - ' ', - '', - '', - '', - ); - echo $documentation->showCode($lines); ?> -
- - -
-

trans('DocCheckboxInputUsage'); ?>

-

trans('DocCheckboxInputDescription'); ?>

-
- -
- showCode($lines); ?> -
- - -
-

trans('DocMultiSelectInputUsage'); ?>

-

trans('DocMultiSelectInputDescription'); ?>

+ +

trans('DocMultiSelectInputsDescription'); ?>

Multiselect showSidebar(); ?> 'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);' ); echo $documentation->showCode($lines); ?> -
- -
-

trans('DocEditorInputUsage'); ?>

-

trans('DocEditorInputDescription'); ?>

+ +

trans('DocDateSelectInputsDescription'); ?>

+
+ Date Select + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectDate(); + ?> +

+ Date Select with hours + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectDate('', 're2', 1, 1, 1); + ?> +
+ $d 1=Show days, month, years,', + ' * @param int<0,2> $addnowlink Add a link "Now", 1 with server time, 2 with local computer time,', + ' * @param int<0,1> $disabled Disable input fields,', + ' * @param int|string $fullday When a checkbox with id #fullday is checked, hours are set with 00:00 (if value if \'fulldaystart\') or 23:59 (if value is \'fulldayend\'),', + ' * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.,', + ' * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array(\'adddateof\' => ..., \'labeladddateof\' => ...)),', + ' * @param string $openinghours Specify hour start and hour end for the select ex 8,20,', + ' * @param int $stepminutes Specify step for minutes between 1 and 30,', + ' * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array.,', + ' * @param string $placeholder Placeholder,', + ' * @param \'auto\'|\'gmt\'|\'tzserver\'|\'tzuserrel\' $gm \'auto\' (for backward compatibility, avoid this), \'gmt\' or \'tzserver\' or \'tzuserrel\',', + ' * @param string $calendarpicto URL of the icon/image used to display the calendar,', + ' * @return string Html for selectDate,', + ' * @see form_date(), select_month(), select_year(), select_dayofweek(),', + ' */', + '', + 'Date Select', + 'print $form->selectDate();', + '', + 'Date Select with hours', + 'print $form->selectDate(\'\', \'re2\', 1, 1, 1);' + ); + echo $documentation->showCode($lines); ?> + + + +

trans('DocEditorInputsDescription'); ?>

showSidebar(); ?>
-'; - docFooter(); diff --git a/htdocs/langs/en_US/uxdocumentation.lang b/htdocs/langs/en_US/uxdocumentation.lang index 56d3c587185..0830a54d06e 100644 --- a/htdocs/langs/en_US/uxdocumentation.lang +++ b/htdocs/langs/en_US/uxdocumentation.lang @@ -79,3 +79,13 @@ DocSetEventMessage = Message #%s DocButtonIconsLowEmphasis = Low emphasis icon buttons DocButtonIconsDescriptionLowEmphasis = An icon button with low emphasis is typically a button that includes only an icon (no accompanying text) and has minimal styling to make it unobtrusive. Icon buttons with low emphasis are ideal for secondary or tertiary actions, like clear field, fill field, bookmarking, or sharing, especially in interfaces that have more prominent primary actions (like "Submit" or "Continue"). DocButtonIconsForTitle = Buttons for list title + +#Input +DocClassicInputsDescription = Classic input to enter string values, integer values... +DocCheckboxInputsDescription = Checkbox input to enter boolean values +DocRadioInputsDescription = Radio input to enter boolean values +DocHelperFunctionsInputUsage = Helper functions usage +DocSelectInputsDescription = Select input to enter one value +DocMultiSelectInputsDescription = Multiselect input to enter several values +DocEditorInputsDescription = Editor input to enter text with HTML +DocDateSelectInputsDescription = Date input to enter a date with or without hours From 2fc61b5433acf3fbf6cef4b971564840dd661d67 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 13 Feb 2025 15:51:06 +0100 Subject: [PATCH 5/8] Add translation --- htdocs/langs/en_US/uxdocumentation.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/uxdocumentation.lang b/htdocs/langs/en_US/uxdocumentation.lang index 0830a54d06e..043cf3aaffc 100644 --- a/htdocs/langs/en_US/uxdocumentation.lang +++ b/htdocs/langs/en_US/uxdocumentation.lang @@ -89,3 +89,4 @@ DocSelectInputsDescription = Select input to enter one value DocMultiSelectInputsDescription = Multiselect input to enter several values DocEditorInputsDescription = Editor input to enter text with HTML DocDateSelectInputsDescription = Date input to enter a date with or without hours +DocInputsMainDescription = Documentation and exmeples for inputs From b661ea69d461df1fe83b869634d6abe3ce183dcd Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 13 Feb 2025 15:52:31 +0100 Subject: [PATCH 6/8] Fix translations --- htdocs/langs/en_US/uxdocumentation.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/uxdocumentation.lang b/htdocs/langs/en_US/uxdocumentation.lang index 043cf3aaffc..10d5944700f 100644 --- a/htdocs/langs/en_US/uxdocumentation.lang +++ b/htdocs/langs/en_US/uxdocumentation.lang @@ -89,4 +89,5 @@ DocSelectInputsDescription = Select input to enter one value DocMultiSelectInputsDescription = Multiselect input to enter several values DocEditorInputsDescription = Editor input to enter text with HTML DocDateSelectInputsDescription = Date input to enter a date with or without hours -DocInputsMainDescription = Documentation and exmeples for inputs +DocInputsMainDescription = Documentation and exemples for inputs +DocInputsTitle = Inputs From a675c3fcaf6bfd3d2ed31d5a05a08c58e47619ea Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 13 Feb 2025 16:01:39 +0100 Subject: [PATCH 7/8] Fix errors --- htdocs/product/card.php | 2 +- htdocs/societe/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5a5c53a8d07..f685f012a5b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1550,7 +1550,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // SellBy / EatBy mandatory list if (!empty($sellOrEatByMandatoryList)) { print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).''; - print $form->selecarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, GETPOSTINT('sell_or_eat_by_mandatory')); + print $form->selectarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, GETPOSTINT('sell_or_eat_by_mandatory')); print ''; } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6658b893a45..b2fee95952e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1497,7 +1497,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { - print ''; + print ''; } if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) From a58ab30e30f7d91bf00f374f392d979ff730ac43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2025 23:57:17 +0100 Subject: [PATCH 8/8] Update inputs.php --- htdocs/admin/tools/ui/components/inputs.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php index 36ffde765e8..3f8c7edda78 100644 --- a/htdocs/admin/tools/ui/components/inputs.php +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -17,14 +17,15 @@ * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; -if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../../main.inc.php'; +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user if ($user->socid > 0) : accessforbidden();