コード例 #1
0
 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');
 }
コード例 #2
0
 function UnInstallUserFields()
 {
     @set_time_limit(0);
     $db_res = CUserTypeEntity::GetList(array("ID" => "ASC"), array("USER_TYPE_ID" => "vote"));
     if ($db_res && ($res = $db_res->Fetch())) {
         $GLOBALS["DB"]->StartTransaction();
         $obUserField = new CUserTypeEntity();
         @set_time_limit(0);
         do {
             if ($obUserField->Delete($res["ID"])) {
                 $GLOBALS["DB"]->Rollback();
             }
         } while ($res = $db_res->Fetch());
         $GLOBALS["DB"]->Commit();
     }
 }
コード例 #3
0
 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("Свойство удалено!");
             }
         }
     }
 }
コード例 #4
0
 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("Свойство 'Дата окончания подписки' удалено!");
             }
         }
     }
 }
コード例 #5
0
 /**
  * Delete
  * @param $entityName
  * @param $fieldName
  * @return mixed
  * @throws \Exception
  */
 public static function Delete($entityName, $fieldName)
 {
     if (empty($entityName)) {
         throw new \Exception('entityName is required');
     }
     if (empty($fieldName)) {
         throw new \Exception('fieldName is required.');
     }
     $filter = array('NAME' => $entityName);
     $hlBlockDbRes = HL\HighloadBlockTable::getList(array("filter" => $filter));
     if (!$hlBlockDbRes->getSelectedRowsCount()) {
         throw new \Exception('Not found highloadBlock with entityName = ' . $entityName);
     }
     $hlBlockRow = $hlBlockDbRes->fetch();
     $entity = HL\HighloadBlockTable::compileEntity($hlBlockRow);
     $entityDataClass = $entity->getDataClass();
     $obList = $entityDataClass::getList(array("select" => array("ID")));
     if ($obList->getSelectedRowsCount() > 0) {
         throw new \Exception('Unable to remove a highloadBlock[ ' . $entityName . ' ], because it has elements');
     }
     $userFieldEntity = self::_getEntityId($entityName);
     $typeEntityDbRes = \CUserTypeEntity::GetList(array(), array("ENTITY_ID" => $userFieldEntity, "FIELD_NAME" => $fieldName));
     if ($typeEntityDbRes->SelectedRowsCount() > 0) {
         $hlBlockFieldData = $typeEntityDbRes->Fetch();
         $userType = new \CUserTypeEntity();
         if (!$userType->Delete($hlBlockFieldData['ID'])) {
             throw new \Exception('Not delete Hlblock field');
         }
         return $hlBlockFieldData['ID'];
     }
 }
コード例 #6
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
 function UnInstallUserFields($arParams = array())
 {
     if (!$arParams['savedata']) {
         $res = CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'USER', 'FIELD_NAME' => 'UF_IM_SEARCH'));
         $arFieldData = $res->Fetch();
         if (isset($arFieldData['ID'])) {
             $CUserTypeEntity = new CUserTypeEntity();
             $CUserTypeEntity->Delete($arFieldData['ID']);
         }
     }
     return true;
 }
コード例 #7
0
ファイル: crm_fields.php プロジェクト: DarneoStudio/bitrix
 public function DeleteField($ID)
 {
     $obUserField = new CUserTypeEntity();
     @set_time_limit(0);
     $this->cdb->StartTransaction();
     if (!$obUserField->Delete($ID)) {
         $this->cdb->Rollback();
         $this->SetError(array('id' => 'DELETE_ENTITY_ID', 'text' => GetMessage('CRM_FIELDS_ERROR_DELETE_ENTITY_ID')));
         return false;
     }
     $this->cdb->Commit();
     UserFieldHistory::processRemoval(CCrmOwnerType::ResolveIDByUFEntityID($this->sUFEntityID), $ID);
     $this->arUFList = $this->GetUserFields($this->sUFEntityID, 0, LANGUAGE_ID);
     return true;
 }
コード例 #8
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
 function UnInstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
         $rsUserType = CUserTypeEntity::getList(array(), array('ENTITY_ID' => 'TASKS_TASK', 'FIELD_NAME' => 'UF_TASK_WEBDAV_FILES'));
         if ($arUserType = $rsUserType->fetch()) {
             $obUserField = new CUserTypeEntity();
             $obUserField->Delete($arUserType['ID']);
         }
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/tasks/install/db/" . strtolower($DB->type) . "/uninstall.sql");
     }
     //delete agents
     CAgent::RemoveModuleAgents("tasks");
     if (CModule::IncludeModule("search")) {
         CSearch::DeleteIndex("tasks");
     }
     UnRegisterModule("tasks");
     UnRegisterModuleDependences("search", "OnReindex", "tasks", "CTasks", "OnSearchReindex");
     UnRegisterModuleDependences("main", "OnUserDelete", "tasks", "CTasks", "OnUserDelete");
     UnRegisterModuleDependences("im", "OnGetNotifySchema", "tasks", "CTasksNotifySchema", "OnGetNotifySchema");
     UnRegisterModuleDependences('main', 'OnBeforeUserDelete', 'tasks', 'CTasks', 'OnBeforeUserDelete');
     UnRegisterModuleDependences("pull", "OnGetDependentModule", "tasks", "CTasksPullSchema", "OnGetDependentModule");
     UnRegisterModuleDependences('search', 'BeforeIndex', 'tasks', 'CTasksTools', 'FixForumCommentURL');
     UnRegisterModuleDependences('intranet', 'OnPlannerInit', 'tasks', 'CTaskPlannerMaintance', 'OnPlannerInit');
     UnRegisterModuleDependences('intranet', 'OnPlannerAction', 'tasks', 'CTaskPlannerMaintance', 'OnPlannerAction');
     UnRegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'tasks', 'CTaskRestService', 'OnRestServiceBuildDescription');
     UnRegisterModuleDependences('forum', 'OnCommentTopicAdd', 'tasks', 'CTaskComments', 'onCommentTopicAdd');
     UnRegisterModuleDependences('forum', 'OnAfterCommentTopicAdd', 'tasks', 'CTaskComments', 'onAfterCommentTopicAdd');
     UnRegisterModuleDependences('forum', 'OnAfterCommentAdd', 'tasks', 'CTaskComments', 'onAfterCommentAdd');
     UnRegisterModuleDependences('forum', 'OnAfterCommentUpdate', 'tasks', 'CTaskComments', 'onAfterCommentUpdate');
     UnRegisterModuleDependences('forum', 'OnModuleUnInstall', 'tasks', 'CTasksRarelyTools', 'onForumUninstall');
     UnRegisterModuleDependences('webdav', 'OnModuleUnInstall', 'tasks', 'CTasksRarelyTools', 'onWebdavUninstall');
     UnRegisterModuleDependences('intranet', 'OnModuleUnInstall', 'tasks', 'CTasksRarelyTools', 'onIntranetUninstall');
     UnRegisterModuleDependences('timeman', 'OnAfterTMDayStart', 'tasks', 'CTaskPlannerMaintance', 'OnAfterTMDayStart');
     UnRegisterModuleDependences('timeman', 'OnAfterTMDayStart', 'tasks', 'CTaskCountersNotifier', 'onAfterTimeManagerDayStart');
     UnRegisterModuleDependences('timeman', 'OnAfterTMEntryUpdate', 'tasks', 'CTaskTimerManager', 'onAfterTMEntryUpdate');
     UnRegisterModuleDependences('tasks', 'OnBeforeTaskUpdate', 'tasks', 'CTaskTimerManager', 'onBeforeTaskUpdate');
     UnRegisterModuleDependences('tasks', 'OnBeforeTaskDelete', 'tasks', 'CTaskTimerManager', 'onBeforeTaskDelete');
     UnRegisterModuleDependences('socialnetwork', 'OnBeforeSocNetGroupDelete', 'tasks', 'CTasks', 'onBeforeSocNetGroupDelete');
     UnRegisterModuleDependences("main", "OnAfterRegisterModule", "main", "tasks", "InstallUserFields", "/modules/tasks/install/index.php");
     // check webdav UF
     UnRegisterModuleDependences("main", "OnBeforeUserTypeAdd", "tasks", "CTasksRarelyTools", "onBeforeUserTypeAdd");
     UnRegisterModuleDependences("main", "OnBeforeUserTypeUpdate", "tasks", "CTasksRarelyTools", "onBeforeUserTypeUpdate");
     UnRegisterModuleDependences("main", "OnBeforeUserTypeDelete", "tasks", "CTasksRarelyTools", "onBeforeUserTypeDelete");
     // im "ilike"
     UnRegisterModuleDependences("main", "OnGetRatingContentOwner", "tasks", "CTaskNotifications", "OnGetRatingContentOwner");
     UnRegisterModuleDependences("im", "OnGetMessageRatingVote", "tasks", "CTaskNotifications", "OnGetMessageRatingVote");
     if ((!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") && IsModuleInstalled('socialnetwork') && CModule::IncludeModule('socialnetwork')) {
         $dbRes = CSocNetLog::GetList(array(), array("EVENT_ID" => "tasks"), false, false, array("ID"));
         if ($dbRes) {
             while ($arRes = $dbRes->Fetch()) {
                 CSocNetLog::Delete($arRes["ID"]);
             }
         }
     }
     // Remove tasks from IM
     if (IsModuleInstalled('im') && CModule::IncludeModule('im')) {
         if (method_exists('CIMNotify', 'DeleteByModule')) {
             CIMNotify::DeleteByModule('tasks');
         }
     }
     // remove comment edit flags
     COption::RemoveOption('tasks', 'task_comment_allow_edit', '');
     COption::RemoveOption('tasks', 'task_comment_allow_remove', '');
     return true;
 }
コード例 #9
0
ファイル: index.php プロジェクト: webgksupport/alpina
 function UnInstallUserFields()
 {
     $keysUserFields = array("UF_CATEGORY_CODE", "UF_ANSWER_ID", "UF_ORIGINAL_ID", "UF_STATUS");
     global $USER_FIELD_MANAGER;
     $oUserFields = $USER_FIELD_MANAGER->GetUserFields("BLOG_POST");
     $ent = new CUserTypeEntity();
     foreach ($oUserFields as $UserFieldName => $arUserField) {
         if (in_array($UserFieldName, $keysUserFields)) {
             $ent->Delete($arUserField["ID"]);
         }
     }
     return;
 }
コード例 #10
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
 function UnInstallUserFields()
 {
     $ent = new CUserTypeEntity();
     foreach (array("disk_file", "disk_version") as $type) {
         $rsData = CUserTypeEntity::GetList(array("ID" => "ASC"), array("USER_TYPE_ID" => $type));
         if ($rsData && ($arRes = $rsData->Fetch())) {
             do {
                 $ent->Delete($arRes['ID']);
             } while ($arRes = $rsData->Fetch());
         }
     }
 }
コード例 #11
0
ファイル: index.php プロジェクト: ASDAFF/1C_Bitrix_info_site
	function UnInstallUserFields($id = "all")
	{
		$id = (empty($id) ? "all" : (in_array($id, array("all", "webdav"/*, "blog"*/)) ? $id : false));
		if (!!$id)
		{
			$arFields = array(
				array(
					"ENTITY_ID" => "SONET_LOG",
					"FIELD_NAME" => "UF_SONET_LOG_FILE",
					"XML_ID" => "UF_SONET_LOG_FILE"
				),
				array(
					"ENTITY_ID" => "SONET_LOG",
					"FIELD_NAME" => "UF_SONET_LOG_DOC",
					"XML_ID" => "UF_SONET_LOG_DOC"
				),
				array(
					"ENTITY_ID" => "SONET_COMMENT",
					"FIELD_NAME" => "UF_SONET_COM_FILE",
					"XML_ID" => "UF_SONET_COM_FILE"
				),
				array(
					"ENTITY_ID" => "SONET_COMMENT",
					"FIELD_NAME" => "UF_SONET_COM_DOC",
					"XML_ID" => "UF_SONET_COM_DOC"
				),
				array(
					"ENTITY_ID" => "BLOG_POST",
					"FIELD_NAME" => "UF_BLOG_POST_IMPRTNT",
					"XML_ID" => "UF_BLOG_POST_IMPRTNT"
				),
				array(
					"ENTITY_ID" => "BLOG_POST",
					"FIELD_NAME" => "UF_BLOG_POST_VOTE",
					"XML_ID" => "UF_BLOG_POST_VOTE"
				),
			);

			if ($id == "webdav")
				$arFields = array(
					array(
						"ENTITY_ID" => "SONET_LOG",
						"FIELD_NAME" => "UF_SONET_LOG_DOC",
						"XML_ID" => "UF_SONET_LOG_DOC"
					),
					array(
						"ENTITY_ID" => "SONET_COMMENT",
						"FIELD_NAME" => "UF_SONET_COM_DOC",
						"XML_ID" => "UF_SONET_COM_DOC"
					),
				);

			foreach ($arFields as $arField)
			{
				$rsData = CUserTypeEntity::GetList(array("ID" => "ASC"), $arField);
				if ($arRes = $rsData->Fetch())
				{
					$ent = new CUserTypeEntity;
					$ent->Delete($arRes['ID']);
					if ($arField["FIELD_NAME"] == "UF_BLOG_POST_IMPRTNT" && $GLOBALS["DB"]->TableExists("b_uts_blog_post") &&
						$GLOBALS["DB"]->IndexExists("b_uts_blog_post", array("UF_BLOG_POST_IMPRTNT", "VALUE_ID")))
					{
						$GLOBALS["DB"]->Query("DROP INDEX UX_UF_BLOG_POST_IMPRTNT ON b_uts_blog_post", true);
					}
				}
			}
		}
	}
コード例 #12
0
	public function UnInstallUserTypes($arParams = array())
	{
		if((!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y"))
		{
			$ob = new \CUserTypeEntity();

			$arFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields(SimpleModule\EntityTable::getUfId());
			foreach($arFields as $key => $val)
				$ob->Delete($val["ID"]);

			UnRegisterModuleDependences("main", "OnUserTypeBuildList", self::MODULE_ID, "SimpleModule\\Usertype\\StatLocation", "GetUserTypeDescription");
		}

		return true;
	}
コード例 #13
0
ファイル: catalog.php プロジェクト: k-kalashnikov/geekcon_new
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
    if (WIZARD_INSTALL_DEMO_DATA) {
        $arCatalog = CCatalog::GetByIDExt($arIBlock["ID"]);
        if (is_array($arCatalog) && in_array($arCatalog['CATALOG_TYPE'], array('P', 'X')) == true) {
            CCatalog::UnLinkSKUIBlock($arIBlock["ID"]);
            CIBlock::Delete($arCatalog['OFFERS_IBLOCK_ID']);
        }
        CIBlock::Delete($arIBlock["ID"]);
        $iblockID = false;
        COption::SetOptionString("eshop", "demo_deleted", "N", "", WIZARD_SITE_ID);
        $dbRes = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => 'IBLOCK_' . $arIBlock["ID"] . '_SECTION'));
        while ($arRes = $dbRes->Fetch()) {
            $userType = new CUserTypeEntity();
            $userType->Delete($arRes["ID"]);
        }
    }
}
$dbResultList = CCatalogGroup::GetList(array(), array("CODE" => "BASE"));
if (!$dbResultList->Fetch()) {
    $arFields = array();
    $rsLanguage = CLanguage::GetList($by, $order, array());
    while ($arLanguage = $rsLanguage->Fetch()) {
        WizardServices::IncludeServiceLang("catalog.php", $arLanguage["ID"]);
        $arFields["USER_LANG"][$arLanguage["ID"]] = GetMessage("WIZ_PRICE_NAME");
    }
    $arFields["BASE"] = "Y";
    $arFields["SORT"] = 100;
    $arFields["NAME"] = "BASE";
    $arFields["USER_GROUP"] = array(1, 2);
コード例 #14
0
ファイル: index.php プロジェクト: ASDAFF/bitrix-5
	function UnInstallUserFields()
	{
		@set_time_limit(0);
		$db_res = CUserTypeEntity::GetList(array("ID" => "ASC"), array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => "UF_BLOG_POST_IMPORTANT"));
		if ($db_res && ($res = $db_res->Fetch())) {
			$GLOBALS["DB"]->StartTransaction();
			$obUserField = new CUserTypeEntity;
			@set_time_limit(0);
			do {
				if ($obUserField->Delete($res["ID"]))
					$GLOBALS["DB"]->Rollback();
			} while ($res = $db_res->Fetch());
			$GLOBALS["DB"]->Commit();
		}
	}
コード例 #15
0
ファイル: index.php プロジェクト: nycmic/bittest
	function UnInstallUserFields()
	{
		global $USER_FIELD_MANAGER;
		$errors = null;

		$arFields = array(
			"BLOG_POST" => array(
				"ENTITY_ID" => "BLOG_POST",
				"FIELD_NAME" => "UF_BLOG_POST_DOC",
				"XML_ID" => "UF_BLOG_POST_DOC"
			),
			"BLOG_COMMENT" => array(
				"ENTITY_ID" => "BLOG_COMMENT",
				"FIELD_NAME" => "UF_BLOG_COMMENT_DOC",
				"XML_ID" => "UF_BLOG_COMMENT_DOC"
			),
		);

		foreach ($arFields as $fieldName => $arField)
		{
			$rsData = CUserTypeEntity::GetList(array($by=>$order), $arField);
			if ($arRes = $rsData->Fetch())
			{
				$ent = new CUserTypeEntity;
				$ent->Delete($arRes['ID']);
			}
		}
		return $errors;
	}
コード例 #16
0
 public static function DropSectionProperty()
 {
     // Check UF for iblock sections
     global $USER_FIELD_MANAGER;
     $db_res = CUserTypeEntity::GetList(array('ID' => 'ASC'), array("FIELD_NAME" => "UF_CAL_CONVERTED"));
     while ($r = $db_res->GetNext()) {
         $obUserField = new CUserTypeEntity();
         $r = $obUserField->Delete($r["ID"]);
         $USER_FIELD_MANAGER->arFieldsCache = array();
     }
 }
コード例 #17
0
ファイル: Coded.php プロジェクト: marvin255/bxmigrate
 /**
  * @var string $entity
  * @var string $code
  */
 protected function UFDelete($entity, $code)
 {
     $id = $this->UFGetIdByCode($entity, $code);
     if ($id) {
         global $DB;
         $group = new \CUserTypeEntity();
         $DB->StartTransaction();
         if (!$group->Delete($id)) {
             $DB->Rollback();
             $error = "Can't delete user field {$code}";
         }
         $DB->Commit();
         echo "Delete user field {$code}\r\n";
         if (isset($error)) {
             throw new \Exception($error);
         }
     }
 }
コード例 #18
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
 function UnInstallUserFields()
 {
     $arFields = array("ENTITY_ID" => "FORUM_MESSAGE");
     $rsData = CUserTypeEntity::GetList(array("ID" => "ASC"), $arFields);
     if ($rsData && ($arRes = $rsData->Fetch())) {
         $ent = new CUserTypeEntity();
         do {
             $ent->Delete($arRes['ID']);
         } while ($arRes = $rsData->Fetch());
     }
     return;
 }
コード例 #19
0
ファイル: userfield_admin.php プロジェクト: ASDAFF/open_bx
	$obUserField = new CUserTypeEntity;
	foreach($arID as $ID)
	{
		if(strlen($ID)<=0)
			continue;
		$ID = IntVal($ID);
		//Rights check
		if($USER_FIELD_MANAGER->GetRights(false, $ID) < "W")
			continue;
		//Do action
		switch($_REQUEST['action'])
		{
		case "delete":
			@set_time_limit(0);
			$DB->StartTransaction();
			if(!$obUserField->Delete($ID))
			{
				$DB->Rollback();
				$lAdmin->AddGroupError(GetMessage("USERTYPE_DEL_ERROR"), $ID);
			}
			$DB->Commit();
			break;
		}
	}
}


$rsData = CUserTypeEntity::GetList(array($by=>$order), $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("USERTYPE_NAV")));
コード例 #20
-1
 /**
  * Delete
  * @param $entityName
  * @return bool
  * @throws \Exception
  */
 public static function Delete($entityName)
 {
     $userType = new \CUserTypeEntity();
     if (!strlen($entityName)) {
         throw new BimException('Incorrect entityName param value');
     }
     $filter = array('NAME' => $entityName);
     $hlBlockDbRes = HL\HighloadBlockTable::getList(array("filter" => $filter));
     if (!$hlBlockDbRes->getSelectedRowsCount()) {
         throw new BimException('Not found highloadBlock with entityName = ' . $entityName);
     }
     $hlBlockRow = $hlBlockDbRes->fetch();
     $entity = HL\HighloadBlockTable::compileEntity($hlBlockRow);
     $entityDataClass = $entity->getDataClass();
     $obList = $entityDataClass::getList();
     if ($obList->getSelectedRowsCount() > 0) {
         throw new BimException('Unable to remove a highloadBlock[' . $entityName . '], because it has elements');
     }
     # delete all Fields
     $obHl = $userType->GetList(array(), array("ENTITY_ID" => "HLBLOCK_" . $hlBlockRow['ID']));
     while ($arHl = $obHl->Fetch()) {
         $obUF = new \CUserTypeEntity();
         $obUF->Delete($arHl['ID']);
     }
     $delResult = HL\HighloadBlockTable::delete($hlBlockRow['ID']);
     if (!$delResult->isSuccess()) {
         throw new BimException(implode(", ", $delResult->getErrorMessages()));
     }
     return true;
 }
コード例 #21
-1
 public function down()
 {
     global $APPLICATION;
     \Bitrix\Main\Loader::includeModule("highloadblock");
     $arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\ProgExternalTable::getTableName())))->fetch();
     if ($arHlblock) {
         $oUserTypeEntity = new \CUserTypeEntity();
         $resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => "UF_DATETIME"));
         if ($aUserHasField = $resProperty->Fetch()) {
             $oUserTypeEntity->Delete($aUserHasField['ID']);
             $this->outSuccess("Свойство 'Дата добавления' удалено!");
         }
     }
 }