Пример #1
0
if ($isAdmin || !$userPermissions->HavePerm('COMPANY', BX_CRM_PERM_NONE, 'READ')) {
    $counter = new CCrmUserCounter(CCrmPerms::GetCurrentUserID(), CCrmUserCounter::CurrentCompanyActivies);
    $stdItems['COMPANY'] = array('ID' => 'COMPANY', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_COMPANY'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_COMPANY_TITLE'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_COMPANY_LIST']), 'ICON' => 'company', 'COUNTER' => $counter->GetValue($arResult['ACTIVE_ITEM_ID'] === 'COMPANY'), 'ACTIONS' => array(array('ID' => 'CREATE', 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_COMPANY_EDIT'], array('company_id' => 0)))));
}
if ($isAdmin || !$userPermissions->HavePerm('DEAL', BX_CRM_PERM_NONE, 'READ')) {
    $counter = new CCrmUserCounter(CCrmPerms::GetCurrentUserID(), CCrmUserCounter::CurrentDealActivies);
    $stdItems['DEAL'] = array('ID' => 'DEAL', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_DEAL'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_DEAL_TITLE'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_INDEX'] !== '' ? $arParams['PATH_TO_DEAL_INDEX'] : $arParams['PATH_TO_DEAL_LIST']), 'ICON' => 'deal', 'COUNTER' => $counter->GetValue($arResult['ACTIVE_ITEM_ID'] === 'DEAL'), 'ACTIONS' => array(array('ID' => 'CREATE', 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_EDIT'], array('deal_id' => 0)))));
}
if ($isAdmin || !$userPermissions->HavePerm('QUOTE', BX_CRM_PERM_NONE, 'READ')) {
    $counter = new CCrmUserCounter(CCrmPerms::GetCurrentUserID(), CCrmUserCounter::CurrentQuoteActivies);
    $stdItems['QUOTE'] = array('ID' => 'QUOTE', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_QUOTE'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_QUOTE_TITLE'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_QUOTE_LIST']), 'ICON' => 'quote', 'COUNTER' => $counter->GetValue($arResult['ACTIVE_ITEM_ID'] === 'QUOTE'), 'ACTIONS' => array(array('ID' => 'CREATE', 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_QUOTE_EDIT'], array('quote_id' => 0)))));
}
//if(IsModuleInstalled('sale'))
//{
if ($isAdmin || !$userPermissions->HavePerm('INVOICE', BX_CRM_PERM_NONE, 'READ')) {
    $counterValue = CCrmInvoice::GetCounterValue();
    $stdItems['INVOICE'] = array('ID' => 'INVOICE', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_INVOICE'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_INVOICE_TITLE'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_INVOICE_LIST']), 'ICON' => 'invoice', 'COUNTER' => $counterValue, 'ACTIONS' => array(array('ID' => 'CREATE', 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_INVOICE_EDIT'], array('invoice_id' => 0)))));
}
//}
if ($isAdmin || !$userPermissions->HavePerm('LEAD', BX_CRM_PERM_NONE, 'READ')) {
    $counter = new CCrmUserCounter(CCrmPerms::GetCurrentUserID(), CCrmUserCounter::CurrentLeadActivies);
    $stdItems['LEAD'] = array('ID' => 'LEAD', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_LEAD'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_LEAD_TITLE'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_LEAD_LIST']), 'ICON' => 'lead', 'COUNTER' => $counter->GetValue($arResult['ACTIVE_ITEM_ID'] === 'LEAD'), 'ACTIONS' => array(array('ID' => 'CREATE', 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_LEAD_EDIT'], array('lead_id' => 0)))));
}
if (IsModuleInstalled('report')) {
    $stdItems['REPORT'] = array('ID' => 'REPORT', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_REPORT'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_REPORT'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_REPORT_LIST']), 'ICON' => 'report');
}
if ($isAdmin || !$userPermissions->HavePerm('DEAL', BX_CRM_PERM_NONE, 'READ')) {
    $stdItems['DEAL_FUNNEL'] = array('ID' => 'DEAL_FUNNEL', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_FUNNEL'), 'BRIEF_NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_FUNNEL_BRIEF'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_FUNNEL'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_FUNNEL']), 'ICON' => 'funnel');
}
$stdItems['EVENT'] = array('ID' => 'EVENT', 'NAME' => GetMessage('CRM_CTRL_PANEL_ITEM_EVENT_2'), 'TITLE' => GetMessage('CRM_CTRL_PANEL_ITEM_EVENT_2'), 'URL' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_EVENT_LIST']), 'ICON' => 'event');
if ($isAdmin || !$userPermissions->HavePerm('CONFIG', BX_CRM_PERM_NONE, 'READ')) {