From c4fbd9157e9d1f9601a0809f08c4b030435c613e Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Fri, 30 Aug 2024 10:17:19 +0200 Subject: [PATCH] #299 [Map] fix: empty projects on pwa view --- view/map.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/map.php b/view/map.php index 918f6e1..2cfecbc 100644 --- a/view/map.php +++ b/view/map.php @@ -245,7 +245,7 @@ $objectLinked = array_shift($projects); } - if ((!empty($fromId) && $objectLinked->entity != $conf->entity) || ($source == 'pwa' && empty($objectLinked->opp_status)) || empty($objectLinked)) { + if ((!empty($fromId) && $objectLinked->entity != $conf->entity) || ($source == 'pwa' && empty($objectLinked->opp_status) && empty($objectLinked->fk_opp_status)) || empty($objectLinked)) { continue; } @@ -254,7 +254,7 @@ $objectLinkedInfo .= '' . $langs->transnoentities('Project') . ' : ' . $objectLinked->getNomUrl(1, '', 0, '', ' - ', 1) . '
'; $objectLinkedInfo .= '' . $langs->transnoentities('ProjectLabel') . ' : ' . $objectLinked->title . '
'; $objectLinkedInfo .= '' . $langs->transnoentities('Description') . ' : ' . $objectLinked->description . '
'; - $code = dol_getIdFromCode($db, $objectLinked->opp_status, 'c_lead_status', 'rowid', 'code'); + $code = dol_getIdFromCode($db, $objectLinked->opp_status > 0 ? $objectLinked->opp_status : $objectLinked->fk_opp_status , 'c_lead_status', 'rowid', 'code'); if ($code) { $objectLinkedInfo .= '' . $langs->transnoentities('OpportunityStatus') . ' : ' . $langs->trans('OppStatus' . $code) . '
'; }