Example #1
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/intranet/public/crm/reports/.left.menu_ext.php");
$aMenuLinksExt = array();
if (CModule::IncludeModule('crm') && CModule::IncludeModule('report')) {
    $aMenuLinksExt[] = array(GetMessage("MENU_CRM_REPORT_LIST"), "#SITE_DIR#crm/reports/report/", array(), array(), "");
    $CrmPerms = new CCrmPerms($GLOBALS["USER"]->GetID());
    if (!$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'READ')) {
        $aMenuLinksExt[] = array(GetMessage("MENU_CRM_FUNNEL"), "#SITE_DIR#crm/reports/index.php", array(), array(), "");
    }
    $obRep = CReport::GetList('crm');
    while ($arRep = $obRep->fetch()) {
        $aMenuLinksExt[] = array($arRep['TITLE'], CComponentEngine::MakePathFromTemplate("#SITE_DIR#crm/reports/report/view/#report_id#/", array('report_id' => $arRep['ID'])), array(), array(), "");
    }
}
$aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);