This commit is contained in:
Laurent Destailleur 2022-07-24 22:13:36 +02:00
parent 40d31d9b8b
commit f024dcdb1a
2 changed files with 15 additions and 3 deletions

View File

@ -6913,7 +6913,9 @@ abstract class CommonObject
if ((string) $keyb == '') {
continue;
}
if (strpos($valb, "|") !== false) list($valb, $parent) = explode('|', $valb);
if (strpos($valb, "|") !== false) {
list($valb, $parent) = explode('|', $valb);
}
$out .= '<option value="'.$keyb.'"';
$out .= (((string) $value == (string) $keyb) ? ' selected' : '');
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');

View File

@ -70,8 +70,18 @@ class MyObject extends CommonObject
/**
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'type' field format:
* 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',
* 'select' (list of values are in 'options'),
* 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]',
* 'chkbxlst:...',
* 'varchar(x)',
* 'text', 'text:none', 'html',
* 'double(24,8)', 'real', 'price',
* 'date', 'datetime', 'timestamp', 'duration',
* 'boolean', 'checkbox', 'radio', 'array',
* 'mail', 'phone', 'url', 'password', 'ip'
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'label' the translation key.
* 'picto' is code of a picto to show before value in forms
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...)