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


PHP CCalendar::SetUserSettings方法代码示例

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


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

示例1: DoConvertStep

 public static function DoConvertStep()
 {
     $types = CCalendarConvert::GetOption('__convert');
     $start_time = microtime(true);
     $time_limit = 2;
     $stage = 'stop';
     $finished = false;
     self::$accessTasks = CCalendar::GetAccessTasks('calendar_section');
     self::$userIblockId = $types['user']['iblockId'];
     foreach ($types as $key => $type) {
         $iblockId = $type['iblockId'];
         if ($iblockId < 0) {
             continue;
         }
         // Fetch type
         if ($key == 'user') {
             $arFilter = array('IBLOCK_ID' => $iblockId, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => 'N', "DEPTH_LEVEL" => 1, "UF_CAL_CONVERTED" => false);
             $dbSections = CIBlockSection::GetList(array('ID' => 'ASC'), $arFilter);
             // For each user:
             while ($arSection = $dbSections->Fetch()) {
                 $ownerId = $arSection["CREATED_BY"];
                 CCalendar::SetUserSettings(false, $ownerId);
                 $res = CCalendarConvert::ConvertEntity('user', $ownerId, $arSection["ID"], $iblockId, $arSection["CREATED_BY"]);
                 if ($res['sectCount'] > 0 || $res['eventsCount'] > 0) {
                     CCalendarConvert::Log(GetMessage("CAL_CONVERT_STAGE_USER_CALS", array('#USER_NAME#' => $arSection['NAME'], '#SECT_COUNT#' => $res['sectCount'], '#EVENTS_COUNT#' => $res['eventsCount'])));
                 }
                 if ($res && ($res['sectCount'] > 0 || $res['eventsCount'] > 0) && microtime(true) - $start_time > $time_limit) {
                     $stage = 'go';
                     break;
                 }
             }
         } elseif ($key == 'group') {
             $arFilter = array('IBLOCK_ID' => $iblockId, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => 'N', "DEPTH_LEVEL" => 1, "UF_CAL_CONVERTED" => false);
             $dbSections = CIBlockSection::GetList(array('ID' => 'ASC'), $arFilter);
             // For each group:
             while ($arSection = $dbSections->Fetch()) {
                 $ownerId = $arSection["SOCNET_GROUP_ID"];
                 $res = CCalendarConvert::ConvertEntity('group', $ownerId, $arSection["ID"], $iblockId, $arSection["CREATED_BY"]);
                 if ($res['sectCount'] > 0 || $res['eventsCount'] > 0) {
                     CCalendarConvert::Log(GetMessage("CAL_CONVERT_STAGE_GROUP_CALS", array('#GROUP_NAME#' => $arSection['NAME'], '#SECT_COUNT#' => $res['sectCount'], '#EVENTS_COUNT#' => $res['eventsCount'])));
                 }
                 if ($res && ($res['sectCount'] > 0 || $res['eventsCount'] > 0) && microtime(true) - $start_time > $time_limit) {
                     $stage = 'go';
                     break;
                 }
             }
         } else {
             $res = CCalendarConvert::ConvertEntity($key, 0, 0, $iblockId, 1);
             if ($res['sectCount'] > 0 || $res['eventsCount'] > 0) {
                 CCalendarConvert::Log(GetMessage("CAL_CONVERT_STAGE_TYPE", array('#TYPE_NAME#' => $type['name'], '#SECT_COUNT#' => $res['sectCount'], '#EVENTS_COUNT#' => $res['eventsCount'])));
             }
             if ($res && ($res['sectCount'] > 0 || $res['eventsCount'] > 0) && microtime(true) - $start_time > $time_limit) {
                 $stage = 'go';
                 break;
             }
         }
         if ($stage == 'go') {
             break;
         }
     }
     return $stage;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:62,代码来源:calendar_convert.php

示例2: GetMeetingSection

 public static function GetMeetingSection($userId, $bCreate = false)
 {
     if (isset(self::$meetingSections[$userId])) {
         return self::$meetingSections[$userId];
     }
     $result = false;
     if ($userId > 0) {
         $set = CCalendar::GetUserSettings($userId);
         $result = $set['meetSection'];
         if ($result && !CCalendarSect::GetById($result, true, true)) {
             $result = false;
         }
         if (!$result) {
             $res = CCalendarSect::GetList(array('arFilter' => array('CAL_TYPE' => 'user', 'OWNER_ID' => $userId)));
             if ($res && count($res) > 0 && $res[0]['ID']) {
                 $result = $res[0]['ID'];
             }
             if (!$result && $bCreate) {
                 $defCalendar = CCalendarSect::CreateDefault(array('type' => 'user', 'ownerId' => $userId));
                 if ($defCalendar && $defCalendar['ID'] > 0) {
                     $result = $defCalendar['ID'];
                 }
             }
             if ($result) {
                 $set['meetSection'] = $result;
                 CCalendar::SetUserSettings($set, $userId);
             }
         }
     }
     self::$meetingSections[$userId] = $result;
     return $result;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:32,代码来源:calendar.php

示例3: UserSettingsClear

 public static function UserSettingsClear($arParams = array(), $nav = null, $server = null)
 {
     $userId = CCalendar::GetCurUserId();
     $methodName = "calendar.user.settings.clear";
     CCalendar::SetUserSettings(false, $userId);
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:7,代码来源:calendar_restservice.php


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