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


PHP CCrmDeal::CheckReadPermission方法代码示例

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


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

示例1: array

if (isset($arResult['ELEMENT']['CURRENCY_ID']) && $arResult['ELEMENT']['CURRENCY_ID'] !== '') {
    $currencyID = $arResult['ELEMENT']['CURRENCY_ID'];
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'CURRENCY_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_CURRENCY_ID'), 'type' => 'list', 'params' => array('sale_order_marker' => 'Y'), 'items' => $arResult['CURRENCY_LIST'], 'value' => $currencyID);
$arResult['FIELDS']['tab_1'][] = array('id' => 'OPPORTUNITY', 'name' => GetMessage('CRM_QUOTE_FIELD_OPPORTUNITY'), 'params' => array('size' => 21, 'sale_order_marker' => 'Y'), 'value' => isset($arResult['ELEMENT']['OPPORTUNITY']) ? $arResult['ELEMENT']['OPPORTUNITY'] : '', 'type' => 'text');
$arResult['RESPONSIBLE_SELECTOR_PARAMS'] = array('NAME' => 'crm_quote_edit_resonsible', 'INPUT_NAME' => 'ASSIGNED_BY_ID', 'SEARCH_INPUT_NAME' => 'ASSIGNED_BY_NAME', 'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE']);
$arResult['FIELDS']['tab_1'][] = array('id' => 'ASSIGNED_BY_ID', 'componentParams' => $arResult['RESPONSIBLE_SELECTOR_PARAMS'], 'name' => GetMessage('CRM_QUOTE_FIELD_ASSIGNED_BY_ID'), 'type' => 'intranet_user_search', 'value' => isset($arResult['ELEMENT']['ASSIGNED_BY_ID']) ? $arResult['ELEMENT']['ASSIGNED_BY_ID'] : $USER->GetID());
//Fix for issue #36848
$beginDate = isset($arResult['ELEMENT']['BEGINDATE']) ? $arResult['ELEMENT']['BEGINDATE'] : '';
$closeDate = isset($arResult['ELEMENT']['CLOSEDATE']) ? $arResult['ELEMENT']['CLOSEDATE'] : '';
$arResult['FIELDS']['tab_1'][] = array('id' => 'BEGINDATE', 'name' => GetMessage('CRM_QUOTE_FIELD_BEGINDATE'), 'params' => array('sale_order_marker' => 'Y'), 'type' => 'date_link', 'value' => $beginDate !== '' ? ConvertTimeStamp(MakeTimeStamp($beginDate), 'SHORT', SITE_ID) : '');
$arResult['FIELDS']['tab_1'][] = array('id' => 'CLOSEDATE', 'name' => GetMessage('CRM_QUOTE_FIELD_CLOSEDATE'), 'type' => 'date_short', 'value' => $closeDate !== '' ? ConvertTimeStamp(MakeTimeStamp($closeDate), 'SHORT', SITE_ID) : '', 'params' => array('class' => 'bx-crm-dialog-input bx-crm-dialog-input-date'));
if (CCrmLead::CheckReadPermission()) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'LEAD_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_LEAD_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'LEAD', 'INPUT_NAME' => 'LEAD_ID', 'NEW_INPUT_NAME' => '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['LEAD_ID']) ? $arResult['ELEMENT']['LEAD_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
if (CCrmDeal::CheckReadPermission()) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'DEAL_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_DEAL_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'DEAL', 'INPUT_NAME' => 'DEAL_ID', 'NEW_INPUT_NAME' => '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['DEAL_ID']) ? $arResult['ELEMENT']['DEAL_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'OPENED', 'name' => GetMessage('CRM_QUOTE_FIELD_OPENED'), 'type' => 'vertical_checkbox', 'params' => array(), 'value' => isset($arResult['ELEMENT']['OPENED']) ? $arResult['ELEMENT']['OPENED'] : true, 'title' => GetMessage('CRM_QUOTE_FIELD_OPENED_TITLE'));
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_contact_info', 'name' => GetMessage('CRM_SECTION_CLIENT_INFO'), 'type' => 'section');
if (CCrmContact::CheckReadPermission()) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'CONTACT_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_CONTACT_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'CONTACT', 'INPUT_NAME' => 'CONTACT_ID', 'NEW_INPUT_NAME' => CCrmContact::CheckCreatePermission() ? 'NEW_CONTACT_ID' : '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['CONTACT_ID']) ? $arResult['ELEMENT']['CONTACT_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
if (CCrmCompany::CheckReadPermission()) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'COMPANY_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_COMPANY_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'COMPANY', 'INPUT_NAME' => 'COMPANY_ID', 'NEW_INPUT_NAME' => CCrmCompany::CheckCreatePermission() ? 'NEW_COMPANY_ID' : '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['COMPANY_ID']) ? $arResult['ELEMENT']['COMPANY_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
if ($bTaxMode) {
    // CLIENT LOCATION
    $sLocationHtml = '';
    $locValue = isset($arResult['ELEMENT']['LOCATION_ID']) ? $arResult['ELEMENT']['LOCATION_ID'] : '';
    ob_start();
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例2: __CrmMobileDealEditEndResonse

        __CrmMobileDealEditEndResonse(array('DELETED_ENTITY_ID' => $ID));
    } else {
        //$DB->Rollback();
        __CrmMobileDealEditEndResonse(array('ERROR' => GetMessage('CRM_DEAL_COULD_NOT_DELETE')));
    }
} elseif ($action === 'GET_ENTITY') {
    __IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
    $typeName = isset($_REQUEST['ENTITY_TYPE_NAME']) ? $_REQUEST['ENTITY_TYPE_NAME'] : '';
    if ($typeName !== CCrmOwnerType::DealName) {
        __CrmMobileDealEditEndResonse(array('ERROR' => GetMessage('CRM_ENTITY_TYPE_NOT_SUPPORTED', array('#ENTITY_TYPE#' => $typeName))));
    }
    $ID = isset($_REQUEST['ENTITY_ID']) ? intval($_REQUEST['ENTITY_ID']) : 0;
    if ($ID <= 0) {
        __CrmMobileDealEditEndResonse(array('ERROR' => GetMessage('CRM_ENTITY_ID_NOT_FOUND')));
    }
    if (!CCrmDeal::CheckReadPermission($ID)) {
        __CrmMobileDealEditEndResonse(array('ERROR' => GetMessage('CRM_ACCESS_DENIED')));
    }
    $dbRes = CCrmDeal::GetListEx(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => 'N'));
    $item = $dbRes ? $dbRes->GetNext() : null;
    if (!is_array($item)) {
        __CrmMobileDealEditEndResonse(array('ERROR' => GetMessage('CRM_DEAL_NOT_FOUND', array('#ID#' => $ID))));
    }
    $formatParams = isset($_REQUEST['FORMAT_PARAMS']) ? $_REQUEST['FORMAT_PARAMS'] : array();
    CCrmMobileHelper::PrepareDealItem($item, $formatParams);
    __CrmMobileDealEditEndResonse(array('ENTITY' => CCrmMobileHelper::PrepareDealData($item)));
} elseif ($action === 'SET_STAGE') {
    __IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
    $typeName = isset($_REQUEST['ENTITY_TYPE_NAME']) ? $_REQUEST['ENTITY_TYPE_NAME'] : '';
    if ($typeName !== CCrmOwnerType::DealName) {
        __CrmMobileDealEditEndResonse(array('ERROR' => GetMessage('CRM_ENTITY_TYPE_NOT_SUPPORTED', array('#ENTITY_TYPE#' => $typeName))));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例3: GetShowUrl

 public static function GetShowUrl($typeID, $ID, $bCheckPermissions = false)
 {
     $typeID = intval($typeID);
     $ID = intval($ID);
     if ($ID <= 0) {
         return '';
     }
     switch ($typeID) {
         case self::Lead:
             if ($bCheckPermissions && !CCrmLead::CheckReadPermission($ID)) {
                 return '';
             }
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_lead_show'), array('lead_id' => $ID));
         case self::Contact:
             if ($bCheckPermissions && !CCrmContact::CheckReadPermission($ID)) {
                 return '';
             }
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_contact_show'), array('contact_id' => $ID));
         case self::Company:
             if ($bCheckPermissions && !CCrmCompany::CheckReadPermission($ID)) {
                 return '';
             }
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_company_show'), array('company_id' => $ID));
         case self::Deal:
             if ($bCheckPermissions && !CCrmDeal::CheckReadPermission($ID)) {
                 return '';
             }
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_deal_show'), array('deal_id' => $ID));
         case self::Activity:
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_activity_show'), array('activity_id' => $ID));
         case self::Invoice:
             if ($bCheckPermissions && !CCrmInvoice::CheckReadPermission($ID)) {
                 return '';
             }
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_invoice_show'), array('invoice_id' => $ID));
         case self::Quote:
             if ($bCheckPermissions && !CCrmQuote::CheckReadPermission($ID)) {
                 return '';
             }
             return CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_quote_show'), array('quote_id' => $ID));
         default:
             return '';
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:44,代码来源:crm_owner_type.php

示例4: array

if ($arParams['ELEMENT_ID'] > 0) {
    $toolbarID .= '_' . $arParams['ELEMENT_ID'];
}
$arResult['TOOLBAR_ID'] = $toolbarID;
$arResult['BUTTONS'] = array();
if ($arParams['TYPE'] == 'list') {
    $bRead = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'READ');
    $bExport = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'EXPORT');
    $bImport = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'IMPORT');
    $bAdd = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'ADD');
    $bWrite = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'WRITE');
    $bDelete = false;
} else {
    $bExport = false;
    $bImport = false;
    $bRead = CCrmDeal::CheckReadPermission($arParams['ELEMENT_ID'], $CrmPerms);
    $bAdd = CCrmDeal::CheckCreatePermission($CrmPerms);
    $bWrite = CCrmDeal::CheckUpdatePermission($arParams['ELEMENT_ID'], $CrmPerms);
    $bDelete = CCrmDeal::CheckDeletePermission($arParams['ELEMENT_ID'], $CrmPerms);
}
if (!$bRead && !$bAdd && !$bWrite) {
    return false;
}
if ($arParams['TYPE'] === 'list') {
    if ($bAdd) {
        $arResult['BUTTONS'][] = array('TEXT' => GetMessage('DEAL_ADD'), 'TITLE' => GetMessage('DEAL_ADD_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_EDIT'], array('deal_id' => 0)), 'HIGHLIGHT' => true);
    }
    if ($bImport) {
        $arResult['BUTTONS'][] = array('TEXT' => GetMessage('DEAL_IMPORT'), 'TITLE' => GetMessage('DEAL_IMPORT_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_IMPORT'], array()), 'ICON' => 'btn-import');
    }
    if ($bExport) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: isset

$componentData = isset($_REQUEST['PARAMS']) && is_array($_REQUEST['PARAMS']) ? $_REQUEST['PARAMS'] : array();
$componentParams = isset($componentData['params']) && is_array($componentData['params']) ? $componentData['params'] : array();
//Security check
$userPermissions = CCrmPerms::GetCurrentUserPermissions();
$filter = isset($componentParams['INTERNAL_FILTER']) && is_array($componentParams['INTERNAL_FILTER']) ? $componentParams['INTERNAL_FILTER'] : array();
$contactID = isset($filter['UF_CONTACT_ID']) ? $filter['UF_CONTACT_ID'] : 0;
$companyID = isset($filter['UF_COMPANY_ID']) ? $filter['UF_COMPANY_ID'] : 0;
$dealID = isset($filter['UF_DEAL_ID']) ? $filter['UF_DEAL_ID'] : 0;
$quoteID = isset($filter['UF_QUOTE_ID']) ? $filter['UF_QUOTE_ID'] : 0;
$isPermitted = false;
if ($contactID > 0) {
    $isPermitted = CCrmContact::CheckReadPermission($contactID, $userPermissions);
} elseif ($companyID > 0) {
    $isPermitted = CCrmCompany::CheckReadPermission($companyID, $userPermissions);
} elseif ($dealID > 0) {
    $isPermitted = CCrmDeal::CheckReadPermission($dealID, $userPermissions);
} elseif ($quoteID > 0) {
    $isPermitted = CCrmQuote::CheckReadPermission($quoteID, $userPermissions);
}
if (!$isPermitted) {
    die;
}
//For custom reload with params
$ajaxLoaderParams = array('url' => '', 'method' => 'POST', 'dataType' => 'ajax', 'data' => array('PARAMS' => $componentData));
global $APPLICATION;
Header('Content-Type: text/html; charset=' . LANG_CHARSET);
$APPLICATION->ShowAjaxHead();
//Force AJAX mode
$componentParams['AJAX_MODE'] = 'Y';
$componentParams['AJAX_OPTION_JUMP'] = 'N';
$componentParams['AJAX_OPTION_HISTORY'] = 'N';
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:lazyload.ajax.php

示例6: getProductRows

 public function getProductRows($ID)
 {
     $ID = intval($ID);
     if ($ID <= 0) {
         throw new RestException('The parameter id is invalid or not defined.');
     }
     if (!CCrmDeal::CheckReadPermission($ID)) {
         throw new RestException('Access denied.');
     }
     return CCrmDeal::LoadProductRows($ID);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:11,代码来源:restservice.php

示例7: __IncludeLang

 * 'ENABLE_SONET_SUBSCRIPTION'
 */
global $DB, $APPLICATION;
if (!CCrmSecurityHelper::IsAuthorized() || !check_bitrix_sessid() || $_SERVER['REQUEST_METHOD'] != 'POST') {
    return;
}
__IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
CUtil::JSPostUnescape();
$APPLICATION->RestartBuffer();
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
$action = isset($_POST['ACTION']) ? $_POST['ACTION'] : '';
if (strlen($action) == 0) {
    echo CUtil::PhpToJSObject(array('ERROR' => 'INVALID DATA!'));
    die;
}
if ($action === 'ENABLE_SONET_SUBSCRIPTION') {
    $userID = CCrmSecurityHelper::GetCurrentUserID();
    $entityTypeName = isset($_POST['ENTITY_TYPE']) ? strtoupper($_POST['ENTITY_TYPE']) : '';
    $entityID = isset($_POST['ENTITY_ID']) ? intval($_POST['ENTITY_ID']) : 0;
    if ($userID > 0 && $entityTypeName === CCrmOwnerType::DealName && $entityID > 0 && CCrmDeal::CheckReadPermission($entityID)) {
        $isEnabled = CCrmSonetSubscription::IsRelationRegistered(CCrmOwnerType::Deal, $entityID, CCrmSonetSubscriptionType::Observation, $userID);
        $enable = isset($_POST['ENABLE']) && strtoupper($_POST['ENABLE']) === 'Y';
        if ($isEnabled !== $enable) {
            if ($enable) {
                CCrmSonetSubscription::RegisterSubscription(CCrmOwnerType::Deal, $entityID, CCrmSonetSubscriptionType::Observation, $userID);
            } else {
                CCrmSonetSubscription::UnRegisterSubscription(CCrmOwnerType::Deal, $entityID, CCrmSonetSubscriptionType::Observation, $userID);
            }
        }
    }
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例8: __CrmMobileInvoiceEditEndResonse

 if ($topic === '') {
     __CrmMobileInvoiceEditEndResonse(array('ERROR' => GetMessage('CRM_INVOICE_TOPIC_IS_NOT_ASSIGNED')));
 }
 $companyID = max(isset($data['COMPANY_ID']) ? intval($data['COMPANY_ID']) : 0, 0);
 if ($companyID > 0 && !CCrmCompany::CheckReadPermission($companyID, $curUserPrems)) {
     $companyID = 0;
 }
 $contactID = max(isset($data['CONTACT_ID']) ? intval($data['CONTACT_ID']) : 0, 0);
 if ($contactID > 0 && !CCrmContact::CheckReadPermission($contactID, $curUserPrems)) {
     $contactID = 0;
 }
 if ($companyID === 0 && $contactID === 0) {
     __CrmMobileInvoiceEditEndResonse(array('ERROR' => GetMessage('CRM_INVOICE_CLIENT_IS_NOT_ASSIGNED')));
 }
 $dealID = max(isset($data['DEAL_ID']) ? intval($data['DEAL_ID']) : 0, 0);
 if ($dealID > 0 && !CCrmDeal::CheckReadPermission($dealID, $curUserPrems)) {
     $dealID = 0;
 }
 $personTypeID = isset($data['PERSON_TYPE_ID']) ? intval($data['PERSON_TYPE_ID']) : 0;
 $resolvedPersonTypeID = $companyID > 0 || $contactID > 0 ? CCrmInvoice::ResolvePersonTypeID($companyID, $contactID) : 0;
 $paySystemID = isset($data['PAY_SYSTEM_ID']) ? intval($data['PAY_SYSTEM_ID']) : 0;
 $paySystems = CCrmPaySystem::GetPaySystemsListItems($resolvedPersonTypeID);
 $resolvedPaySystemID = 0;
 if ($personTypeID === $resolvedPersonTypeID && $paySystemID > 0 && array_key_exists($paySystemID, $paySystems)) {
     // Pay system does not changed
     $resolvedPaySystemID = $paySystemID;
 } elseif (!empty($paySystems)) {
     // Take first pay system
     $resolvedPaySystemID = array_shift(array_keys($paySystems));
 }
 // CURRENCY_ID -->
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


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