Fix socpeople assigned list in action com list
This commit is contained in:
parent
617d10bf2a
commit
b5d348356d
@ -524,6 +524,7 @@ if ($resql)
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||||
$caction=new CActionComm($db);
|
$caction=new CActionComm($db);
|
||||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
|
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
|
||||||
|
$contactListCache = array();
|
||||||
|
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
@ -634,7 +635,34 @@ if ($resql)
|
|||||||
// Contact
|
// Contact
|
||||||
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
||||||
print '<td>';
|
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->id=$obj->fk_contact;
|
||||||
$contactstatic->email=$obj->email;
|
$contactstatic->email=$obj->email;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user