mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
NEW Can set parameters with setup type yesno.
This commit is contained in:
@@ -673,6 +673,7 @@ class FormSetupItem
|
||||
*/
|
||||
public $cssClass = '';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -904,7 +905,11 @@ class FormSetupItem
|
||||
$out .= $this->generateInputFieldColor();
|
||||
} elseif ($this->type == 'yesno') {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out .= ajax_constantonoff($this->confKey);
|
||||
$input = $this->fieldParams['input'] ?? array();
|
||||
$revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0;
|
||||
$forcereload = $this->fieldParams['forcereload'] ? 1 : 0;
|
||||
|
||||
$out .= ajax_constantonoff($this->confKey, $input, $this->entity, $revertonoff, 0, $forcereload);
|
||||
} else {
|
||||
$out .= $this->form->selectyesno($this->confKey, $this->fieldValue, 1);
|
||||
}
|
||||
@@ -1218,7 +1223,10 @@ class FormSetupItem
|
||||
$out .= $this->generateOutputFieldColor();
|
||||
} elseif ($this->type == 'yesno') {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out .= ajax_constantonoff($this->confKey, array(), $this->entity); // TODO possibility to add $input parameter
|
||||
$revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0;
|
||||
$forcereload = $this->fieldParams['forcereload'] ? 1 : 0;
|
||||
|
||||
$out .= ajax_constantonoff($this->confKey, array(), $this->entity, $revertonoff, 0, $forcereload);
|
||||
} else {
|
||||
if ($this->fieldValue == 1) {
|
||||
$out .= $langs->trans('yes');
|
||||
|
||||
@@ -12450,6 +12450,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
* ],
|
||||
* ]
|
||||
* // phpcs:enable
|
||||
* Example: array('attr' => array('class' => 'reposition'))
|
||||
* @return string html button
|
||||
*/
|
||||
function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array())
|
||||
|
||||
Reference in New Issue
Block a user