2
0
forked from Wavyzz/dolibarr

Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/bom/tpl/objectline_create.tpl.php
	htdocs/compta/bank/releve.php
	htdocs/core/class/html.formsetup.class.php
	htdocs/takepos/freezone.php
This commit is contained in:
Laurent Destailleur
2024-03-22 02:35:37 +01:00
13 changed files with 56 additions and 36 deletions

View File

@@ -27,6 +27,9 @@ class FormSetup
*/
public $db;
/** @var int */
public $entity;
/** @var FormSetupItem[] */
public $items = array();
@@ -92,7 +95,8 @@ class FormSetup
*/
public function __construct($db, $outputLangs = null)
{
global $langs;
global $conf, $langs;
$this->db = $db;
$this->form = new Form($this->db);
@@ -101,6 +105,8 @@ class FormSetup
$this->formHiddenInputs['token'] = newToken();
$this->formHiddenInputs['action'] = 'update';
$this->entity = (is_null($this->entity) ? $conf->entity : $this->entity);
if ($outputLangs) {
$this->langs = $outputLangs;
} else {
@@ -461,6 +467,8 @@ class FormSetup
{
$item = new FormSetupItem($confKey);
$item->entity = $this->entity;
// set item rank if not defined as last item
if (empty($item->rank)) {
$item->rank = $this->getCurentItemMaxRank() + 1;
@@ -657,7 +665,7 @@ class FormSetupItem
/**
* Constructor
*
* @param string $confKey the conf key used in database
* @param string $confKey the conf key used in database
*/
public function __construct($confKey)
{
@@ -671,7 +679,7 @@ class FormSetupItem
}
$this->langs = $langs;
$this->entity = $conf->entity;
$this->entity = (is_null($this->entity) ? $conf->entity : ((int) $this->entity));
$this->confKey = $confKey;
$this->loadValueFromConf();
@@ -1184,7 +1192,7 @@ class FormSetupItem
$out .= $this->generateOutputFieldColor();
} elseif ($this->type == 'yesno') {
if (!empty($conf->use_javascript_ajax)) {
$out .= ajax_constantonoff($this->confKey);
$out .= ajax_constantonoff($this->confKey, array(), $this->entity); // TODO possibility to add $input parameter
} else {
if ($this->fieldValue == 1) {
$out .= $langs->trans('yes');