Infolog: Skip all user accounts for importing mail -> infolog entry, contacts only

This commit is contained in:
nathan 2024-06-25 15:50:27 -06:00
parent 02e35d609f
commit 1cdd0ac383

View File

@ -1472,16 +1472,22 @@ class infolog_bo
} }
else else
{ {
// Remove all accounts
$contacts = array_filter($contacts, function ($v)
{
return empty($v['account_id']);
});
// create the first address as info_contact // create the first address as info_contact
$contact = array_shift($contacts); if(count($contacts) > 0)
$info['info_contact'] = 'addressbook:'.$contact['id']; {
$contact = array_shift($contacts);
$info['info_contact'] = 'addressbook:' . $contact['id'];
}
// create the rest as "ordinary" links, skipping accounts // create the rest as "ordinary" links, skipping accounts
foreach ($contacts as $contact) foreach ($contacts as $contact)
{ {
if(empty($contact['account_id'])) Link::link('infolog', $info['link_to']['to_id'], 'addressbook', $contact['id']);
{
Link::link('infolog', $info['link_to']['to_id'], 'addressbook', $contact['id']);
}
} }
} }
if (is_array($_attachments)) if (is_array($_attachments))