ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
$this->
read
();
59
}
60
}
61
62
67
public
function
getId
()
68
{
69
return
$this->exclusion_id
;
70
}
71
76
public
function
getEntryId
()
77
{
78
return
$this->cal_id
;
79
}
80
86
public
function
setEntryId
($a_id)
87
{
88
$this->cal_id = $a_id;
89
}
90
95
public
function
getDate
()
96
{
97
return
$this->exclusion instanceof
ilDate
? $this->exclusion : null;
98
}
99
105
public
function
setDate
(
ilDate
$dt = null)
106
{
107
$this->exclusion = $dt;
108
}
109
114
public
function
toICal
()
115
{
116
$entry =
new
ilCalendarEntry
($this->
getEntryId
());
117
$start = $entry->getStart();
118
119
if
($entry->isFullday()) {
120
return
'EXDATE;VALUE=DATE:'
. $this->
getDate
()->get(
IL_CAL_FKT_DATE
,
'Ymd'
);
121
}
else
{
122
return
'EXDATE:'
.
123
$this->
getDate
()->get(
IL_CAL_FKT_DATE
,
'Ymd'
,
ilTimeZone::UTC
) .
124
'T'
. $start->get(
IL_CAL_FKT_DATE
,
'His'
,
ilTimeZone::UTC
) .
'Z'
;
125
}
126
}
127
132
public
function
save
()
133
{
134
global
$ilDB
;
135
136
if
(!$this->
getDate
()) {
137
return
false
;
138
}
139
140
$query
=
"INSERT INTO cal_rec_exclusion (excl_id,cal_id,excl_date) "
.
141
"VALUES( "
.
142
$ilDB->quote($next_id = $ilDB->nextId(
'cal_rec_exclusion'
),
'integer'
) .
', '
.
143
$ilDB->quote($this->getEntryId(),
'integer'
) .
', '
.
144
$ilDB->quote($this->getDate()->get(
IL_CAL_DATE
,
''
,
'UTC'
),
'timestamp'
) .
145
')'
;
146
$ilDB->manipulate(
$query
);
147
148
$this->exclusion_id = $next_id;
149
return
$this->
getId
();
150
}
151
156
protected
function
read
()
157
{
158
global
$ilDB
;
159
160
$query
=
"SELECT * FROM cal_rec_exclusion WHERE excl_id = "
. $ilDB->quote($this->
getId
(),
'integer'
);
161
$res
= $ilDB->query(
$query
);
162
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
163
$this->cal_id =
$row
->cal_id;
164
$this->
setDate
(
new
ilDate
(
$row
->excl_date,
IL_CAL_DATE
,
'UTC'
));
165
}
166
}
167
}
ilCalendarRecurrenceExclusion\read
read()
Read exclusion.
Definition:
class.ilCalendarRecurrenceExclusion.php:156
ilCalendarEntry
Model for a calendar entry.
Definition:
class.ilCalendarEntry.php:20
ilCalendarRecurrenceExclusion\setDate
setDate(ilDate $dt=null)
Set exclusion date.
Definition:
class.ilCalendarRecurrenceExclusion.php:105
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
ilCalendarRecurrenceExclusion\getEntryId
getEntryId()
Get calendar entry id.
Definition:
class.ilCalendarRecurrenceExclusion.php:76
ilCalendarRecurrenceExclusion\$db
$db
Definition:
class.ilCalendarRecurrenceExclusion.php:44
ilCalendarRecurrenceExclusion\getDate
getDate()
Get exclusion date.
Definition:
class.ilCalendarRecurrenceExclusion.php:95
ilCalendarRecurrenceExclusion\toICal
toICal()
Exclusion date to ical format.
Definition:
class.ilCalendarRecurrenceExclusion.php:114
ilDate
Class for single dates.
Definition:
class.ilDate.php:36
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
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:86
IL_CAL_FKT_DATE
const IL_CAL_FKT_DATE
Definition:
class.ilDateTime.php:12
$query
$query
Definition:
proxy_ylocal.php:13
ilCalendarRecurrenceExclusion\save
save()
Save exclusion date to db.
Definition:
class.ilCalendarRecurrenceExclusion.php:132
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
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:67
Services
Calendar
classes
class.ilCalendarRecurrenceExclusion.php
Generated on Sat Jan 18 2025 19:01:27 for ILIAS by
1.8.13 (using
Doxyfile
)