Fix label of button

This commit is contained in:
Laurent Destailleur 2026-02-26 14:42:38 +01:00
parent 0b920df95a
commit 5879acbedf

View file

@ -66,6 +66,11 @@ class FormSetup
*/
public $htmlOutputMoreButton = '';
/**
* Html string of button label
* @var string
*/
public $htmlButtonLabel = 'Save';
/**
* @var array<string,string>
@ -191,10 +196,14 @@ class FormSetup
} elseif ($editMode) {
$out .= '<div class="form-setup-button-container center">'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes
$out .= $this->htmlOutputMoreButton;
$out .= '<input class="button button-save reposition" type="submit" value="' . $this->langs->trans("Save") . '">'; // Todo fix dolibarr style for <button and use <button instead of input
/*$out .= ' &nbsp;&nbsp; ';
$out .= '<a class="button button-cancel" type="submit" href="' . $this->formAttributes['action'] . '">'.$this->langs->trans('Cancel').'</a>';
*/
if ($editMode !== 3) {
$out .= '<input class="button button-save reposition" type="submit" value="' . $this->langs->trans($this->htmlButtonLabel ?: "Save") . '" name="save">'; // Todo fix dolibarr style for <button and use <button instead of input
}
if ($editMode === 2) {
// Add also a cancel button
$out .= ' &nbsp;&nbsp; ';
$out .= '<input class="button button-cancel" type="submit" value="' . $this->langs->trans('Cancel') . '" name="cancel">';
}
$out .= '</div>';
}
@ -1665,7 +1674,7 @@ class FormSetupItem
/**
* Set type of input as a simple title. No data to store
* Set type of input as a multiselect list.
*
* @param array<string,string|array{id:string,label:string,color:string,picto:string,labelhtml:string}> $fieldOptions A table of field options
* @return self
@ -1681,7 +1690,7 @@ class FormSetupItem
}
/**
* Set type of input as a simple title. No data to store
* Set type of input as a select list.
*
* @param ?array<string,string|array{id:string,label:string,color:string,picto:string,labelhtml:string}> $fieldOptions A table of field options
* @return self
@ -1698,7 +1707,7 @@ class FormSetupItem
/**
* Set type of input as a simple title. No data to store
* Set type of input as a radio button.
*
* @param ?array<string,string|array{id:string,label:string,picto?:string,labelIsHtml?:bool}> $fieldOptions A table of field options
* @return self
@ -1714,7 +1723,7 @@ class FormSetupItem
}
/**
* Set type of input as a simple title. No data to store
* Set type of input as a selection of a user from dolibarr users list
*
* @return self
*/
@ -1725,7 +1734,7 @@ class FormSetupItem
}
/**
* Set type of input as a simple title. No data to store
* Set type of input as a bank account selection from dolibarr bank accounts list
*
* @return self
*/