当前位置: 首页>>代码示例>>PHP>>正文


PHP CCrmPerms::HavePerm方法代码示例

本文整理汇总了PHP中CCrmPerms::HavePerm方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmPerms::HavePerm方法的具体用法?PHP CCrmPerms::HavePerm怎么用?PHP CCrmPerms::HavePerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCrmPerms的用法示例。


在下文中一共展示了CCrmPerms::HavePerm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkPermissions

 /**
  * Function checks if user have basic permissions to launch the component
  * @throws Exception
  * @return void
  */
 protected function checkPermissions()
 {
     $result = true;
     $CrmPerms = new CCrmPerms($GLOBALS['USER']->GetID());
     if (!$CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'READ')) {
         $this->errors['FATAL'][] = Loc::getMessage('CRM_CLL2_PERMISSION_DENIED');
         $result = false;
     } else {
         $this->dbResult['CAN_DELETE'] = $this->dbResult['CAN_EDIT'] = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE');
     }
     return $result;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:17,代码来源:class.php

示例2: CheckAuth

 public static function CheckAuth()
 {
     $CCrmPerms = new CCrmPerms($GLOBALS['USER']->GetID());
     if ($CCrmPerms->HavePerm('LEAD', BX_CRM_PERM_NONE)) {
         return new CSOAPFault('Server Error', 'Unable to authorize user.');
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:ws_lead.php

示例3: checkAccessPermissions

 protected static function checkAccessPermissions($parameters = array())
 {
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $errors = array();
     $CCrmPerms = new CCrmPerms($GLOBALS['USER']->GetID());
     if ($CCrmPerms->HavePerm('CONFIG', BX_CRM_PERM_NONE, 'WRITE')) {
         $errors[] = Loc::getMessage("SALE_CCLI2_CRM_MODULE_WRITE_ACCESS_DENIED");
     }
     if (!LocationHelper::checkLocationEnabled()) {
         $errors[] = 'Locations were disabled or data has not been converted';
     }
     if ($parameters['CHECK_CSRF']) {
         $post = \Bitrix\Main\Context::getCurrent()->getRequest()->getPostList();
         if (!strlen($post['csrf']) || bitrix_sessid() != $post['csrf']) {
             $errors[] = 'CSRF token is not valid';
         }
     }
     return $errors;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:21,代码来源:class.php

示例4: array

<?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);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:19,代码来源:.left.menu_ext.php

示例5: ShowError

<?php

if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule('crm')) {
    ShowError(GetMessage('CRM_MODULE_NOT_INSTALLED'));
    return;
}
if (!CModule::IncludeModule('sale')) {
    ShowError(GetMessage('CRM_SALE_MODULE_NOT_INSTALLED'));
    return;
}
global $USER, $APPLICATION;
$CrmPerms = new CCrmPerms($USER->GetID());
if (!$CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'READ')) {
    ShowError(GetMessage('CRM_PERMISSION_DENIED'));
    return;
}
$arResult['CAN_DELETE'] = $arResult['CAN_EDIT'] = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE');
$arParams['PATH_TO_TAX_LIST'] = CrmCheckPath('PATH_TO_TAX_LIST', $arParams['PATH_TO_TAX_LIST'], '');
$arParams['PATH_TO_TAX_SHOW'] = CrmCheckPath('PATH_TO_TAX_SHOW', $arParams['PATH_TO_TAX_SHOW'], '?tax_id=#tax_id#&show');
$arParams['PATH_TO_TAX_ADD'] = CrmCheckPath('PATH_TO_TAX_ADD', $arParams['PATH_TO_TAX_ADD'], '?add');
$arParams['PATH_TO_TAX_EDIT'] = CrmCheckPath('PATH_TO_TAX_EDIT', $arParams['PATH_TO_TAX_EDIT'], '?tax_id=#tax_id#&edit');
$arResult['GRID_ID'] = 'CRM_TAX_LIST';
$arResult['FORM_ID'] = isset($arParams['FORM_ID']) ? $arParams['FORM_ID'] : '';
$arResult['EDIT_FORM_ID'] = 'CRM_TAX_EDIT_FORM';
$arResult['TAB_ID'] = isset($arParams['TAB_ID']) ? $arParams['TAB_ID'] : '';
$arResult['HEADERS'] = array(array('id' => 'ID', 'name' => GetMessage('CRM_COLUMN_ID'), 'sort' => 'ID', 'default' => false, 'editable' => false), array('id' => 'NAME', 'name' => GetMessage('CRM_COLUMN_NAME'), 'sort' => 'NAME', 'default' => true, 'editable' => true), array('id' => 'STAV', 'name' => GetMessage('CRM_COLUMN_RATES'), 'sort' => false, 'default' => true, 'editable' => false), array('id' => 'TIMESTAMP_X', 'name' => GetMessage('CRM_COLUMN_DATE'), 'sort' => 'TIMESTAMP_X', 'default' => true, 'editable' => false), array('id' => 'LID', 'name' => GetMessage('CRM_COLUMN_SITE'), 'sort' => false, 'default' => false, 'editable' => false), array('id' => 'CODE', 'name' => GetMessage('CRM_COLUMN_CODE'), 'sort' => 'CODE', 'default' => false, 'editable' => true));
if ($_SERVER['REQUEST_METHOD'] === 'POST' && check_bitrix_sessid() && isset($_POST['action_button_' . $arResult['GRID_ID']])) {
    $action = $_POST['action_button_' . $arResult['GRID_ID']];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例6: CCrmPerms

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/intranet/public/crm/contact/.left.menu_ext.php");
if (CModule::IncludeModule('crm')) {
    $CrmPerms = new CCrmPerms($GLOBALS['USER']->GetID());
    $aMenuLinksExt = array();
    if (!$CrmPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'ADD')) {
        $aMenuLinksExt[] = array(GetMessage("MENU_CRM_ADD_CONTACT"), '#SITE_DIR#crm/contact/edit/0/', array(), array(), '');
    }
    if (!$CrmPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'READ')) {
        $aMenuLinksExt[] = array(GetMessage("MENU_CRM_CONTACT_LIST"), '#SITE_DIR#crm/contact/list/', array(), array(), '');
    }
    if (!$CrmPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'ADD')) {
        $aMenuLinksExt[] = array(GetMessage("MENU_CRM_CONTACT_IMPORT"), '#SITE_DIR#crm/contact/import/', array(), array(), '');
    }
    $aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:20,代码来源:.left.menu_ext.php

示例7: ShowError

}
if (!CModule::IncludeModule('iblock')) {
    ShowError(GetMessage('CRM_IBLOCK_MODULE_NOT_INSTALLED'));
    return;
}
global $USER, $APPLICATION;
$arParams['PATH_TO_PRODUCTPROPS_LIST'] = CrmCheckPath('PATH_TO_PRODUCTPROPS_LIST', $arParams['PATH_TO_PRODUCTPROPS_LIST'], '');
$arParams['PATH_TO_PRODUCTPROPS_ADD'] = CrmCheckPath('PATH_TO_PRODUCTPROPS_ADD', $arParams['PATH_TO_PRODUCTPROPS_ADD'], '?add');
$arParams['PATH_TO_PRODUCTPROPS_EDIT'] = CrmCheckPath('PATH_TO_PRODUCTPROPS_EDIT', $arParams['PATH_TO_PRODUCTPROPS_EDIT'], '?prop_id=#prop_id#&edit');
if (!isset($arParams['TYPE'])) {
    $arParams['TYPE'] = 'list';
}
$arResult['BUTTONS'] = array();
$propID = isset($arParams['PROP_ID']) ? intval($arParams['PROP_ID']) : 0;
$CrmPerms = new CCrmPerms($USER->GetID());
$propAdd = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE');
$arProp = null;
if ($propID > 0) {
    $iblockID = intval(CCrmCatalog::EnsureDefaultExists());
    $dbRes = CIBlockProperty::GetByID($propID, $iblockID);
    if (is_object($dbRes)) {
        $arProp = $dbRes->Fetch();
    }
    unset($dbRes);
}
$exists = intval($propID > 0) && is_array($arProp);
if ($arParams['TYPE'] !== 'list') {
    $arResult['BUTTONS'][] = array('TEXT' => GetMessage('CRM_PRODUCTPROP_LIST'), 'TITLE' => GetMessage('CRM_PRODUCTPROP_LIST_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_PRODUCTPROPS_LIST'], array()), 'ICON' => 'btn-list');
}
if ($arParams['TYPE'] === 'list' && $propAdd) {
    $arResult['BUTTONS'][] = array('TEXT' => GetMessage('CRM_PRODUCTPROP_ADD'), 'TITLE' => GetMessage('CRM_PRODUCTPROP_ADD_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_PRODUCTPROPS_ADD'], array()), 'ICON' => 'btn-new');
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例8: CCrmPerms

<?php

define('NO_KEEP_STATISTIC', 'Y');
define('NO_AGENT_STATISTIC', 'Y');
require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!CModule::IncludeModule('crm')) {
    return;
}
global $APPLICATION;
$CCrmPerms = new CCrmPerms($USER->GetID());
if (!$USER->IsAuthorized() || $CCrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE)) {
    return;
}
$arResult = array();
$_GET['USER_ID'] = preg_replace('/^(CONTACT|COMPANY|LEAD|DEAL)_/i' . BX_UTF_PCRE_MODIFIER, '', $_GET['USER_ID']);
$iDealId = (int) $_GET['USER_ID'];
if ($iDealId > 0) {
    __IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
    $arParams['PATH_TO_DEAL_SHOW'] = CrmCheckPath('PATH_TO_DEAL_SHOW', $arParams['PATH_TO_DEAL_SHOW'], $APPLICATION->GetCurPage() . '?deal_id=#deal_id#&show');
    $arParams['PATH_TO_DEAL_EDIT'] = CrmCheckPath('PATH_TO_DEAL_EDIT', $arParams['PATH_TO_DEAL_EDIT'], $APPLICATION->GetCurPage() . '?deal_id=#deal_id#&edit');
    $arParams['PATH_TO_CONTACT_SHOW'] = CrmCheckPath('PATH_TO_CONTACT_SHOW', $arParams['PATH_TO_CONTACT_SHOW'], $APPLICATION->GetCurPage() . '?contact_id=#contact_id#&show');
    $arParams['PATH_TO_COMPANY_SHOW'] = CrmCheckPath('PATH_TO_COMPANY_SHOW', $arParams['PATH_TO_COMPANY_SHOW'], $APPLICATION->GetCurPage() . '?company_id=#company_id#&show');
    $arResult['STAGE_LIST'] = CCrmStatus::GetStatusListEx('DEAL_STAGE');
    $obRes = CCrmDeal::GetList(array(), array('ID' => $iDealId));
    $arDeal = $obRes->Fetch();
    if ($arDeal == false) {
        return;
    }
    $res = CCrmFieldMulti::GetList(array('ID' => 'asc'), array('ENTITY_ID' => 'DEAL', 'ELEMENT_ID' => $iDealId));
    while ($ar = $res->Fetch()) {
        if (empty($arDeal[$ar['COMPLEX_ID']])) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:card.ajax.php

示例9: elseif

if ($ownerType == 'D') {
    $ownerName = 'DEAL';
} elseif ($ownerType == CCrmQuote::OWNER_TYPE) {
    $ownerName = 'QUOTE';
} elseif ($ownerType == 'L') {
    $ownerName = 'LEAD';
} elseif ($ownerType == 'I') {
    $ownerName = 'INVOICE';
} else {
    ShowError(GetMessage('CRM_UNSUPPORTED_OWNER_TYPE', array('#OWNER_TYPE#' => $ownerType)));
    return;
}
// Check permissions (READ by default)
$permissionType = isset($arParams['PERMISSION_TYPE']) ? (string) $arParams['PERMISSION_TYPE'] : 'READ';
$perms = new CCrmPerms($USER->GetID());
if ($perms->HavePerm($ownerName, BX_CRM_PERM_NONE, $permissionType)) {
    ShowError(GetMessage('CRM_PERMISSION_DENIED'));
    return;
}
/** @var \CBitrixComponent $this */
$arResult['COMPONENT_ID'] = $this->randString();
$arResult['OWNER_TYPE'] = $ownerType;
$arResult['OWNER_ID'] = $ownerID;
$arResult['READ_ONLY'] = $permissionType == 'READ';
$arResult['INIT_EDITABLE'] = isset($arParams['INIT_EDITABLE']) ? $arParams['INIT_EDITABLE'] === 'Y' : false;
$arResult['HIDE_MODE_BUTTON'] = isset($arParams['HIDE_MODE_BUTTON']) ? $arParams['HIDE_MODE_BUTTON'] === 'Y' : false;
$arResult['HIDE_ALL_TAXES'] = isset($arParams['HIDE_ALL_TAXES']) ? $arParams['HIDE_ALL_TAXES'] === 'Y' : false;
$arResult['ALLOW_TAX'] = isset($arParams['ALLOW_TAX']) ? $arParams['ALLOW_TAX'] === 'Y' : CCrmTax::isVatMode();
$arResult['ALLOW_TAX'] = $arResult['ALLOW_TAX'] && !$arResult['HIDE_ALL_TAXES'];
$arResult['ALLOW_LD_TAX'] = isset($arParams['ALLOW_LD_TAX']) ? $arParams['ALLOW_LD_TAX'] === 'Y' : CCrmTax::isTaxMode();
$arResult['ALLOW_LD_TAX'] = $arResult['ALLOW_LD_TAX'] || $arResult['HIDE_ALL_TAXES'];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例10: isset

}
global $USER, $APPLICATION;
$arResult['LIST_SECTION_ID'] = isset($_REQUEST['list_section_id']) ? intval($_REQUEST['list_section_id']) : (isset($arParams['SECTION_ID']) ? intval($arParams['SECTION_ID']) : 0);
$arParams['PATH_TO_PRODUCT_LIST'] = CrmCheckPath('PATH_TO_PRODUCT_LIST', $arParams['PATH_TO_PRODUCT_LIST'], '?#section_id#');
$arParams['PATH_TO_PRODUCT_SHOW'] = CrmCheckPath('PATH_TO_PRODUCT_SHOW', $arParams['PATH_TO_PRODUCT_SHOW'], '?product_id=#product_id#&show');
$arParams['PATH_TO_PRODUCT_EDIT'] = CrmCheckPath('PATH_TO_PRODUCT_EDIT', $arParams['PATH_TO_PRODUCT_EDIT'], '?product_id=#product_id#&edit');
$arParams['PATH_TO_PRODUCT_IMPORT'] = CrmCheckPath('PATH_TO_PRODUCT_IMPORT', $arParams['PATH_TO_PRODUCT_IMPORT'], $APPLICATION->GetCurPage() . '?import');
$arParams['PATH_TO_SECTION_LIST'] = CrmCheckPath('PATH_TO_SECTION_LIST', $arParams['PATH_TO_SECTION_LIST'], '?#section_id#&sections');
if (!isset($arParams['TYPE'])) {
    $arParams['TYPE'] = 'list';
}
$arResult['BUTTONS'] = array();
$sectionID = isset($arParams['SECTION_ID']) ? intval($arParams['SECTION_ID']) : 0;
$productID = isset($arParams['PRODUCT_ID']) ? intval($arParams['PRODUCT_ID']) : 0;
$CrmPerms = new CCrmPerms($USER->GetID());
$productAdd = $sectionAdd = $productEdit = $productDelete = $bImport = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE');
$productShow = $sectionShow = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'READ');
$exists = $productID > 0 && CCrmProduct::Exists($productID);
if ($arParams['TYPE'] === 'sections') {
    $arSection = false;
    if ($sectionShow && $sectionID > 0) {
        $rsSection = CIBlockSection::GetList(array(), array('ID' => $sectionID, 'GLOBAL_ACTIVE' => 'Y', 'CHECK_PERMISSIONS' => 'N'), false, array('ID', 'IBLOCK_SECTION_ID'));
        $arSection = $rsSection->Fetch();
    }
    if ($arSection) {
        $parentSectionID = isset($arSection['IBLOCK_SECTION_ID']) ? intval($arSection['IBLOCK_SECTION_ID']) : 0;
        $arResult['BUTTONS'][] = array('TEXT' => GetMessage('CRM_MOVE_UP'), 'TITLE' => GetMessage('CRM_MOVE_UP_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_SECTION_LIST'], array('section_id' => $parentSectionID)), 'ICON' => 'btn-parent-section');
    }
    if ($sectionAdd) {
        $arResult['BUTTONS'][] = array('TEXT' => GetMessage('CRM_ADD_PRODUCT_SECTION'), 'TITLE' => GetMessage('CRM_ADD_PRODUCT_SECTION_TITLE'), 'LINK' => "javascript:BX.CrmProductSectionManager.getDefault().addSection();", 'ICON' => 'btn-add-section');
    }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例11: foreach

            }
            if (count($settings) > 0) {
                $arSettings = CCrmProductRow::LoadSettings($ownerType, $ownerID);
                foreach ($settings as $k => $v) {
                    $arSettings[$k] = $v;
                }
                CCrmProductRow::SaveSettings($ownerType, $ownerID, $arSettings);
                unset($arSettings);
            }
        } else {
            $arResponse['ERROR'] = 'OWNER_NOT_FOUND';
        }
    }
    echo CUtil::PhpToJSObject($arResponse);
} elseif ($mode === 'CALC_PRODUCT_PRICES') {
    if ($perms->HavePerm($ownerName, BX_CRM_PERM_NONE, 'READ')) {
        echo CUtil::PhpToJSObject(array('ERROR' => 'PERMISSION_DENIED'));
        die;
    }
    $data = isset($_POST['DATA']) && is_array($_POST['DATA']) ? $_POST['DATA'] : array();
    if (count($data) == 0) {
        echo CUtil::PhpToJSObject(array('ERROR' => 'SOURCE_DATA_NOT_FOUND'));
        die;
    }
    //{ SRC_CURRENCY_ID:'RUB', SRC_EXCH_RATE:1, DST_CURRENCY_ID:'USD', PRODUCTS:[ { ID:1, PRICE:1.0 }...] }
    // National currency is default currency
    $srcCurrencyID = isset($data['SRC_CURRENCY_ID']) && strlen(strval($data['SRC_CURRENCY_ID'])) > 0 ? strval($data['SRC_CURRENCY_ID']) : CCrmCurrency::GetBaseCurrencyID();
    //	$srcExchRate = 0.0;
    //	if(isset($data['SRC_EXCH_RATE']))
    //	{
    //		$srcExchRate = doubleval($data['SRC_EXCH_RATE']);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例12: RemoveRelation

 public function RemoveRelation($RELATION_ID, $ENTITY_TYPE, $bPermCheck = true)
 {
     $RELATION_ID = intval($RELATION_ID);
     if (!in_array($ENTITY_TYPE, array('LEAD', 'CONTACT', 'COMPANY', 'DEAL', 'QUOTE'))) {
         return false;
     }
     if ($bPermCheck) {
         $CrmPerms = new CCrmPerms($this->currentUserID);
         if ($CrmPerms->HavePerm($ENTITY_TYPE, BX_CRM_PERM_NONE)) {
             return false;
         }
     }
     $sSql = "DELETE FROM b_crm_event_relations WHERE ID = {$RELATION_ID}";
     $this->cdb->Query($sSql, 'FILE: ' . __FILE__ . '<br /> LINE: ' . __LINE__);
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:crm_event.php

示例13: json_encode

<?php

define("STOP_STATISTICS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
$arReturn = array();
if (!CModule::IncludeModule('crm')) {
    $arReturn['ERROR'][] = GetMessage('CRM_PS_MODULE_NOT_INSTALLED');
}
if (!isset($arReturn['ERROR'])) {
    $CrmPerms = new CCrmPerms($USER->GetID());
    $bCrmWritePerm = $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'WRITE');
    if ($USER->IsAuthorized() && check_bitrix_sessid() && $bCrmWritePerm) {
        $ID = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
        $personTypeId = isset($_REQUEST['person_type']) ? $_REQUEST['person_type'] : 0;
        $action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : '';
        switch ($action) {
            case 'get_fields':
                $arReturn['FIELDS'] = CCrmPaySystem::getPSCorrespondence($ID);
                $arReturn['FIELDS_LIST'] = implode(',', array_keys($arReturn['FIELDS']));
                break;
        }
    } else {
        $arReturn['ERROR'][] = GetMessage('CRM_PS_ACCESS_DENIED');
    }
}
$arReturn = $APPLICATION->ConvertCharsetArray($arReturn, SITE_CHARSET, 'utf-8');
echo json_encode($arReturn);
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:28,代码来源:ajax.php

示例14: CCrmPerms

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (CModule::IncludeModule('crm')) {
    global $USER;
    $USER_ID = $USER->GetID();
    $CrmPerms = new CCrmPerms($USER_ID);
    $aMenuLinksExt = array();
    if (!$CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_NONE)) {
        $aMenuLinksExt = array(array("Справочники", "/crm/configs/status/", array(), array(), ""), array("Валюты", "/crm/configs/currency/", array(), array(), ""), array("Налоги", "/crm/configs/tax/", array(), array(), ""), array("Местоположения", "/crm/configs/locations/", array(), array(), ""), array("Способы оплаты", "/crm/configs/ps/", array(), array(), ""), array("Права доступа", "/crm/configs/perms/", array(), array(), ""), array("Бизнес-процессы", "/crm/configs/bp/", array(), array(), "CModule::IncludeModule('bizproc') && CModule::IncludeModule('bizprocdesigner')"), array("Пользовательские поля", "/crm/configs/fields/", array(), array(), ""), array("Прочее", "/crm/configs/config/", array(), array(), "CModule::IncludeModule('subscribe')"), array("Интеграция c почтой", "/crm/configs/sendsave/", array(), array(), "CModule::IncludeModule('mail')"), array("Интернет-магазины", "/crm/configs/external_sale/", array(), array(), ""), array("Интеграция с \"1С:Предприятие\"", "/crm/configs/exch1c/", array(), array(), ""), array("Справка", "/crm/configs/info/", array(), array(), ""));
    }
    if ($CrmPerms->IsAccessEnabled()) {
        $aMenuLinksExt[] = array("Почтовые шаблоны", "/crm/configs/mailtemplate/", array(), array(), "");
    }
    $aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:18,代码来源:.left.menu_ext.php

示例15: CCrmPerms

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/intranet/public/crm/.left.menu_ext.php");
if (CModule::IncludeModule('crm')) {
    $CrmPerms = new CCrmPerms($GLOBALS["USER"]->GetID());
    $arMenuCrm = array();
    if (SITE_TEMPLATE_ID === "bitrix24") {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_DESKTOP"), "#SITE_DIR#crm/", array(), array(), "");
    }
    $arMenuCrm[] = array(GetMessage("MENU_CRM_STREAM"), "#SITE_DIR#crm/stream/", array(), array(), "");
    $arMenuCrm[] = array(GetMessage("MENU_CRM_ACTIVITY"), "#SITE_DIR#crm/activity/", array(), array(), "");
    if (!$CrmPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE)) {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_CONTACT"), "#SITE_DIR#crm/contact/", array(), array(), "");
    }
    if (!$CrmPerms->HavePerm('COMPANY', BX_CRM_PERM_NONE)) {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_COMPANY"), "#SITE_DIR#crm/company/", array(), array(), "");
    }
    if (!$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE)) {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_DEAL"), "#SITE_DIR#crm/deal/", array(), array(), "");
    }
    if (!$CrmPerms->HavePerm('INVOICE', BX_CRM_PERM_NONE)) {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_INVOICE"), "#SITE_DIR#crm/invoice/", array(), array(), "");
    }
    if (!$CrmPerms->HavePerm('QUOTE', BX_CRM_PERM_NONE)) {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_QUOTE"), "#SITE_DIR#crm/quote/", array(), array(), "");
    }
    if (!$CrmPerms->HavePerm('LEAD', BX_CRM_PERM_NONE)) {
        $arMenuCrm[] = array(GetMessage("MENU_CRM_LEAD"), "#SITE_DIR#crm/lead/", array(), array(), "");
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:.left.menu_ext.php


注:本文中的CCrmPerms::HavePerm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。