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