本文整理汇总了PHP中CCalendar类的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar类的具体用法?PHP CCalendar怎么用?PHP CCalendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCalendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Execute
public function Execute()
{
if (!CModule::IncludeModule("calendar")) {
return CBPActivityExecutionStatus::Closed;
}
$rootActivity = $this->GetRootActivity();
$documentId = $rootActivity->GetDocumentId();
$documentService = $this->workflow->GetService("DocumentService");
$fromTs = CCalendar::Timestamp($this->CalendarFrom);
$toTs = $this->CalendarTo == '' ? $fromTs : CCalendar::Timestamp($this->CalendarTo);
$arFields = array("CAL_TYPE" => !$this->CalendarType ? 'user' : $this->CalendarType, "NAME" => trim($this->CalendarName) == '' ? GetMessage('EC_DEFAULT_EVENT_NAME') : $this->CalendarName, "DESCRIPTION" => $this->CalendarDesrc, "SKIP_TIME" => date('H:i', $fromTs) == '00:00' && date('H:i', $toTs) == '00:00', "IS_MEETING" => false, "RRULE" => false);
if ($fromTs == $toTs && !$arFields["SKIP_TIME"]) {
$toTs += 3600;
}
$arFields['DATE_FROM'] = CCalendar::Date($fromTs);
$arFields['DATE_TO'] = CCalendar::Date($toTs);
if ($this->CalendarSection && intVal($this->CalendarSection) > 0) {
$arFields['SECTIONS'] = array(intVal($this->CalendarSection));
}
if ($this->CalendarOwnerId || $arFields["CAL_TYPE"] != "user" && $arFields["CAL_TYPE"] != "group") {
$arFields["OWNER_ID"] = $this->CalendarOwnerId;
$eventId = CCalendar::SaveEvent(array('arFields' => $arFields, 'autoDetectSection' => true));
} else {
$arCalendarUser = CBPHelper::ExtractUsers($this->CalendarUser, $documentId);
foreach ($arCalendarUser as $calendarUser) {
$arFields["CAL_TYPE"] = "user";
$arFields["OWNER_ID"] = $calendarUser;
$eventId = CCalendar::SaveEvent(array('arFields' => $arFields, 'autoDetectSection' => true));
}
}
return CBPActivityExecutionStatus::Closed;
}
示例2:
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arResult['TIMEZONE_LIST'] = CCalendar::GetTimezoneList();
$this->IncludeComponentTemplate();
示例3: InstallEvents
function InstallEvents()
{
global $DB;
$arCurPhpVer = Explode(".", PhpVersion());
if (IntVal($arCurPhpVer[0]) < 5)
return true;
$sIn = "'CALENDAR_INVITATION'";
$rs = $DB->Query("SELECT count(*) C FROM b_event_type WHERE EVENT_NAME IN (".$sIn.") ", false, "File: ".__FILE__."<br>Line: ".__LINE__);
$ar = $rs->Fetch();
if($ar["C"] <= 0)
include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/calendar/install/events.php");
if (!IsModuleInstalled('intranet'))
{
COption::SetOptionString("intranet", "calendar_2", "Y");
CModule::IncludeModule('calendar');
CCalendar::ClearCache();
CCalendar::CacheTime(0);
$arTypes = CCalendarType::GetList();
if (!$arTypes || !count($arTypes))
{
CCalendarType::Edit(array(
'NEW' => true,
'arFields' => array(
'XML_ID' => 'events',
'NAME' => GetMessage('CAL_DEFAULT_TYPE'),
'ACCESS' => array(
'G2' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_view')
)
)
));
}
}
return true;
}
示例4:
?>
</span><?php
?>
</a><?php
}
}
?>
<?php
if (!$bShowAll) {
?>
<span id="feed-event-more-att-link-n-<?php
echo $id;
?>
" class="bxcal-more-attendees"><?php
echo CCalendar::GetMoreAttendeesMessage(count($event['DECLINED_ATTENDEES']) - $arParams['ATTENDEES_SHOWN_COUNT']);
?>
</span>
<div id="feed-event-more-attendees-n-<?php
echo $id;
?>
" class="bxcal-more-attendees-popup" style="display: none;">
<?php
echo $popupContent;
?>
</div>
<?php
}
?>
<?php
}
示例5: 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(" ", " "), "", $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);
//.........这里部分代码省略.........
示例6: BuildDialog
//.........这里部分代码省略.........
<td class="bxec-scale-cont"><label for="<?php
echo $id;
?>
_plan_scale_sel"><?php
echo GetMessage('EC_SCALE');
?>
:</label>
<select id="<?php
echo $id;
?>
_plan_scale_sel">
<option value="0">30 <?php
echo GetMessage('EC_EDEV_REM_MIN');
?>
</option>
<option value="1">1 <?php
echo GetMessage('EC_PL_DUR_HOUR1');
?>
</option>
<option value="2">2 <?php
echo GetMessage('EC_PL_DUR_HOUR2');
?>
</option>
<option value="3">1 <?php
echo GetMessage('EC_JS_DAY_P');
?>
</option>
</select>
</td>
<td class="bxec-separator-gr" rowSpan="2"></td>
<td rowSpan="2"><div class="bxec-grid-cont-title"></div></td>
</tr>
<tr class="bxec-header">
<td class="bxec-user">
<div><?php
echo GetMessage('EC_EDEV_GUESTS');
?>
<span id="<?php
echo $id;
?>
pl-count"></span>
<i class="bxplan-del bxplan-del-all" id="<?php
echo $id;
?>
_planner_del_all" title="<?php
echo GetMessage('EC_DEL_ALL_GUESTS_TITLE');
?>
"></i>
</div>
</td>
</tr>
<tr>
<td><div class="bxec-user-list-div"><div class="bxec-empty-list"> <?php
echo GetMessage('EC_NO_ATTENDEES');
?>
</div></div></td>
<td class="bxec-separator"></td>
<td><div class="bxec-grid-cont"><div class="bxec-gacc-cont"></div>
<div class="bxecp-selection" id="<?php
echo $id;
?>
_plan_selection" title="<?php
echo GetMessage('EC_PL_EVENT');
?>
"><img src="/bitrix/images/1.gif" class="bxecp-sel-left" title="<?php
echo GetMessage('EC_PL_EVENT_MOVE_LEFT');
?>
" /><img src="/bitrix/images/1.gif" class="bxecp-sel-right" title="<?php
echo GetMessage('EC_PL_EVENT_MOVE_RIGHT');
?>
" /><img src="/bitrix/images/1.gif" class="bxecp-sel-mover" title="<?php
echo GetMessage('EC_PL_EVENT_MOVE');
?>
" /></div>
</div>
<div class="bxec-empty-list2"><?php
echo GetMessage('EC_NO_GUEST_MESS');
?>
</div>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
<script>
function BXPlannerAttendeeOnchange(arUsers){BX.onCustomEvent(window, 'onPlannerAttendeeOnChange', [arUsers]);}
</script>
<?php
$isExtranetGroup = false;
if ($Params["bSocNet"] && $Params["type"] == "group" && intval($Params["ownerId"]) > 0 && CModule::IncludeModule("extranet")) {
$isExtranetGroup = CExtranet::IsExtranetSocNetGroup($Params["ownerId"]);
}
$APPLICATION->IncludeComponent("bitrix:intranet.user.selector.new", "", array("MULTIPLE" => "Y", "NAME" => "BXPlannerUserSelect", "VALUE" => array(), "POPUP" => "Y", "ON_CHANGE" => "BXPlannerAttendeeOnchange", "SITE_ID" => SITE_ID, "NAME_TEMPLATE" => CCalendar::GetUserNameTemplate(), "SHOW_EXTRANET_USERS" => $isExtranetGroup ? "FROM_EXACT_GROUP" : "NONE", "EX_GROUP" => $isExtranetGroup ? $Params["ownerId"] : ""), null, array("HIDE_ICONS" => "Y"));
?>
</div>
<?php
}
示例7: class_exists
die;
}
if (!CModule::IncludeModule("calendar")) {
return;
}
$adv_mode = $arCurrentValues["ADVANCED_MODE_SETTINGS"] == 'Y';
$eventListMode = $arCurrentValues["EVENT_LIST_MODE"] == 'Y';
$bSocNet = CModule::IncludeModule("socialnetwork");
if ($bSocNet) {
$bSocNet = class_exists('CSocNetUserToGroup') && CBXFeatures::IsFeatureEnabled("Calendar");
}
$arTypes = array();
$types = CCalendarType::GetList();
if (is_array($types)) {
foreach ($types as $type) {
$arTypes[$type["XML_ID"]] = "[" . $type["XML_ID"] . "] " . $type["NAME"];
}
}
// * * * * * * * * * * * * Groups * * * * * * * * * * * *
$arComponentParameters = array();
// $arComponentParameters["GROUPS"] = array(
// "BASE_SETTINGS" => array("NAME" => GetMessage("EC_GROUP_BASE_SETTINGS"), "SORT" => "100")
// );
//* * * * * * * * * * * Parameters * * * * * * * * * * *
$arParams = array();
$arParams["CALENDAR_TYPE"] = array("PARENT" => "BASE", "NAME" => GetMessage("EC_TYPE"), "TYPE" => "LIST", "VALUES" => $arTypes);
if (CCalendar::IsIntranetEnabled()) {
$arParams["ALLOW_SUPERPOSE"] = array("PARENT" => "BASE", "NAME" => GetMessage("EC_P_ALLOW_SUPERPOSE"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y");
$arParams["ALLOW_RES_MEETING"] = array("PARENT" => "BASE", "NAME" => GetMessage("EC_P_ALLOW_RES_MEETING"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y");
}
$arComponentParameters["PARAMETERS"] = $arParams;
示例8: array
}
$arSelect[] = 'UF_CRM_CAL_EVENT';
if (!in_array('ID', $arSelect)) {
$arSelect[] = 'ID';
}
$obRes = CCrmActivityCalendar::GetList($arResult['SORT'], $arFilter, $arSelect, $nPageTop);
if ($arResult['GADGET'] != 'Y') {
$obRes->NavStart($arNav['nPageSize'], false);
$arResult['DB_LIST'] = $obRes;
}
$obRes->bShowAll = false;
$arResult['ROWS_COUNT'] = $obRes->NavRecordCount;
$arResult['CAL'] = array();
$arCalList = array();
$i = 0;
$arCalendarConf = CCalendar::GetSettings();
$arParams['PATH_TO_CAL_SHOW'] = $arCalendarConf['path_to_user_calendar'];
while ($arCal = $obRes->GetNext()) {
if (!isset($arCal['~UF_CRM_CAL_EVENT']) || !is_array($arCal['~UF_CRM_CAL_EVENT'])) {
continue;
}
$iAddTask = -1;
foreach ($arCal['~UF_CRM_CAL_EVENT'] as $sCalRel) {
if ($nPageTop !== false && $i >= $nPageTop) {
break 2;
}
$arCal['REL_ID'] = $sCalRel;
$arCalEntityData = CCrmActivityCalendar::GetEntityDataByCalRel($sCalRel);
if (isset($arResult['CAL'][$arCal['ID'] . '_' . $sCalRel])) {
continue;
}
示例9: IsModuleInstalled
// Webdaw upload file UF
$arParams["UPLOAD_WEBDAV_ELEMENT"] = $arResult['USER_FIELDS']['UF_WEBDAV_CAL_EVENT'];
$arParams['SECTIONS'] = CCalendar::GetSectionList(array(
'CAL_TYPE' => $arParams['OWNER_TYPE'],
'OWNER_ID' => $arParams['CUR_USER']
));
if (empty($arParams['SECTIONS']))
{
$defCalendar = CCalendarSect::CreateDefault(array(
'type' => $arParams['OWNER_TYPE'],
'ownerId' => $arParams['CUR_USER']
));
$arParams['SECTIONS'][] = $defCalendar;
CCalendar::SetCurUserMeetingSection($defCalendar['ID']);
}
$arParams['EVENT'] = CCalendarEvent::GetById($arParams['EVENT_ID']);
$arParams["DESTINATION"] = (is_array($arParams["DESTINATION"]) && IsModuleInstalled("socialnetwork") ? $arParams["DESTINATION"] : array());
$arParams["DESTINATION"] = (array_key_exists("VALUE", $arParams["DESTINATION"]) ? $arParams["DESTINATION"]["VALUE"] : $arParams["DESTINATION"]);
$users = array();
foreach ($arParams["DESTINATION"]['USERS'] as $key => $entry)
{
if ($entry['isExtranet'] == 'N')
$users[$key] = $entry;
}
$arParams["DESTINATION"]['USERS'] = $users;
示例10: ShowError
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("calendar")) {
return ShowError("EC_CALENDAR_MODULE_NOT_INSTALLED");
}
CModule::IncludeModule("socialnetwork");
$APPLICATION->ResetException();
$Params = array('type' => $arParams["CALENDAR_TYPE"], 'ownerId' => $arParams["OWNER_ID"], 'pageUrl' => htmlspecialcharsback(POST_FORM_ACTION_URI), 'allowSuperpose' => $arParams["ALLOW_SUPERPOSE"] == 'Y', 'allowResMeeting' => $arParams["ALLOW_RES_MEETING"] != 'N', 'allowVideoMeeting' => $arParams["ALLOW_RES_MEETING"] != 'N', 'SectionControlsDOMId' => 'sidebar', 'user_name_template' => empty($arParams['NAME_TEMPLATE']) ? CSite::GetNameFormat(false) : str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]));
if (isset($arParams["SIDEBAR_DOM_ID"])) {
$Params['SectionControlsDOMId'] = $arParams["SIDEBAR_DOM_ID"];
}
// Create new instance of Event Calendar object
$EC = new CCalendar();
$EC->Init($Params);
// Init with $Params array
if (isset($_REQUEST['action'])) {
$EC->Request($_REQUEST['action']);
} else {
$EC->Show();
}
if ($ex = $APPLICATION->GetException()) {
return ShowError($ex->GetString());
}
// Set title and navigation
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "Y" ? "Y" : "N";
$arParams["SET_NAV_CHAIN"] = $arParams["SET_NAV_CHAIN"] == "Y" ? "Y" : "N";
//Turn OFF by default
if ($arParams["STR_TITLE"]) {
示例11: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("calendar")) {
return;
}
COption::SetOptionString("intranet", "calendar_2", "Y");
if (WIZARD_FIRST_INSTAL != 'Y') {
// calendar type
$arTypes = CCalendarType::GetList(array("arFilter" => array("XML_ID" => 'events_info')));
if (!$arTypes || count($arTypes) <= 0) {
CCalendarType::Edit(array('NEW' => true, 'arFields' => array('XML_ID' => 'events_info', 'NAME' => GetMessage('CAL_DEFAULT_TYPE'), 'ACCESS' => array('G2' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_view')))));
}
// Sections
$sectId0 = CCalendar::SaveSection(array('arFields' => array('CAL_TYPE' => 'events_info', 'ID' => 0, 'NAME' => GetMessage("CAL_TYPE_COMPANY_NAME"), 'DESCRIPTION' => "", 'COLOR' => '#855CC5', 'TEXT_COLOR' => '', 'OWNER_ID' => '', 'EXPORT' => array('ALLOW' => true, 'SET' => '3_9'), 'ACCESS' => array(), 'IS_EXCHANGE' => false)));
// Events for company_calendar
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'events_info', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_EVENT_1_NAME"), 'DESCRIPTION' => "", 'DT_FROM' => GetTime(mktime(0, 0, 0, date("m"), date("d") + 4, date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(0, 0, 0, date("m"), date("d") + 4, date("Y")), "FULL"), 'RRULE' => array(), 'SECTIONS' => $sectId0), 'userId' => 1));
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'events', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_EVENT_2_NAME"), 'DESCRIPTION' => "", 'COLOR' => '#FFFF80', 'DT_FROM' => GetTime(mktime(0, 0, 0, date("m"), date("d"), date("Y")), "SHORT"), 'DT_TO' => GetTime(mktime(0, 0, 0, date("m"), date("d"), date("Y")), "SHORT"), 'RRULE' => array('FREQ' => 'WEEKLY', 'INTERVAL' => 3, 'BYDAY' => 'SA'), 'SECTIONS' => $sectId0), 'userId' => 1));
}
示例12: elseif
$arResult["TIME_ZONE_LIST"] = CTimeZone::GetZones();
if (empty($arResult["ITEM"]["WORKTIME_TIMEZONE"])) {
if (LANGUAGE_ID == "ru") {
$arResult["ITEM"]["WORKTIME_TIMEZONE"] = "Europe/Moscow";
} elseif (LANGUAGE_ID == "de") {
$arResult["ITEM"]["WORKTIME_TIMEZONE"] = "Europe/Berlin";
} elseif (LANGUAGE_ID == "ua") {
$arResult["ITEM"]["WORKTIME_TIMEZONE"] = "Europe/Kiev";
} else {
$arResult["ITEM"]["WORKTIME_TIMEZONE"] = "America/New_York";
}
}
$arResult["WEEK_DAYS"] = array('MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU');
$arResult["WORKTIME_LIST_FROM"] = array();
$arResult["WORKTIME_LIST_TO"] = array();
if (CModule::IncludeModule("calendar")) {
$arResult["WORKTIME_LIST_FROM"][strval(0)] = CCalendar::FormatTime(0, 0);
for ($i = 0; $i < 24; $i++) {
if ($i !== 0) {
$arResult["WORKTIME_LIST_FROM"][strval($i)] = CCalendar::FormatTime($i, 0);
$arResult["WORKTIME_LIST_TO"][strval($i)] = CCalendar::FormatTime($i, 0);
}
$arResult["WORKTIME_LIST_FROM"][strval($i) . '.30'] = CCalendar::FormatTime($i, 30);
$arResult["WORKTIME_LIST_TO"][strval($i) . '.30'] = CCalendar::FormatTime($i, 30);
}
$arResult["WORKTIME_LIST_TO"][strval('23.59')] = CCalendar::FormatTime(23, 59);
}
if (!(isset($arParams['TEMPLATE_HIDE']) && $arParams['TEMPLATE_HIDE'] == 'Y')) {
$this->IncludeComponentTemplate();
}
return $arResult;
示例13: FixForumCommentURL
public static function FixForumCommentURL($arData)
{
if(
in_array($arData["MODULE_ID"], array("forum", "FORUM"))
&& $arData['ENTITY_TYPE_ID'] === 'FORUM_POST'
&& intval($arData['PARAM1']) > 0
&& preg_match('/^EVENT_([0-9]+)/', $arData["TITLE"], $match)
)
{
$arCalendarSettings = CCalendar::GetSettings();
$forumID = $arCalendarSettings["forum_id"];
$eventID = intval($match[1]);
if (
intval($arData['PARAM1']) == $forumID
&& $eventID > 0
&& !empty($arCalendarSettings["pathes"])
&& ($arCalendarEvent = CCalendarEvent::GetById($eventID))
&& strlen($arCalendarEvent["CAL_TYPE"]) > 0
&& in_array($arCalendarEvent["CAL_TYPE"], array("user", "group"))
&& intval($arCalendarEvent["OWNER_ID"]) > 0
)
{
foreach ($arData['LID'] as $siteId => $value)
{
$messageUrl = false;
if (
array_key_exists($siteId, $arCalendarSettings["pathes"])
&& is_array($arCalendarSettings["pathes"][$siteId])
&& !empty($arCalendarSettings["pathes"][$siteId])
)
{
if ($arCalendarEvent["CAL_TYPE"] == "user")
{
if (
array_key_exists("path_to_user_calendar", $arCalendarSettings["pathes"][$siteId])
&& !empty($arCalendarSettings["pathes"][$siteId]["path_to_user_calendar"])
)
{
$messageUrl = CComponentEngine::MakePathFromTemplate(
$arCalendarSettings["pathes"][$siteId]["path_to_user_calendar"],
array(
"user_id" => $arCalendarEvent['OWNER_ID'],
)
);
}
}
else
{
if (
array_key_exists("path_to_group_calendar", $arCalendarSettings["pathes"][$siteId])
&& !empty($arCalendarSettings["pathes"][$siteId]["path_to_group_calendar"])
)
{
$messageUrl = CComponentEngine::MakePathFromTemplate(
$arCalendarSettings["pathes"][$siteId]["path_to_group_calendar"],
array(
"group_id" => $arCalendarEvent['OWNER_ID'],
)
);
}
}
}
$arData['LID'][$siteId] = ($messageUrl ? $messageUrl."?EVENT_ID=".$arCalendarEvent["ID"]."&MID=".$arData['ENTITY_ID']."#message".$arData['ENTITY_ID'] : "");
}
return $arData;
}
return array(
"TITLE" => "",
"BODY" => ""
);
}
}
示例14: GetMessage
$today = CCalendar::Date(time(), false);
$tomorrow = CCalendar::Date(time() + 86400, false);
$bToday = false;
$bTomorrow = false;
$bLater = false;
$use_sections = "YES";
$iconEvent = '/bitrix/templates/mobile_app/images/calendar/event.png';
$iconMeeting = '/bitrix/templates/mobile_app/images/calendar/meeting.png';
$iconInviting = '/bitrix/templates/mobile_app/images/calendar/meeting-q.png';
$dateFormat = GetMessage('MB_CAL_EVENT_DATE_FORMAT');
$timeFormat = IsAmPmMode() ? GetMessage('MB_CAL_EVENT_TIME_FORMAT_AMPM') : GetMessage('MB_CAL_EVENT_TIME_FORMAT');
$count = count($arEvents);
for ($i = 0; $i < $count; $i++) {
$event = $arEvents[$i];
$event['DT_FROM_TS'] = CCalendar::_fixTimestamp($event['DT_FROM_TS']);
$event['DT_TO_TS'] = CCalendar::_fixTimestamp($event['DT_TO_TS']);
$item = array("ID" => $event['ID'], "NAME" => CMobile::PrepareStrToJson($event['NAME']), "URL" => $url . "?event_id=" . $event['ID']);
if ($event['IS_MEETING'] && $event['USER_MEETING']['STATUS'] == 'N') {
continue;
}
if ($event['IS_MEETING']) {
$item["IMAGE"] = $event['USER_MEETING']['STATUS'] == 'Q' ? $iconInviting : $iconMeeting;
} else {
$item["IMAGE"] = $iconEvent;
}
$bOneDay = $event['DT_LENGTH'] == 86400;
// One full day
$bDuringOneDay = !$bOneDay && FormatDate('d.m.Y', $event['DT_FROM_TS']) === FormatDate('d.m.Y', $event['DT_TO_TS']);
$fromToMess = '';
// It's event for today
if ($event['DT_FROM_TS'] <= $todayEndTs && $event['DT_TO_TS'] >= $todayStartTs) {
示例15: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("calendar") || WIZARD_IS_RERUN) {
return;
}
COption::SetOptionString("intranet", "calendar_2", "Y");
// company calendar calendar type
CCalendarType::Edit(array('NEW' => true, 'arFields' => array('XML_ID' => 'company_calendar', 'NAME' => GetMessage('CAL_TYPE_COMPANY_NAME'), 'DESCRIPTION' => '', 'ACCESS' => array('G2' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_view')))));
// Sections
$sectId0 = CCalendar::SaveSection(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'ID' => 0, 'NAME' => GetMessage("CAL_COMPANY_SECT_0"), 'DESCRIPTION' => GetMessage("CAL_COMPANY_SECT_DESC_0"), 'COLOR' => '#855CC5', 'TEXT_COLOR' => '', 'OWNER_ID' => '', 'EXPORT' => array('ALLOW' => true, 'SET' => '3_9'), 'ACCESS' => array(), 'IS_EXCHANGE' => false)));
$sectId1 = CCalendar::SaveSection(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'ID' => 0, 'NAME' => GetMessage("CAL_COMPANY_SECT_1"), 'DESCRIPTION' => GetMessage("CAL_COMPANY_SECT_DESC_1"), 'COLOR' => '#7DDEC2', 'TEXT_COLOR' => '', 'OWNER_ID' => '', 'EXPORT' => array('ALLOW' => true, 'SET' => '3_9'), 'ACCESS' => array(), 'IS_EXCHANGE' => false)));
$sectId2 = CCalendar::SaveSection(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'ID' => 0, 'NAME' => GetMessage("CAL_COMPANY_SECT_2"), 'DESCRIPTION' => GetMessage("CAL_COMPANY_SECT_DESC_2"), 'COLOR' => '#F6EA68', 'TEXT_COLOR' => '', 'OWNER_ID' => '', 'EXPORT' => array('ALLOW' => true, 'SET' => '3_9'), 'ACCESS' => array(), 'IS_EXCHANGE' => false)));
// Events for company_calendar
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_COMP_EVENT_NAME_0"), 'DESCRIPTION' => GetMessage("CAL_COMP_EVENT_DESC_0"), 'DT_FROM' => GetTime(mktime(9, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(16, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'RRULE' => array('FREQ' => 'WEEKLY', 'INTERVAL' => 1, 'UNTIL' => GetTime(mktime(0, 0, 0, date("m"), date("d"), date("Y") + 1), "SHORT"), 'BYDAY' => 'TU'), 'SECTIONS' => $sectId0), 'userId' => 1));
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_COMP_EVENT_NAME_1"), 'DESCRIPTION' => GetMessage("CAL_COMP_EVENT_DESC_1"), 'DT_FROM' => GetTime(mktime(0, 0, 0, date("m"), date("d") + 2, date("Y")), "SHORT"), 'DT_TO' => GetTime(mktime(0, 0, 0, date("m"), date("d") + 2, date("Y")), "SHORT"), 'RRULE' => array('FREQ' => 'MONTHLY', 'INTERVAL' => 1, 'UNTIL' => GetTime(mktime(0, 0, 0, date("m"), date("d"), date("Y") + 1), "SHORT")), 'SECTIONS' => $sectId0), 'userId' => 1));
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_COMP_EVENT_NAME_2"), 'DESCRIPTION' => GetMessage("CAL_COMP_EVENT_DESC_2"), 'DT_FROM' => GetTime(mktime(10, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(12, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'RRULE' => array('FREQ' => 'WEEKLY', 'INTERVAL' => 1, 'BYDAY' => 'MO'), 'SECTIONS' => $sectId1), 'userId' => 1));
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_COMP_EVENT_NAME_3"), 'DESCRIPTION' => GetMessage("CAL_COMP_EVENT_DESC_3"), 'DT_FROM' => GetTime(mktime(9, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(18, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'RRULE' => array('FREQ' => 'WEEKLY', 'INTERVAL' => 1, 'BYDAY' => 'TU'), 'SECTIONS' => $sectId2), 'userId' => 1));
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'OWNER_ID' => 0, 'NAME' => GetMessage("CAL_COMP_EVENT_NAME_4"), 'DESCRIPTION' => GetMessage("CAL_COMP_EVENT_DESC_4"), 'DT_FROM' => GetTime(mktime(12, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(17, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'RRULE' => array('FREQ' => 'WEEKLY', 'INTERVAL' => 1, 'BYDAY' => 'FR'), 'SECTIONS' => $sectId2), 'userId' => 1));
CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'company_calendar', 'OWNER_ID' => 1, 'NAME' => GetMessage("CAL_COMP_EVENT_NAME_5"), 'DESCRIPTION' => GetMessage("CAL_COMP_EVENT_DESC_5"), 'DT_FROM' => GetTime(mktime(16, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(21, 0, 0, date("m"), date("d"), date("Y")), "FULL"), 'RRULE' => array('FREQ' => 'WEEKLY', 'INTERVAL' => 1, 'BYDAY' => 'SA'), 'SECTIONS' => $sectId1), 'userId' => 1));
// User's calendar type
CCalendarType::Edit(array('NEW' => true, 'arFields' => array('XML_ID' => 'user', 'NAME' => GetMessage('CAL_TYPE_USER_NAME'), 'DESCRIPTION' => '', 'ACCESS' => array('G2' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_edit')))));
// Group's calendar type
CCalendarType::Edit(array('NEW' => true, 'arFields' => array('XML_ID' => 'group', 'NAME' => GetMessage('CAL_TYPE_GROUP_NAME'), 'DESCRIPTION' => '', 'ACCESS' => array('G2' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_edit')))));
$id = CCalendar::SaveEvent(array('arFields' => array('CAL_TYPE' => 'user', 'OWNER_ID' => 1, 'NAME' => GetMessage("W_IB_CALENDAR_EMP_ABS"), 'DT_FROM' => GetTime(mktime(12, 0, 0, date("m"), date("d") + 1, date("Y")), "FULL"), 'DT_TO' => GetTime(mktime(14, 0, 0, date("m"), date("d") + 1, date("Y")), "FULL"), 'DESCRIPTION' => ''), 'userId' => 1, 'autoDetectSection' => true, 'autoCreateSection' => true));