Calendar: Fix missing owner resource icons on initial load

This commit is contained in:
nathan 2023-03-24 13:15:23 -06:00
parent 0de4ad22c2
commit c9c98969b4
2 changed files with 7 additions and 5 deletions

View File

@ -326,10 +326,10 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
case 'c':
case '':
// check if link-search already returned either icon or (l|f)name and only if not, query contact again
if (!(isset($value['icon']) || isset($value['lname']) && isset($value['fname'])) &&
($contact = $contacts_obj->read($type === '' ? 'account:'.$id : $id, true)))
if(!(isset($value['icon']) || isset($value['lname']) && isset($value['fname'])) &&
($contact = $contacts_obj->read($type === '' ? 'account:' . $id : $data['res_id'], true)))
{
if (Api\Contacts::hasPhoto($contact))
if(Api\Contacts::hasPhoto($contact))
{
$value['icon'] = Api\Framework::link('/api/avatar.php', array(
'contact_id' => $contact['id'],
@ -344,7 +344,7 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
}
if($id < 0)
{
$value['resources'] = array_map('strval',$GLOBALS['egw']->accounts->members($id, true));
$value['resources'] = array_map('strval', $GLOBALS['egw']->accounts->members($id, true));
}
break;
default :

View File

@ -16,6 +16,8 @@ use EGroupware\Api\Egw;
use EGroupware\Api\Etemplate;
use EGroupware\Api\Framework;
require_once("class.calendar_owner_etemplate_widget.inc.php");
/**
* Shared base-class of all calendar UserInterface classes
*