ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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
$DIC
;
53
54
$ilDB
= $DIC[
'ilDB'
];
55
56
$this->db =
$ilDB
;
57
$this->exclusion_id = $a_exclusion_id;
58
59
if
($this->
getId
()) {
60
$this->
read
();
61
}
62
}
63
64
69
public
function
getId
()
70
{
71
return
$this->exclusion_id
;
72
}
73
78
public
function
getEntryId
()
79
{
80
return
$this->cal_id
;
81
}
82
88
public
function
setEntryId
($a_id)
89
{
90
$this->cal_id = $a_id;
91
}
92
97
public
function
getDate
()
98
{
99
return
$this->exclusion instanceof
ilDate
? $this->exclusion : null;
100
}
101
107
public
function
setDate
(
ilDate
$dt = null)
108
{
109
$this->exclusion = $dt;
110
}
111
116
public
function
toICal
()
117
{
118
$entry =
new
ilCalendarEntry
($this->
getEntryId
());
119
$start
= $entry->getStart();
120
121
if
($entry->isFullday()) {
122
return
'EXDATE;VALUE=DATE:'
. $this->
getDate
()->get(
IL_CAL_FKT_DATE
,
'Ymd'
);
123
}
else
{
124
return
'EXDATE:'
.
125
$this->
getDate
()->get(
IL_CAL_FKT_DATE
,
'Ymd'
,
ilTimeZone::UTC
) .
126
'T'
.
$start
->get(
IL_CAL_FKT_DATE
,
'His'
,
ilTimeZone::UTC
) .
'Z'
;
127
}
128
}
129
134
public
function
save
()
135
{
136
global
$DIC
;
137
138
$ilDB
= $DIC[
'ilDB'
];
139
140
if
(!$this->
getDate
()) {
141
return
false
;
142
}
143
144
$query
=
"INSERT INTO cal_rec_exclusion (excl_id,cal_id,excl_date) "
.
145
"VALUES( "
.
146
$ilDB
->quote($next_id =
$ilDB
->nextId(
'cal_rec_exclusion'
),
'integer'
) .
', '
.
147
$ilDB
->quote($this->getEntryId(),
'integer'
) .
', '
.
148
$ilDB
->quote($this->getDate()->get(
IL_CAL_DATE
,
''
,
'UTC'
),
'timestamp'
) .
149
')'
;
150
$ilDB
->manipulate(
$query
);
151
152
$this->exclusion_id = $next_id;
153
return
$this->
getId
();
154
}
155
160
protected
function
read
()
161
{
162
global
$DIC
;
163
164
$ilDB
= $DIC[
'ilDB'
];
165
166
$query
=
"SELECT * FROM cal_rec_exclusion WHERE excl_id = "
.
$ilDB
->quote($this->
getId
(),
'integer'
);
167
$res
=
$ilDB
->query(
$query
);
168
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
169
$this->cal_id =
$row
->cal_id;
170
$this->
setDate
(
new
ilDate
(
$row
->excl_date,
IL_CAL_DATE
,
'UTC'
));
171
}
172
}
173
}
ilCalendarRecurrenceExclusion\read
read()
Read exclusion.
Definition:
class.ilCalendarRecurrenceExclusion.php:160
ilCalendarEntry
Model for a calendar entry.
Definition:
class.ilCalendarEntry.php:20
ilCalendarRecurrenceExclusion\setDate
setDate(ilDate $dt=null)
Set exclusion date.
Definition:
class.ilCalendarRecurrenceExclusion.php:107
$DIC
global $DIC
Definition:
saml.php:7
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:78
ilCalendarRecurrenceExclusion\$db
$db
Definition:
class.ilCalendarRecurrenceExclusion.php:44
$start
$start
Definition:
bench.php:8
ilCalendarRecurrenceExclusion\getDate
getDate()
Get exclusion date.
Definition:
class.ilCalendarRecurrenceExclusion.php:97
ilCalendarRecurrenceExclusion\toICal
toICal()
Exclusion date to ical format.
Definition:
class.ilCalendarRecurrenceExclusion.php:116
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:88
IL_CAL_FKT_DATE
const IL_CAL_FKT_DATE
Definition:
class.ilDateTime.php:12
$query
$query
Definition:
proxy_ylocal.php:13
$row
$row
Definition:
migrateto20.php:360
ilCalendarRecurrenceExclusion\save
save()
Save exclusion date to db.
Definition:
class.ilCalendarRecurrenceExclusion.php:134
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
ilCalendarRecurrenceExclusion\getId
getId()
Get exclusion id.
Definition:
class.ilCalendarRecurrenceExclusion.php:69
Services
Calendar
classes
class.ilCalendarRecurrenceExclusion.php
Generated on Thu Jan 30 2025 19:01:53 for ILIAS by
1.8.13 (using
Doxyfile
)