本文整理汇总了PHP中CCalendar::SetSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar::SetSettings方法的具体用法?PHP CCalendar::SetSettings怎么用?PHP CCalendar::SetSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCalendar
的用法示例。
在下文中一共展示了CCalendar::SetSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
}
if (CModule::IncludeModule("intranet") && CModule::IncludeModule("calendar")) {
CModule::IncludeModule("socialnetwork");
$RES = NULL;
// 1. Fetch options
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["convert"]) && $_POST["convert"] == 'Y' && check_bitrix_sessid()) {
// Remember all settings
$SET = array('work_time_start' => $_REQUEST['work_time_start'], 'work_time_end' => $_REQUEST['work_time_end'], 'year_holidays' => $_REQUEST['year_holidays'], 'week_holidays' => implode('|', $_REQUEST['week_holidays']), 'path_to_user' => $_REQUEST['path_to_user'], 'path_to_user_calendar' => $_REQUEST['path_to_user_calendar'], 'path_to_group' => $_REQUEST['path_to_group'], 'path_to_group_calendar' => $_REQUEST['path_to_group_calendar'], 'path_to_vr' => $_REQUEST['path_to_vr'], 'path_to_rm' => $_REQUEST['path_to_rm'], 'rm_iblock_type' => $_REQUEST['rm_iblock_type'], 'rm_iblock_id' => $_REQUEST['rm_iblock_id'], 'vr_iblock_id' => $_REQUEST['vr_iblock_id']);
$CUR_SET = CCalendar::GetSettings();
foreach ($CUR_SET as $key => $value) {
if (!isset($SET[$key]) && isset($value)) {
$SET[$key] = $value;
}
}
CCalendar::SetSettings($SET);
CCalendar::ClearCache(array('access_tasks', 'type_list', 'type_list', 'section_list'));
// Remember iblocks
// Create types
if (isset($_POST["set_params"]) && $_POST["set_params"] == 'Y') {
$types = array();
foreach ($_POST['types'] as $type) {
if (isset($type['allow']) && $type['allow'] == "Y") {
$types[$type['key']] = array('iblockType' => $type['iblock_type'], 'iblockId' => $type['iblock_id'], 'name' => $type['title'], 'desc' => $type['desc']);
$typeAccess = array('G2' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_edit'));
if ($type['key'] != 'user' && $type['key'] != 'group') {
$arGroupPerm = CIBlock::GetGroupPermissions($type['iblock_id']);
$taskByLetter = array('D' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_denied'), 'R' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_view'), 'W' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_edit'), 'X' => CCalendar::GetAccessTasksByName('calendar_type', 'calendar_type_access'));
foreach ($arGroupPerm as $groupId => $letter) {
$typeAccess['G' . $groupId] = $taskByLetter[$letter];
}
示例2: Request
//.........这里部分代码省略.........
CCalendar::OutputJSRes($reqId, array('result' => true));
} else {
CCalendar::ThrowError('Error! Cant save displayed superposed calendars');
}
break;
// * * * * * Fetch all available sections for superposing * * * * *
// * * * * * Fetch all available sections for superposing * * * * *
case 'get_superposed':
CCalendar::OutputJSRes($reqId, array('sections' => CCalendar::GetSuperposed()));
break;
// * * * * * Return info about user, and user calendars * * * * *
// * * * * * Return info about user, and user calendars * * * * *
case 'spcal_user_cals':
CCalendar::OutputJSRes($reqId, array('sections' => CCalendar::GetSuperposedForUsers($_REQUEST['users'])));
break;
// * * * * * Delete tracking user * * * * *
// * * * * * Delete tracking user * * * * *
case 'spcal_del_user':
CCalendar::OutputJSRes($reqId, array('result' => CCalendar::DeleteTrackingUser(intVal($_REQUEST['userId']))));
break;
// * * * * * Save user settings * * * * *
// * * * * * Save user settings * * * * *
case 'save_settings':
if (isset($_POST['clear_all']) && $_POST['clear_all'] == true) {
// Clear personal settings
CCalendar::SetUserSettings(false);
} else {
// Personal
CCalendar::SetUserSettings($_REQUEST['user_settings']);
// Save access for type
if (CCalendarType::CanDo('calendar_type_access', self::$type)) {
// General
$_REQUEST['settings']['week_holidays'] = implode('|', $_REQUEST['settings']['week_holidays']);
CCalendar::SetSettings($_REQUEST['settings']);
CCalendarType::Edit(array('arFields' => array('XML_ID' => self::$type, 'ACCESS' => $_REQUEST['type_access'])));
}
}
CCalendar::OutputJSRes($reqId, array('result' => true));
break;
// * * * * * Confirm user part in event * * * * *
// * * * * * Confirm user part in event * * * * *
case 'set_meeting_status':
CCalendarEvent::SetMeetingStatus(self::$userId, intVal($_REQUEST['event_id']), in_array($_REQUEST['status'], array('Q', 'Y', 'N')) ? $_REQUEST['status'] : 'Q', $_REQUEST['status_comment']);
CCalendar::OutputJSRes($reqId, true);
break;
case 'set_meeting_params':
CCalendarEvent::SetMeetingParams(self::$userId, intVal($_REQUEST['event_id']), array('ACCESSIBILITY' => $_REQUEST['accessibility'], 'REMIND' => $_REQUEST['remind']));
CCalendar::OutputJSRes($reqId, true);
break;
// * * * * * Check users accessibility * * * * *
// * * * * * Check users accessibility * * * * *
case 'check_guests':
CCalendar::OutputJSRes($reqId, array('data' => CCalendar::CheckUsersAccessibility(array('users' => $_REQUEST['attendees'], 'from' => self::Date($_POST['from']), 'to' => self::Date($_POST['to']), 'eventId' => intVal($_POST['event_id'])))));
break;
// * * * * * Get list of group members * * * * *
// * * * * * Get list of group members * * * * *
case 'get_group_members':
if (self::$type == 'group') {
CCalendar::OutputJSRes($reqId, array('users' => self::GetGroupMembers(self::$ownerId)));
}
break;
// * * * * * Get Guests Accessibility * * * * *
// * * * * * Get Guests Accessibility * * * * *
case 'get_accessibility':
$res = CCalendar::GetAccessibilityForUsers(array('users' => $_POST['users'], 'from' => self::Date(self::Timestamp($_POST['from'])), 'to' => self::Date(self::Timestamp($_POST['to'])), 'curEventId' => intVal($_POST['cur_event_id']), 'getFromHR' => true));
CCalendar::OutputJSRes($reqId, array('data' => $res));
示例3: SettingsClear
public static function SettingsClear($arParams = array(), $nav = null, $server = null)
{
global $USER;
$methodName = "calendar.settings.clear";
if (!$USER->CanDoOperation('bitrix24_config') && !$USER->CanDoOperation('edit_php')) {
throw new Exception(GetMessage('CAL_REST_ACCESS_DENIED'));
}
CCalendar::SetSettings(array(), true);
return true;
}