當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCrmOwnerType::GetDescriptions方法代碼示例

本文整理匯總了PHP中CCrmOwnerType::GetDescriptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmOwnerType::GetDescriptions方法的具體用法?PHP CCrmOwnerType::GetDescriptions怎麽用?PHP CCrmOwnerType::GetDescriptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCrmOwnerType的用法示例。


在下文中一共展示了CCrmOwnerType::GetDescriptions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processMethodRequest

 public function processMethodRequest($name, $nameDetails, $arParams, $nav, $server)
 {
     $descriptions = null;
     $name = strtoupper($name);
     if ($name === 'OWNERTYPE') {
         $descriptions = CCrmOwnerType::GetDescriptions(array(CCrmOwnerType::Lead, CCrmOwnerType::Deal, CCrmOwnerType::Contact, CCrmOwnerType::Company));
     } elseif ($name === 'CONTENTTYPE') {
         $descriptions = CCrmContentType::GetAllDescriptions();
     } elseif ($name === 'ACTIVITYTYPE') {
         $descriptions = CCrmActivityType::GetAllDescriptions();
     } elseif ($name === 'ACTIVITYPRIORITY') {
         $descriptions = CCrmActivityPriority::GetAllDescriptions();
     } elseif ($name === 'ACTIVITYDIRECTION') {
         $descriptions = CCrmActivityDirection::GetAllDescriptions();
     } elseif ($name === 'ACTIVITYNOTIFYTYPE') {
         $descriptions = CCrmActivityNotifyType::GetAllDescriptions();
     }
     if (!is_array($descriptions)) {
         return parent::processMethodRequest($name, $nameDetails, $arParams, $nav, $server);
     }
     $result = array();
     foreach ($descriptions as $k => &$v) {
         $result[] = array('ID' => $k, 'NAME' => $v);
     }
     unset($v);
     return $result;
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:27,代碼來源:restservice.php

示例2: elseif

            }
        }
    } elseif ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_GET['delete'])) {
        if (CCrmMailTemplate::Exists($elementID) && !CCrmMailTemplate::Delete($elementID)) {
            $errors = CCrmMailTemplate::GetErrorMessages();
            if (empty($errors)) {
                $errors[] = GetMessage('CRM_MAIL_TEMPLATE_DELETE_UNKNOWN_ERROR');
            }
            ShowError(implode("\n", $errors));
            return;
        }
        LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_MAIL_TEMPLATE_LIST']));
    }
}
$arResult['ELEMENT_ID'] = $elementID;
$arResult['ELEMENT'] = $element;
$isEditMode = $elementID > 0;
$arResult['FORM_ID'] = $arResult['GRID_ID'] = 'CRM_MAIL_TEMPLATE_EDIT';
$arResult['BACK_URL'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_MAIL_TEMPLATE_LIST'], array());
$arResult['FIELDS']['tab_1'][] = array('ID' => 'TITLE', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_TITLE'), 'VALUE' => isset($element['TITLE']) ? $element['TITLE'] : '', 'REQUIRED' => true);
$arResult['FIELDS']['tab_1'][] = array('ID' => 'SORT', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_SORT'), 'VALUE' => isset($element['SORT']) ? intval($element['SORT']) : 100);
if (CCrmPerms::IsAdmin()) {
    $arResult['FIELDS']['tab_1'][] = array('ID' => 'SCOPE', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_SCOPE'), 'VALUE' => isset($element['SCOPE']) ? $element['SCOPE'] : CCrmMailTemplateScope::Personal, 'ALL_VALUES' => CCrmMailTemplateScope::GetAllDescriptions());
}
$arResult['FIELDS']['tab_1'][] = array('ID' => 'IS_ACTIVE', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_IS_ACTIVE'), 'VALUE' => isset($element['IS_ACTIVE']) && $element['IS_ACTIVE'] === 'Y' ? 'Y' : 'N');
$arResult['FIELDS']['tab_1'][] = array('ID' => 'EMAIL_FROM', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_EMAIL_FROM'), 'VALUE' => isset($element['EMAIL_FROM']) ? $element['EMAIL_FROM'] : '');
$arResult['FIELDS']['tab_1'][] = array('ID' => 'SUBJECT', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_SUBJECT'), 'VALUE' => isset($element['SUBJECT']) ? $element['SUBJECT'] : '');
$ownerTypes = CCrmOwnerType::GetDescriptions(array(CCrmOwnerType::Lead, CCrmOwnerType::Deal, CCrmOwnerType::Contact, CCrmOwnerType::Company));
$arResult['FIELDS']['tab_1'][] = array('ID' => 'ENTITY_TYPE_ID', 'NAME' => GetMessage('CRM_MAIL_ENTITY_TYPE'), 'VALUE' => isset($element['ENTITY_TYPE_ID']) ? $element['ENTITY_TYPE_ID'] : CCrmOwnerType::Lead, 'ALL_VALUES' => $ownerTypes, 'REQUIRED' => true);
$arResult['FIELDS']['tab_1'][] = array('ID' => 'BODY', 'NAME' => GetMessage('CRM_MAIL_TEMPLATE_BODY'), 'VALUE' => isset($element['BODY']) ? $element['BODY'] : '');
$this->IncludeComponentTemplate();
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:component.php


注:本文中的CCrmOwnerType::GetDescriptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。