本文整理汇总了PHP中CCalendar::UnParseTextLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar::UnParseTextLocation方法的具体用法?PHP CCalendar::UnParseTextLocation怎么用?PHP CCalendar::UnParseTextLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCalendar
的用法示例。
在下文中一共展示了CCalendar::UnParseTextLocation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ModifyEvent
public static function ModifyEvent($calendarId, $arFields)
{
list($sectionId, $entityType, $entityId) = $calendarId;
$userId = $entityType == 'user' ? $entityId : 0;
self::$silentErrorMode = true;
CCalendar::SetOffset(false, CCalendar::GetOffset($userId));
$entityType = strtolower($entityType);
$eventId = isset($arFields["ID"]) && intval($arFields["ID"]) > 0 ? intval($arFields["ID"]) : 0;
$arNewFields = array("DAV_XML_ID" => $arFields['XML_ID'], "CAL_DAV_LABEL" => isset($arFields['PROPERTY_BXDAVCD_LABEL']) && strlen($arFields['PROPERTY_BXDAVCD_LABEL']) > 0 ? $arFields['PROPERTY_BXDAVCD_LABEL'] : '', "DAV_EXCH_LABEL" => isset($arFields['PROPERTY_BXDAVEX_LABEL']) && strlen($arFields['PROPERTY_BXDAVEX_LABEL']) > 0 ? $arFields['PROPERTY_BXDAVEX_LABEL'] : '', "ID" => $eventId, 'NAME' => $arFields["NAME"] ? $arFields["NAME"] : GetMessage('EC_NONAME_EVENT'), 'CAL_TYPE' => $entityType, 'OWNER_ID' => $entityId, 'DESCRIPTION' => isset($arFields['DESCRIPTION']) ? $arFields['DESCRIPTION'] : '', 'SECTIONS' => $sectionId, 'ACCESSIBILITY' => isset($arFields['ACCESSIBILITY']) ? $arFields['ACCESSIBILITY'] : 'busy', 'IMPORTANCE' => isset($arFields['IMPORTANCE']) ? $arFields['IMPORTANCE'] : 'normal', "REMIND" => is_array($arFields['REMIND']) ? $arFields['REMIND'] : array(), "RRULE" => is_array($arFields['RRULE']) ? is_array($arFields['RRULE']) : array(), "VERSION" => isset($arFields['VERSION']) ? intVal($arFields['VERSION']) : 1, "PRIVATE_EVENT" => !!$arFields['PRIVATE_EVENT']);
$bServerTime = false;
if (isset($arFields['DT_FROM_TS'], $arFields['DT_TO_TS'])) {
$arNewFields["DT_FROM_TS"] = $arFields['DT_FROM_TS'];
$arNewFields["DT_TO_TS"] = $arFields['DT_TO_TS'];
$arNewFields["SKIP_TIME"] = $arFields['SKIP_TIME'];
$bServerTime = true;
} elseif (isset($arFields['ACTIVE_FROM'], $arFields['ACTIVE_TO'])) {
$arNewFields["DT_FROM"] = $arFields['ACTIVE_FROM'];
$arNewFields["DT_TO"] = $arFields['ACTIVE_TO'];
}
if (!empty($arFields['PROPERTY_REMIND_SETTINGS'])) {
$ar = explode("_", $arFields["PROPERTY_REMIND_SETTINGS"]);
if (count($ar) == 2) {
$arNewFields["REMIND"][] = array('type' => $ar[1], 'count' => floatVal($ar[0]));
}
}
if (!empty($arFields['PROPERTY_ACCESSIBILITY'])) {
$arNewFields["ACCESSIBILITY"] = $arFields['PROPERTY_ACCESSIBILITY'];
}
if (!empty($arFields['PROPERTY_IMPORTANCE'])) {
$arNewFields["IMPORTANCE"] = $arFields['PROPERTY_IMPORTANCE'];
}
if (!empty($arFields['PROPERTY_LOCATION'])) {
$arNewFields["LOCATION"] = CCalendar::UnParseTextLocation($arFields['PROPERTY_LOCATION']);
}
if (!empty($arFields['DETAIL_TEXT'])) {
$arNewFields["DESCRIPTION"] = $arFields['DETAIL_TEXT'];
}
$arNewFields["DESCRIPTION"] = CCalendar::ClearExchangeHtml($arNewFields["DESCRIPTION"]);
if (isset($arFields["PROPERTY_PERIOD_TYPE"]) && in_array($arFields["PROPERTY_PERIOD_TYPE"], array("DAILY", "WEEKLY", "MONTHLY", "YEARLY"))) {
$arNewFields['RRULE']['FREQ'] = $arFields["PROPERTY_PERIOD_TYPE"];
$arNewFields['RRULE']['INTERVAL'] = $arFields["PROPERTY_PERIOD_COUNT"];
if (!isset($arNewFields['DT_LENGTH']) && !empty($arFields['PROPERTY_EVENT_LENGTH'])) {
$arNewFields['DT_LENGTH'] = intval($arFields['PROPERTY_EVENT_LENGTH']);
} else {
$arNewFields['DT_LENGTH'] = $arFields['DT_TO_TS'] - $arFields['DT_FROM_TS'];
//$arNewFields['DT_LENGTH'] = self::GetDayLen();
}
if ($arNewFields['RRULE']['FREQ'] == "WEEKLY" && !empty($arFields['PROPERTY_PERIOD_ADDITIONAL'])) {
$arNewFields['RRULE']['BYDAY'] = array();
$bydays = explode(',', $arFields['PROPERTY_PERIOD_ADDITIONAL']);
foreach ($bydays as $day) {
$day = CCalendar::WeekDayByInd($day, false);
if ($day !== false) {
$arNewFields['RRULE']['BYDAY'][] = $day;
}
}
$arNewFields['RRULE']['BYDAY'] = implode(',', $arNewFields['RRULE']['BYDAY']);
}
if (isset($arFields['ACTIVE_TO'])) {
$arNewFields['RRULE']['UNTIL'] = $arFields['ACTIVE_TO'];
} else {
$arNewFields['RRULE']['UNTIL'] = $arFields['DT_TO_TS'];
}
}
$eventId = CCalendar::SaveEvent(array('arFields' => $arNewFields, 'userId' => $userId, 'bAffectToDav' => false, 'bSilentAccessMeeting' => true, 'bServerTime' => $bServerTime));
self::$silentErrorMode = false;
return $eventId;
}
示例2: 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);
}
示例3: array
$newMeeting = $_POST['new_meeting'] == 'Y';
$from_ts = $_POST['from_ts'];
$to_ts = $_POST['to_ts'];
if (isset($_POST['skip_time']) && $_POST['skip_time'] == 'Y') {
$from_ts = CCalendar::_fixTimestamp($from_ts);
$to_ts = CCalendar::_fixTimestamp($to_ts);
}
$arFields = array("ID" => $id, "CAL_TYPE" => $_POST['cal_type'], "OWNER_ID" => $_POST['owner_id'], "DT_FROM_TS" => $from_ts, "DT_TO_TS" => $to_ts, "SKIP_TIME" => isset($_POST['skip_time']) && $_POST['skip_time'] == 'Y', 'NAME' => CMobile::ConvertFromUtf(trim($_POST['name'])), 'DESCRIPTION' => CMobile::ConvertFromUtf(trim($_POST['desc'])), 'SECTIONS' => array($sectId), 'ACCESSIBILITY' => $_POST['accessibility'], 'IMPORTANCE' => $_POST['importance'], 'PRIVATE_EVENT' => $_POST['private_event'] == "Y", "REMIND" => $_POST['remind'], 'LOCATION' => array(), "IS_MEETING" => !empty($_POST['attendees']));
// LOCATION
if (is_array($_POST['location']) && !empty($_POST['location'])) {
$arFields['LOCATION'] = $_POST['location'];
$arFields['LOCATION']['CHANGED'] = $arFields['LOCATION']['CHANGED'] == 'Y';
$arFields['LOCATION']['NEW'] = CMobile::ConvertFromUtf($arFields['LOCATION']['NEW']);
$arFields['LOCATION']['OLD'] = CMobile::ConvertFromUtf($arFields['LOCATION']['OLD']);
if ($arFields['LOCATION']['CHANGED']) {
$loc = CCalendar::UnParseTextLocation($arFields['LOCATION']['NEW']);
$arFields['LOCATION']['NEW'] = $loc['NEW'];
}
}
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);
}