Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-01-06 16:56:28 +01:00
10 changed files with 47 additions and 32 deletions

View File

@@ -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')) {

View File

@@ -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;

View File

@@ -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)

View File

@@ -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()
*/

View File

@@ -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 '<span class="paddingright"></span>'; // we also add class="paddingright". width similar to pictofixedwidth is managed by class=lilevel2
}
print $val2['titre'];

View File

@@ -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 .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
if (property_exists($this, 'fk_user_author') && !empty($this->id)) {
$return .= '<br><span class="info-box-label">'.$this->fk_user_author.'</span>';
if (array_key_exists('userauthor', $arraydata)) {
$return .= '<br><span class="info-box-label">'.$arraydata['userauthor']->getNomUrl(-1).'</span>';
}
if (property_exists($this, 'date_debut') && property_exists($this, 'date_fin')) {
$return .= '<br><span class="info-box-label">'.dol_print_date($this->date_debut, 'day').'</span>';

View File

@@ -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 '</div>';
@@ -840,13 +850,6 @@ if ($resql) {
// User
if (!empty($arrayfields['user']['checked'])) {
print '<td class="left">';
$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 '</td>';
if (!$i) {
@@ -979,7 +982,7 @@ if ($resql) {
$colspan++;
}
}
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
}
// Show total line

View File

@@ -1158,7 +1158,7 @@ class Position extends CommonObject
$return .= '<br><span class="info-box-label ">'.$arraydata['job'].'</span>';
}
if (property_exists($this, 'date_start') && property_exists($this, 'date_end')) {
$return .= '<br><div class ="margintoponly"><span class="info-box-label ">'.dol_print_date($this->db->jdate($this->date_start), 'day').'</span>';
$return .= '<br><div class ="nothing"><span class="info-box-label ">'.dol_print_date($this->db->jdate($this->date_start), 'day').'</span>';
$return .= ' - <span class="info-box-label ">'.dol_print_date($this->db->jdate($this->date_end), 'day').'</span></div>';
}
$return .= '</div>';

View File

@@ -1082,10 +1082,21 @@ class RecruitmentCandidature extends CommonObject
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
if (property_exists($this, 'fk_recruitmentjobposition')) {
$return .= '<br><span class="opacitymedium">'.$langs->trans('Job').'</span> : <span class="info-box-label">'.$this->fk_recruitmentjobposition.'</span>';
$return .= '<br>';
//$return .= '<span class="opacitymedium">';
//$return .= $langs->trans('Job').'</span> : ';
$return .= '<span class="info-box-label">';
$tmpjob = new RecruitmentJobPosition($this->db);
$tmpjob->fetch($this->fk_recruitmentjobposition);
//$return .= $this->fk_recruitmentjobposition;
$return .= $tmpjob->label;
$return .= '</span>';
}
if (property_exists($this, 'phone')) {
$return .= '<br><span class="opacitymedium">'.$langs->trans("phone").'</span> : <span class="info-box-label">'.$this->phone.'</span>';
if (property_exists($this, 'phone') && $this->phone) {
$return .= '<br><span class="info-box-label opacitymedium small">'.img_picto('', 'phone').' '.$this->phone.'</span>';
}
if (property_exists($this, 'email') && $this->email) {
$return .= '<br><span class="info-box-label opacitymedium small">'.img_picto('', 'email').' '.$this->email.'</span>';
}
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';

View File

@@ -1135,21 +1135,19 @@ class RecruitmentJobPosition extends CommonObject
$return .= img_picto('', $this->picto);
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).($this->qty > 1 ? ' <span title="'.$langs->trans("NbOfEmployeesExpected").'">('.$this->qty.')</span>' : '').'</span>';
if ($selected >= 0) {
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
/*
if (property_exists($this, 'date_planned')) {
$return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->date_planned), 'day').'</span>';
}
if (property_exists($this, 'qty')) {
$return .= '<br><span class="opacitymedium" title="'.$langs->trans("NbOfEmployeesExpected").'">'.$langs->trans("NbOfEmployeesExpected", '', '', '', '', 2).'</span> : <span class="info-box-label">'.$this->qty.'</span>';
}
}*/
if (property_exists($this, 'remuneration_suggested')) {
$return .= ' | <span class="opacitymedium">'.$langs->trans("Remuneration").'</span> : <span class="info-box-label">'.$this->remuneration_suggested.'</span>';
$return .= '<br><span class="opacitymedium">'.$langs->trans("Remuneration").'</span> : <span class="info-box-label">'.$this->remuneration_suggested.'</span>';
}
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).' | <span class="opacitymedium" title="'.$langs->trans("RecruitmentCandidatures").'">'.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).'</span> : <span>';
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).' &nbsp; <span class="opacitymedium" title="'.$langs->trans("RecruitmentCandidatures").'">'.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).'</span> : <span>';
$return .= $arraydata['nbapplications'];
$return .= '</span></div>';
}