diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index f8ef63364eb..7468b2a0d0e 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -1033,7 +1033,7 @@ if ($action == 'edit') { } } // Test SPF default automatic email from - $defaultnoreplyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); + $defaultnoreplyemail = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); if ($defaultnoreplyemail != $companyemail) { // We show if email differs $dnsinfo = false; if (!empty($defaultnoreplyemail) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1de033d1579..03813d40245 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1724,7 +1724,8 @@ if (empty($reshook)) { } } else { // Positive line - $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); + // we keep first type from product if exist, otherwise we keep type from line (free line) and at last default Product + $product_type = $lines[$i]->product_type ?? ($lines[$i]->type ?? Product::TYPE_PRODUCT); // Date start $date_start = false; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7693a8fa680..82e1a062af6 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 9d8d5697a62..2b57fd6e26f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8017,7 +8017,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/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index bba4ff62515..50d1086104e 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -319,8 +319,6 @@ class MenuManager // Add font-awesome (if $val2['level'] == 0, we are on level2 if ($val2['level'] == 0 && !empty($val2['prefix'])) { print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright" - } else { - print ''; // we also add class="paddingright". width similar to pictofixedwidth is managed by class=lilevel2 } print $val2['titre']; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 18dbe67591d..231e7774e2a 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 ''; - $usertmp->id = $obj->id_user; - $usertmp->lastname = $obj->lastname; - $usertmp->firstname = $obj->firstname; - $usertmp->login = $obj->login; - $usertmp->statut = $obj->statut; - $usertmp->photo = $obj->photo; - $usertmp->email = $obj->email; print $usertmp->getNomUrl(-1); print ''; if (!$i) { @@ -979,7 +982,7 @@ if ($resql) { $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } // Show total line diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index e8978b9b8cd..57a267c5264 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -1158,7 +1158,7 @@ class Position extends CommonObject $return .= '
'.$arraydata['job'].''; } if (property_exists($this, 'date_start') && property_exists($this, 'date_end')) { - $return .= '
'.dol_print_date($this->db->jdate($this->date_start), 'day').''; + $return .= '
'.dol_print_date($this->db->jdate($this->date_start), 'day').''; $return .= ' - '.dol_print_date($this->db->jdate($this->date_end), 'day').'
'; } $return .= '
'; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index ec80627738a..cd3f4446ba8 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -1082,10 +1082,21 @@ class RecruitmentCandidature extends CommonObject $return .= ''; } if (property_exists($this, 'fk_recruitmentjobposition')) { - $return .= '
'.$langs->trans('Job').' : '.$this->fk_recruitmentjobposition.''; + $return .= '
'; + //$return .= ''; + //$return .= $langs->trans('Job').' : '; + $return .= ''; + $tmpjob = new RecruitmentJobPosition($this->db); + $tmpjob->fetch($this->fk_recruitmentjobposition); + //$return .= $this->fk_recruitmentjobposition; + $return .= $tmpjob->label; + $return .= ''; } - if (property_exists($this, 'phone')) { - $return .= '
'.$langs->trans("phone").' : '.$this->phone.''; + if (property_exists($this, 'phone') && $this->phone) { + $return .= '
'.img_picto('', 'phone').' '.$this->phone.''; + } + if (property_exists($this, 'email') && $this->email) { + $return .= '
'.img_picto('', 'email').' '.$this->email.''; } if (method_exists($this, 'getLibStatut')) { $return .= '
'.$this->getLibStatut(3).'
'; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index c5e85e3d41c..dba9c86ef5f 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1135,21 +1135,19 @@ class RecruitmentJobPosition extends CommonObject $return .= img_picto('', $this->picto); $return .= ''; $return .= '
'; - $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).''; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).($this->qty > 1 ? ' ('.$this->qty.')' : '').''; if ($selected >= 0) { $return .= ''; } + /* if (property_exists($this, 'date_planned')) { $return .= '
'.$langs->trans("Date").' : '.dol_print_date($this->db->jdate($this->date_planned), 'day').''; - } - if (property_exists($this, 'qty')) { - $return .= '
'.$langs->trans("NbOfEmployeesExpected", '', '', '', '', 2).' : '.$this->qty.''; - } + }*/ if (property_exists($this, 'remuneration_suggested')) { - $return .= ' | '.$langs->trans("Remuneration").' : '.$this->remuneration_suggested.''; + $return .= '
'.$langs->trans("Remuneration").' : '.$this->remuneration_suggested.''; } if (method_exists($this, 'getLibStatut')) { - $return .= '
'.$this->getLibStatut(3).' | '.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).' : '; + $return .= '
'.$this->getLibStatut(3).'   '.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).' : '; $return .= $arraydata['nbapplications']; $return .= '
'; }