forked from Wavyzz/dolibarr
Merge pull request #11522 from atm-john/9.0_fix_action_list_contact_assigned
FIX: socpeople assigned list in action com list
This commit is contained in:
@@ -524,6 +524,7 @@ if ($resql)
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
$caction=new CActionComm($db);
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
|
||||
$contactListCache = array();
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
@@ -634,7 +635,34 @@ if ($resql)
|
||||
// Contact
|
||||
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->fk_contact > 0)
|
||||
|
||||
|
||||
$actionstatic->fetchResources();
|
||||
if(!empty($actionstatic->socpeopleassigned))
|
||||
{
|
||||
$contactList = array();
|
||||
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
|
||||
{
|
||||
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
||||
{
|
||||
// if no cache found we fetch it
|
||||
$contact = new Contact($db);
|
||||
if($contact->fetch($socpeopleassigned['id'])>0)
|
||||
{
|
||||
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1,'',28);
|
||||
$contactList[] = $contact->getNomUrl(1,'',28);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// use cache
|
||||
$contactList[] = $contactListCache[$socpeopleassigned['id']];
|
||||
}
|
||||
}
|
||||
if(!empty($contactList)){
|
||||
print implode(', ', $contactList);
|
||||
}
|
||||
}
|
||||
elseif ($obj->fk_contact > 0) //keep for retrocompatibility with faraway event
|
||||
{
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
$contactstatic->email=$obj->email;
|
||||
|
||||
Reference in New Issue
Block a user