From b027ca38378f7d8f2232bb4ba9e4e435bbe1b936 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jan 2024 12:28:28 +0100 Subject: [PATCH 1/6] Fix bad email tested --- htdocs/admin/mails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 8e30f2f0844..f8044a98fc9 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')) { From 3ed18dc92c3943d56598abb735af61ba469f71ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 5 Jan 2024 15:47:24 +0100 Subject: [PATCH 2/6] fix create invoice from contract with free service line --- htdocs/compta/facture/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3a2d80e8709..404e9afa3da 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1723,7 +1723,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) + $product_type = $lines[$i]->product_type ?? ($lines[$i]->type ?? 0); // Date start $date_start = false; From 045b42d3b8896e5eab1dc3a105ee5688ed9bcda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 5 Jan 2024 16:08:14 +0100 Subject: [PATCH 3/6] Update card.php --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 404e9afa3da..3d8015110c3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1723,8 +1723,8 @@ if (empty($reshook)) { } } else { // Positive line - // we keep first type from product if exist, otherwise we keep type from line (free line) - $product_type = $lines[$i]->product_type ?? ($lines[$i]->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; From c6c40e4c4a5b40b7aa172bb520957af836470361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jan 2024 13:01:58 +0100 Subject: [PATCH 4/6] Fix css --- htdocs/core/menus/standard/eldy_menu.php | 2 -- 1 file changed, 2 deletions(-) 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']; From 5d2c32e4d5d1b1a3c290098df2c41e5fdc809b3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jan 2024 16:11:04 +0100 Subject: [PATCH 5/6] Debug v19 --- htdocs/core/class/commonobject.class.php | 11 +++++++---- htdocs/core/class/html.form.class.php | 2 +- htdocs/expensereport/list.php | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) 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/list.php b/htdocs/expensereport/list.php index e5ff9a080a6..465ae4b02a5 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -979,7 +979,7 @@ if ($resql) { $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } // Show total line From 76ee9e506d708e4b33334362e6e77b33486fcdcf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jan 2024 16:11:04 +0100 Subject: [PATCH 6/6] Debug v19 --- htdocs/core/class/commonobject.class.php | 11 +++++---- htdocs/core/class/html.form.class.php | 2 +- .../class/expensereport.class.php | 5 ++-- htdocs/expensereport/list.php | 23 +++++++++++-------- htdocs/hrm/class/position.class.php | 2 +- .../class/recruitmentcandidature.class.php | 17 +++++++++++--- .../class/recruitmentjobposition.class.php | 12 ++++------ 7 files changed, 44 insertions(+), 28 deletions(-) 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 ''; - $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 a1bd5183cae..ab6db1911f2 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 0fc4e0d6bf2..d632c7d30f3 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 77454f09ce3..feb94f13bd9 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 .= '
'; }