Beispiel #1
0
 public static function DeleteSection($ID)
 {
     // Exchange
     if (CCalendar::IsExchangeEnabled() && self::$type == 'user') {
         $oSect = CCalendarSect::GetById($ID);
         // For exchange we change only calendar name
         if ($oSect && $oSect['IS_EXCHANGE'] && $oSect['DAV_EXCH_CAL']) {
             $exchRes = CDavExchangeCalendar::DoDeleteCalendar($oSect['OWNER_ID'], $oSect['DAV_EXCH_CAL']);
             if ($exchRes !== true) {
                 return CCalendar::CollectExchangeErrors($exchRes);
             }
         }
     }
     return CCalendarSect::Delete($ID);
 }
Beispiel #2
0
 function DeleteCalendar($ID, $arEvIds = false)
 {
     global $DB;
     if (!$this->CheckPermissionForEvent(array(), true)) {
         return CEventCalendar::ThrowError('EC_ACCESS_DENIED');
     }
     @set_time_limit(0);
     // Exchange
     if (CEventCalendar::IsExchangeEnabled() && $this->ownerType == 'USER') {
         $calendarXmlId = CECCalendar::GetExchangeXmlId($this->iblockId, $ID);
         if (strlen($calendarXmlId) > 0 && $calendarXmlId !== 0) {
             $exchRes = CDavExchangeCalendar::DoDeleteCalendar($this->ownerId, $calendarXmlId);
             if ($exchRes !== true) {
                 return CEventCalendar::CollectExchangeErros($exchRes);
             }
         }
     }
     $DB->StartTransaction();
     if (!CIBlockSection::Delete($ID)) {
         $DB->Rollback();
         return false;
     }
     $DB->Commit();
     return true;
 }