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


PHP CCalendar::GetMeetingSection方法代码示例

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


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

示例1: ApplyAccessRestrictions

 public static function ApplyAccessRestrictions($event, $userId = false)
 {
     $sectId = $event['SECT_ID'];
     if (!$event['ACCESSIBILITY']) {
         $event['ACCESSIBILITY'] = 'busy';
     }
     $private = $event['PRIVATE_EVENT'] && $event['CAL_TYPE'] == 'user';
     $bManager = false;
     $bAttendee = false;
     if (isset($event['~ATTENDEES'])) {
         foreach ($event['~ATTENDEES'] as $user) {
             if ($user['USER_ID'] == $userId) {
                 $bAttendee = true;
             }
         }
     }
     if (!$userId) {
         $userId = CCalendar::GetUserId();
     }
     $settings = CCalendar::GetSettings(array('request' => false));
     if (CModule::IncludeModule('intranet') && $event['CAL_TYPE'] == 'user' && $settings['dep_manager_sub']) {
         $bManager = in_array($userId, CCalendar::GetUserManagers($event['OWNER_ID'], true));
     }
     if ($event['CAL_TYPE'] == 'user' && $event['IS_MEETING'] && $event['OWNER_ID'] != $userId) {
         if ($bAttendee) {
             $sectId = CCalendar::GetMeetingSection($userId);
         } elseif (isset($event['USER_MEETING']['ATTENDEE_ID']) && $event['USER_MEETING']['ATTENDEE_ID'] !== $userId) {
             $sectId = CCalendar::GetMeetingSection($event['USER_MEETING']['ATTENDEE_ID']);
             $event['SECT_ID'] = $sectId;
             $event['OWNER_ID'] = $event['USER_MEETING']['ATTENDEE_ID'];
         }
     }
     if ($private || !CCalendarSect::CanDo('calendar_view_full', $sectId, $userId) && !$bManager && !$bAttendee) {
         if ($private) {
             $event['NAME'] = '[' . GetMessage('EC_ACCESSIBILITY_' . strtoupper($event['ACCESSIBILITY'])) . ']';
             if (!$bManager && !CCalendarSect::CanDo('calendar_view_time', $sectId, $userId)) {
                 return false;
             }
         } else {
             if (!CCalendarSect::CanDo('calendar_view_title', $sectId, $userId)) {
                 if (CCalendarSect::CanDo('calendar_view_time', $sectId, $userId)) {
                     $event['NAME'] = '[' . GetMessage('EC_ACCESSIBILITY_' . strtoupper($event['ACCESSIBILITY'])) . ']';
                 } else {
                     return false;
                 }
             } else {
                 $event['NAME'] = $event['NAME'] . ' [' . GetMessage('EC_ACCESSIBILITY_' . strtoupper($event['ACCESSIBILITY'])) . ']';
             }
         }
         $event['~IS_MEETING'] = $event['IS_MEETING'];
         // Clear information about
         unset($event['DESCRIPTION'], $event['IS_MEETING'], $event['MEETING_HOST'], $event['MEETING'], $event['LOCATION'], $event['REMIND'], $event['USER_MEETING'], $event['~ATTENDEES'], $event['ATTENDEES_CODES']);
     }
     return $event;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:55,代码来源:calendar_event.php

示例2: GetCurUserMeetingSection

 public static function GetCurUserMeetingSection($bCreate = false)
 {
     if (!isset(self::$userMeetingSection) || !self::$userMeetingSection) {
         self::$userMeetingSection = CCalendar::GetMeetingSection(self::$userId, $bCreate);
     }
     return self::$userMeetingSection;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:7,代码来源:calendar.php

示例3: UpdateListItems


//.........这里部分代码省略.........
				elseif($arData['fRecurrence'] == -1 && $id > 0)
				{
					$arData['RRULE'] = -1;
				}

				if (isset($arData['EventDate']))
				{
					$skipTime = $arData['fAllDayEvent'] ? 'Y' : 'N';
					$TZBias = $arData['fAllDayEvent'] ? 0 : $TZBias;
					$arData['EventDate'] += $TZBias;
					$arData['EndDate'] += $TZBias;

//					$arData["DT_FROM"] = ConvertTimeStamp($arData['EventDate'], 'FULL');
//					$arData["DT_TO"] = ConvertTimeStamp($arData['EndDate'], 'FULL');
				}
				else
				{
					$arData["DT_FROM"] = -1;
					$arData["DT_TO"] = -1;
				}

				// fields
				$arFields = array(
					"ID" => $id,
					'CAL_TYPE' => $calType,
					'OWNER_ID' => $ownerId,
					'CREATED_BY' => $userId,
					'DT_FROM_TS' => $arData['EventDate'],
					'DT_TO_TS' => $arData['EndDate'],
					'DT_SKIP_TIME' => $skipTime,
//					"DT_FROM" => $arData["DT_FROM"],
//					"DT_TO" => $arData["DT_TO"],
					'NAME' => $arData['Title'],
					'DESCRIPTION' => CCalendar::ParseHTMLToBB($arData['Description']),
					'SECTIONS' => array($arSection['ID']),
					'ACCESSIBILITY' => $arStatusValues[$arData['MetaInfo_BusyStatus']],
					'IMPORTANCE' => $arPriorityValues[$arData['MetaInfo_Priority']],
					'RRULE' => $arData['RRULE'],
					'LOCATION' => CCalendar::UnParseTextLocation($arData['Location'])
				);

				if (isset($arData['DT_LENGTH']) && $arData['DT_LENGTH'] > 0)
					$arFields['DT_LENGTH'] = $arData['DT_LENGTH'];

				$EventID = CCalendar::SaveEvent(
					array(
						'arFields' => $arFields,
						'fromWebservice' => true
					)
				);

				if ($EventID)
				{
					// dirty hack
					$arReplicationIDs[$EventID] = $arData['MetaInfo_ReplicationID'];

					$arResponseRows[$EventID] = new CXMLCreator('Result');
					$arResponseRows[$EventID]->setAttribute('ID', $obMethod->getAttribute('ID').','.$arData['_command']);
					$arResponseRows[$EventID]->setAttribute('List', $listName);

					$arResponseRows[$EventID]->addChild($obNode = new CXMLCreator('ErrorCode'));
					$obNode->setData('0x00000000');
					//$arResponseRows[$EventID]->setAttribute('Version', 3);
				}
			}
		}

		$userId = (is_object($USER) && $USER->GetID()) ? $USER->GetID() : 1;
		$fetchMeetings = CCalendar::GetMeetingSection($userId) == $arSection['ID'];
		$arEvents = CCalendarEvent::GetList(
			array(
				'arFilter' => array(
					'CAL_TYPE' => $calType,
					'OWNER_ID' => $ownerId,
					'SECTION' => $arSection['ID'],
					//'INCLUDE_INVITINGS' => 'N'
				),
				'getUserfields' => false,
				'parseRecursion' => false,
				'fetchAttendees' => false,
				'fetchMeetings' => $fetchMeetings,
				'userId' => $userId
			)
		);

		foreach ($arEvents as $key => $event)
		{
			if ($arResponseRows[$event['ID']])
			{
				$obRow = $this->__getRow($event, $listName, $last_change = 0);
				$obRow->setAttribute('xmlns:z', "#RowsetSchema");
				if ($arReplicationIDs[$event['ID']])
					$obRow->setAttribute('MetaInfo_ReplicationID', $arReplicationIDs[$event['ID']]);

				$arResponseRows[$event['ID']]->addChild($obRow);
			}
			$obResponse->addChild($arResponseRows[$event['ID']]);
		}
		return array('UpdateListItemsResult' => $obResponse);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:webservice.php

示例4: SetMeetingStatus

 public static function SetMeetingStatus($userId, $eventId, $status = 'Q', $comment = '')
 {
     global $DB;
     $eventId = intVal($eventId);
     $userId = intVal($userId);
     if (!in_array($status, array("Q", "Y", "N"))) {
         $status = "Q";
     }
     // Select meeting info about event
     CTimeZone::Disable();
     $res = CCalendarEvent::GetList(array('arFilter' => array("ID" => $eventId, "DELETED" => "N"), 'fetchMeetings' => true, 'parseRecursion' => false, 'setDefaultLimit' => false));
     $Event = $res[0];
     if ($Event && $Event['IS_MEETING']) {
         if ($Event['IS_MEETING']) {
             $arAffectedSections = array($Event['SECT_ID']);
             // Try to find this user into attendees for this event
             $strSql = "SELECT * FROM b_calendar_attendees WHERE USER_KEY={$userId} AND EVENT_ID={$eventId}";
             $dbAtt = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
             $curStatus = "Q";
             if ($att = $dbAtt->Fetch()) {
                 $curStatus = $att["STATUS"];
                 //Set status
                 if ($att["STATUS"] != $status) {
                     $strSql = "UPDATE b_calendar_attendees SET " . $DB->PrepareUpdate("b_calendar_attendees", array("STATUS" => $status, "DESCRIPTION" => $comment)) . " WHERE EVENT_ID=" . $eventId . " AND USER_KEY=" . $userId;
                     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
                 }
             } else {
                 if ($Event['MEETING'] && $Event['MEETING']['OPEN'] && $status == "Y") {
                     //Set status
                     $strSql = "INSERT INTO b_calendar_attendees(EVENT_ID, USER_KEY, USER_ID, STATUS, DESCRIPTION, ACCESSIBILITY) " . "VALUES (" . $eventId . ", '" . $userId . "', " . $userId . ", '" . $status . "', '" . $DB->ForSql($comment) . "','')";
                     $res = $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
                 }
             }
             if (($status == 'Y' || ($status = 'N')) && CModule::IncludeModule("im")) {
                 CIMNotify::DeleteByTag("CALENDAR|INVITE|" . $eventId . "|" . $userId);
             }
             if ($Event['MEETING']['NOTIFY'] && $status != 'Q' && $userId != $Event['CREATED_BY'] && $curStatus != $status) {
                 // Send message to the author
                 CCalendar::SendMessage(array('mode' => $status == "Y" ? 'accept' : 'decline', 'name' => $Event['NAME'], "from" => $Event["DT_FROM"], "to" => $Event["DT_TO"], "location" => CCalendar::GetTextLocation($Event["LOCATION"]), "comment" => $comment, "guestId" => $userId, "eventId" => $eventId, "userId" => $Event['CREATED_BY']));
             }
             $arAffectedSections[] = CCalendar::GetMeetingSection($userId);
             if (count($arAffectedSections) > 0) {
                 CCalendarSect::UpdateModificationLabel($arAffectedSections);
             }
         }
     }
     CTimeZone::Enable();
     CCalendar::ClearCache(array('attendees_list', 'event_list'));
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:49,代码来源:calendar_event.php


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