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


PHP CCrmStatus::GetEntityTypes方法代码示例

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


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

示例1: GetSettingsHTML

    function GetSettingsHTML($arUserField = false, $arHtmlControl, $bVarsFromForm)
    {
        $result = '';
        if ($bVarsFromForm) {
            $value = htmlspecialcharsbx($GLOBALS[$arHtmlControl['NAME']]['ENTITY_TYPE']);
        } elseif (is_array($arUserField)) {
            $value = htmlspecialcharsbx($arUserField['SETTINGS']['ENTITY_TYPE']);
        } else {
            $value = '';
        }
        $ar = CCrmStatus::GetEntityTypes();
        foreach ($ar as $entityType) {
            $arr['reference'][] = $entityType['NAME'];
            $arr['reference_id'][] = $entityType['ID'];
        }
        $result .= '
		<tr>
			<td>' . GetMessage('USER_TYPE_CRM_ENTITY_TYPE') . ':</td>
			<td>
				' . SelectBoxFromArray($arHtmlControl["NAME"] . '[ENTITY_TYPE]', $arr, $value) . '
			</td>
		</tr>
		';
        return $result;
    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:crm_usertypecrmstatus.php

示例2: GetFieldInputControlOptions

    public static function GetFieldInputControlOptions($documentType, &$arFieldType, $jsFunctionName, &$value)
    {
        $result = '';
        static $arDocumentFieldTypes = array();
        if (!array_key_exists($documentType, $arDocumentFieldTypes)) {
            $arDocumentFieldTypes[$documentType] = self::GetDocumentFieldTypes($documentType);
        }
        if (!array_key_exists($arFieldType['Type'], $arDocumentFieldTypes[$documentType]) || !$arDocumentFieldTypes[$documentType][$arFieldType['Type']]['Complex']) {
            return '';
        }
        if ($arFieldType['Type'] == 'UF:iblock_element' || $arFieldType['Type'] == 'UF:iblock_section') {
            if (is_array($value)) {
                reset($value);
                $valueTmp = intval(current($value));
            } else {
                $valueTmp = intval($value);
            }
            $iblockId = 0;
            if ($valueTmp > 0) {
                $dbResult = CIBlockElement::GetList(array(), array($arFieldType['Type'] == 'UF:iblock_section' ? 'SECTION_ID' : 'ID' => $valueTmp), false, false, array('ID', 'IBLOCK_ID'));
                if ($arResult = $dbResult->Fetch()) {
                    $iblockId = $arResult['IBLOCK_ID'];
                }
            }
            if ($iblockId <= 0 && intval($arFieldType['Options']) > 0) {
                $iblockId = intval($arFieldType['Options']);
            }
            $defaultIBlockId = 0;
            $result .= '<select id="WFSFormOptionsX" onchange="' . $jsFunctionName . '(this.options[this.selectedIndex].value)">';
            $arIBlockType = CIBlockParameters::GetIBlockTypes();
            foreach ($arIBlockType as $iblockTypeId => $iblockTypeName) {
                $result .= '<optgroup label="' . $iblockTypeName . '">';
                $dbIBlock = CIBlock::GetList(array('SORT' => 'ASC'), array('TYPE' => $iblockTypeId, 'ACTIVE' => 'Y'));
                while ($arIBlock = $dbIBlock->GetNext()) {
                    $result .= '<option value="' . $arIBlock['ID'] . '"' . ($arIBlock['ID'] == $iblockId ? ' selected="selected"' : '') . '>' . $arIBlock['NAME'] . '</option>';
                    if ($defaultIBlockId <= 0 || $arIBlock['ID'] == $iblockId) {
                        $defaultIBlockId = $arIBlock['ID'];
                    }
                }
                $result .= '</optgroup>';
            }
            $result .= '</select><!--__defaultOptionsValue:' . $defaultIBlockId . '--><!--__modifyOptionsPromt:' . GetMessage('CRM_DOCUMENT_IBLOCK') . '-->';
            $arFieldType['Options'] = $defaultIBlockId;
        } else {
            if ($arFieldType['Type'] == 'UF:crm_status') {
                $statusID = $arFieldType['Options'];
                $arEntityTypes = CCrmStatus::GetEntityTypes();
                $default = 'STATUS';
                $result .= '<select id="WFSFormOptionsX" onchange="' . $jsFunctionName . '(this.options[this.selectedIndex].value)">';
                foreach ($arEntityTypes as $arEntityType) {
                    $result .= '<option value="' . $arEntityType['ID'] . '"' . ($arEntityType['ID'] == $statusID ? ' selected="selected"' : '') . '>' . htmlspecialcharsbx($arEntityType['NAME']) . '</option>';
                    if ($arEntityType['ID'] == $statusID) {
                        $default = $arEntityType['ID'];
                    }
                }
                $result .= '</select><!--__defaultOptionsValue:' . $default . '--><!--__modifyOptionsPromt:' . GetMessage('CRM_DOCUMENT_CRM_STATUS') . '-->';
            } else {
                if ($arFieldType['Type'] == 'UF:crm') {
                    $arEntity = $arFieldType['Options'];
                    if (empty($arEntity)) {
                        $arEntity = array('LEAD' => 'Y', 'CONTACT' => 'Y', 'COMPANY' => 'Y', 'DEAL' => 'Y');
                    }
                    $result .= '<input type="checkbox" id="WFSFormOptionsXL" name="ENITTY[]" value="LEAD" ' . ($arEntity['LEAD'] == 'Y' ? 'checked="checked"' : '') . '> ' . GetMessage('CRM_DOCUMENT_CRM_ENTITY_TYPE_LEAD') . ' <br/>';
                    $result .= '<input type="checkbox" id="WFSFormOptionsXC"  name="ENITTY[]" value="CONTACT" ' . ($arEntity['CONTACT'] == 'Y' ? 'checked="checked"' : '') . '> ' . GetMessage('CRM_DOCUMENT_CRM_ENTITY_TYPE_CONTACT') . '<br/>';
                    $result .= '<input type="checkbox" id="WFSFormOptionsXCO" name="ENITTY[]" value="COMPANY" ' . ($arEntity['COMPANY'] == 'Y' ? 'checked="checked"' : '') . '> ' . GetMessage('CRM_DOCUMENT_CRM_ENTITY_TYPE_COMPANY') . '<br/>';
                    $result .= '<input type="checkbox" id="WFSFormOptionsXD"  name="ENITTY[]" value="DEAL" ' . ($arEntity['DEAL'] == 'Y' ? 'checked="checked"' : '') . '> ' . GetMessage('CRM_DOCUMENT_CRM_ENTITY_TYPE_DEAL') . '<br/>';
                    $result .= '<input type="button" onclick="' . $jsFunctionName . '(WFSFormOptionsXCRM())" value="' . GetMessage('CRM_DOCUMENT_CRM_ENTITY_OK') . '" />';
                    $result .= '<script>
					function WFSFormOptionsXCRM()
					{
						var a = {};
						a["LEAD"] = BX("WFSFormOptionsXL").checked ? "Y" : "N";
						a["CONTACT"] = BX("WFSFormOptionsXC").checked ? "Y" : "N";
						a["COMPANY"] = BX("WFSFormOptionsXCO").checked ? "Y" : "N";
						a["DEAL"] = BX("WFSFormOptionsXD").checked ? "Y" : "N";
						return a;
					}
				</script>';
                    $result .= '<!--__modifyOptionsPromt:' . GetMessage('CRM_DOCUMENT_CRM_ENTITY') . '-->';
                } elseif ($arFieldType["Type"] == "select") {
                    $valueTmp = $arFieldType["Options"];
                    if (!is_array($valueTmp)) {
                        $valueTmp = array($valueTmp => $valueTmp);
                    }
                    $str = '';
                    foreach ($valueTmp as $k => $v) {
                        if (is_array($v) && count($v) == 2) {
                            $v1 = array_values($v);
                            $k = $v1[0];
                            $v = $v1[1];
                        }
                        if ($k != $v) {
                            $str .= '[' . $k . ']' . $v;
                        } else {
                            $str .= $v;
                        }
                        $str .= "\n";
                    }
                    $result .= '<textarea id="WFSFormOptionsX" rows="5" cols="30">' . htmlspecialcharsbx($str) . '</textarea><br />';
                    $result .= GetMessage("IBD_DOCUMENT_XFORMOPTIONS1") . '<br />';
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:crm_document.php

示例3: GetAdditionalFields

    public static function GetAdditionalFields($entityType, $fieldValue = array())
    {
        $arFields = array();
        switch ($entityType) {
            case 'string':
                $arFields[] = array('id' => 'ROWS', 'name' => GetMessage('CRM_FIELDS_TEXT_ROW_COUNT'), 'type' => 'text');
                $arFields[] = array('id' => 'DEFAULT_VALUE', 'name' => GetMessage('CRM_FIELDS_DEFAULT_VALUE'), 'type' => 'text');
                break;
            case 'integer':
            case 'double':
                $arFields[] = array('id' => 'DEFAULT_VALUE', 'name' => GetMessage('CRM_FIELDS_DEFAULT_VALUE'), 'type' => 'text');
                break;
            case 'boolean':
                $arFields[] = array('id' => 'B_DEFAULT_VALUE', 'name' => GetMessage('CRM_FIELDS_TYPE_B_VALUE'), 'type' => 'list', 'items' => array('1' => GetMessage('CRM_FIELDS_TYPE_B_VALUE_YES'), '0' => GetMessage('CRM_FIELDS_TYPE_B_VALUE_NO')));
                $arFields[] = array('id' => 'B_DISPLAY', 'name' => GetMessage('CRM_FIELDS_TYPE_B_DISPLAY'), 'type' => 'list', 'items' => array('CHECKBOX' => GetMessage('CRM_FIELDS_TYPE_B_DISPLAY_CHECKBOX'), 'RADIO' => GetMessage('CRM_FIELDS_TYPE_B_DISPLAY_RADIO'), 'DROPDOWN' => GetMessage('CRM_FIELDS_TYPE_B_DISPLAY_DROPDOWN')));
                break;
            case 'datetime':
                $arFields[] = array('id' => 'DT_TYPE', 'name' => GetMessage('CRM_FIELDS_TYPE_DT_TYPE'), 'type' => 'list', 'items' => array('NONE' => GetMessage('CRM_FIELDS_TYPE_DT_TYPE_NONE'), 'NOW' => GetMessage('CRM_FIELDS_TYPE_DT_TYPE_NOW'), 'FIXED' => GetMessage('CRM_FIELDS_TYPE_DT_TYPE_FIXED')));
                $arFields[] = array('id' => 'DT_DEFAULT_VALUE', 'name' => GetMessage('CRM_FIELDS_TYPE_DT_FIXED'), 'type' => 'date', 'params' => array('size' => 25));
                break;
            case 'enumeration':
                $arFields[] = array('id' => 'E_DISPLAY', 'name' => GetMessage('CRM_FIELDS_TYPE_E_DISPLAY'), 'type' => 'list', 'items' => array('LIST' => GetMessage('CRM_FIELDS_TYPE_E_DISPLAY_LIST'), 'CHECKBOX' => GetMessage('CRM_FIELDS_TYPE_E_DISPLAY_CHECKBOX')));
                $arFields[] = array('id' => 'E_LIST_HEIGHT', 'name' => GetMessage('CRM_FIELDS_TYPE_E_LIST_HEIGHT'), 'type' => 'text');
                break;
            case 'iblock_section':
                $id = isset($fieldValue['IB_IBLOCK_ID']) ? $fieldValue['IB_IBLOCK_ID'] : 0;
                $bActiveFilter = isset($fieldValue['IB_ACTIVE_FILTER']) && $fieldValue['IB_ACTIVE_FILTER'] == 'Y' ? 'Y' : 'N';
                $arFields[] = array('id' => 'IB_IBLOCK_TYPE_ID', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_IBLOCK_TYPE_ID'), 'type' => 'custom', 'value' => GetIBlockDropDownList($id, 'IB_IBLOCK_TYPE_ID', 'IB_IBLOCK_ID'));
                $arFilter = array("IBLOCK_ID" => $id);
                if ($bActiveFilter === "Y") {
                    $arFilter["GLOBAL_ACTIVE"] = "Y";
                }
                $rs = CIBlockElement::GetList(array("SORT" => "DESC", "NAME" => "ASC"), $arFilter, false, false, array("ID", "NAME"));
                $rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), $arFilter, false, array("ID", "DEPTH_LEVEL", "NAME"));
                $arDefault = array('' => GetMessage('CRM_FIELDS_TYPE_IB_DEFAULT_VALUE_ANY'));
                while ($arSection = $rsSections->GetNext()) {
                    $arDefaul[$arSection["ID"]] = str_repeat("&nbsp;.&nbsp;", $arSection["DEPTH_LEVEL"]) . $arSection["NAME"];
                }
                $arFields[] = array('id' => 'IB_DEFAULT_VALUE', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_DEFAULT_VALUE'), 'items' => $arDefault, 'type' => 'list');
                $arFields[] = array('id' => 'IB_DISPLAY', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_DISPLAY'), 'type' => 'list', 'items' => array('LIST' => GetMessage('CRM_FIELDS_TYPE_IB_DISPLAY_LIST'), 'CHECKBOX' => GetMessage('CRM_FIELDS_TYPE_IB_DISPLAY_CHECKBOX')));
                $arFields[] = array('id' => 'IB_LIST_HEIGHT', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_LIST_HEIGHT'), 'type' => 'text');
                $arFields[] = array('id' => 'IB_ACTIVE_FILTER', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_ACTIVE_FILTER'), 'type' => 'checkbox');
                break;
            case 'iblock_element':
                $id = isset($fieldValue['IB_IBLOCK_ID']) ? $fieldValue['IB_IBLOCK_ID'] : 0;
                $bActiveFilter = isset($fieldValue['IB_ACTIVE_FILTER']) && $fieldValue['IB_ACTIVE_FILTER'] == 'Y' ? 'Y' : 'N';
                $arFields[] = array('id' => 'IB_IBLOCK_TYPE_ID', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_IBLOCK_TYPE_ID'), 'type' => 'custom', 'value' => GetIBlockDropDownList($id, 'IB_IBLOCK_TYPE_ID', 'IB_IBLOCK_ID'));
                $arFilter = array("IBLOCK_ID" => $id);
                if ($bActiveFilter === "Y") {
                    $arFilter["ACTIVE"] = "Y";
                }
                $rs = CIBlockElement::GetList(array("SORT" => "DESC", "NAME" => "ASC"), $arFilter, false, false, array("ID", "NAME"));
                $arDefault = array('' => GetMessage('CRM_FIELDS_TYPE_IB_DEFAULT_VALUE_ANY'));
                while ($ar = $rs->GetNext()) {
                    $arDefault[$ar["ID"]] = $ar["NAME"];
                }
                $arFields[] = array('id' => 'IB_DEFAULT_VALUE', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_DEFAULT_VALUE'), 'items' => $arDefault, 'type' => 'list');
                $arFields[] = array('id' => 'IB_DISPLAY', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_DISPLAY'), 'type' => 'list', 'items' => array('LIST' => GetMessage('CRM_FIELDS_TYPE_IB_DISPLAY_LIST'), 'CHECKBOX' => GetMessage('CRM_FIELDS_TYPE_IB_DISPLAY_CHECKBOX')));
                $arFields[] = array('id' => 'IB_LIST_HEIGHT', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_LIST_HEIGHT'), 'type' => 'text');
                $arFields[] = array('id' => 'IB_ACTIVE_FILTER', 'name' => GetMessage('CRM_FIELDS_TYPE_IB_ACTIVE_FILTER'), 'type' => 'checkbox');
                break;
            case 'crm_status':
                $arItems = array();
                $ar = CCrmStatus::GetEntityTypes();
                foreach ($ar as $data) {
                    $arItems[$data['ID']] = $data['NAME'];
                }
                $arFields[] = array('id' => 'ENTITY_TYPE', 'name' => GetMessage('CRM_FIELDS_TYPE_CRM_STATUS_ENTITY_TYPE'), 'type' => 'list', 'items' => $arItems);
                break;
            case 'crm':
                $entityTypeLead = isset($fieldValue['ENTITY_TYPE_LEAD']) && $fieldValue['ENTITY_TYPE_LEAD'] == 'Y' ? 'Y' : 'N';
                $entityTypeContact = isset($fieldValue['ENTITY_TYPE_CONTACT']) && $fieldValue['ENTITY_TYPE_CONTACT'] == 'Y' ? 'Y' : 'N';
                $entityTypeCompany = isset($fieldValue['ENTITY_TYPE_COMPANY']) && $fieldValue['ENTITY_TYPE_COMPANY'] == 'Y' ? 'Y' : 'N';
                $entityTypeDeal = isset($fieldValue['ENTITY_TYPE_DEAL']) && $fieldValue['ENTITY_TYPE_DEAL'] == 'Y' ? 'Y' : 'N';
                $sVal = '
					<input type="checkbox" name="ENTITY_TYPE_LEAD" value="Y" ' . ($entityTypeLead == "Y" ? 'checked="checked"' : '') . '> ' . GetMessage('USER_TYPE_CRM_ENTITY_TYPE_LEAD') . ' <br/>
					<input type="checkbox" name="ENTITY_TYPE_CONTACT" value="Y" ' . ($entityTypeContact == "Y" ? 'checked="checked"' : '') . '> ' . GetMessage('USER_TYPE_CRM_ENTITY_TYPE_CONTACT') . '<br/>
					<input type="checkbox" name="ENTITY_TYPE_COMPANY" value="Y" ' . ($entityTypeCompany == "Y" ? 'checked="checked"' : '') . '> ' . GetMessage('USER_TYPE_CRM_ENTITY_TYPE_COMPANY') . '<br/>
					<input type="checkbox" name="ENTITY_TYPE_DEAL" value="Y" ' . ($entityTypeDeal == "Y" ? 'checked="checked"' : '') . '> ' . GetMessage('USER_TYPE_CRM_ENTITY_TYPE_DEAL') . '<br/>
				';
                $arFields[] = array('id' => 'ENTITY_TYPE', 'name' => GetMessage('CRM_FIELDS_TYPE_CRM_ELEMENT_ENTITY_TYPE'), 'type' => 'custom', 'value' => $sVal);
                break;
        }
        return $arFields;
    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:85,代码来源:crm_fields.php

示例4: trim

                        $CCrmStatus->Update($id, $arUpdate);
                    }
                } else {
                    $arCurrentData = $CCrmStatus->GetStatusById($id);
                    if (trim($arField['VALUE']) != $arCurrentData['NAME'] || intval($arField['SORT']) != $arCurrentData['SORT']) {
                        $arUpdate['NAME'] = trim($arField['VALUE']);
                        $arUpdate['SORT'] = $arField['SORT'];
                        $CCrmStatus->Update($id, $arUpdate);
                    }
                }
            }
        }
    }
    $arResult['ACTIVE_TAB'] = $_POST['ACTIVE_TAB'];
}
$ar = CCrmStatus::GetEntityTypes();
foreach ($ar as $entityId => $arEntityType) {
    $arResult['HEADERS'][$entityId] = $arEntityType['NAME'];
    $arResult['ROWS'][$entityId] = array();
}
$res = CCrmStatus::GetList(array('SORT' => 'ASC'));
while ($ar = $res->Fetch()) {
    $arResult['ROWS'][$ar['ENTITY_ID']][$ar['ID']] = $ar;
}
/*
 * We can add here some elements to status list of own type(s)
 * TODO: transfer to GetList
 */
$events = GetModuleEvents("crm", "OnCrmStatusGetList");
while ($arEvent = $events->Fetch()) {
    $arStatuses = ExecuteModuleEventEx($arEvent);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: prepareEntityTypes

 private static function prepareEntityTypes()
 {
     if (!self::$ENTITY_TYPES) {
         self::$ENTITY_TYPES = CCrmStatus::GetEntityTypes();
     }
     return self::$ENTITY_TYPES;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:7,代码来源:restservice.php


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