diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 627f1b8c0e7..f860242ff8c 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7693,8 +7693,11 @@ abstract class CommonObject
}
}
} elseif ($type == 'link') {
- $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'
- $param_list_array = explode(':', $param_list[0]);
+ // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'
+ // Filter can contains some ':' inside.
+ $param_list = array_keys($param['options']);
+ $param_list_array = explode(':', $param_list[0], 4);
+
$showempty = (($required && $default != '') ? 0 : 1);
if (!preg_match('/search_/', $keyprefix)) {
@@ -7711,8 +7714,8 @@ abstract class CommonObject
}
}
- //$out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '');
- $out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $this->element.':'.$key.$keysuffix);
+ $objectfield = $this->element.($this->module ? '@'.$this->module : '').':'.$key.$keysuffix;
+ $out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield);
if (!empty($param_list_array[2])) { // If the entry into $fields is set, we must add a create button
if ((!GETPOSTISSET('backtopage') || strpos(GETPOST('backtopage'), $_SERVER['PHP_SELF']) === 0) // // To avoid to open several times the 'Plus' button (we accept only one level)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index eff88cf20c4..628e389548d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8011,7 +8011,7 @@ class Form
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @param int $disabled 1=Html component is disabled
* @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 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
+ * @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
* @return string Return HTML string
* @see selectForFormsList(), select_thirdparty_list()
*/
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index f021e7ee9c7..615125ec3e6 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php';
+
/**
* Class to manage Trips and Expenses
*/
@@ -2792,8 +2793,8 @@ class ExpenseReport extends CommonObject
if ($selected >= 0) {
$return .= '';
}
- if (property_exists($this, 'fk_user_author') && !empty($this->id)) {
- $return .= '
'.$this->fk_user_author.'';
+ if (array_key_exists('userauthor', $arraydata)) {
+ $return .= '
'.$arraydata['userauthor']->getNomUrl(-1).'';
}
if (property_exists($this, 'date_debut') && property_exists($this, 'date_fin')) {
$return .= '
'.dol_print_date($this->date_debut, 'day').'';
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index e5ff9a080a6..0d371731c90 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -276,7 +276,7 @@ if ($id > 0) {
$sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
$sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,";
-$sql .= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo";
+$sql .= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut as user_status, u.photo";
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
@@ -768,6 +768,16 @@ if ($resql) {
$expensereportstatic->date_approve = $db->jdate($obj->date_approve);
$expensereportstatic->note_private = $obj->note_private;
$expensereportstatic->note_public = $obj->note_public;
+ $expensereportstatic->fk_user = $obj->id_user;
+
+ $usertmp->id = $obj->id_user;
+ $usertmp->lastname = $obj->lastname;
+ $usertmp->firstname = $obj->firstname;
+ $usertmp->login = $obj->login;
+ $usertmp->statut = $obj->user_status;
+ $usertmp->status = $obj->user_status;
+ $usertmp->photo = $obj->photo;
+ $usertmp->email = $obj->email;
if ($mode == 'kanban') {
if ($i == 0) {
@@ -781,7 +791,7 @@ if ($resql) {
if ($massactionbutton || $massaction) {
$selected = 0;
- print $expensereportstatic->getKanbanView('', array('userauthor' => $usertmp->getNomUrl(1), 'selected' => in_array($expensereportstatic->id, $arrayofselected)));
+ print $expensereportstatic->getKanbanView('', array('userauthor' => $usertmp, 'selected' => in_array($expensereportstatic->id, $arrayofselected)));
}
if ($i == ($imaxinloop - 1)) {
print '';
@@ -840,13 +850,6 @@ if ($resql) {
// User
if (!empty($arrayfields['user']['checked'])) {
print '