ILIAS  release_4-4 Revision
ilCalendarRecurrence Class Reference
+ Inheritance diagram for ilCalendarRecurrence:
+ Collaboration diagram for ilCalendarRecurrence:

Public Member Functions

 __construct ($a_rec_id=0)
 Constructor. More...
 
 toICal ($a_user_id)
 
 reset ()
 reset all settings More...
 
 getRecurrenceId ()
 get recurrence id More...
 
 setEntryId ($a_id)
 set cal id More...
 
 setRecurrence ($a_type)
 set type of recurrence More...
 
 isRecurrence ()
 is recurrence More...
 
 setFrequenceType ($a_type)
 set frequence type More...
 
 getFrequenceType ()
 get freq type More...
 
 getFrequenceUntilDate ()
 get until date More...
 
 setFrequenceUntilDate (ilDateTime $a_date=null)
 set freq until date More...
 
 setFrequenceUntilCount ($a_count)
 set frequence count More...
 
 getFrequenceUntilCount ()
 get frequence until count More...
 
 setInterval ($a_interval)
 set interval More...
 
 getInterval ()
 get interval More...
 
 setBYDAY ($a_byday)
 set by day More...
 
 getBYDAY ()
 get BYDAY More...
 
 getBYDAYList ()
 get BYDAY list More...
 
 setBYWEEKNO ($a_byweekno)
 set by day More...
 
 getBYWEEKNOList ()
 get byweekno list More...
 
 getBYWEEKNO ()
 get BYDAY More...
 
 setBYMONTH ($a_by)
 set by day More...
 
 getBYMONTH ()
 get BYDAY More...
 
 getBYMONTHList ()
 get bymonth list More...
 
 setBYMONTHDAY ($a_by)
 set by day More...
 
 getBYMONTHDAY ()
 get BYDAY More...
 
 getBYMONTHDAYList ()
 get BYMONTHDAY list More...
 
 setBYYEARDAY ($a_by)
 set by day More...
 
 getBYYEARDAY ()
 get BYDAY More...
 
 getBYYEARDAYList ()
 get BYYEARDAY list More...
 
 setBYSETPOS ($a_by)
 set by day More...
 
 getBYSETPOS ()
 get BYDAY More...
 
 getBYSETPOSList ()
 get bysetpos list More...
 
 setWeekstart ($a_start)
 set weekstart More...
 
 getWeekstart ()
 get weekstart More...
 
 getTimeZone ()
 get timezone More...
 
 setTimeZone ($a_tz)
 set timezone More...
 
 getExclusionDates ()
 Get exclusion dates. More...
 
 validate ()
 validate More...
 
 save ()
 save More...
 
 update ()
 save More...
 
 delete ()
 delete More...
 

Static Public Member Functions

static _delete ($a_cal_id)
 delete More...
 

Data Fields

const REC_RECURRENCE = 0
 
const REC_EXCLUSION = 1
 
const FREQ_DAILY = 'DAILY'
 
const FREQ_WEEKLY = 'WEEKLY'
 
const FREQ_MONTHLY = 'MONTHLY'
 
const FREQ_YEARLY = 'YEARLY'
 

Protected Attributes

 $db
 

Private Member Functions

 read ()
 Read entry. More...
 

Private Attributes

 $recurrence_id
 
 $cal_id
 
 $recurrence_type
 
 $freq_type = ''
 
 $freq_until_type
 
 $freq_until_date = null
 
 $freq_until_count
 
 $interval = 0
 
 $byday = ''
 
 $byweekno = ''
 
 $bymonth = ''
 
 $bymonthday = ''
 
 $byyearday = ''
 
 $bysetpos = ''
 
 $weekstart = ''
 
 $exclusion_dates = array()
 
 $timezone = 'Europe/Berlin'
 

Detailed Description

Definition at line 43 of file class.ilCalendarRecurrence.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarRecurrence::__construct (   $a_rec_id = 0)

Constructor.

public

Parameters
intrecurrence id

Definition at line 85 of file class.ilCalendarRecurrence.php.

References read().

86  {
87  global $ilDB;
88 
89  $this->db = $ilDB;
90  $this->recurrence_id = $a_rec_id;
91  if($a_rec_id)
92  {
93  $this->read();
94  }
95  }
+ Here is the call graph for this function:

Member Function Documentation

◆ _delete()

static ilCalendarRecurrence::_delete (   $a_cal_id)
static

delete

public

Parameters
intappointment id
Returns

Definition at line 105 of file class.ilCalendarRecurrence.php.

References $query, $res, and ilCalendarRecurrenceExclusions\delete().

Referenced by ilCalendarEntry\_delete(), and ilCalendarEntry\delete().

106  {
107  global $ilDB;
108 
109  $query = "DELETE FROM cal_recurrence_rules ".
110  "WHERE cal_id = ".$ilDB->quote($a_cal_id ,'integer')." ";
111  $res = $ilDB->manipulate($query);
112 
114  }
static delete($a_cal_id)
Delete exclusion dates of calendar entry.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilCalendarRecurrence::delete ( )

delete

public

Definition at line 751 of file class.ilCalendarRecurrence.php.

References $query, and $res.

752  {
753  global $ilDB;
754 
755  $query = "DELETE FROM cal_recurrence_rules ".
756  "WHERE rule_id = ".$this->db->quote($this->recurrence_id ,'integer');
757  $res = $ilDB->manipulate($query);
758  return true;
759  }

◆ getBYDAY()

ilCalendarRecurrence::getBYDAY ( )

get BYDAY

public

Definition at line 357 of file class.ilCalendarRecurrence.php.

References $byday.

Referenced by getBYDAYList(), save(), toICal(), and update().

358  {
359  return $this->byday;
360  }
+ Here is the caller graph for this function:

◆ getBYDAYList()

ilCalendarRecurrence::getBYDAYList ( )

get BYDAY list

public

Returns

Implements ilCalendarRecurrenceCalculation.

Definition at line 368 of file class.ilCalendarRecurrence.php.

References $byday, and getBYDAY().

369  {
370  if(!trim($this->getBYDAY()))
371  {
372  return array();
373  }
374  foreach(explode(',',$this->getBYDAY()) as $byday)
375  {
376  $bydays[] = trim($byday);
377  }
378  return $bydays ? $bydays : array();
379  }
+ Here is the call graph for this function:

◆ getBYMONTH()

ilCalendarRecurrence::getBYMONTH ( )

get BYDAY

public

Definition at line 442 of file class.ilCalendarRecurrence.php.

References $bymonth.

Referenced by getBYMONTHList(), save(), toICal(), and update().

443  {
444  return $this->bymonth;
445  }
+ Here is the caller graph for this function:

◆ getBYMONTHDAY()

ilCalendarRecurrence::getBYMONTHDAY ( )

get BYDAY

public

Definition at line 484 of file class.ilCalendarRecurrence.php.

References $bymonthday.

Referenced by getBYMONTHDAYList(), save(), toICal(), and update().

485  {
486  return $this->bymonthday;
487  }
+ Here is the caller graph for this function:

◆ getBYMONTHDAYList()

ilCalendarRecurrence::getBYMONTHDAYList ( )

get BYMONTHDAY list

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 494 of file class.ilCalendarRecurrence.php.

References getBYMONTHDAY().

495  {
496  if(!trim($this->getBYMONTHDAY()))
497  {
498  return array();
499  }
500  foreach(explode(',',$this->getBYMONTHDAY()) as $month_num)
501  {
502  $months[] = (int) $month_num;
503  }
504  return $months ? $months : array();
505 
506  }
+ Here is the call graph for this function:

◆ getBYMONTHList()

ilCalendarRecurrence::getBYMONTHList ( )

get bymonth list

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 453 of file class.ilCalendarRecurrence.php.

References getBYMONTH().

454  {
455  if(!trim($this->getBYMONTH()))
456  {
457  return array();
458  }
459  foreach(explode(',',$this->getBYMONTH()) as $month_num)
460  {
461  $months[] = (int) $month_num;
462  }
463  return $months ? $months : array();
464  }
+ Here is the call graph for this function:

◆ getBYSETPOS()

ilCalendarRecurrence::getBYSETPOS ( )

get BYDAY

public

Definition at line 569 of file class.ilCalendarRecurrence.php.

References $bysetpos.

Referenced by getBYSETPOSList(), save(), toICal(), and update().

570  {
571  return $this->bysetpos;
572  }
+ Here is the caller graph for this function:

◆ getBYSETPOSList()

ilCalendarRecurrence::getBYSETPOSList ( )

get bysetpos list

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 580 of file class.ilCalendarRecurrence.php.

References getBYSETPOS().

581  {
582  if(!trim($this->getBYSETPOS()))
583  {
584  return array();
585  }
586  foreach(explode(',',$this->getBYSETPOS()) as $pos)
587  {
588  $positions[] = (int) $pos;
589  }
590  return $positions ? $positions : array();
591  }
+ Here is the call graph for this function:

◆ getBYWEEKNO()

ilCalendarRecurrence::getBYWEEKNO ( )

get BYDAY

public

Definition at line 419 of file class.ilCalendarRecurrence.php.

References $byweekno.

Referenced by getBYWEEKNOList(), save(), toICal(), and update().

420  {
421  return $this->byweekno;
422  }
+ Here is the caller graph for this function:

◆ getBYWEEKNOList()

ilCalendarRecurrence::getBYWEEKNOList ( )

get byweekno list

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 399 of file class.ilCalendarRecurrence.php.

References getBYWEEKNO().

400  {
401  if(!trim($this->getBYWEEKNO()))
402  {
403  return array();
404  }
405  foreach(explode(',',$this->getBYWEEKNO()) as $week_num)
406  {
407  $weeks[] = (int) $week_num;
408  }
409  return $weeks ? $weeks : array();
410  }
+ Here is the call graph for this function:

◆ getBYYEARDAY()

ilCalendarRecurrence::getBYYEARDAY ( )

get BYDAY

public

Definition at line 527 of file class.ilCalendarRecurrence.php.

References $byyearday.

Referenced by getBYYEARDAYList(), save(), toICal(), and update().

528  {
529  return $this->byyearday;
530  }
+ Here is the caller graph for this function:

◆ getBYYEARDAYList()

ilCalendarRecurrence::getBYYEARDAYList ( )

get BYYEARDAY list

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 538 of file class.ilCalendarRecurrence.php.

References getBYYEARDAY().

539  {
540  if(!trim($this->getBYYEARDAY()))
541  {
542  return array();
543  }
544  foreach(explode(',',$this->getBYYEARDAY()) as $year_day)
545  {
546  $days[] = (int) $year_day;
547  }
548  return $days ? $days : array();
549  }
+ Here is the call graph for this function:

◆ getExclusionDates()

ilCalendarRecurrence::getExclusionDates ( )

Get exclusion dates.

Returns

Implements ilCalendarRecurrenceCalculation.

Definition at line 644 of file class.ilCalendarRecurrence.php.

References $exclusion_dates.

645  {
646  return (array) $this->exclusion_dates;
647  }

◆ getFrequenceType()

ilCalendarRecurrence::getFrequenceType ( )

get freq type

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 265 of file class.ilCalendarRecurrence.php.

References $freq_type.

Referenced by save(), update(), and validate().

266  {
267  return $this->freq_type;
268  }
+ Here is the caller graph for this function:

◆ getFrequenceUntilCount()

ilCalendarRecurrence::getFrequenceUntilCount ( )

get frequence until count

public

Parameters

Implements ilCalendarRecurrenceCalculation.

Definition at line 311 of file class.ilCalendarRecurrence.php.

References $freq_until_count.

Referenced by save(), toICal(), update(), and validate().

+ Here is the caller graph for this function:

◆ getFrequenceUntilDate()

ilCalendarRecurrence::getFrequenceUntilDate ( )

get until date

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 276 of file class.ilCalendarRecurrence.php.

Referenced by save(), toICal(), and update().

277  {
278  return is_object($this->freq_until_date) ? $this->freq_until_date : null;
279  }
+ Here is the caller graph for this function:

◆ getInterval()

ilCalendarRecurrence::getInterval ( )

get interval

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 334 of file class.ilCalendarRecurrence.php.

Referenced by save(), toICal(), update(), and validate().

335  {
336  return $this->interval ? $this->interval : 1;
337  }
+ Here is the caller graph for this function:

◆ getRecurrenceId()

ilCalendarRecurrence::getRecurrenceId ( )

get recurrence id

public

Returns

Definition at line 205 of file class.ilCalendarRecurrence.php.

References $recurrence_id.

◆ getTimeZone()

ilCalendarRecurrence::getTimeZone ( )

get timezone

public

Implements ilCalendarRecurrenceCalculation.

Definition at line 623 of file class.ilCalendarRecurrence.php.

References $timezone.

624  {
625  return $this->timezone;
626  }

◆ getWeekstart()

ilCalendarRecurrence::getWeekstart ( )

get weekstart

public

Definition at line 612 of file class.ilCalendarRecurrence.php.

References $weekstart.

Referenced by save(), and update().

613  {
614  return $this->weekstart;
615  }
+ Here is the caller graph for this function:

◆ isRecurrence()

ilCalendarRecurrence::isRecurrence ( )

is recurrence

public

Parameters

Definition at line 242 of file class.ilCalendarRecurrence.php.

243  {
244  return $this->recurrence_type == self::REC_RECURRENCE;
245  }

◆ read()

ilCalendarRecurrence::read ( )
private

Read entry.

private

Definition at line 767 of file class.ilCalendarRecurrence.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, ilCalendarRecurrenceExclusions\getExclusionDates(), and IL_CAL_DATETIME.

Referenced by __construct().

768  {
769  global $ilDB;
770 
771  $query = "SELECT * FROM cal_recurrence_rules ".
772  "WHERE rule_id = ".$this->db->quote($this->recurrence_id ,'integer')." ";
773  $res = $this->db->query($query);
774  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
775  {
776  $this->cal_id = $row->cal_id;
777  $this->recurrence_type = $row->cal_recurrence;
778  $this->freq_type = $row->freq_type;
779 
780  if($row->freq_until_date != null)
781  {
782  $this->freq_until_date = new ilDateTime($row->freq_until_date,IL_CAL_DATETIME,'UTC');
783  }
784  $this->freq_until_count = $row->freq_until_count;
785  $this->interval = $row->intervall;
786  $this->byday = $row->byday;
787  $this->byweekno = $row->byweekno;
788  $this->bymonth = $row->bymonth;
789  $this->bymonthday = $row->bymonthday;
790  $this->byyearday = $row->byyearday;
791  $this->bysetpos = $row->bysetpos;
792  $this->weekstart = $row->week_start;
793  }
794 
795  $this->exclusion_dates = ilCalendarRecurrenceExclusions::getExclusionDates($this->cal_id);
796  }
const IL_CAL_DATETIME
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
Date and time handling
static getExclusionDates($a_cal_id)
Read exclusion dates.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

ilCalendarRecurrence::reset ( )

reset all settings

public

Returns

Definition at line 184 of file class.ilCalendarRecurrence.php.

References setBYDAY(), setBYMONTH(), setBYMONTHDAY(), setBYSETPOS(), setBYWEEKNO(), setBYYEARDAY(), setFrequenceType(), setFrequenceUntilCount(), and setInterval().

185  {
186  $this->setBYDAY('');
187  $this->setBYMONTHDAY('');
188  $this->setBYMONTH('');
189  $this->setBYSETPOS('');
190  $this->setBYWEEKNO('');
191  $this->setBYYEARDAY('');
192  $this->setFrequenceType('');
193  $this->setInterval(1);
194  $this->setFrequenceUntilCount(0);
195 
196  return true;
197  }
setBYWEEKNO($a_byweekno)
set by day
setFrequenceUntilCount($a_count)
set frequence count
setFrequenceType($a_type)
set frequence type
setInterval($a_interval)
set interval
+ Here is the call graph for this function:

◆ save()

ilCalendarRecurrence::save ( )

save

public

Definition at line 680 of file class.ilCalendarRecurrence.php.

References $query, $res, getBYDAY(), getBYMONTH(), getBYMONTHDAY(), getBYSETPOS(), getBYWEEKNO(), getBYYEARDAY(), getFrequenceType(), getFrequenceUntilCount(), getFrequenceUntilDate(), getInterval(), getWeekstart(), and IL_CAL_DATETIME.

681  {
682  global $ilDB;
683 
684  $until_date = is_null($this->getFrequenceUntilDate()) ?
685  null :
686  $this->getFrequenceUntilDate()->get(IL_CAL_DATETIME,'','UTC');
687  $next_id = $ilDB->nextId('cal_recurrence_rules');
688 
689  $query = "INSERT INTO cal_recurrence_rules (rule_id,cal_id,cal_recurrence,freq_type,freq_until_date,freq_until_count,intervall, ".
690  "byday,byweekno,bymonth,bymonthday,byyearday,bysetpos,weekstart) ".
691  "VALUES( ".
692  $ilDB->quote($next_id,'integer').", ".
693  $this->db->quote($this->cal_id ,'integer').", ".
694  $ilDB->quote(1,'integer').", ".
695  $ilDB->quote((string) $this->getFrequenceType() ,'text').", ".
696  $this->db->quote($until_date,'timestamp').", ".
697  $this->db->quote((int) $this->getFrequenceUntilCount() ,'integer').", ".
698  $this->db->quote((int) $this->getInterval() ,'integer').", ".
699  $this->db->quote((string) $this->getBYDAY() ,'text').", ".
700  $this->db->quote((string) $this->getBYWEEKNO() ,'text').", ".
701  $this->db->quote((string) $this->getBYMONTH() ,'text').", ".
702  $this->db->quote((string) $this->getBYMONTHDAY() ,'text').", ".
703  $this->db->quote((string) $this->getBYYEARDAY() ,'text').", ".
704  $this->db->quote((string) $this->getBYSETPOS() ,'text').", ".
705  $this->db->quote((string) $this->getWeekstart() ,'text')." ".
706  ")";
707  $res = $ilDB->manipulate($query);
708  $this->recurrence_id = $next_id;
709  return true;
710  }
const IL_CAL_DATETIME
getFrequenceUntilCount()
get frequence until count
+ Here is the call graph for this function:

◆ setBYDAY()

ilCalendarRecurrence::setBYDAY (   $a_byday)

set by day

public

Parameters
stringbyday rule

Definition at line 346 of file class.ilCalendarRecurrence.php.

Referenced by reset().

347  {
348  $this->byday = $a_byday;
349  }
+ Here is the caller graph for this function:

◆ setBYMONTH()

ilCalendarRecurrence::setBYMONTH (   $a_by)

set by day

public

Parameters
stringbyday rule

Definition at line 431 of file class.ilCalendarRecurrence.php.

Referenced by reset().

432  {
433  $this->bymonth = $a_by;
434  }
+ Here is the caller graph for this function:

◆ setBYMONTHDAY()

ilCalendarRecurrence::setBYMONTHDAY (   $a_by)

set by day

public

Parameters
stringbyday rule

Definition at line 473 of file class.ilCalendarRecurrence.php.

Referenced by reset().

474  {
475  $this->bymonthday = $a_by;
476  }
+ Here is the caller graph for this function:

◆ setBYSETPOS()

ilCalendarRecurrence::setBYSETPOS (   $a_by)

set by day

public

Parameters
stringbyday rule

Definition at line 558 of file class.ilCalendarRecurrence.php.

Referenced by reset().

559  {
560  $this->bysetpos = $a_by;
561  }
+ Here is the caller graph for this function:

◆ setBYWEEKNO()

ilCalendarRecurrence::setBYWEEKNO (   $a_byweekno)

set by day

public

Parameters
stringbyday rule

Definition at line 388 of file class.ilCalendarRecurrence.php.

Referenced by reset().

389  {
390  $this->byweekno = $a_byweekno;
391  }
+ Here is the caller graph for this function:

◆ setBYYEARDAY()

ilCalendarRecurrence::setBYYEARDAY (   $a_by)

set by day

public

Parameters
stringbyday rule

Definition at line 516 of file class.ilCalendarRecurrence.php.

Referenced by reset().

517  {
518  $this->byyearday = $a_by;
519  }
+ Here is the caller graph for this function:

◆ setEntryId()

ilCalendarRecurrence::setEntryId (   $a_id)

set cal id

public

Parameters
intcalendar entry id

Definition at line 218 of file class.ilCalendarRecurrence.php.

219  {
220  $this->cal_id = $a_id;
221  }

◆ setFrequenceType()

ilCalendarRecurrence::setFrequenceType (   $a_type)

set frequence type

public

Parameters
intFREQUENCE_TYPE e.g MONTHLY, WEEKLY ...

Definition at line 254 of file class.ilCalendarRecurrence.php.

Referenced by reset().

255  {
256  $this->freq_type = $a_type;
257  }
+ Here is the caller graph for this function:

◆ setFrequenceUntilCount()

ilCalendarRecurrence::setFrequenceUntilCount (   $a_count)

set frequence count

public

Parameters
intcount

Definition at line 299 of file class.ilCalendarRecurrence.php.

Referenced by reset().

300  {
301  $this->freq_until_count = $a_count;
302  }
+ Here is the caller graph for this function:

◆ setFrequenceUntilDate()

ilCalendarRecurrence::setFrequenceUntilDate ( ilDateTime  $a_date = null)

set freq until date

public

Definition at line 287 of file class.ilCalendarRecurrence.php.

288  {
289  $this->freq_until_date = $a_date;
290  }

◆ setInterval()

ilCalendarRecurrence::setInterval (   $a_interval)

set interval

public

Parameters
intinterval

Definition at line 323 of file class.ilCalendarRecurrence.php.

Referenced by reset().

324  {
325  $this->interval = $a_interval;
326  }
+ Here is the caller graph for this function:

◆ setRecurrence()

ilCalendarRecurrence::setRecurrence (   $a_type)

set type of recurrence

public

Parameters
intREC_RECURRENCE or REC_EXLUSION defines whther the current object is a recurrence an exclusion pattern

Definition at line 230 of file class.ilCalendarRecurrence.php.

231  {
232  $this->recurrence_type = $a_type;
233  }

◆ setTimeZone()

ilCalendarRecurrence::setTimeZone (   $a_tz)

set timezone

public

Parameters
stringtimezone

Definition at line 635 of file class.ilCalendarRecurrence.php.

636  {
637  $this->timezone = $a_tz;
638  }

◆ setWeekstart()

ilCalendarRecurrence::setWeekstart (   $a_start)

set weekstart

public

Parameters
stringweekstart

Definition at line 601 of file class.ilCalendarRecurrence.php.

602  {
603  $this->weekstart = $a_start;
604  }

◆ toICal()

ilCalendarRecurrence::toICal (   $a_user_id)

Definition at line 116 of file class.ilCalendarRecurrence.php.

References ilCalendarUserSettings\_getInstanceByUserId(), getBYDAY(), getBYMONTH(), getBYMONTHDAY(), getBYSETPOS(), getBYWEEKNO(), getBYYEARDAY(), getFrequenceUntilCount(), getFrequenceUntilDate(), getInterval(), IL_CAL_FKT_DATE, and ilCalendarSettings\WEEK_START_MONDAY.

117  {
118  $ical = 'RRULE:';
119  $ical .= ('FREQ='.$this->getFrequenceType());
120 
121  if($this->getInterval())
122  {
123  $ical .= (';INTERVAL='.$this->getInterval());
124  }
125  if($this->getFrequenceUntilCount())
126  {
127  $ical .= (';COUNT='.$this->getFrequenceUntilCount());
128  }
129  elseif($this->getFrequenceUntilDate())
130  {
131  $ical .= (';UNTIL='.$this->getFrequenceUntilDate()->get(IL_CAL_FKT_DATE,'Ymd'));
132  }
133  if($this->getBYMONTH())
134  {
135  $ical .= (';BYMONTH='.$this->getBYMONTH());
136  }
137  if($this->getBYWEEKNO())
138  {
139  $ical .= (';BYWEEKNO='.$this->getBYWEEKNO());
140  }
141  if($this->getBYYEARDAY())
142  {
143  $ical .= (';BYYEARDAY='.$this->getBYYEARDAY());
144  }
145  if($this->getBYMONTHDAY())
146  {
147  $ical .= (';BYMONTHDAY='.$this->getBYMONTHDAY());
148  }
149  if($this->getBYDAY())
150  {
151  $ical .= (';BYDAY='.$this->getBYDAY());
152  }
153  if($this->getBYSETPOS())
154  {
155  $ical .= (';BYSETPOS='.$this->getBYSETPOS());
156  }
157 
158  // Required in outlook
159  if($this->getBYDAY())
160  {
161  include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
162  include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
164  if($us->getWeekStart() == ilCalendarSettings::WEEK_START_MONDAY)
165  {
166  $ical .= (';WKST=MO');
167  }
168  else
169  {
170  $ical .= (';WKST=SU');
171  }
172  }
173 
174  return $ical;
175  }
static _getInstanceByUserId($a_user_id)
get singleton instance
const IL_CAL_FKT_DATE
getFrequenceUntilCount()
get frequence until count
+ Here is the call graph for this function:

◆ update()

ilCalendarRecurrence::update ( )

save

public

Definition at line 718 of file class.ilCalendarRecurrence.php.

References $query, $res, getBYDAY(), getBYMONTH(), getBYMONTHDAY(), getBYSETPOS(), getBYWEEKNO(), getBYYEARDAY(), getFrequenceType(), getFrequenceUntilCount(), getFrequenceUntilDate(), getInterval(), getWeekstart(), and IL_CAL_DATETIME.

719  {
720  global $ilDB;
721 
722  $until_date = is_null($this->getFrequenceUntilDate()) ?
723  null :
724  $this->getFrequenceUntilDate()->get(IL_CAL_DATETIME,'','UTC');
725 
726  $query = "UPDATE cal_recurrence_rules SET ".
727  "cal_id = ".$this->db->quote($this->cal_id ,'integer').", ".
728  "cal_recurrence = 1,".
729  "freq_type = ".$this->db->quote($this->getFrequenceType() ,'text').", ".
730  "freq_until_date = ".$this->db->quote($until_date ,'timestamp').", ".
731  "freq_until_count = ".$this->db->quote($this->getFrequenceUntilCount() ,'integer').", ".
732  "intervall = ".$this->db->quote($this->getInterval() ,'integer').", ".
733  "byday = ".$this->db->quote($this->getBYDAY() ,'text').", ".
734  "byweekno = ".$this->db->quote($this->getBYWEEKNO() ,'text').", ".
735  "bymonth = ".$this->db->quote($this->getBYMONTH() ,'text').", ".
736  "bymonthday = ".$this->db->quote($this->getBYMONTHDAY() ,'text').", ".
737  "byyearday = ".$this->db->quote($this->getBYYEARDAY() ,'text').", ".
738  "bysetpos = ".$this->db->quote($this->getBYSETPOS() ,'text').", ".
739  "weekstart = ".$this->db->quote($this->getWeekstart() ,'text')." ".
740  "WHERE rule_id = ".$this->db->quote($this->recurrence_id ,'integer')." ";
741  $res = $ilDB->manipulate($query);
742  return true;
743  }
const IL_CAL_DATETIME
getFrequenceUntilCount()
get frequence until count
+ Here is the call graph for this function:

◆ validate()

ilCalendarRecurrence::validate ( )

validate

public

Returns
bool

Implements ilCalendarRecurrenceCalculation.

Definition at line 655 of file class.ilCalendarRecurrence.php.

References getFrequenceType(), getFrequenceUntilCount(), getInterval(), IL_CAL_FREQ_DAILY, IL_CAL_FREQ_MONTHLY, IL_CAL_FREQ_WEEKLY, and IL_CAL_FREQ_YEARLY.

656  {
658  if(!in_array($this->getFrequenceType(),$valid_frequences))
659  {
660  return false;
661  }
662  if($this->getFrequenceUntilCount() < 0)
663  {
664  return false;
665  }
666  if($this->getInterval() <= 0)
667  {
668  return false;
669  }
670  return true;
671  }
const IL_CAL_FREQ_MONTHLY
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
const IL_CAL_FREQ_YEARLY
getFrequenceUntilCount()
get frequence until count
const IL_CAL_FREQ_WEEKLY
+ Here is the call graph for this function:

Field Documentation

◆ $byday

ilCalendarRecurrence::$byday = ''
private

Definition at line 66 of file class.ilCalendarRecurrence.php.

Referenced by getBYDAY(), and getBYDAYList().

◆ $bymonth

ilCalendarRecurrence::$bymonth = ''
private

Definition at line 68 of file class.ilCalendarRecurrence.php.

Referenced by getBYMONTH().

◆ $bymonthday

ilCalendarRecurrence::$bymonthday = ''
private

Definition at line 69 of file class.ilCalendarRecurrence.php.

Referenced by getBYMONTHDAY().

◆ $bysetpos

ilCalendarRecurrence::$bysetpos = ''
private

Definition at line 71 of file class.ilCalendarRecurrence.php.

Referenced by getBYSETPOS().

◆ $byweekno

ilCalendarRecurrence::$byweekno = ''
private

Definition at line 67 of file class.ilCalendarRecurrence.php.

Referenced by getBYWEEKNO().

◆ $byyearday

ilCalendarRecurrence::$byyearday = ''
private

Definition at line 70 of file class.ilCalendarRecurrence.php.

Referenced by getBYYEARDAY().

◆ $cal_id

ilCalendarRecurrence::$cal_id
private

Definition at line 57 of file class.ilCalendarRecurrence.php.

◆ $db

ilCalendarRecurrence::$db
protected

Definition at line 54 of file class.ilCalendarRecurrence.php.

◆ $exclusion_dates

ilCalendarRecurrence::$exclusion_dates = array()
private

Definition at line 74 of file class.ilCalendarRecurrence.php.

Referenced by getExclusionDates().

◆ $freq_type

ilCalendarRecurrence::$freq_type = ''
private

Definition at line 60 of file class.ilCalendarRecurrence.php.

Referenced by getFrequenceType().

◆ $freq_until_count

ilCalendarRecurrence::$freq_until_count
private

Definition at line 63 of file class.ilCalendarRecurrence.php.

Referenced by getFrequenceUntilCount().

◆ $freq_until_date

ilCalendarRecurrence::$freq_until_date = null
private

Definition at line 62 of file class.ilCalendarRecurrence.php.

◆ $freq_until_type

ilCalendarRecurrence::$freq_until_type
private

Definition at line 61 of file class.ilCalendarRecurrence.php.

◆ $interval

ilCalendarRecurrence::$interval = 0
private

Definition at line 65 of file class.ilCalendarRecurrence.php.

◆ $recurrence_id

ilCalendarRecurrence::$recurrence_id
private

Definition at line 56 of file class.ilCalendarRecurrence.php.

Referenced by getRecurrenceId().

◆ $recurrence_type

ilCalendarRecurrence::$recurrence_type
private

Definition at line 58 of file class.ilCalendarRecurrence.php.

◆ $timezone

ilCalendarRecurrence::$timezone = 'Europe/Berlin'
private

Definition at line 76 of file class.ilCalendarRecurrence.php.

Referenced by getTimeZone().

◆ $weekstart

ilCalendarRecurrence::$weekstart = ''
private

Definition at line 72 of file class.ilCalendarRecurrence.php.

Referenced by getWeekstart().

◆ FREQ_DAILY

◆ FREQ_MONTHLY

◆ FREQ_WEEKLY

◆ FREQ_YEARLY

◆ REC_EXCLUSION

const ilCalendarRecurrence::REC_EXCLUSION = 1

Definition at line 46 of file class.ilCalendarRecurrence.php.

◆ REC_RECURRENCE

const ilCalendarRecurrence::REC_RECURRENCE = 0

Definition at line 45 of file class.ilCalendarRecurrence.php.


The documentation for this class was generated from the following file: