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


PHP CCalendar::GetTextLocation方法代码示例

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


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

示例1: __getRow

	public function __getRow($event, $listName, &$last_change)
	{
		global $APPLICATION, $USER;

		$arStatusValues = $this->arStatusValues;
		$arPriorityValues = $this->arPriorityValues;

		$first_week_day = COption::GetOptionString('calendar', 'week_start', 'MO');
		$first_week_day = strtolower($first_week_day);

		$change = MakeTimeStamp($event['TIMESTAMP_X']);
		if ($last_change < $change)
			$last_change = $change;

		$bRecurrent = (isset($event['RRULE']) && $event['RRULE'] != "") ? 1 : 0;
		$rrule = CCalendarEvent::ParseRRULE($event['RRULE']);

		$ts_start = $event['DT_FROM_TS'];
		$ts_finish = $event['DT_TO_TS'];
		$bAllDay = $event['DT_SKIP_TIME'] == 'Y' ? 1 : 0;

		$TZBias = intval(date('Z'));
		$TZBiasStart = intval(date('Z', $ts_start));

		$duration = $event['DT_LENGTH'];
		if ($bAllDay)
			$duration -= 20;

		//$duration = $bRecurrent ? $event['DT_LENGTH'] : ($ts_finish - $ts_start);

		if (!$bAllDay || defined('OLD_OUTLOOK_VERSION'))
		{
			$ts_start -= $TZBiasStart;
			$ts_finish -= $TZBiasStart;
		}

		$obRow = new CXMLCreator('z:row');
		$obRow->setAttribute('ows_ID', $event['ID']);
		$obRow->setAttribute('ows_Title', htmlspecialcharsback($event['NAME'])); // we have data htmlspecialchared yet

		$version = $event['VERSION'] ? $event['VERSION'] : 1;

		$obRow->setAttribute('ows_Attachments', 0);
		$obRow->setAttribute('ows_owshiddenversion', $version);
		$obRow->setAttribute('ows_MetaInfo_vti_versionhistory', md5($event['ID']).':'.$version);

		/*
			ows_MetaInfo_BusyStatus='2' - Editor
			ows_MetaInfo_IntendedBusyStatus='-1' - Creator

			values:
				-1 - Unspecified busy status. Protocol clients can choose to display one of the other values if BusyStatus is -1.
				0 - Free - ACCESSIBILITY => 'free'
				1 - Tentative - ACCESSIBILITY => 'quest'
				2 - Busy - ACCESSIBILITY => 'busy'
				3 - Out of Office - ACCESSIBILITY => 'absent'
		*/

		$status = $arStatusValues[$event['ACCESSIBILITY']];
		$obRow->setAttribute('ows_MetaInfo_BusyStatus', $status === null ? -1 : $status);
		$obRow->setAttribute('ows_MetaInfo_Priority', intval($arPriorityValues[$event['IMPORTANCE']]));

		$obRow->setAttribute('ows_Created', $this->__makeDateTime(MakeTimeStamp($event['DATE_CREATE'])-$TZBias));
		$obRow->setAttribute('ows_Modified', $this->__makeDateTime($change-$TZBias));
		$obRow->setAttribute('ows_EventType', $bRecurrent ? 1 : 0);

		$obRow->setAttribute('ows_Location', CCalendar::GetTextLocation($event['LOCATION']));
		$obRow->setAttribute('ows_Description', $event['~DESCRIPTION']); // Description parsed from BB-codes to HTML

		$obRow->setAttribute('ows_EventDate', $this->__makeDateTime($ts_start));
		$obRow->setAttribute('ows_EndDate', $this->__makeDateTime($ts_start + $event['DT_LENGTH']));

		//$obRow->setAttribute('ows_EndDate', $this->__makeDateTime(((false && $bRecurrent) ? $ts_start + $event['DT_LENGTH'] : $ts_finish) + ($bAllDay ? 86340 : 0)));
		//$obRow->setAttribute('ows_EndDate', $this->__makeDateTime(($bRecurrent ? $ts_start + $event['DT_LENGTH'] : $ts_finish) - ($bAllDay ? 20 : 0)));


		$obRow->setAttribute('ows_fAllDayEvent', $bAllDay);

		/* Recurrence */
		$obRow->setAttribute('ows_fRecurrence', $bRecurrent);
		if ($bRecurrent)
		{
			$obRow->setAttribute('ows_UID', CIntranetUtils::makeGUID(md5($event['ID'].'_'.$change)));
			$tz_data = '';
			$tz_data .= '<timeZoneRule>';
			$tz_data .= '<standardBias>'.(-intval(($TZBias - (date('I') ? 3600 : 0)) /60)).'</standardBias>';
			$tz_data .= '<additionalDaylightBias>-60</additionalDaylightBias>';

			$bUseTransition = COption::GetOptionString('intranet', 'tz_transition', 'Y') == 'Y';

			if ($bUseTransition)
			{
				$transition_standard = COption::GetOptionString('intranet', 'tz_transition_standard', '');
				$transition_daylight = COption::GetOptionString('intranet', 'tz_transition_daylight', '');
				if (!$transition_standard) $transition_standard = '<transitionRule month="10" day="su" weekdayOfMonth="last" /><transitionTime>3:0:0</transitionTime>';
				if (!$transition_daylight) $transition_daylight = '<transitionRule  month="3" day="su" weekdayOfMonth="last" /><transitionTime>2:0:0</transitionTime>';

				$tz_data .= '<standardDate>'.$transition_standard.'</standardDate><daylightDate>'.$transition_daylight.'</daylightDate>';
			}

//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:webservice.php

示例2: 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:mrdeadmouse,项目名称:u136006,代码行数:49,代码来源:calendar_event.php

示例3: GetMessage

</td>
			</tr>
		<?php 
}
/* if ($event['RRULE']) */
?>
		<?php 
if (!empty($event['LOCATION'])) {
    ?>
			<tr>
				<td class="bx-cal-view-text-cell-l"><?php 
    echo GetMessage('EC_LOCATION');
    ?>
:</td>
				<td class="bx-cal-view-text-cell-r"><span class="bx-cal-location"><?php 
    echo htmlspecialcharsEx(CCalendar::GetTextLocation($event['LOCATION']));
    ?>
</span></td>
			</tr>
		<?php 
}
/* if (!empty($event['LOCATION'])) */
?>
	</table>
</div>

<?php 
if (!empty($event['~DESCRIPTION'])) {
    ?>
	<div class="bx-cal-view-description">
		<div class="feed-cal-view-desc-title"><?php 
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:template.php

示例4: DoSaveToDav

 public static function DoSaveToDav($Params = array(), &$arFields, $oCurEvent = false)
 {
     $sectionId = $Params['sectionId'];
     $bExchange = $Params['bExchange'];
     $bCalDav = $Params['bCalDav'];
     if (isset($oCurEvent['DAV_XML_ID'])) {
         $arFields['DAV_XML_ID'] = $oCurEvent['DAV_XML_ID'];
     }
     if (isset($oCurEvent['DAV_EXCH_LABEL'])) {
         $arFields['DAV_EXCH_LABEL'] = $oCurEvent['DAV_EXCH_LABEL'];
     }
     if (isset($oCurEvent['CAL_DAV_LABEL'])) {
         $arFields['CAL_DAV_LABEL'] = $oCurEvent['CAL_DAV_LABEL'];
     }
     $oSect = CCalendarSect::GetById($sectionId);
     if ($oCurEvent) {
         if ($oCurEvent['SECT_ID'] != $sectionId) {
             $bCalDav = CCalendar::IsCalDAVEnabled() && $oCurEvent['CAL_TYPE'] == 'user' && strlen($oCurEvent['CAL_DAV_LABEL']) > 0;
             $bExchangeEnabled = CCalendar::IsExchangeEnabled() && $oCurEvent['CAL_TYPE'] == 'user';
             if ($bExchangeEnabled || $bCalDav) {
                 $res = CCalendar::DoDeleteToDav(array('bCalDav' => $bCalDav, 'bExchangeEnabled' => $bExchangeEnabled, 'sectionId' => $oCurEvent['SECT_ID']), $oCurEvent);
                 if ($res !== true) {
                     return CCalendar::ThrowError($res);
                 }
             }
         }
     }
     $fromTs = CCalendar::Timestamp($arFields['DT_FROM']);
     $toTs = CCalendar::Timestamp($arFields['DT_TO']);
     if (!isset($arFields['DT_FROM_TS'])) {
         $arFields['DT_FROM_TS'] = $fromTs;
     }
     if (!isset($arFields['DT_TO_TS'])) {
         $arFields['DT_TO_TS'] = $toTs;
     }
     $arDavFields = $arFields;
     CCalendarEvent::CheckFields($arDavFields);
     if ($arDavFields['RRULE'] != '') {
         $arDavFields['RRULE'] = $arFields['RRULE'];
     }
     $arDavFields['DETAIL_TEXT'] = $arDavFields['DESCRIPTION'];
     $arDavFields['DETAIL_TEXT_TYPE'] = 'text';
     $arDavFields['ACTIVE_FROM'] = $arDavFields['DT_FROM'];
     $arDavFields['ACTIVE_TO'] = $arDavFields['DT_TO'];
     $arDavFields['PROPERTY_LOCATION'] = $arDavFields['LOCATION']['NEW'];
     if ($arDavFields['PROPERTY_LOCATION'] !== '') {
         $arDavFields['PROPERTY_LOCATION'] = CCalendar::GetTextLocation($arDavFields['PROPERTY_LOCATION']);
     }
     $arDavFields['PROPERTY_IMPORTANCE'] = $arDavFields['IMPORTANCE'];
     $arDavFields['REMIND_SETTINGS'] = '';
     if ($arFields['REMIND'] && is_array($arFields['REMIND']) && is_array($arFields['REMIND'][0])) {
         $arDavFields['REMIND_SETTINGS'] = floatVal($arFields['REMIND'][0]['count']) . '_' . $arFields['REMIND'][0]['type'];
     }
     // RRULE
     $arDavFields['PROPERTY_PERIOD_TYPE'] = 'NONE';
     if (is_array($arFields['RRULE']) && isset($arFields['RRULE']['FREQ']) && in_array($arFields['RRULE']['FREQ'], array('HOURLY', 'DAILY', 'MONTHLY', 'YEARLY', 'WEEKLY'))) {
         $arDavFields['PROPERTY_PERIOD_TYPE'] = $arFields['RRULE']['FREQ'];
         // Interval
         $arDavFields['PROPERTY_PERIOD_COUNT'] = isset($arFields['RRULE']['INTERVAL']) && intVal($arFields['RRULE']['INTERVAL']) > 1 ? intVal($arFields['RRULE']['INTERVAL']) : 1;
         if ($arFields['RRULE']['FREQ'] == 'WEEKLY' && isset($arFields['RRULE']['BYDAY'])) {
             //PROPERTY_PERIOD_ADDITIONAL
             $BYDAYS = array();
             $days = array('SU' => 0, 'MO' => 1, 'TU' => 2, 'WE' => 3, 'TH' => 4, 'FR' => 5, 'SA' => 6);
             $bydays = explode(',', $arFields['RRULE']['BYDAY']);
             foreach ($bydays as $day) {
                 $BYDAYS[] = $days[$day];
             }
             $arDavFields['PROPERTY_PERIOD_ADDITIONAL'] = implode(',', $BYDAYS);
         }
         $h24 = 60 * 60 * 24;
         if ($fromTs == $toTs) {
             $arDavFields['PROPERTY_EVENT_LENGTH'] = $h24;
         } else {
             $arDavFields['PROPERTY_EVENT_LENGTH'] = intVal($toTs - $fromTs);
             if ($arDavFields['PROPERTY_EVENT_LENGTH'] % $h24 == 0) {
                 // We have dates without times
                 $arDavFields['PROPERTY_EVENT_LENGTH'] += $h24;
             }
         }
         // Until date
         if (isset($arFields['RRULE']['UNTIL'])) {
             $periodTs = $arFields['RRULE']['UNTIL'];
         } else {
             $periodTs = CCalendar::GetMaxTimestamp();
         }
         $arDavFields['ACTIVE_TO'] = CCalendar::Date($periodTs);
     }
     // **** Synchronize with CalDav ****
     if ($bCalDav && $oSect['CAL_DAV_CON'] > 0) {
         // New event or move existent event to DAV calendar
         if ($arFields['ID'] <= 0 || $oCurEvent && !$oCurEvent['CAL_DAV_LABEL']) {
             $DAVRes = CDavGroupdavClientCalendar::DoAddItem($oSect['CAL_DAV_CON'], $oSect['CAL_DAV_CAL'], $arDavFields);
         } else {
             // Edit existent event
             $DAVRes = CDavGroupdavClientCalendar::DoUpdateItem($oSect['CAL_DAV_CON'], $oSect['CAL_DAV_CAL'], $oCurEvent['DAV_XML_ID'], $oCurEvent['CAL_DAV_LABEL'], $arDavFields);
         }
         if (!is_array($DAVRes) || !array_key_exists("XML_ID", $DAVRes)) {
             return CCalendar::CollectCalDAVErros($DAVRes);
         }
         // // It's ok, we successfuly save event to caldav calendar - and save it to DB
//.........这里部分代码省略.........
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:101,代码来源:calendar.php

示例5: FormatICal

 private static function FormatICal($section, $events)
 {
     global $APPLICATION;
     $res = 'BEGIN:VCALENDAR' . "\n" . 'PRODID:-//Bitrix//Bitrix Calendar//EN' . "\n" . 'VERSION:2.0' . "\n" . 'CALSCALE:GREGORIAN' . "\n" . 'METHOD:PUBLISH' . "\n" . 'X-WR-CALNAME:' . self::_ICalPaste($section['NAME']) . "\n" . 'X-WR-CALDESC:' . self::_ICalPaste($section['DESCRIPTION']) . "\n";
     $localTime = new DateTime();
     $localOffset = $localTime->getOffset();
     foreach ($events as $event) {
         $fromTs = CCalendar::Timestamp($event['DATE_FROM']);
         $toTs = CCalendar::Timestamp($event['DATE_TO']);
         if ($event['DT_SKIP_TIME'] === "Y") {
             $dtStart = date("Ymd", $fromTs);
             $dtEnd = date("Ymd", $toTs + CCalendar::GetDayLen());
         } else {
             $fromTsUTC = $fromTs - $event['TZ_OFFSET_FROM'];
             $toTsUTC = $toTs - $event['TZ_OFFSET_TO'];
             $dtStart = date("Ymd\\THis\\Z", $fromTsUTC);
             $dtEnd = date("Ymd\\THis\\Z", $toTsUTC);
         }
         $dtStamp = str_replace('T000000Z', '', date("Ymd\\THisZ", CCalendar::Timestamp($event['TIMESTAMP_X']) - $localOffset));
         $uid = md5(uniqid(rand(), true) . $event['ID']) . '@bitrix';
         $period = '';
         $rrule = CCalendarEvent::ParseRRULE($event['RRULE']);
         if ($rrule && isset($rrule['FREQ']) && $rrule['FREQ'] != 'NONE') {
             $period = 'RRULE:FREQ=' . $rrule['FREQ'] . ';';
             $period .= 'INTERVAL=' . $rrule['INTERVAL'] . ';';
             if ($rrule['FREQ'] == 'WEEKLY') {
                 $period .= 'BYDAY=' . implode(',', $rrule['BYDAY']) . ';';
             }
             $until = date("Ymd", $event['DATE_TO_TS_UTC']);
             if ($until != '20380101') {
                 $period .= 'UNTIL=' . $until . ';';
             }
             $period .= 'WKST=MO';
             $period .= "\n";
         }
         $res .= 'BEGIN:VEVENT' . "\n";
         if ($event['DT_SKIP_TIME'] === "Y") {
             $res .= 'DTSTART;VALUE=DATE:' . $dtStart . "\n" . 'DTEND;VALUE=DATE:' . $dtEnd . "\n";
         } else {
             $res .= 'DTSTART;VALUE=DATE-TIME:' . $dtStart . "\n" . 'DTEND;VALUE=DATE-TIME:' . $dtEnd . "\n";
         }
         $res .= 'DTSTAMP:' . $dtStamp . "\n" . 'UID:' . $uid . "\n" . 'SUMMARY:' . self::_ICalPaste($event['NAME']) . "\n" . 'DESCRIPTION:' . self::_ICalPaste($event['DESCRIPTION']) . "\n" . $period . "\n" . 'CLASS:PRIVATE' . "\n" . 'LOCATION:' . self::_ICalPaste(CCalendar::GetTextLocation($event['LOCATION'])) . "\n" . 'SEQUENCE:0' . "\n" . 'STATUS:CONFIRMED' . "\n" . 'TRANSP:TRANSPARENT' . "\n" . 'END:VEVENT' . "\n";
     }
     $res .= 'END:VCALENDAR';
     if (!defined('BX_UTF') || BX_UTF !== true) {
         $res = $APPLICATION->ConvertCharset($res, LANG_CHARSET, 'UTF-8');
     }
     return $res;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:49,代码来源:calendar_sect.php

示例6: FormatICal

    private static function FormatICal($Section, $Events)
    {
        $res = 'BEGIN:VCALENDAR
PRODID:-//Bitrix//Bitrix Calendar//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:' . self::_ICalPaste($Section['NAME']) . '
X-WR-CALDESC:' . self::_ICalPaste($Section['DESCRIPTION']) . "\n";
        $localTime = new DateTime();
        $localOffset = $localTime->getOffset();
        $h24 = CCalendar::GetDayLen();
        foreach ($Events as $event) {
            //$fts = CCalendar::Timestamp($event['DT_FROM']);
            //$tts = CCalendar::Timestamp($event['DT_TO']);
            $fts = $event['DT_FROM_TS'];
            $tts = $event['DT_TO_TS'];
            if ($event['DT_SKIP_TIME'] == 'Y') {
                $dtStart = date("Ymd", $event['DT_FROM_TS']);
                if ($event['DT_LENGTH'] == $h24) {
                    $dtEnd = $dtStart;
                } else {
                    $dtEnd = date("Ymd", $event['DT_TO_TS'] - $h24);
                }
            } else {
                $dtStart = date("Ymd\\THis\\Z", $event['DT_FROM_TS'] - $localOffset);
                $dtEnd = date("Ymd\\THis\\Z", $event['DT_TO_TS'] - $localOffset);
            }
            $dtStamp = str_replace('T000000Z', '', date("Ymd\\THisZ", CCalendar::Timestamp($event['TIMESTAMP_X']) - $localOffset));
            $uid = md5(uniqid(rand(), true) . $event['ID']) . '@bitrix';
            $period = '';
            $rrule = CCalendarEvent::ParseRRULE($event['RRULE']);
            if ($rrule && isset($rrule['FREQ']) && $rrule['FREQ'] != 'NONE') {
                $period = 'RRULE:FREQ=' . $rrule['FREQ'] . ';';
                $period .= 'INTERVAL=' . $rrule['INTERVAL'] . ';';
                if ($rrule['FREQ'] == 'WEEKLY') {
                    $period .= 'BYDAY=' . implode(',', $rrule['BYDAY']) . ';';
                }
                if ($event['DT_SKIP_TIME'] == 'Y') {
                    if ($event['DT_LENGTH'] == $h24) {
                        $dtEnd_ = $dtStart;
                    } else {
                        $dtEnd_ = date("Ymd", $event['DT_FROM_TS'] + $event['DT_LENGTH'] - $h24 - $localOffset);
                    }
                } else {
                    $dtEnd_ = date("Ymd\\THisZ", $event['DT_FROM_TS'] + $event['DT_LENGTH'] - $localOffset);
                }
                if (date("Ymd", $tts) != '20380101') {
                    $period .= 'UNTIL=' . $dtEnd . ';';
                }
                $period .= 'WKST=MO';
                $dtEnd = $dtEnd_;
                $period .= "\n";
            }
            $res .= 'BEGIN:VEVENT
DTSTART;VALUE=DATE:' . $dtStart . '
DTEND;VALUE=DATE:' . $dtEnd . '
DTSTAMP:' . $dtStamp . '
UID:' . $uid . '
SUMMARY:' . self::_ICalPaste($event['NAME']) . '
DESCRIPTION:' . self::_ICalPaste($event['DESCRIPTION']) . "\n" . $period . '
CLASS:PRIVATE
LOCATION:' . self::_ICalPaste(CCalendar::GetTextLocation($event['LOCATION'])) . '
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:TRANSPARENT
END:VEVENT' . "\n";
        }
        $res .= 'END:VCALENDAR';
        if (!defined('BX_UTF') || BX_UTF !== true) {
            $res = $GLOBALS["APPLICATION"]->ConvertCharset($res, LANG_CHARSET, 'UTF-8');
        }
        return $res;
    }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:74,代码来源:calendar_sect.php

示例7: array

				$repeatHTML .= '<br>'.GetMessage('EC_RRULE_FROM', array('#FROM_DATE#' => FormatDate(CCalendar::DFormat(false), $event['~DT_FROM_TS'])));
				if (date('dmY', $event['RRULE']['UNTIL']) != '01012038')
				{
					$repeatHTML .= ' '.GetMessage('EC_RRULE_UNTIL', array('#UNTIL_DATE#' => FormatDate(CCalendar::DFormat(false), $event['RRULE']['UNTIL'])));
				}
				?>
			<tr>
				<td class="bx-cal-view-text-cell-l"><?=GetMessage('EC_T_REPEAT')?>:</td>
				<td class="bx-cal-view-text-cell-r"><?= $repeatHTML?></td>
			</tr>
			<?endif;?>
			<?if (!empty($event['LOCATION'])):?>
			<tr>
				<td class="bx-cal-view-text-cell-l"><?= GetMessage('EC_LOCATION')?>:</td>
				<td class="bx-cal-view-text-cell-r"><span class="bx-cal-location"><?= htmlspecialcharsEx(CCalendar::GetTextLocation($event['LOCATION']))?></span></td>
			</tr>
			<?endif;?>
		</table>
	</div>

	<?if (!empty($event['~DESCRIPTION'])):?>
	<div class="bx-cal-view-description">
		<div class="feed-cal-view-desc-title"><?= GetMessage('EC_T_DESC')?>:</div>
		<div class="bx-cal-view-desc-cont"><?= $event['~DESCRIPTION']?></div>
	</div>
	<?endif;?>

	<?if ($event['UF_WEBDAV_CAL_EVENT']):?>
	<div class="bx-cal-view-files" id="bx-cal-view-files-<?=$id?><?=$event['ID']?>">
		<?$APPLICATION->IncludeComponent(
开发者ID:rasuldev,项目名称:torino,代码行数:30,代码来源:calendar_sceleton.php

示例8: array

$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;
            }
            unset($Event['~ATTENDEES']);
            $arResult['ATTENDEES'] = $arAttendees;
        }
        $Event['~LOCATION'] = $Event['LOCATION'] !== '' ? CCalendar::GetTextLocation($Event["LOCATION"]) : '';
        if ($Event['RRULE'] !== '') {
            $Event['RRULE'] = CCalendarEvent::ParseRRULE($Event['RRULE']);
            if (is_array($Event['RRULE']) && !isset($Event['RRULE']['UNTIL'])) {
                $Event['RRULE']['UNTIL'] = $Event['DT_TO_TS'];
            }
            $Event['DT_TO_TS'] = $Event['DT_FROM_TS'] + intval($Event['DT_LENGTH']);
        }
        $arResult['EVENT'] = $Event;
        $calType = $Event['CAL_TYPE'];
        $ownerId = $Event['OWNER_ID'];
    } else {
        $Event = array();
        // Event is not found
        $arResult['DELETED'] = "Y";
        $arResult['EVENT_ID'] = $eventId;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例9: SetMeetingStatus

 public static function SetMeetingStatus($userId, $eventId, $status = 'Q', $comment = '', $parentEventId)
 {
     CTimeZone::Disable();
     global $DB, $CACHE_MANAGER;
     $eventId = intVal($eventId);
     $userId = intVal($userId);
     if (!in_array($status, array("Q", "Y", "N", "H", "M"))) {
         $status = "Q";
     }
     $event = CCalendarEvent::GetById($eventId, false);
     if ($event && $event['IS_MEETING'] && intVal($event['PARENT_ID']) > 0) {
         $strSql = "UPDATE b_calendar_event SET " . $DB->PrepareUpdate("b_calendar_event", array("MEETING_STATUS" => $status)) . " WHERE PARENT_ID=" . intVal($event['PARENT_ID']) . " AND OWNER_ID=" . $userId;
         $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         CCalendarSect::UpdateModificationLabel($event['SECT_ID']);
         // If it's open meeting and our attendee is not on the list
         if ($event['MEETING'] && $event['MEETING']['OPEN'] && ($status == 'Y' || $status == 'M')) {
             $arAttendees = self::GetAttendees(array($event['PARENT_ID']));
             $arAttendees = $arAttendees[$event['PARENT_ID']];
             $attendeeExist = false;
             foreach ($arAttendees as $attendee) {
                 if ($attendee['USER_ID'] == $userId) {
                     $attendeeExist = true;
                     break;
                 }
             }
             if (!$attendeeExist) {
                 // 1. Create another childEvent for new attendee
                 $AllFields = self::GetFields();
                 $dbFields = array();
                 foreach ($event as $field => $val) {
                     if (isset($AllFields[$field]) && $field != "ID" && $field != "ATTENDEES_CODES") {
                         $dbFields[$field] = $event[$field];
                     }
                 }
                 $dbFields['MEETING_STATUS'] = $status;
                 $dbFields['CAL_TYPE'] = 'user';
                 $dbFields['OWNER_ID'] = $userId;
                 $dbFields['PARENT_ID'] = $event['PARENT_ID'];
                 $dbFields['MEETING'] = serialize($event['MEETING']);
                 $dbFields['REMIND'] = serialize($event['REMIND']);
                 $eventId = CDatabase::Add("b_calendar_event", $dbFields, array('DESCRIPTION', 'MEETING', 'RDATE', 'EXDATE'));
                 $DB->Query("UPDATE b_calendar_event SET " . $DB->PrepareUpdate("b_calendar_event", array('DAV_XML_ID' => $eventId)) . " WHERE ID=" . IntVal($eventId), false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
                 $sectionId = CCalendarSect::GetLastUsedSection('user', $userId, $userId);
                 if (!$sectionId || !CCalendarSect::GetById($sectionId, false)) {
                     $sectRes = CCalendarSect::GetSectionForOwner('user', $userId);
                     $sectionId = $sectRes['sectionId'];
                 }
                 if ($eventId && $sectionId) {
                     self::ConnectEventToSection($eventId, $sectionId);
                 }
                 // 2. Update ATTENDEES_CODES
                 $attendeesCodes = $event['ATTENDEES_CODES'];
                 $attendeesCodes[] = 'U' . intVal($userId);
                 $attendeesCodes = array_unique($attendeesCodes);
                 $DB->Query("UPDATE b_calendar_event SET " . "ATTENDEES_CODES='" . implode(',', $attendeesCodes) . "'" . " WHERE PARENT_ID=" . intVal($event['PARENT_ID']), false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
                 CCalendarSect::UpdateModificationLabel(array($sectionId));
             }
         }
         // Notify author of event
         if ($event['MEETING']['NOTIFY'] && $userId != $event['MEETING_HOST']) {
             // Send message to the author
             $fromTo = CCalendarEvent::GetEventFromToForUser($event, $event['MEETING_HOST']);
             CCalendar::SendMessage(array('mode' => $status == "Y" ? 'accept' : 'decline', 'name' => $event['NAME'], "from" => $fromTo["DATE_FROM"], "to" => $fromTo["DATE_TO"], "location" => CCalendar::GetTextLocation($event["LOCATION"]), "comment" => $comment, "guestId" => $userId, "eventId" => $event['PARENT_ID'], "userId" => $event['MEETING_HOST']));
         }
         CCalendarSect::UpdateModificationLabel(array($event['SECTIONS'][0]));
         $CACHE_MANAGER->ClearByTag('calendar_user_' . $userId);
         $CACHE_MANAGER->ClearByTag('calendar_user_' . $event['CREATED_BY']);
     }
     CTimeZone::Enable();
     CCalendar::ClearCache(array('attendees_list', 'event_list'));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:71,代码来源:calendar_event.php

示例10: DialogViewEvent


//.........这里部分代码省略.........
                        $repeatHTML = GetMessage('EC_RRULE_EVERY_YEAR', array('#DAY#' => $event['FROM_MONTH_DAY'], '#MONTH#' => $event['FROM_MONTH']));
                    } else {
                        $repeatHTML = GetMessage('EC_RRULE_EVERY_YEAR_1', array('#YEAR#' => $event['RRULE']['INTERVAL'], '#DAY#' => $event['FROM_MONTH_DAY'], '#MONTH#' => $event['FROM_MONTH']));
                    }
                    break;
            }
            $repeatHTML .= '<br>' . GetMessage('EC_RRULE_FROM', array('#FROM_DATE#' => FormatDate(CCalendar::DFormat(false), $event['~DT_FROM_TS'])));
            if (date('dmY', $event['RRULE']['UNTIL']) != '01012038') {
                $repeatHTML .= ' ' . GetMessage('EC_RRULE_UNTIL', array('#UNTIL_DATE#' => FormatDate(CCalendar::DFormat(false), $event['RRULE']['UNTIL'])));
            }
            ?>
			<tr>
				<td class="bx-cal-view-text-cell-l"><?php 
            echo GetMessage('EC_T_REPEAT');
            ?>
:</td>
				<td class="bx-cal-view-text-cell-r"><?php 
            echo $repeatHTML;
            ?>
</td>
			</tr>
			<?php 
        }
        ?>
			<?php 
        if (!empty($event['LOCATION'])) {
            ?>
			<tr>
				<td class="bx-cal-view-text-cell-l"><?php 
            echo GetMessage('EC_LOCATION');
            ?>
:</td>
				<td class="bx-cal-view-text-cell-r"><span class="bx-cal-location"><?php 
            echo htmlspecialcharsEx(CCalendar::GetTextLocation($event['LOCATION']));
            ?>
</span></td>
			</tr>
			<?php 
        }
        ?>
		</table>
	</div>

	<?php 
        if (!empty($event['~DESCRIPTION'])) {
            ?>
	<div class="bx-cal-view-description">
		<div class="feed-cal-view-desc-title"><?php 
            echo GetMessage('EC_T_DESC');
            ?>
:</div>
		<div class="bx-cal-view-desc-cont"><?php 
            echo $event['~DESCRIPTION'];
            ?>
</div>
	</div>
	<?php 
        }
        ?>

	<?php 
        if ($event['UF_WEBDAV_CAL_EVENT']) {
            ?>
	<div class="bx-cal-view-files" id="bx-cal-view-files-<?php 
            echo $id;
            echo $event['ID'];
开发者ID:Satariall,项目名称:izurit,代码行数:67,代码来源:calendar_sceleton.php

示例11: array

$arResult['EVENT'] = false;
$arParams['CUR_USER'] = $USER->GetId();
$Events = CCalendarEvent::GetList(array('arFilter' => array("ID" => $arParams['EVENT_ID'], "DELETED" => false), 'parseRecursion' => false, 'fetchAttendees' => true, 'checkPermissions' => true, 'setDefaultLimit' => false));
if ($Events && is_array($Events[0])) {
    $arResult['EVENT'] = $Events[0];
}
if (!$arResult['EVENT']) {
    $Events = CCalendarEvent::GetList(array('arFilter' => array("ID" => $arParams['EVENT_ID'], "DELETED" => false), 'parseRecursion' => false, 'checkPermissions' => false, 'setDefaultLimit' => false));
    // Clean damaged event from livefeed
    if (!$Events || !is_array($Events[0])) {
        CCalendarLiveFeed::OnDeleteCalendarEventEntry($arParams['EVENT_ID']);
    }
    return false;
}
if ($arResult['EVENT']['LOCATION'] !== '') {
    $arResult['EVENT']['LOCATION'] = CCalendar::GetTextLocation($arResult['EVENT']["LOCATION"]);
}
global $USER_FIELD_MANAGER;
$UF = CCalendarEvent::GetEventUserFields($arResult['EVENT']);
$arResult['UF_CRM_CAL_EVENT'] = $UF['UF_CRM_CAL_EVENT'];
if (empty($arResult['UF_CRM_CAL_EVENT']['VALUE'])) {
    $arResult['UF_CRM_CAL_EVENT'] = false;
}
$arResult['UF_WEBDAV_CAL_EVENT'] = $UF['UF_WEBDAV_CAL_EVENT'];
if (empty($arResult['UF_WEBDAV_CAL_EVENT']['VALUE'])) {
    $arResult['UF_WEBDAV_CAL_EVENT'] = false;
}
$arParams['ATTENDEES_SHOWN_COUNT'] = 4;
$arParams['ATTENDEES_SHOWN_COUNT_MAX'] = 8;
$arParams['AVATAR_SIZE'] = 30;
if (!isset($arParams['EVENT_TEMPLATE_URL'])) {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例12: DoSaveToDav

 public static function DoSaveToDav($Params = array(), &$arFields, $oCurEvent = false)
 {
     $sectionId = $Params['sectionId'];
     $bExchange = $Params['bExchange'];
     $bCalDav = $Params['bCalDav'];
     if (isset($oCurEvent['DAV_XML_ID'])) {
         $arFields['DAV_XML_ID'] = $oCurEvent['DAV_XML_ID'];
     }
     if (isset($oCurEvent['DAV_EXCH_LABEL'])) {
         $arFields['DAV_EXCH_LABEL'] = $oCurEvent['DAV_EXCH_LABEL'];
     }
     if (isset($oCurEvent['CAL_DAV_LABEL'])) {
         $arFields['CAL_DAV_LABEL'] = $oCurEvent['CAL_DAV_LABEL'];
     }
     $oSect = CCalendarSect::GetById($sectionId);
     if ($oCurEvent) {
         if ($oCurEvent['SECT_ID'] != $sectionId) {
             $bCalDavCur = CCalendar::IsCalDAVEnabled() && $oCurEvent['CAL_TYPE'] == 'user' && strlen($oCurEvent['CAL_DAV_LABEL']) > 0;
             $bExchangeEnabledCur = CCalendar::IsExchangeEnabled() && $oCurEvent['CAL_TYPE'] == 'user';
             if ($bExchangeEnabledCur || $bCalDavCur) {
                 $res = CCalendar::DoDeleteToDav(array('bCalDav' => $bCalDavCur, 'bExchangeEnabled' => $bExchangeEnabledCur, 'sectionId' => $oCurEvent['SECT_ID']), $oCurEvent);
                 if ($oCurEvent['DAV_EXCH_LABEL']) {
                     $oCurEvent['DAV_EXCH_LABEL'] = '';
                 }
                 if ($res !== true) {
                     return CCalendar::ThrowError($res);
                 }
             }
         }
     }
     $arDavFields = $arFields;
     CCalendarEvent::CheckFields($arDavFields);
     if ($arDavFields['RRULE'] != '') {
         $arDavFields['RRULE'] = $arFields['RRULE'];
     }
     $arDavFields['PROPERTY_LOCATION'] = $arDavFields['LOCATION']['NEW'];
     if ($arDavFields['PROPERTY_LOCATION'] !== '') {
         $arDavFields['PROPERTY_LOCATION'] = CCalendar::GetTextLocation($arDavFields['PROPERTY_LOCATION']);
     }
     $arDavFields['PROPERTY_IMPORTANCE'] = $arDavFields['IMPORTANCE'];
     $arDavFields['REMIND_SETTINGS'] = '';
     if ($arFields['REMIND'] && is_array($arFields['REMIND']) && is_array($arFields['REMIND'][0])) {
         $arDavFields['REMIND_SETTINGS'] = floatVal($arFields['REMIND'][0]['count']) . '_' . $arFields['REMIND'][0]['type'];
     }
     // **** Synchronize with CalDav ****
     if ($bCalDav && $oSect['CAL_DAV_CON'] > 0) {
         // New event or move existent event to DAV calendar
         if ($arFields['ID'] <= 0 || $oCurEvent && !$oCurEvent['CAL_DAV_LABEL']) {
             $DAVRes = CDavGroupdavClientCalendar::DoAddItem($oSect['CAL_DAV_CON'], $oSect['CAL_DAV_CAL'], $arDavFields);
         } else {
             // Edit existent event
             $DAVRes = CDavGroupdavClientCalendar::DoUpdateItem($oSect['CAL_DAV_CON'], $oSect['CAL_DAV_CAL'], $oCurEvent['DAV_XML_ID'], $oCurEvent['CAL_DAV_LABEL'], $arDavFields);
         }
         if (!is_array($DAVRes) || !array_key_exists("XML_ID", $DAVRes)) {
             return CCalendar::CollectCalDAVErros($DAVRes);
         }
         // // It's ok, we successfuly save event to caldav calendar - and save it to DB
         $arFields['DAV_XML_ID'] = $DAVRes['XML_ID'];
         $arFields['CAL_DAV_LABEL'] = $DAVRes['MODIFICATION_LABEL'];
     } elseif ($bExchange && $oSect['IS_EXCHANGE'] && strlen($oSect['DAV_EXCH_CAL']) > 0 && $oSect['DAV_EXCH_CAL'] !== 0) {
         $ownerId = $arFields['OWNER_ID'];
         $fromTo = CCalendarEvent::GetEventFromToForUser($arDavFields, $ownerId);
         $arDavFields["DATE_FROM"] = $fromTo['DATE_FROM'];
         $arDavFields["DATE_TO"] = $fromTo['DATE_TO'];
         // Convert BBcode to HTML for exchange
         $arDavFields["DESCRIPTION"] = CCalendarEvent::ParseText($arDavFields['DESCRIPTION']);
         // New event  or move existent event to Exchange calendar
         if ($arFields['ID'] <= 0 || $oCurEvent && !$oCurEvent['DAV_EXCH_LABEL']) {
             $exchRes = CDavExchangeCalendar::DoAddItem($ownerId, $oSect['DAV_EXCH_CAL'], $arDavFields);
         } else {
             $exchRes = CDavExchangeCalendar::DoUpdateItem($ownerId, $oCurEvent['DAV_XML_ID'], $oCurEvent['DAV_EXCH_LABEL'], $arDavFields);
         }
         if (!is_array($exchRes) || !array_key_exists("XML_ID", $exchRes)) {
             return CCalendar::CollectExchangeErrors($exchRes);
         }
         // It's ok, we successfuly save event to exchange calendar - and save it to DB
         $arFields['DAV_XML_ID'] = $exchRes['XML_ID'];
         $arFields['DAV_EXCH_LABEL'] = $exchRes['MODIFICATION_LABEL'];
     }
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:81,代码来源:calendar.php


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