ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilCalendarRecurrenceExclusion.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
include_once(
'./Services/Calendar/classes/class.ilDateList.php'
);
25
include_once(
'./Services/Calendar/classes/class.ilTimeZone.php'
);
26
include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php'
);
27
include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php'
;
28
38
class
ilCalendarRecurrenceExclusion
39
{
40
protected
$exclusion
= null;
41
protected
$cal_id
= 0;
42
protected
$exclusion_id
= 0;
43
44
protected
$db
= null;
45
50
public
function
__construct
($a_exclusion_id = 0)
51
{
52
global
$ilDB
;
53
54
$this->db =
$ilDB
;
55
$this->exclusion_id = $a_exclusion_id;
56
57
if
($this->
getId
())
58
{
59
$this->
read
();
60
}
61
}
62
63
68
public
function
getId
()
69
{
70
return
$this->exclusion_id
;
71
}
72
77
public
function
getEntryId
()
78
{
79
return
$this->cal_id
;
80
}
81
87
public
function
setEntryId
($a_id)
88
{
89
$this->cal_id = $a_id;
90
}
91
96
public
function
getDate
()
97
{
98
return
$this->exclusion instanceof
ilDate
? $this->exclusion : null;
99
}
100
106
public
function
setDate
(
ilDate
$dt = NULL)
107
{
108
$this->exclusion = $dt;
109
}
110
115
public
function
toICal
()
116
{
117
$entry =
new
ilCalendarEntry
($this->
getEntryId
());
118
$start
= $entry->getStart();
119
120
if
($entry->isFullday())
121
{
122
return
'EXDATE;VALUE=DATE:'
.$this->getDate()->get(
IL_CAL_FKT_DATE
,
'Ymd'
);
123
}
124
else
125
{
126
return
'EXDATE:'
.
127
$this->
getDate
()->get(
IL_CAL_FKT_DATE
,
'Ymd'
,
ilTimeZone::UTC
).
128
'T'
.$start->get(
IL_CAL_FKT_DATE
,
'His'
,
ilTimeZone::UTC
).
'Z'
;
129
}
130
}
131
136
public
function
save
()
137
{
138
global
$ilDB
;
139
140
if
(!$this->
getDate
())
141
{
142
return
false
;
143
}
144
145
$query
=
"INSERT INTO cal_rec_exclusion (excl_id,cal_id,excl_date) "
.
146
"VALUES( "
.
147
$ilDB->quote($next_id = $ilDB->nextId(
'cal_rec_exclusion'
),
'integer'
).
', '
.
148
$ilDB->quote($this->getEntryId(),
'integer'
).
', '
.
149
$ilDB->quote($this->getDate()->get(
IL_CAL_DATE
,
''
,
'UTC'
),
'timestamp'
).
150
')'
;
151
$ilDB->manipulate(
$query
);
152
153
$this->exclusion_id = $next_id;
154
return
$this->
getId
();
155
}
156
161
protected
function
read
()
162
{
163
global
$ilDB
;
164
165
$query
=
"SELECT * FROM cal_rec_exclusion WHERE excl_id = "
.$ilDB->quote($this->
getId
(),
'integer'
);
166
$res
= $ilDB->query(
$query
);
167
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
))
168
{
169
$this->cal_id =
$row
->cal_id;
170
$this->
setDate
(
new
ilDate
(
$row
->excl_date,
IL_CAL_DATE
,
'UTC'
));
171
}
172
}
173
}
174
?>
ilCalendarRecurrenceExclusion\read
read()
Read exclusion.
Definition:
class.ilCalendarRecurrenceExclusion.php:161
ilCalendarEntry
Model for a calendar entry.
Definition:
class.ilCalendarEntry.php:20
$res
$res
Definition:
examplelayouts.sql.php:25
ilTimeZone\UTC
const UTC
Definition:
class.ilTimeZone.php:45
ilCalendarRecurrenceExclusion\$cal_id
$cal_id
Definition:
class.ilCalendarRecurrenceExclusion.php:41
ilCalendarRecurrenceExclusion\$exclusion_id
$exclusion_id
Definition:
class.ilCalendarRecurrenceExclusion.php:42
$query
$query
Definition:
examplelayouts.sql.php:24
ilCalendarRecurrenceExclusion\getEntryId
getEntryId()
Get calendar entry id.
Definition:
class.ilCalendarRecurrenceExclusion.php:77
ilCalendarRecurrenceExclusion\setDate
setDate(ilDate $dt=NULL)
Set exclusion date.
Definition:
class.ilCalendarRecurrenceExclusion.php:106
ilCalendarRecurrenceExclusion\$db
$db
Definition:
class.ilCalendarRecurrenceExclusion.php:44
$start
$start
Definition:
NonStopableProcess.php:42
ilCalendarRecurrenceExclusion\getDate
getDate()
Get exclusion date.
Definition:
class.ilCalendarRecurrenceExclusion.php:96
ilCalendarRecurrenceExclusion\toICal
toICal()
Exclusion date to ical format.
Definition:
class.ilCalendarRecurrenceExclusion.php:115
ilDate
Class for single dates.
Definition:
class.ilDate.php:36
ilCalendarRecurrenceExclusion\__construct
__construct($a_exclusion_id=0)
Constructor.
Definition:
class.ilCalendarRecurrenceExclusion.php:50
ilCalendarRecurrenceExclusion\setEntryId
setEntryId($a_id)
Set entry id (id of calendar appointment)
Definition:
class.ilCalendarRecurrenceExclusion.php:87
IL_CAL_FKT_DATE
const IL_CAL_FKT_DATE
Definition:
class.ilDateTime.php:12
ilCalendarRecurrenceExclusion\save
save()
Save exclusion date to db.
Definition:
class.ilCalendarRecurrenceExclusion.php:136
IL_CAL_DATE
const IL_CAL_DATE
Definition:
class.ilDateTime.php:10
ilCalendarRecurrenceExclusion\$exclusion
$exclusion
Definition:
class.ilCalendarRecurrenceExclusion.php:40
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilCalendarRecurrenceExclusion
Stores exclusion dates for calendar recurrences.
Definition:
class.ilCalendarRecurrenceExclusion.php:38
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilCalendarRecurrenceExclusion\getId
getId()
Get exclusion id.
Definition:
class.ilCalendarRecurrenceExclusion.php:68
Services
Calendar
classes
class.ilCalendarRecurrenceExclusion.php
Generated on Fri Jan 24 2025 19:01:06 for ILIAS by
1.8.13 (using
Doxyfile
)