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


PHP CCalendar::DeleteEvent方法代码示例

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


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

示例1: UpdateListItems

	public function UpdateListItems($listName, $updates)
	{
		global $USER;

		$arStatusValues = array_flip($this->arStatusValues);
		$arPriorityValues = array_flip($this->arPriorityValues);

		if (!$listName_original = CIntranetUtils::checkGUID($listName))
			return new CSoapFault('Data error', 'Wrong GUID - '.$listName);

		$obResponse = new CXMLCreator('Results');

		$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
		$arSections = CCalendarSect::GetList(array('arFilter' => array('XML_ID' => $listName_original)));
		if (!$arSections || !is_array($arSections[0]))
			return new CSoapFault(
				'List not found',
				'List with '.$listName.' GUID not found'
			);
		$arSection = $arSections[0];

		$bGroup = $arSection['CAL_TYPE'] == 'group';
		$calType = $arSection['CAL_TYPE'];
		$ownerId = $arSection['OWNER_ID'];

		if ($bGroup)
		{
			CModule::IncludeModule('socialnetwork');
			$arGroupTmp = CSocNetGroup::GetByID($arSection['SOCNET_GROUP_ID']);
			if ($arGroupTmp["CLOSED"] == "Y")
				if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")
					return new CSoapFault('Cannot modify archive group calendar', 'Cannot modify archive group calendar');
		}

		$obBatch = $updates->children[0];
		$atrONERROR = $obBatch->getAttribute('OnError');
		$atrDATEINUTC = $obBatch->getAttribute('DateInUtc');
		$atrPROPERTIES = $obBatch->getAttribute('Properties');

		$arChanges = $obBatch->children;

		$arResultIDs = array();
		$dateStart = ConvertTimeStamp(strtotime('-1 hour'), 'FULL');
		$arResponseRows = array();
		$arReplicationIDs = array();
		$userId = (is_object($USER) && $USER->GetID()) ? $USER->GetID() : 1;

		foreach ($arChanges as $obMethod)
		{
			$arData = array('_command' => $obMethod->getAttribute('Cmd'));

			foreach ($obMethod->children as $obField)
			{
				$name = $obField->getAttribute('Name');
				if ($name == 'MetaInfo')
					$name .= '_'.$obField->getAttribute('Property');

				$arData[$name] = $obField->content;
			}

			if ($arData['_command'] == 'Delete')
			{
				$obRes = new CXMLCreator('Result');
				$obRes->setAttribute('ID', $obMethod->getAttribute('ID').','.$arData['_command']);
				$obRes->setAttribute('List', $listName);
				$obRes->addChild($obNode = new CXMLCreator('ErrorCode'));

				$res = CCalendar::DeleteEvent($arData['ID']);
				if ($res === true)
					$obNode->setData('0x00000000');
				else
					$obNode->setData('0x81020014');

				/*
					0x00000000 - ok
					0x81020015 - data conflict
					0x81020014 - generic error such as invalid value for Field
					0x81020016 - item does not exist
				*/

				$obResponse->addChild($obRes);
			}
			elseif ($arData['_command'] == 'New' || $arData['_command'] == 'Update')
			{
				$q = ToLower($arData['Description']);
				if (($pos = strrpos($q, '</body>')) !== false) $arData['Description'] = substr($arData['Description'], 0, $pos);
				if (($pos = strpos($q, '<body>')) !== false) $arData['Description'] = substr($arData['Description'], $pos + 6);

				$arData['Description'] = str_replace('</DIV>', "\r\n</DIV>", $arData['Description']);
				$arData['Description'] = str_replace(array("&#10;", "&#13;"), "", $arData['Description']);
				$arData['Description'] = preg_replace("/<![^>]*>/", '', $arData['Description']);
				//$arData['Description'] = strip_tags($arData['Description']);
				$arData['Description'] = trim($arData['Description']);

				$arData['Location'] = trim($arData['Location']);

				if (isset($arData['EventDate']))
				{
					$arData['EventDate'] = $this->__makeTS($arData['EventDate']);
					$arData['EndDate'] = $this->__makeTS($arData['EndDate']) + ($arData['fAllDayEvent'] ? -86340 : 0);
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:webservice.php

示例2: array_merge

}
$arResult['HEADERS'] = array_merge($arResult['HEADERS'], array(array('id' => 'DT_FROM', 'name' => GetMessage('CRM_COLUMN_DATE_START'), 'sort' => 'date_end', 'default' => true, 'editable' => false, 'type' => 'date'), array('id' => 'DT_TO', 'name' => GetMessage('CRM_COLUMN_DATE_END'), 'sort' => 'date_to', 'default' => true, 'editable' => false, 'type' => 'date'), array('id' => 'DESCRIPTION', 'name' => GetMessage('CRM_COLUMN_DESCRIPTION'), 'sort' => 'description', 'default' => false, 'editable' => false, 'type' => 'string'), array('id' => 'OWNER_ID', 'name' => GetMessage('CRM_COLUMN_ASSIGNED_BY'), 'sort' => 'responsible_id', 'default' => true, 'editable' => false)));
if ($_SERVER['REQUEST_METHOD'] == 'GET' && check_bitrix_sessid() && isset($_GET['action_' . $arResult['GRID_ID']])) {
    if ($_GET['action_' . $arResult['GRID_ID']] == 'delete') {
        global $USER_FIELD_MANAGER;
        $_GET['ID'] = (int) $_GET['ID'];
        $_GET['OWNER_ID'] = (int) $_GET['OWNER_ID'];
        $arUserFields = $USER_FIELD_MANAGER->GetUserFields('CALENDAR_EVENT', $_GET['ID'], LANGUAGE_ID);
        if (isset($arUserFields['UF_CRM_CAL_EVENT'])) {
            if (count($arUserFields['UF_CRM_CAL_EVENT']['VALUE']) > 1) {
                if (($k = array_search($_GET['REL_ID'], $arUserFields['UF_CRM_CAL_EVENT']['VALUE'])) !== false) {
                    unset($arUserFields['UF_CRM_CAL_EVENT']['VALUE'][$k]);
                    $USER_FIELD_MANAGER->Update('CALENDAR_EVENT', $_GET['ID'], array('UF_CRM_CAL_EVENT' => $arUserFields['UF_CRM_CAL_EVENT']['VALUE']));
                }
            } else {
                CCalendar::DeleteEvent($_GET['ID']);
            }
        }
        unset($_GET['ID'], $_POST['ID'], $_REQUEST['ID']);
        // otherwise the filter will work
    }
    if (!isset($_GET['AJAX_CALL'])) {
        LocalRedirect($bInternal ? '?' . $arParams['FORM_ID'] . '_active_tab=tab_activity' : '');
    }
}
$CGridOptions = new CCrmGridOptions($arResult['GRID_ID']);
if (isset($_REQUEST['clear_filter']) && $_REQUEST['clear_filter'] == 'Y') {
    $urlParams = array();
    foreach ($arResult['FILTER'] as $id => $arFilter) {
        if ($arFilter['type'] == 'user') {
            $urlParams[] = $arFilter['id'];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例3: EventDelete

 public static function EventDelete($arParams = array(), $nav = null, $server = null)
 {
     $methodName = "calendar.event.delete";
     if (isset($arParams['id']) && intVal($arParams['id']) > 0) {
         $id = intVal($arParams['id']);
     } else {
         throw new Exception(GetMessage('CAL_REST_EVENT_ID_EXCEPTION'));
     }
     $res = CCalendar::DeleteEvent($id, false);
     if ($res !== true) {
         if ($res === false) {
             throw new Exception(GetMessage('CAL_REST_EVENT_DELETE_ERROR'));
         } else {
             throw new Exception($res);
         }
     }
     return $res;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:18,代码来源:calendar_restservice.php

示例4: array

        }
        if (isset($_POST['rrule']) && $_POST['rrule'] == '') {
            $arFields['RRULE'] = '';
        }
        if ($arFields['IS_MEETING']) {
            $arFields['ATTENDEES'] = $_POST['attendees'];
            $arFields['ATTENDEES'] = $_POST['attendees'];
            if ($newMeeting && !in_array($ownerId, $arFields['ATTENDEES'])) {
                $arFields['ATTENDEES'][] = $ownerId;
            }
            $arFields['MEETING_HOST'] = $ownerId;
            $arFields['MEETING'] = array('HOST_NAME' => CCalendar::GetUserName($ownerId), 'TEXT' => '', 'OPEN' => false, 'NOTIFY' => true, 'REINVITE' => true);
        }
        $newId = CCalendar::SaveEvent(array('arFields' => $arFields, 'autoDetectSection' => true, 'autoCreateSection' => true));
    } elseif ($_REQUEST['app_calendar_action'] == 'drop_event' && check_bitrix_sessid()) {
        $res = CCalendar::DeleteEvent(intVal($_POST['event_id']));
    }
    die;
}
$calType = 'user';
$ownerId = $userId;
if ($arResult['NEW']) {
} else {
    $Event = CCalendarEvent::GetList(array('arFilter' => array("ID" => $eventId, "OWNER_ID" => $userId, "DELETED" => "N"), 'parseRecursion' => false, 'fetchAttendees' => true, 'fetchMeetings' => true, 'checkPermissions' => true, 'setDefaultLimit' => false));
    if ($Event && is_array($Event[0])) {
        $Event = $Event[0];
        if ($Event['IS_MEETING']) {
            foreach ($Event['~ATTENDEES'] as $attendee) {
                $attendee['DISPLAY_NAME'] = CCalendar::GetUserName($attendee);
                $arAttendees[] = $attendee;
            }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: define

define("NOT_CHECK_PERMISSIONS", true);
define("BX_PUBLIC_TOOLS", true);
define("ADMIN_SECTION", true);
// mantiss: 52059
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/bx_root.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
if (!CModule::IncludeModule("calendar") || !class_exists("CCalendar")) {
    return;
}
$event_feed_action = $_REQUEST["event_feed_action"];
if (!empty($event_feed_action) && check_bitrix_sessid()) {
    $GLOBALS["APPLICATION"]->ShowAjaxHead();
    $userId = $GLOBALS["USER"]->GetId();
    $eventId = intVal($_REQUEST['event_id']);
    if ($event_feed_action == 'delete_event') {
        $res = CCalendar::DeleteEvent($eventId);
        if ($res) {
            echo '#EVENT_FEED_RESULT_OK#';
        }
    } else {
        $status = false;
        if ($event_feed_action == 'decline') {
            $status = 'N';
        } elseif ($event_feed_action == 'accept') {
            $status = 'Y';
        }
        if ($status && $eventId) {
            CCalendarEvent::SetMeetingStatus($userId, $eventId, $status);
            $Events = CCalendarEvent::GetList(array('arFilter' => array("ID" => $eventId, "DELETED" => "N"), 'parseRecursion' => false, 'fetchAttendees' => true, 'checkPermissions' => true, 'setDefaultLimit' => false));
            if ($Events && is_array($Events[0]) && $Events[0]['IS_MEETING']) {
                $ajaxParams = $_REQUEST['ajax_params'];
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:action.php


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