示例#1
0
         }
         $arContact['BIZPROC_STATUS'] = $taskQty > 0 ? 'attention' : 'inprogress';
         $arContact['BIZPROC_STATUS_HINT'] = '<div class=\'bizproc-item-title\'>' . htmlspecialcharsbx($docTemplateName !== '' ? $docTemplateName : GetMessage('CRM_BPLIST')) . ': <span class=\'bizproc-item-title bizproc-state-title\'><a href=\'' . $arContact['PATH_TO_BIZPROC_LIST'] . '\'>' . htmlspecialcharsbx($docTtl !== '' ? $docTtl : $docName) . '</a></span></div>';
     }
 } elseif ($docStatesQty > 1) {
     foreach ($arDocumentStates as &$arDocState) {
         $docTemplateID = $arDocState['TEMPLATE_ID'];
         $paramName = "BIZPROC_{$docTemplateID}";
         $docTtl = isset($arDocState['STATE_TITLE']) ? $arDocState['STATE_TITLE'] : '';
         if ($isInExportMode) {
             $arContact[$paramName] = $docTtl;
         } else {
             $arContact[$paramName] = '<a href="' . htmlspecialcharsbx($arContact['PATH_TO_BIZPROC_LIST']) . '">' . htmlspecialcharsbx($docTtl) . '</a>';
             $docID = $arDocState['ID'];
             //TODO: wait for bizproc bugs will be fixed and replace serial call of CCrmBizProcHelper::GetUserWorkflowTaskCount on single call
             $taskQty = CCrmBizProcHelper::GetUserWorkflowTaskCount(array($docID), $userID);
             if ($taskQty === 0) {
                 continue;
             }
             if ($arContact['BIZPROC_STATUS'] !== 'attention') {
                 $arContact['BIZPROC_STATUS'] = 'attention';
             }
             $totalTaskQty += $taskQty;
             if ($totalTaskQty > 5) {
                 break;
             }
         }
     }
     unset($arDocState);
     if (!$isInExportMode) {
         $arContact['BIZPROC_STATUS_HINT'] = '<span class=\'bizproc-item-title\'>' . GetMessage('CRM_BP_R_P') . ': <a href=\'' . $arContact['PATH_TO_BIZPROC_LIST'] . '\' title=\'' . GetMessage('CRM_BP_R_P_TITLE') . '\'>' . $docStatesQty . '</a></span>' . ($totalTaskQty === 0 ? '' : '<br /><span class=\'bizproc-item-title\'>' . GetMessage('CRM_TASKS') . ': <a href=\'' . $arContact['PATH_TO_USER_BP'] . '\' title=\'' . GetMessage('CRM_TASKS_TITLE') . '\'>' . $totalTaskQty . ($totalTaskQty > 5 ? '+' : '') . '</a></span>');