Better tooltips.

This commit is contained in:
ldestailleur
2025-05-10 16:29:32 +02:00
parent ac357c1059
commit 45d4e3faaa
4 changed files with 15 additions and 12 deletions

View File

@@ -67,20 +67,21 @@ $nbletter = GETPOSTINT('ACCOUNTING_LETTERING_NBLETTERS');
$formSetup = new FormSetup($db);
// Main options
$formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')
->setAsYesNo();
$formSetup->newItem('ACCOUNTANCY_COMBO_FOR_AUX')
->setAsYesNo();
$formSetup->newItem('ACCOUNTING_MANAGE_ZERO')
->setAsYesNo();
$formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
$formSetup->newItem('ACCOUNTANCY_COMBO_FOR_AUX')->setAsYesNo();
$item = $formSetup->newItem('ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
$item->helpText = $langs->trans('ACCOUNTING_MANAGE_ZERO2');
$item->fieldParams['helpText'] = 'noclick';
if (!getDolGlobalInt('ACCOUNTING_MANAGE_ZERO')) {
$item = $formSetup->newItem('ACCOUNTING_LENGTH_GACCOUNT')
->setAsString();
$item = $formSetup->newItem('ACCOUNTING_LENGTH_GACCOUNT')->setAsString();
$item->fieldAttr['type'] = 'number';
$item->fieldAttr['class'] = 'maxwidth50 right';
$item = $formSetup->newItem('ACCOUNTING_LENGTH_AACCOUNT')
->setAsString();
$item = $formSetup->newItem('ACCOUNTING_LENGTH_AACCOUNT')->setAsString();
$item->fieldAttr['type'] = 'number';
$item->fieldAttr['class'] = 'maxwidth50 right';
}

View File

@@ -332,7 +332,7 @@ class FormSetup
$out .= '<td class="col-setup-title'.(!empty($item->fieldParams['isMandatory']) ? ' fieldrequired' : '').'">';
$out .= '<span id="helplink'.$item->confKey.'" class="spanforparamtooltip">';
$out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, 'tootips'.$item->confKey);
$out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, empty($item->fieldParams['helpText']) ? 'tootips'.$item->confKey : ($item->fieldParams['helpText'] != 'noclick' ? $item->fieldParams['helpText'] : ''));
$out .= '</span>';
$out .= '</td>';

View File

@@ -161,7 +161,8 @@ ACCOUNTING_LENGTH_DESCRIPTION=Truncate product & services description in listing
ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Truncate product & services account description form in listings after x chars (Best = 50)
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts (If you set value to 6 here, the account '706' will appear like '706000' on screen)
ACCOUNTING_LENGTH_AACCOUNT=Length of the third-party accounting accounts (If you set value to 6 here, the account '401' will appear like '401000' on screen)
ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zeros at the end of an accounting account. Needed by some countries (like Switzerland). If set to off (default), you can set the following two parameters to ask the application to add virtual zeros.
ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zeros at the end of an accounting account instead of a fixed length account.
ACCOUNTING_MANAGE_ZERO2=Needed by some countries (like Switzerland). If kept to off (default), you can set the following two parameters to ask the application to add virtual zeros.
ACCOUNTING_BANK_CONCILIATED=Transfer into accounting only the lines reconciliated in bank statements (by default, could be unchecked on each transfer)
BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account
ACCOUNTANCY_ER_DATE_RECORD=Use the end date of the period of an expense report as the date for the transfer to accounting, instead of the date of the expense

View File

@@ -120,6 +120,7 @@ $item->cssClass = 'minwidth500';
$item = $formSetup->newItem('MYMODULE_MYPARAM2');
$item->defaultFieldValue = 'default value';
$item->fieldAttr['placeholder'] = 'A placeholder here';
$item->helpText = 'Tooltip text';
// Setup conf for selection of a simple textarea input but we replace the text of field title
$item = $formSetup->newItem('MYMODULE_MYPARAM3');