FIX wrong socpeople id when multiple assigned + avoid php warnings (#35878)

This commit is contained in:
Regis Houssin
2025-10-22 02:29:05 +02:00
committed by GitHub
parent c04359f995
commit d37cf4b38a
3 changed files with 12 additions and 12 deletions

View File

@@ -432,7 +432,7 @@ if ($usergroup > 0) {
$sql .= " DISTINCT";
}
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location, a.entity,";
$sql .= " a.fk_user_author, a.fk_user_action,";
$sql .= " a.fk_contact, a.note, a.percent as percent,";
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";

View File

@@ -2255,10 +2255,10 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style1 .= 'peruser_busy ';
}
foreach ($cases1[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style1 = 'onclickopenref peruser_busy';
}
if ($ev['css']) {
if (!empty($ev['css'])) {
$style1 .= ' '.$ev['css'];
}
}
@@ -2275,10 +2275,10 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style2 .= 'peruser_busy ';
}
foreach ($cases2[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style2 = 'onclickopenref peruser_busy';
}
if ($ev['css']) {
if (!empty($ev['css'])) {
$style2 .= ' '.$ev['css'];
}
}
@@ -2295,10 +2295,10 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style3 .= 'peruser_busy ';
}
foreach ($cases3[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style3 = 'onclickopenref peruser_busy';
}
if ($ev['css']) {
if (!empty($ev['css'])) {
$style3 .= ' '.$ev['css'];
}
}
@@ -2315,10 +2315,10 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style4 .= 'peruser_busy ';
}
foreach ($cases4[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style4 = 'onclickopenref peruser_busy';
}
if ($ev['css']) {
if (!empty($ev['css'])) {
$style4 .= ' '.$ev['css'];
}
}

View File

@@ -15079,12 +15079,12 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null,
if (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
$contactList = '';
foreach ($histo[$key]['socpeopleassigned'] as $cid => $Tab) {
if (empty($conf->cache['contact'][$histo[$key]['contact_id']])) {
if (empty($conf->cache['contact'][$cid])) {
$contact = new Contact($db);
$contact->fetch($cid);
$conf->cache['contact'][$histo[$key]['contact_id']] = $contact;
$conf->cache['contact'][$cid] = $contact;
} else {
$contact = $conf->cache['contact'][$histo[$key]['contact_id']];
$contact = $conf->cache['contact'][$cid];
}
if ($contact) {