Ejemplo n.º 1
0
}
foreach ($imageless as $typeName => &$ids) {
    if ($typeName === CCrmOwnerType::ContactName) {
        $dbRes = CCrmContact::GetListEx(array(), array('@ID' => $ids), false, false, array('ID', 'PHOTO'));
        while ($contact = $dbRes->Fetch()) {
            $key = "CONTACT_{$contact['ID']}";
            if (isset($items[$key])) {
                $items[$key]['IMAGE_URL'] = CCrmMobileHelper::PrepareContactImageUrl($contact, array('WIDTH' => 40, 'HEIGHT' => 40));
            }
        }
    } elseif ($typeName === CCrmOwnerType::CompanyName) {
        $dbRes = CCrmCompany::GetListEx(array(), array('@ID' => $ids), false, false, array('ID', 'LOGO'));
        while ($company = $dbRes->Fetch()) {
            $key = "COMPANY_{$company['ID']}";
            if (isset($items[$key])) {
                $items[$key]['IMAGE_URL'] = CCrmMobileHelper::PrepareCompanyImageUrl($company, array('WIDTH' => 40, 'HEIGHT' => 40));
            }
        }
    } elseif ($typeName === CCrmOwnerType::LeadName) {
        foreach ($ids as $id) {
            $key = "LEAD_{$id}";
            if (isset($items[$key])) {
                $items[$key]['IMAGE_URL'] = CCrmMobileHelper::GetLeadListImageStub();
            }
        }
    }
}
unset($ids);
unset($imageless);
$arResult['ITEMS'] = array_values($items);
unset($items);