2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2024-04-27 17:01:53 +02:00
parent c656df9d35
commit f533fccc5f
2 changed files with 6 additions and 7 deletions

View File

@@ -8089,7 +8089,7 @@ class Form
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @param int<0,1> $disabled 1=Html component is disabled * @param int<0,1> $disabled 1=Html component is disabled
* @param string $selected_input_value Value of preselected input text (for use with ajax) * @param string $selected_input_value Value of preselected input text (for use with ajax)
* @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' (old syntax 'Module_Object:xxx') or 'Object:options_xxx' or 'Object@module:options_xxx' (old syntax 'Module_Object:options_xxx') * @param string $objectfield Object:Field that contains the definition of parent (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' (old syntax 'Module_Object:xxx') or 'Object:options_xxx' or 'Object@module:options_xxx' (old syntax 'Module_Object:options_xxx')
* @return string Return HTML string * @return string Return HTML string
* @see selectForFormsList(), select_thirdparty_list() * @see selectForFormsList(), select_thirdparty_list()
*/ */
@@ -8105,11 +8105,11 @@ class Form
$sortfield = ''; // Ensure filter has value (for static analysis) $sortfield = ''; // Ensure filter has value (for static analysis)
if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield
// Example: $objectfield = 'product:options_package' // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
$tmparray = explode(':', $objectfield); $tmparray = explode(':', $objectfield);
$objectdesc = ''; $objectdesc = '';
// Load object according to $id and $element // Get instance of object from $element
$objectforfieldstmp = fetchObjectByElement(0, strtolower($tmparray[0])); $objectforfieldstmp = fetchObjectByElement(0, strtolower($tmparray[0]));
$reg = array(); $reg = array();
@@ -8128,7 +8128,7 @@ class Form
} else { } else {
// For a property in ->fields // For a property in ->fields
if (array_key_exists($tmparray[1], $objectforfieldstmp->fields)) { if (array_key_exists($tmparray[1], $objectforfieldstmp->fields)) {
$objectdesc = $objectforfieldstmp->fields[$tmparray[1]]['type']; $objectdesc = $objectforfieldstmp->fields[$tmparray[1]]['type']; // should be integer:ObjectClass...
$objectdesc = preg_replace('/^integer[^:]*:/', '', $objectdesc); $objectdesc = preg_replace('/^integer[^:]*:/', '', $objectdesc);
} }
} }

View File

@@ -12254,10 +12254,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
/** /**
* Get an array with properties of an element. * Get an array with properties of an element.
* *
* @param string $elementType Element type (Value of $object->element). Example: * @param string $elementType Element type (Value of $object->element or value of $object->element@$object->module). Example:
* 'action', 'facture', 'project', 'project_task' or * 'action', 'facture', 'project', 'project_task' or
* 'myobject@mymodule' or * 'myobject@mymodule' (or old syntax 'mymodule_myobject' like 'project_task')
* 'myobject_mysubobject' (where mymodule = myobject, like 'project_task')
* @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>) * @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>)
* @see fetchObjectByElement(), getMultiDirOutput() * @see fetchObjectByElement(), getMultiDirOutput()
*/ */