diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 17b9583f36e..9ce79e02889 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -66,7 +66,8 @@ $nbletter = GETPOSTINT('ACCOUNTING_LETTERING_NBLETTERS'); $formSetup = new FormSetup($db); // Main options -$formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo(); +$item = $formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo(); +$item->fieldParams['tdOutputFieldClass'] = 'right'; // Auxiliary account select mode $arrval = array( @@ -79,20 +80,26 @@ $arrval = array( $item = $formSetup->newItem('ACCOUNTANCY_AUXACCOUNT_USE_SEARCH_TO_SELECT'); $item->setAsSelect($arrval); $item->helpText = $langs->trans('UseSearchToSelectAuxAccountTooltip'); +$item->cssClass = 'minwidth300 maxwidth400'; +$item->fieldParams['tdOutputFieldClass'] = 'right'; $item = $formSetup->newItem('ACCOUNTING_MANAGE_ZERO')->setAsYesNo(); $item->helpText = $langs->trans('ACCOUNTING_MANAGE_ZERO2'); $item->fieldParams['helpText'] = 'noclick'; +$item->fieldParams['forcereload'] = 1; +$item->fieldParams['tdOutputFieldClass'] = 'right'; if (!getDolGlobalInt('ACCOUNTING_MANAGE_ZERO')) { $item = $formSetup->newItem('ACCOUNTING_LENGTH_GACCOUNT')->setAsString(); $item->fieldAttr['type'] = 'number'; - $item->fieldAttr['class'] = 'maxwidth50 right'; + $item->fieldAttr['class'] = 'maxwidth50'; + $item->fieldParams['tdOutputFieldClass'] = 'right'; $item = $formSetup->newItem('ACCOUNTING_LENGTH_AACCOUNT')->setAsString(); $item->fieldAttr['type'] = 'number'; - $item->fieldAttr['class'] = 'maxwidth50 right'; + $item->fieldAttr['class'] = 'maxwidth50'; + $item->fieldParams['tdOutputFieldClass'] = 'right'; } // Parameters ACCOUNTING_* and others diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 7951bd8f4ef..ab801e87513 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2024-2025 MDW +/* Copyright (C) 2021 John BOTELLA + * Copyright (C) 2024-2025 MDW * Copyright (C) 2026 Frédéric France + * Copyright (C) 2026 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -337,12 +338,16 @@ class FormSetup $out = ''; if ($item->enabled == 1) { $trClass = 'oddeven'; + $tdOutputFieldClass = ''; if ($item->getType() == 'title') { $trClass = 'liste_titre'; } if (!empty($item->fieldParams['trClass'])) { $trClass .= ' '.$item->fieldParams['trClass']; } + if (!empty($item->fieldParams['tdOutputFieldClass'])) { + $tdOutputFieldClass .= ' class="'.$item->fieldParams['tdOutputFieldClass'].'"'; + } $this->setupNotEmpty++; $out .= ''; @@ -353,7 +358,7 @@ class FormSetup $out .= ''; $out .= ''; - $out .= ''; + $out .= ''; if ($editMode) { $out .= $item->generateInputField();