本文整理汇总了PHP中CUserTypeEntity类的典型用法代码示例。如果您正苦于以下问题:PHP CUserTypeEntity类的具体用法?PHP CUserTypeEntity怎么用?PHP CUserTypeEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CUserTypeEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __IRM_InitReservation
function __IRM_InitReservation($iblockId)
{
$arResult = array();
$arResult["ALLOWED_FIELDS"] = array("ID" => array("NAME" => GetMessage("INAF_F_ID"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "int", "IS_FIELD" => true), "NAME" => array("NAME" => GetMessage("INAF_F_NAME"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "string", "IS_FIELD" => true), "DESCRIPTION" => array("NAME" => GetMessage("INAF_F_DESCRIPTION"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "text", "IS_FIELD" => true), "UF_FLOOR" => array("NAME" => GetMessage("INAF_F_FLOOR"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PLACE" => array("NAME" => GetMessage("INAF_F_PLACE"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PHONE" => array("NAME" => GetMessage("INAF_F_PHONE"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "string", "IS_FIELD" => false));
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $iblockId . "_SECTION", 0, LANGUAGE_ID);
$arKeys = Array_Keys($arResult["ALLOWED_FIELDS"]);
foreach ($arKeys as $key) {
if (!$arResult["ALLOWED_FIELDS"][$key]["IS_FIELD"]) {
if (!Array_Key_Exists($key, $arUserFields)) {
$arFields = array("ENTITY_ID" => "IBLOCK_" . $iblockId . "_SECTION", "FIELD_NAME" => $key, "USER_TYPE_ID" => $arResult["ALLOWED_FIELDS"][$key]["TYPE"]);
$obUserField = new CUserTypeEntity();
$obUserField->Add($arFields);
}
}
}
$arResult["ALLOWED_ITEM_PROPERTIES"] = array("UF_PERSONS" => array("NAME" => GetMessage("INTASK_C29_UF_PERSONS"), "ACTIVE" => "Y", "SORT" => 300, "CODE" => "UF_PERSONS", "PROPERTY_TYPE" => "N", "USER_TYPE" => false, "ROW_COUNT" => 1, "COL_COUNT" => 5, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "Y", "SEARCHABLE" => "Y", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "UF_RES_TYPE" => array("NAME" => GetMessage("INTASK_C29_UF_RES_TYPE"), "ACTIVE" => "Y", "SORT" => 200, "CODE" => "UF_RES_TYPE", "PROPERTY_TYPE" => "L", "USER_TYPE" => false, "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "Y", "SEARCHABLE" => "Y", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "Y", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId, "VALUES" => array(array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPEA"), "DEF" => "Y", "SORT" => 100, "XML_ID" => "A"), array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPEB"), "DEF" => "N", "SORT" => 200, "XML_ID" => "B"), array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPEC"), "DEF" => "N", "SORT" => 200, "XML_ID" => "C"), array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPED"), "DEF" => "N", "SORT" => 300, "XML_ID" => "D"))), "UF_PREPARE_ROOM" => array("NAME" => GetMessage("INTASK_C29_UF_PREPARE_ROOM"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "UF_PREPARE_ROOM", "PROPERTY_TYPE" => "S", "USER_TYPE" => false, "DEFAULT_VALUE" => "Y", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "PERIOD_TYPE" => array("NAME" => GetMessage("INTASK_C29_PERIOD_TYPE"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "PERIOD_TYPE", "PROPERTY_TYPE" => "S", "USER_TYPE" => false, "DEFAULT_VALUE" => "NONE", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "PERIOD_COUNT" => array("NAME" => GetMessage("INTASK_C29_PERIOD_COUNT"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "PERIOD_COUNT", "PROPERTY_TYPE" => "N", "USER_TYPE" => false, "DEFAULT_VALUE" => "", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "EVENT_LENGTH" => array("NAME" => GetMessage("INTASK_C29_EVENT_LENGTH"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "EVENT_LENGTH", "PROPERTY_TYPE" => "N", "USER_TYPE" => false, "DEFAULT_VALUE" => "", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "PERIOD_ADDITIONAL" => array("NAME" => GetMessage("INTASK_C29_PERIOD_ADDITIONAL"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "PERIOD_ADDITIONAL", "PROPERTY_TYPE" => "S", "USER_TYPE" => false, "DEFAULT_VALUE" => "", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId));
$dbIBlockProps = CIBlock::GetProperties($iblockId);
while ($arIBlockProps = $dbIBlockProps->Fetch()) {
if (Array_Key_Exists($arIBlockProps["CODE"], $arResult["ALLOWED_ITEM_PROPERTIES"])) {
$arResult["ALLOWED_ITEM_PROPERTIES"][$arIBlockProps["CODE"]]["ID"] = $arIBlockProps["ID"];
}
}
$keys = Array_Keys($arResult["ALLOWED_ITEM_PROPERTIES"]);
foreach ($keys as $key) {
if (IntVal($arResult["ALLOWED_ITEM_PROPERTIES"][$key]["ID"]) <= 0) {
$ibp = new CIBlockProperty();
$arResult["ALLOWED_ITEM_PROPERTIES"][$key]["ID"] = $ibp->Add($arResult["ALLOWED_ITEM_PROPERTIES"][$key]);
}
}
return $arResult;
}
示例2: __wd_check_uf_use_bp_property
function __wd_check_uf_use_bp_property($iblock_id)
{
$iblock_id = intval($iblock_id);
$db_res = CUserTypeEntity::GetList(array($by=>$order), array("ENTITY_ID" => "IBLOCK_".$iblock_id."_SECTION", "FIELD_NAME" => "UF_USE_BP"));
if (!$db_res || !($res = $db_res->GetNext()))
{
$arFields = Array(
"ENTITY_ID" => "IBLOCK_".$iblock_id."_SECTION",
"FIELD_NAME" => "UF_USE_BP",
"USER_TYPE_ID" => "string",
"MULTIPLE" => "N",
"MANDATORY" => "N",
"SETTINGS" => array("DEFAULT_VALUE" => "Y"));
$arFieldName = array();
$rsLanguage = CLanguage::GetList($by, $order, array());
while($arLanguage = $rsLanguage->Fetch()):
// GetMessage("SONET_UF_USE_BP");
$dir = str_replace(array("\\", "//"), "/", dirname(__FILE__));
$dirs = explode("/", $dir);
array_pop($dirs);
$file = trim(implode("/", $dirs)."/lang/".$arLanguage["LID"]."/include/webdav_settings.php");
$tmp_mess = __IncludeLang($file, true);
$arFieldName[$arLanguage["LID"]] = (empty($tmp_mess["SONET_UF_USE_BP"]) ? "Use Business Process" : $tmp_mess["SONET_UF_USE_BP"]);
endwhile;
$arFields["EDIT_FORM_LABEL"] = $arFieldName;
$obUserField = new CUserTypeEntity;
$obUserField->Add($arFields);
$GLOBALS["USER_FIELD_MANAGER"]->arFieldsCache = array();
}
}
示例3: InstallDBUserFields
function InstallDBUserFields()
{
$ImportantUserFields = $this->GetIdeaUserFields();
foreach ($ImportantUserFields as $UserFieldName => $Exists) {
if (!$Exists) {
$UserType = new CUserTypeEntity();
switch ($UserFieldName) {
case "UF_CATEGORY_CODE":
$UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "string", "IS_SEARCHABLE" => "N", "EDIT_FORM_LABEL" => array(LANGUAGE_ID => GetMessage("IDEA_UF_CATEGORY_CODE_DESCRIPTION"))));
break;
case "UF_ANSWER_ID":
$UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "integer", "IS_SEARCHABLE" => "N", "MULTIPLE" => "Y", "EDIT_FORM_LABEL" => array(LANGUAGE_ID => GetMessage("IDEA_UF_ANSWER_ID_DESCRIPTION"))));
break;
case "UF_ORIGINAL_ID":
$UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "string", "IS_SEARCHABLE" => "N", "EDIT_FORM_LABEL" => array(LANGUAGE_ID => GetMessage("IDEA_UF_ORIGINAL_ID_DESCRIPTION"))));
break;
case "UF_STATUS":
$ID = $UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "enumeration", "IS_SEARCHABLE" => "N", "EDIT_FORM_LABEL" => array(LANGUAGE_ID => GetMessage("IDEA_UF_STATUS_DESCRIPTION"))));
if (intval($ID) > 0) {
$UserTypeEnum = new CUserFieldEnum();
$UserTypeEnum->SetEnumValues($ID, array("n0" => array("SORT" => 100, "XML_ID" => "NEW", "VALUE" => GetMessage("IDEA_UF_STATUS_NEW_TITLE"), "DEF" => "Y"), "n1" => array("SORT" => 200, "XML_ID" => "PROCESSING", "VALUE" => GetMessage("IDEA_UF_STATUS_PROCESSING_TITLE"), "DEF" => "N"), "n2" => array("SORT" => 300, "XML_ID" => "COMPLETED", "VALUE" => GetMessage("IDEA_UF_STATUS_COMPLETED_TITLE"), "DEF" => "N")));
}
break;
}
}
}
}
示例4: GetList
public static function GetList($arOrder = array('CREATED_DATE' => 'DESC'), $arFilter = array(), $arSelect = array(), $nPageTop = false)
{
$ENTITY_ID = 'TASKS_TASK';
$arElement = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields($ENTITY_ID, 0, LANGUAGE_ID);
if ($arElement == false || !isset($arElement['UF_CRM_TASK'])) {
$arFields = array();
$arFields['ENTITY_ID'] = $ENTITY_ID;
$arFields['FIELD_NAME'] = 'UF_CRM_TASK';
$arFields['USER_TYPE_ID'] = 'crm';
$arFields['EDIT_FORM_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
$arFields['LIST_COLUMN_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
$arFields['LIST_FILTER_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
$arFields['SETTINGS']['LEAD'] = 'Y';
$arFields['SETTINGS']['CONTACT'] = 'Y';
$arFields['SETTINGS']['COMPANY'] = 'Y';
$arFields['SETTINGS']['DEAL'] = 'Y';
$arFields['MULTIPLE'] = 'Y';
$CAllUserTypeEntity = new CUserTypeEntity();
$CAllUserTypeEntity->Add($arFields);
}
if (isset($arFilter['ENTITY_TYPE']) && isset($arFilter['ENTITY_ID'])) {
$arFilter['ENTITY_TYPE'] = CUserTypeCrm::GetShortEntityType($arFilter['ENTITY_TYPE']);
$arFilter['UF_CRM_TASK'] = $arFilter['ENTITY_TYPE'] . '_' . $arFilter['ENTITY_ID'];
unset($arFilter['ENTITY_TYPE'], $arFilter['ENTITY_ID']);
} else {
if (isset($arFilter['ENTITY_TYPE'])) {
if (!empty($arFilter['ENTITY_TYPE'])) {
$arFilter['ENTITY_TYPE'] = CUserTypeCrm::GetShortEntityType($arFilter['ENTITY_TYPE']);
$arFilter['%UF_CRM_TASK'] = $arFilter['ENTITY_TYPE'] . '_';
} else {
$arFilter['!=UF_CRM_TASK'] = '';
}
unset($arFilter['ENTITY_TYPE']);
} else {
$arFilter['!=UF_CRM_TASK'] = '';
}
}
if (isset($arFilter['TITLE'])) {
$arFilter['%TITLE'] = $arFilter['TITLE'];
unset($arFilter['TITLE']);
}
if (isset($arFilter['REAL_STATUS'])) {
$arFilter['STATUS'] = $arFilter['REAL_STATUS'];
unset($arFilter['REAL_STATUS']);
}
if (isset($arOrder['ID']) || isset($arOrder['id'])) {
$arSelect[] = 'ID';
}
if (in_array('RESPONSIBLE_ID', $arSelect)) {
$arSelect[] = 'RESPONSIBLE_NAME';
$arSelect[] = 'RESPONSIBLE_LAST_NAME';
$arSelect[] = 'RESPONSIBLE_SECOND_NAME';
$arSelect[] = 'RESPONSIBLE_LOGIN';
}
$obRes = CTasks::GetList($arOrder, $arFilter, $arSelect, $nPageTop);
return $obRes;
}
示例5: deleteUserTypeEntityIfExists
public function deleteUserTypeEntityIfExists($entityId, $fieldName)
{
$aItem = $this->getUserTypeEntity($entityId, $fieldName);
if (!$aItem) {
return false;
}
$entity = new \CUserTypeEntity();
if ($entity->Delete($aItem['ID'])) {
return true;
}
$this->throwException(__METHOD__, 'UserType not deleted');
}
示例6: InstallUserFields
function InstallUserFields()
{
global $USER_FIELD_MANAGER, $APPLICATION;
AddEventHandler("main", "OnUserTypeBuildList", array("CUserTypeWebdavElement", "GetUserTypeDescription"));
AddEventHandler("main", "OnUserTypeBuildList", array("CUserTypeWebdavElementHistory", "GetUserTypeDescription"));
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/webdav/classes/usertypewebdav.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/webdav/classes/usertypewebdavelementhistory.php";
$USER_FIELD_MANAGER->CleanCache();
$USER_FIELD_MANAGER->arUserTypes = '';
$arFields = array("BLOG_POST" => array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => "UF_BLOG_POST_FILE", "XML_ID" => "UF_BLOG_POST_FILE"), "BLOG_COMMENT" => array("ENTITY_ID" => "BLOG_COMMENT", "FIELD_NAME" => "UF_BLOG_COMMENT_FILE", "XML_ID" => "UF_BLOG_COMMENT_FILE"));
$arFieldProps = array("USER_TYPE_ID" => "webdav_element", "SORT" => 100, "MULTIPLE" => "Y", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "N", "SETTINGS" => array(), "EDIT_FORM_LABEL" => "", "LIST_COLUMN_LABEL" => "", "LIST_FILTER_LABEL" => "", "ERROR_MESSAGE" => "", "HELP_MESSAGE" => "");
$typeData = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => "BLOG_COMMENT", "FIELD_NAME" => "UF_BLOG_COMMENT_FH", "XML_ID" => "UF_BLOG_COMMENT_FH"));
if (!($typeData = $typeData->Fetch())) {
$arFieldPropsHistory = array("USER_TYPE_ID" => "webdav_element_history", "SORT" => 100, "MULTIPLE" => "N", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "N", "SETTINGS" => array(), "EDIT_FORM_LABEL" => "", "LIST_COLUMN_LABEL" => "", "LIST_FILTER_LABEL" => "", "ERROR_MESSAGE" => "", "HELP_MESSAGE" => "", "ENTITY_ID" => "BLOG_COMMENT", "FIELD_NAME" => "UF_BLOG_COMMENT_FH", "XML_ID" => "UF_BLOG_COMMENT_FH");
$obUserField = new CUserTypeEntity();
$intID = $obUserField->Add($arFieldPropsHistory);
if (false == $intID) {
if ($strEx = $APPLICATION->GetException()) {
$this->errors[] = $strEx->GetString();
}
}
}
foreach ($arFields as $fieldName => $arField) {
$rsData = CUserTypeEntity::GetList(array(), $arField);
if ($arRes = $rsData->Fetch()) {
$intID = $arRes['ID'];
} else {
$arProps = $arFieldProps + $arField;
$obUserField = new CUserTypeEntity();
$intID = $obUserField->Add($arProps);
if (false == $intID) {
if ($strEx = $APPLICATION->GetException()) {
$this->errors[] = $strEx->GetString();
}
}
}
}
$rsData = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => "BLOG_POST", "XML_ID" => "UF_BLOG_POST_F_EDIT"));
$arRes = $rsData->Fetch();
if (!$arRes) {
$arFieldProps = array("USER_TYPE_ID" => "boolean", "SORT" => 100, "MULTIPLE" => "N", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "N", "SETTINGS" => array(), "EDIT_FORM_LABEL" => "", "LIST_COLUMN_LABEL" => "", "LIST_FILTER_LABEL" => "", "ERROR_MESSAGE" => "", "HELP_MESSAGE" => "", "ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => "UF_BLOG_POST_F_EDIT", "XML_ID" => "UF_BLOG_POST_F_EDIT");
$obUserField = new CUserTypeEntity();
$propID = $obUserField->Add($arFieldProps, false);
}
$rsData = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => "BLOG_POST", "XML_ID" => "UF_BLOG_POST_FILE"));
$arRes = $rsData->Fetch();
if ($arRes && empty($arRes['SETTINGS']['UF_TO_SAVE_ALLOW_EDIT'])) {
$arRes['SETTINGS']['UF_TO_SAVE_ALLOW_EDIT'] = 'UF_BLOG_POST_F_EDIT';
$obUserField = new CUserTypeEntity();
$res = $obUserField->Update($arRes['ID'], array('SETTINGS' => $arRes['SETTINGS']));
}
}
示例7: checkExistProperty
/**
* @param string $propCode
* @param string $userType
*
* @return bool
*
* @throws PropertyAlreadyExistException
*/
protected function checkExistProperty($propCode, $userType)
{
$propertyModel = new \CUserTypeEntity();
$rsProperty = $propertyModel->GetList([], ['ENTITY_ID' => 'IBLOCK_' . $this->getIblockId() . '_SECTION', 'FIELD_NAME' => 'UF_' . $propCode]);
if ($property = $rsProperty->Fetch()) {
if ($property['USER_TYPE_ID'] !== $userType) {
throw new PropertyAlreadyExistException($propCode);
} else {
return true;
}
}
return false;
}
示例8: GetList
public static function GetList($arOrder = array('CREATED_DATE' => 'DESC'), $arFilter = array(), $arSelect = array(), $nPageTop = false)
{
// Fix for #27449
if (!CModule::IncludeModule('calendar')) {
$obRes = new CDBResult();
$obRes->InitFromArray(array());
return $obRes;
}
global $USER;
$ENTITY_ID = 'CALENDAR_EVENT';
$arElement = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields($ENTITY_ID, 0, LANGUAGE_ID);
if ($arElement == false || !isset($arElement['UF_CRM_CAL_EVENT'])) {
$arFields = array();
$arFields['ENTITY_ID'] = $ENTITY_ID;
$arFields['FIELD_NAME'] = 'UF_CRM_CAL_EVENT';
$arFields['USER_TYPE_ID'] = 'crm';
$arFields['EDIT_FORM_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
$arFields['LIST_COLUMN_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
$arFields['LIST_FILTER_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
$arFields['SETTINGS']['LEAD'] = 'Y';
$arFields['SETTINGS']['CONTACT'] = 'Y';
$arFields['SETTINGS']['COMPANY'] = 'Y';
$arFields['SETTINGS']['DEAL'] = 'Y';
$arFields['MULTIPLE'] = 'Y';
$CAllUserTypeEntity = new CUserTypeEntity();
$CAllUserTypeEntity->Add($arFields);
}
if (isset($arFilter['ENTITY_TYPE']) && isset($arFilter['ENTITY_ID'])) {
$arFilter['ENTITY_TYPE'] = CUserTypeCrm::GetShortEntityType($arFilter['ENTITY_TYPE']);
$arFilter['UF_CRM_CAL_EVENT'] = $arFilter['ENTITY_TYPE'] . '_' . $arFilter['ENTITY_ID'];
unset($arFilter['ENTITY_TYPE'], $arFilter['ENTITY_ID']);
} else {
if (!empty($arFilter['ENTITY_TYPE'])) {
$arFilter['ENTITY_TYPE'] = CUserTypeCrm::GetShortEntityType($arFilter['ENTITY_TYPE']);
$arFilter['%UF_CRM_CAL_EVENT'] = $arFilter['ENTITY_TYPE'] . '_';
unset($arFilter['ENTITY_TYPE']);
} else {
$arFilter['!=UF_CRM_CAL_EVENT'] = '';
}
}
$arFilter['CAL_TYPE'] = 'user';
$arFilter['DELETED'] = 'N';
if (isset($arFilter['OWNER_ID']) && is_array($arFilter['OWNER_ID'])) {
$arFilter['OWNER_ID'] = current($arFilter['OWNER_ID']);
}
$arCal = CCalendarEvent::GetList(array('arFilter' => $arFilter, 'parseRecursion' => false, 'userId' => $USER->GetID(), 'fetchAttendees' => false, 'fetchMeetings' => true));
$obRes = new CDBResult();
$obRes->InitFromArray($arCal);
return $obRes;
}
示例9: isMandatoryUserFieldExists
/**
* @return bool true if some mandatory UF exists for TASKS
*/
public static function isMandatoryUserFieldExists()
{
/** @var $CACHE_MANAGER CCacheManager */
global $CACHE_MANAGER;
$isFieldExists = null;
// unknown yet
$obCache = new CPHPCache();
$lifeTime = CTasksTools::CACHE_TTL_UNLIM;
$cacheID = md5('uftasks');
$cacheDir = "/tasks/ufs";
if (defined('BX_COMP_MANAGED_CACHE') && $obCache->InitCache($lifeTime, $cacheID, $cacheDir)) {
$data = $obCache->GetVars();
$isFieldExists = $data['isFieldExists'];
} else {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$rsUserType = CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'TASKS_TASK', 'MANDATORY' => 'Y'));
if ($rsUserType->fetch()) {
$isFieldExists = true;
} else {
$isFieldExists = false;
}
if (defined('BX_COMP_MANAGED_CACHE') && $obCache->StartDataCache()) {
$CACHE_MANAGER->StartTagCache($cacheDir);
$CACHE_MANAGER->RegisterTag('tasks_user_fields');
$CACHE_MANAGER->EndTagCache();
$data = array('isFieldExists' => $isFieldExists);
$obCache->EndDataCache($data);
}
}
return $isFieldExists;
}
示例10: down
public function down()
{
global $APPLICATION;
\Bitrix\Main\Loader::includeModule("highloadblock");
$arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\SubscribeTable::getTableName())))->fetch();
if ($arHlblock) {
$arProps = array("UF_DATETIME_TO");
foreach ($arProps as $prop_name) {
$oUserTypeEntity = new \CUserTypeEntity();
$resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => $prop_name));
if ($aUserHasField = $resProperty->Fetch()) {
$oUserTypeEntity->Delete($aUserHasField['ID']);
$this->outSuccess("Свойство 'Дата окончания подписки' удалено!");
}
}
}
}
示例11: down
public function down()
{
global $APPLICATION;
$arHlData = $this->arHlData;
\Bitrix\Main\Loader::includeModule("highloadblock");
$arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\PeopleTable::getTableName())))->fetch();
if ($arHlblock) {
foreach ($arHlData as $fieldName => $fieldValue) {
$oUserTypeEntity = new \CUserTypeEntity();
$resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => $fieldName));
if ($aUserHasField = $resProperty->Fetch()) {
$oUserTypeEntity->Delete($aUserHasField['ID']);
$this->outSuccess("Свойство удалено!");
}
}
}
}
示例12: getUserEntityFields
function getUserEntityFields()
{
if (empty($this->_user_fields)) {
$rsData = CUserTypeEntity::GetList(array($by => $order), array());
while ($arData = $rsData->GetNext()) {
$this->_user_fields[$arData["ID"]] = $arData;
}
}
return $this->_user_fields;
}
示例13: getListFor
/**
* Возвращает список полей, которые подключены к пользователю
* @return array
*/
public static function getListFor($entity)
{
if (!isset(self::$_entities[$entity])) {
self::$_entities[$entity] = array();
$array = array();
$rsData = \CUserTypeEntity::GetList(array(), ['ENTITY_ID' => $entity]);
while ($ob = $rsData->Fetch()) {
self::$_entities[$entity][] = $ob;
}
}
return self::$_entities[$entity];
}
示例14: addValueToList
function addValueToList($field, $entity, $props)
{
$raw = CUserTypeEntity::GetList(array($by => $order), array('FIELD_NAME' => $field, 'ENTITY_ID' => $entity))->Fetch();
$fields = array();
$enum = CUserFieldEnum::GetList(array(), array("USER_FIELD_ID" => $raw['ID']));
while ($el = $enum->GetNext()) {
$fields[$el['XML_ID']] = $el;
}
if (!isset($fields[$props['XML_ID']])) {
$obEnum = new CUserFieldEnum();
$obEnum->SetEnumValues($raw['ID'], array("n0" => $props));
}
}
示例15: getEnumVariant
public function getEnumVariant($attr, $code)
{
$attrData = $this->attrs[$attr];
if (ltrim($attrData[0], '\\') != PropEnumElement::className()) {
throw new \Exception('Attr `' . $attr . '(' . $attrData[0] . ')` is not list');
}
$field = $this->attrsToFields[$attr];
$userField = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'USER', 'FIELD_NAME' => $field))->Fetch();
if (!$userField) {
throw new \Exception('User property `' . $field . '` as code `' . $field . '` not exists');
}
$gw = $this->getGatewayByEntityClass(PropEnumElement::className());
return $gw->findOne(array(array('attr' => 'propertyId', 'operator' => '', 'value' => $userField['ID']), array('attr' => 'xmlId', 'operator' => '', 'value' => $code)), array('value' => 'asc'));
}