$arContact['PATH_TO_CONTACT_SHOW'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_SHOW'], array('contact_id' => $arContact['ID'])); $arContact['PATH_TO_CONTACT_EDIT'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_EDIT'], array('contact_id' => $arContact['ID'])); $arContact['PATH_TO_CONTACT_COPY'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_EDIT'], array('contact_id' => $arContact['ID'])), array('copy' => 1)); $arContact['PATH_TO_CONTACT_DELETE'] = CHTTP::urlAddParams($bInternal ? $APPLICATION->GetCurPage() : $arParams['PATH_TO_CONTACT_LIST'], array('action_' . $arResult['GRID_ID'] => 'delete', 'ID' => $arContact['ID'], 'sessid' => $arResult['SESSION_ID'])); $arContact['PATH_TO_USER_PROFILE'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER_PROFILE'], array('user_id' => $arContact['ASSIGNED_BY'])); $arContact['CONTACT_FORMATTED_NAME'] = CUser::FormatName(\Bitrix\Crm\Format\PersonNameFormatter::getFormat(), array('LOGIN' => '', 'NAME' => $arContact['NAME'], 'LAST_NAME' => $arContact['LAST_NAME'], 'SECOND_NAME' => $arContact['SECOND_NAME']), false, false); $typeID = isset($arContact['TYPE_ID']) ? $arContact['TYPE_ID'] : ''; $arContact['CONTACT_TYPE_NAME'] = isset($arResult['TYPE_LIST'][$typeID]) ? $arResult['TYPE_LIST'][$typeID] : $typeID; $arContact['PATH_TO_USER_CREATOR'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER_PROFILE'], array('user_id' => $arContact['CREATED_BY'])); $arContact['PATH_TO_USER_MODIFIER'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER_PROFILE'], array('user_id' => $arContact['MODIFY_BY'])); $arContact['CREATED_BY_FORMATTED_NAME'] = CUser::FormatName($arParams['NAME_TEMPLATE'], array('LOGIN' => $arContact['CREATED_BY_LOGIN'], 'NAME' => $arContact['CREATED_BY_NAME'], 'LAST_NAME' => $arContact['CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arContact['CREATED_BY_SECOND_NAME']), true, false); $arContact['MODIFY_BY_FORMATTED_NAME'] = CUser::FormatName($arParams['NAME_TEMPLATE'], array('LOGIN' => $arContact['MODIFY_BY_LOGIN'], 'NAME' => $arContact['MODIFY_BY_NAME'], 'LAST_NAME' => $arContact['MODIFY_BY_LAST_NAME'], 'SECOND_NAME' => $arContact['MODIFY_BY_SECOND_NAME']), true, false); if (isset($arContact['~ACTIVITY_TIME'])) { $time = MakeTimeStamp($arContact['~ACTIVITY_TIME']); $arContact['~ACTIVITY_EXPIRED'] = $time <= $now; $arContact['~ACTIVITY_IS_CURRENT_DAY'] = $arContact['~ACTIVITY_EXPIRED'] || CCrmActivity::IsCurrentDay($time); } if ($arResult['ENABLE_TASK']) { $arContact['PATH_TO_TASK_EDIT'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate(COption::GetOptionString('tasks', 'paths_task_user_edit', ''), array('task_id' => 0, 'user_id' => $userID)), array('UF_CRM_TASK' => 'C_' . $arContact['ID'], 'TITLE' => urlencode(GetMessage('CRM_TASK_TITLE_PREFIX')), 'TAGS' => urlencode(GetMessage('CRM_TASK_TAG')), 'back_url' => urlencode($arParams['PATH_TO_CONTACT_LIST']))); } if (IsModuleInstalled('sale')) { $arContact['PATH_TO_QUOTE_ADD'] = CHTTP::urlAddParams(CComponentEngine::makePathFromTemplate($arParams['PATH_TO_QUOTE_EDIT'], array('quote_id' => 0)), array('contact_id' => $arContact['ID'])); $arContact['PATH_TO_INVOICE_ADD'] = CHTTP::urlAddParams(CComponentEngine::makePathFromTemplate($arParams['PATH_TO_INVOICE_EDIT'], array('invoice_id' => 0)), array('contact' => $arContact['ID'])); } if ($arResult['ENABLE_BIZPROC']) { $arContact['BIZPROC_STATUS'] = ''; $arContact['BIZPROC_STATUS_HINT'] = ''; $arDocumentStates = CBPDocument::GetDocumentStates(array('crm', 'CCrmDocumentContact', 'CONTACT'), array('crm', 'CCrmDocumentContact', 'CONTACT_' . $arContact['ID'])); $arContact['PATH_TO_BIZPROC_LIST'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_SHOW'], array('contact_id' => $arContact['ID'])), array('CRM_CONTACT_SHOW_V12_active_tab' => 'tab_bizproc')); $totalTaskQty = 0; $docStatesQty = count($arDocumentStates);