ILIAS  release_8 Revision v8.24
ilCalendarEntry Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilCalendarEntry:
+ Collaboration diagram for ilCalendarEntry:

Public Member Functions

 __construct (int $a_id=0)
 
 __clone ()
 clone instance More...
 
 setContextInfo (string $a_info)
 
 getContextInfo ()
 
 getEntryId ()
 
 getLastUpdate ()
 
 setLastUpdate (ilDateTime $a_date)
 
 getStart ()
 Get start of date period. More...
 
 setStart (?ilDateTime $a_start)
 
 getEnd ()
 Get end of period. More...
 
 setEnd (?ilDateTime $a_end)
 
 setTitle (string $a_title)
 
 getTitle ()
 
 getPresentationTitle (bool $a_shorten=true)
 
 getPresentationStyle ()
 
 setSubtitle (string $a_subtitle)
 set subtitle Used for automatic generated appointments. More...
 
 getSubtitle ()
 
 setDescription (string $a_description)
 
 getDescription ()
 
 setLocation (string $a_location)
 
 getLocation ()
 
 setFurtherInformations (string $a_informations)
 
 getFurtherInformations ()
 
 setFullday (bool $a_fullday)
 set fullday event Fullday events do not change their time in different timezones. More...
 
 isFullday ()
 is event a fullday period More...
 
 isAutoGenerated ()
 
 setAutoGenerated (bool $a_status)
 
 isMilestone ()
 
 setMilestone (bool $a_status)
 
 setCompletion (int $a_completion)
 
 getCompletion ()
 
 setContextId (int $a_context_id)
 
 getContextId ()
 
 setTranslationType (int $a_type)
 
 getTranslationType ()
 
 enableNotification (bool $a_status)
 
 isNotificationEnabled ()
 
 update ()
 
 save ()
 
 delete ()
 
 validate ()
 
 appointmentToMailString (ilLanguage $lng)
 
 writeResponsibleUsers (array $a_users)
 
 readResponsibleUsers ()
 
 getStart ()
 Get start of date period. More...
 
 getEnd ()
 Get end of period. More...
 
 isFullday ()
 is event a fullday period More...
 

Static Public Member Functions

static _delete (int $a_entry_id)
 

Data Fields

const TRANSLATION_NONE = 0
 
const TRANSLATION_SYSTEM = 1
 

Protected Member Functions

 parseDynamicTitle (string $a_type)
 
 read ()
 

Protected Attributes

ilLogger $log
 
ilDBInterface $db
 
ilLanguage $lng
 
ilErrorHandling $error
 
int $entry_id = 0
 
ilDateTime $last_update = null
 
string $title = ''
 
string $presentation_style = ''
 
string $subtitle = ''
 
string $description = ''
 
string $location = ''
 
string $further_informations = ''
 
ilDateTime $start = null
 
bool $fullday = false
 
ilDateTime $end = null
 
bool $is_auto_generated = false
 
int $context_id = 0
 
string $context_info = ''
 
int $translation_type = ilCalendarEntry::TRANSLATION_NONE
 
bool $is_milestone = false
 
int $completion = 0
 
bool $notification = false
 
array $responsible_users = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Model for a calendar entry.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 27 of file class.ilCalendarEntry.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarEntry::__construct ( int  $a_id = 0)

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

58 {
59 global $DIC;
60
61 $this->log = $DIC->logger()->cal();
62 $this->lng = $DIC->language();
63 $this->db = $DIC->database();
64 $this->error = $DIC['ilErr'];
65 $this->entry_id = $a_id;
66 if ($this->entry_id > 0) {
67 $this->read();
68 }
69 }
error(string $a_errmsg)
global $DIC
Definition: feed.php:28

References $DIC, error(), ILIAS\Repository\lng(), and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilCalendarEntry::__clone ( )

clone instance

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

75 {
76 $this->entry_id = 0;
77 }

◆ _delete()

static ilCalendarEntry::_delete ( int  $a_entry_id)
static

Definition at line 79 of file class.ilCalendarEntry.php.

79 : void
80 {
81 global $DIC;
82
83 $ilDB = $DIC['ilDB'];
85
86 $query = "DELETE FROM cal_entries " .
87 "WHERE cal_id = " . $ilDB->quote($a_entry_id, 'integer') . " ";
88 $res = $ilDB->manipulate($query);
89 }
static _delete(int $a_cal_id)
$res
Definition: ltiservices.php:69
$query

References $DIC, $ilDB, $query, $res, and ilCalendarRecurrence\_delete().

Referenced by ilCalendarCategory\delete(), ilCalendarAppEventListener\deleteAppointments(), and ilCalendarRemoteReader\importIcal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appointmentToMailString()

ilCalendarEntry::appointmentToMailString ( ilLanguage  $lng)

Definition at line 465 of file class.ilCalendarEntry.php.

465 : string
466 {
467 $body = $lng->txt('cal_details');
468 $body .= "\n\n";
469 $body .= $lng->txt('title') . ': ' . $this->getTitle() . "\n";
470
472 $body .= $lng->txt('date') . ': ' . ilDatePresentation::formatPeriod($this->getStart(), $this->getEnd()) . "\n";
474
475 if (strlen($this->getLocation())) {
476 $body .= $lng->txt('cal_where') . ': ' . $this->getLocation() . "\n";
477 }
478
479 if (strlen($this->getDescription())) {
480 $body .= $lng->txt('description') . ': ' . $this->getDescription() . "\n";
481 }
482 return $body;
483 }
getEnd()
Get end of period.
getStart()
Get start of date period.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
static setUseRelativeDates(bool $a_status)
set use relative dates
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $lng, ilDatePresentation\formatPeriod(), getDescription(), getEnd(), getLocation(), getStart(), getTitle(), ilDatePresentation\setUseRelativeDates(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ delete()

ilCalendarEntry::delete ( )

Definition at line 407 of file class.ilCalendarEntry.php.

407 : void
408 {
410
411 $query = "DELETE FROM cal_entries " .
412 "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
413 $res = $this->db->manipulate($query);
414
416 }
static _deleteByAppointmentId(int $a_app_id)
Delete appointment assignment.

References $query, $res, ilCalendarRecurrence\_delete(), ilCalendarCategoryAssignments\_deleteByAppointmentId(), and getEntryId().

+ Here is the call graph for this function:

◆ enableNotification()

ilCalendarEntry::enableNotification ( bool  $a_status)

Definition at line 340 of file class.ilCalendarEntry.php.

340 : void
341 {
342 $this->notification = $a_status;
343 }

References ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCompletion()

ilCalendarEntry::getCompletion ( )

Definition at line 315 of file class.ilCalendarEntry.php.

315 : int
316 {
317 return $this->completion;
318 }

References $completion.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getContextId()

◆ getContextInfo()

ilCalendarEntry::getContextInfo ( )

Definition at line 96 of file class.ilCalendarEntry.php.

96 : string
97 {
99 }

References $context_info.

Referenced by ilCalendarScheduleFilterTimings\modifyEvent(), save(), and update().

+ Here is the caller graph for this function:

◆ getDescription()

ilCalendarEntry::getDescription ( )

Definition at line 250 of file class.ilCalendarEntry.php.

250 : string
251 {
252 return $this->description;
253 }

References $description.

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

+ Here is the caller graph for this function:

◆ getEnd()

ilCalendarEntry::getEnd ( )

Get end of period.

Implements ilDatePeriod.

Definition at line 126 of file class.ilCalendarEntry.php.

126 : ?ilDateTime
127 {
128 return $this->end;
129 }
@classDescription Date and time handling

References $end.

Referenced by appointmentToMailString(), ilCalendarScheduleFilterBookingPool\modifyEvent(), save(), update(), and validate().

+ Here is the caller graph for this function:

◆ getEntryId()

◆ getFurtherInformations()

ilCalendarEntry::getFurtherInformations ( )

Definition at line 270 of file class.ilCalendarEntry.php.

270 : string
271 {
273 }

References $further_informations.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getLastUpdate()

ilCalendarEntry::getLastUpdate ( )

Definition at line 106 of file class.ilCalendarEntry.php.

106 : ilDateTime
107 {
108 return $this->last_update ?: new ilDateTime(time(), IL_CAL_UNIX);
109 }
const IL_CAL_UNIX

References IL_CAL_UNIX.

◆ getLocation()

ilCalendarEntry::getLocation ( )

Definition at line 260 of file class.ilCalendarEntry.php.

260 : string
261 {
262 return $this->location;
263 }

References $location.

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

+ Here is the caller graph for this function:

◆ getPresentationStyle()

ilCalendarEntry::getPresentationStyle ( )

Definition at line 225 of file class.ilCalendarEntry.php.

225 : string
226 {
228 }

References $presentation_style.

◆ getPresentationTitle()

ilCalendarEntry::getPresentationTitle ( bool  $a_shorten = true)

Definition at line 146 of file class.ilCalendarEntry.php.

146 : string
147 {
149 $title = $this->getTitle();
150 } elseif (strlen($this->getSubtitle())) {
151 // parse dynamic title?
152 if (preg_match("/#([a-z]+)#/", $this->getSubtitle(), $matches)) {
153 $subtitle = $this->parseDynamicTitle($matches[1]);
154 } else {
155 $subtitle = $this->lng->txt($this->getSubtitle());
156 }
157 $title = $this->getTitle() .
158 (strlen($subtitle)
159 ? ' (' . $subtitle . ')'
160 : '');
161 } else {
162 $title = $this->lng->txt($this->getTitle());
163 }
164
165 if ($a_shorten) {
167 }
168 return $title;
169 }
parseDynamicTitle(string $a_type)
static shortenWords(string $a_str, int $a_len=30, bool $a_dots=true)
Ensure that the maximum word lenght within a text is not longer than $a_len.
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)

References $subtitle, $title, getSubtitle(), getTitle(), getTranslationType(), ILIAS\Repository\lng(), parseDynamicTitle(), ilStr\shortenTextExtended(), ilStr\shortenWords(), and TRANSLATION_NONE.

Referenced by ilCalendarScheduleFilterTimings\modifyEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStart()

ilCalendarEntry::getStart ( )

Get start of date period.

Implements ilDatePeriod.

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

116 : ?ilDateTime
117 {
118 return $this->start;
119 }

References $start.

Referenced by appointmentToMailString(), ilCalendarWeekGUI\getAppointmentTimeString(), ilCalendarAgendaListGUI\getPluginAgendaItem(), save(), update(), and validate().

+ Here is the caller graph for this function:

◆ getSubtitle()

ilCalendarEntry::getSubtitle ( )

Definition at line 240 of file class.ilCalendarEntry.php.

240 : string
241 {
242 return $this->subtitle;
243 }

References $subtitle.

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

+ Here is the caller graph for this function:

◆ getTitle()

ilCalendarEntry::getTitle ( )

Definition at line 141 of file class.ilCalendarEntry.php.

141 : string
142 {
143 return $this->title;
144 }

References $title.

Referenced by appointmentToMailString(), getPresentationTitle(), ilCalendarScheduleFilterTimings\modifyEvent(), save(), update(), and validate().

+ Here is the caller graph for this function:

◆ getTranslationType()

ilCalendarEntry::getTranslationType ( )

Definition at line 335 of file class.ilCalendarEntry.php.

335 : int
336 {
338 }

References $translation_type.

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

+ Here is the caller graph for this function:

◆ isAutoGenerated()

ilCalendarEntry::isAutoGenerated ( )

Definition at line 290 of file class.ilCalendarEntry.php.

290 : bool
291 {
293 }

References $is_auto_generated.

Referenced by ilCalendarScheduleFilterTimings\modifyEvent(), save(), and update().

+ Here is the caller graph for this function:

◆ isFullday()

ilCalendarEntry::isFullday ( )

is event a fullday period

Implements ilDatePeriod.

Definition at line 285 of file class.ilCalendarEntry.php.

285 : bool
286 {
287 return $this->fullday;
288 }

References $fullday.

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

+ Here is the caller graph for this function:

◆ isMilestone()

ilCalendarEntry::isMilestone ( )

Definition at line 300 of file class.ilCalendarEntry.php.

300 : bool
301 {
302 return $this->is_milestone;
303 }

References $is_milestone.

Referenced by ilCalendarExport\createAppointment(), save(), and update().

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilCalendarEntry::isNotificationEnabled ( )

Definition at line 345 of file class.ilCalendarEntry.php.

345 : bool
346 {
347 return $this->notification;
348 }

References $notification.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ parseDynamicTitle()

ilCalendarEntry::parseDynamicTitle ( string  $a_type)
protected

Definition at line 171 of file class.ilCalendarEntry.php.

171 : string
172 {
173 $title = $style = "";
174 switch ($a_type) {
175 case "consultationhour":
176 $entry = new ilBookingEntry($this->getContextId());
177 if ($entry) {
178 if ($entry->isOwner()) {
179 $max = $entry->getNumberOfBookings();
180 $current = $entry->getCurrentNumberOfBookings($this->getEntryId());
181 if (!$current) {
182 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
183 $title = $this->lng->txt('cal_book_free');
184 } elseif ($current >= $max) {
185 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
186 $title = $this->lng->txt('cal_booked_out');
187 } else {
188 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: yellow';
189 $title = $current . '/' . $max;
190 }
191 } else {
193 $entry->getObjId(),
194 $this->getContextId(),
195 $this->getStart()
196 );
197 if ($apps === []) {
198 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
199 $title = $this->lng->txt('cal_booked_out');
200 } else {
201 $orig_event = $apps[0];
202 $max = $entry->getNumberOfBookings();
203 $current = $entry->getCurrentNumberOfBookings($this->getEntryId());
204 if ($entry->hasBooked($orig_event)) {
205 $title = $this->lng->txt('cal_date_booked');
206 } elseif ($current >= $max) {
207 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
208 $title = $this->lng->txt('cal_booked_out');
209 } else {
210 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
211 $title = $this->lng->txt('cal_book_free');
212 }
213 }
214 }
215 }
216 break;
217 }
218 if (strlen($style)) {
219 $this->presentation_style = $style;
220 }
221
222 return $title;
223 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAppointmentIds(int $a_user_id, int $a_context_id=null, ?ilDateTime $a_start=null, ?int $a_type=null, bool $a_check_owner=true)

References $title, ilConsultationHourAppointments\getAppointmentIds(), getContextId(), getEntryId(), and ILIAS\Repository\lng().

Referenced by getPresentationTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilCalendarEntry::read ( )
protected

Definition at line 435 of file class.ilCalendarEntry.php.

435 : void
436 {
437 $query = "SELECT * FROM cal_entries WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
438 $res = $this->db->query($query);
439 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
440 $this->setLastUpdate(new ilDateTime((string) $row->last_update, IL_CAL_DATETIME, 'UTC'));
441 $this->setTitle((string) $row->title);
442 $this->setSubtitle((string) $row->subtitle);
443 $this->setDescription((string) $row->description);
444 $this->setLocation((string) $row->location);
445 $this->setFurtherInformations((string) $row->informations);
446 $this->setFullday((bool) $row->fullday);
447 $this->setAutoGenerated((bool) $row->auto_generated);
448 $this->setContextId((int) $row->context_id);
449 $this->setContextInfo((string) $row->context_info);
450 $this->setTranslationType((int) $row->translation_type);
451 $this->setCompletion((int) $row->completion);
452 $this->setMilestone((bool) $row->is_milestone);
453 $this->enableNotification((bool) $row->notification);
454
455 if ($this->isFullday()) {
456 $this->start = new ilDate((string) $row->starta, IL_CAL_DATETIME);
457 $this->end = new ilDate((string) $row->enda, IL_CAL_DATETIME);
458 } else {
459 $this->start = new ilDateTime((string) $row->starta, IL_CAL_DATETIME, 'UTC');
460 $this->end = new ilDateTime((string) $row->enda, IL_CAL_DATETIME, 'UTC');
461 }
462 }
463 }
const IL_CAL_DATETIME
setTranslationType(int $a_type)
setMilestone(bool $a_status)
setLastUpdate(ilDateTime $a_date)
setDescription(string $a_description)
setFullday(bool $a_fullday)
set fullday event Fullday events do not change their time in different timezones.
setLocation(string $a_location)
setCompletion(int $a_completion)
enableNotification(bool $a_status)
setSubtitle(string $a_subtitle)
set subtitle Used for automatic generated appointments.
isFullday()
is event a fullday period
setFurtherInformations(string $a_informations)
setAutoGenerated(bool $a_status)
setContextInfo(string $a_info)
setContextId(int $a_context_id)
setTitle(string $a_title)
Class for single dates.

References $query, $res, enableNotification(), ilDBConstants\FETCHMODE_OBJECT, getEntryId(), IL_CAL_DATETIME, isFullday(), setAutoGenerated(), setCompletion(), setContextId(), setContextInfo(), setDescription(), setFullday(), setFurtherInformations(), setLastUpdate(), setLocation(), setMilestone(), setSubtitle(), setTitle(), and setTranslationType().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readResponsibleUsers()

ilCalendarEntry::readResponsibleUsers ( )

Definition at line 507 of file class.ilCalendarEntry.php.

507 : array
508 {
509 $set = $this->db->queryF(
510 "SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
511 array("integer"),
512 array($this->getEntryId())
513 );
514
515 $return = array();
516 while ($rec = $this->db->fetchAssoc($set)) {
517 $n = ilObjUser::_lookupName((int) $rec["user_id"]);
518 $return[] = array_merge(
519 $n,
520 array("login" => ilObjUser::_lookupLogin((int) $rec["user_id"]))
521 );
522 }
523 return $return;
524 }
static _lookupName(int $a_user_id)
lookup user name
static _lookupLogin(int $a_user_id)

References ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), and getEntryId().

+ Here is the call graph for this function:

◆ save()

ilCalendarEntry::save ( )

Definition at line 375 of file class.ilCalendarEntry.php.

375 : void
376 {
377 $next_id = $this->db->nextId('cal_entries');
378 $now = new ilDateTime(time(), IL_CAL_UNIX);
379 $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
380
381 $query = "INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, " .
382 "informations,auto_generated,context_id,context_info,translation_type, completion, is_milestone, notification) " .
383 "VALUES( " .
384 $this->db->quote($next_id, 'integer') . ", " .
385 $this->db->quote($this->getTitle(), 'text') . ", " .
386 $this->db->quote($utc_timestamp, 'timestamp') . ", " .
387 $this->db->quote($this->getSubtitle(), 'text') . ", " .
388 $this->db->quote($this->getDescription(), 'text') . ", " .
389 $this->db->quote($this->getLocation(), 'text') . ", " .
390 $this->db->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
391 $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
392 $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
393 $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
394 $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
395 $this->db->quote($this->getContextId(), 'integer') . ", " .
396 $this->db->quote($this->getContextInfo(), 'text') . ', ' .
397 $this->db->quote($this->getTranslationType(), 'integer') . ", " .
398 $this->db->quote($this->getCompletion(), 'integer') . ", " .
399 $this->db->quote($this->isMilestone() ? 1 : 0, 'integer') . ", " .
400 $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
401 ")";
402 $res = $this->db->manipulate($query);
403
404 $this->entry_id = $next_id;
405 }

References $query, $res, getCompletion(), getContextId(), getContextInfo(), getDescription(), getEnd(), getFurtherInformations(), getLocation(), getStart(), getSubtitle(), getTitle(), getTranslationType(), IL_CAL_DATETIME, IL_CAL_UNIX, isAutoGenerated(), isFullday(), isMilestone(), isNotificationEnabled(), and ilTimeZone\UTC.

+ Here is the call graph for this function:

◆ setAutoGenerated()

ilCalendarEntry::setAutoGenerated ( bool  $a_status)

Definition at line 295 of file class.ilCalendarEntry.php.

295 : void
296 {
297 $this->is_auto_generated = $a_status;
298 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCompletion()

ilCalendarEntry::setCompletion ( int  $a_completion)

Definition at line 310 of file class.ilCalendarEntry.php.

310 : void
311 {
312 $this->completion = $a_completion;
313 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setContextId()

ilCalendarEntry::setContextId ( int  $a_context_id)

Definition at line 320 of file class.ilCalendarEntry.php.

320 : void
321 {
322 $this->context_id = $a_context_id;
323 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setContextInfo()

ilCalendarEntry::setContextInfo ( string  $a_info)

Definition at line 91 of file class.ilCalendarEntry.php.

91 : void
92 {
93 $this->context_info = $a_info;
94 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescription()

ilCalendarEntry::setDescription ( string  $a_description)

Definition at line 245 of file class.ilCalendarEntry.php.

245 : void
246 {
247 $this->description = $a_description;
248 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEnd()

ilCalendarEntry::setEnd ( ?ilDateTime  $a_end)

Definition at line 131 of file class.ilCalendarEntry.php.

131 : void
132 {
133 $this->end = $a_end;
134 }

Referenced by ilCalendarScheduleFilterBookingPool\modifyEvent().

+ Here is the caller graph for this function:

◆ setFullday()

ilCalendarEntry::setFullday ( bool  $a_fullday)

set fullday event Fullday events do not change their time in different timezones.

It is possible to create fullday events with a duration of more than one day.

Definition at line 280 of file class.ilCalendarEntry.php.

280 : void
281 {
282 $this->fullday = $a_fullday;
283 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setFurtherInformations()

ilCalendarEntry::setFurtherInformations ( string  $a_informations)

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

265 : void
266 {
267 $this->further_informations = $a_informations;
268 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilCalendarEntry::setLastUpdate ( ilDateTime  $a_date)

Definition at line 111 of file class.ilCalendarEntry.php.

111 : void
112 {
113 $this->last_update = $a_date;
114 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocation()

ilCalendarEntry::setLocation ( string  $a_location)

Definition at line 255 of file class.ilCalendarEntry.php.

255 : void
256 {
257 $this->location = $a_location;
258 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMilestone()

ilCalendarEntry::setMilestone ( bool  $a_status)

Definition at line 305 of file class.ilCalendarEntry.php.

305 : void
306 {
307 $this->is_milestone = $a_status;
308 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStart()

ilCalendarEntry::setStart ( ?ilDateTime  $a_start)

Definition at line 121 of file class.ilCalendarEntry.php.

121 : void
122 {
123 $this->start = $a_start;
124 }

◆ setSubtitle()

ilCalendarEntry::setSubtitle ( string  $a_subtitle)

set subtitle Used for automatic generated appointments.

Will be appended to the title.

Definition at line 235 of file class.ilCalendarEntry.php.

235 : void
236 {
237 $this->subtitle = $a_subtitle;
238 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilCalendarEntry::setTitle ( string  $a_title)

Definition at line 136 of file class.ilCalendarEntry.php.

136 : void
137 {
138 $this->title = $a_title;
139 }

Referenced by ilCalendarScheduleFilterTimings\modifyEvent(), and read().

+ Here is the caller graph for this function:

◆ setTranslationType()

ilCalendarEntry::setTranslationType ( int  $a_type)

Definition at line 330 of file class.ilCalendarEntry.php.

330 : void
331 {
332 $this->translation_type = $a_type;
333 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilCalendarEntry::update ( )

Definition at line 350 of file class.ilCalendarEntry.php.

350 : void
351 {
352 $now = new ilDateTime(time(), IL_CAL_UNIX);
353 $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
354 $query = "UPDATE cal_entries " .
355 "SET title = " . $this->db->quote($this->getTitle(), 'text') . ", " .
356 "last_update = " . $this->db->quote($utc_timestamp, 'timestamp') . ", " .
357 "subtitle = " . $this->db->quote($this->getSubtitle(), 'text') . ", " .
358 "description = " . $this->db->quote($this->getDescription(), 'text') . ", " .
359 "location = " . $this->db->quote($this->getLocation(), 'text') . ", " .
360 "fullday = " . $this->db->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
361 "starta = " . $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
362 "enda = " . $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
363 "informations = " . $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
364 "auto_generated = " . $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
365 "translation_type = " . $this->db->quote($this->getTranslationType(), 'integer') . ", " .
366 "context_id = " . $this->db->quote($this->getContextId(), 'integer') . ", " .
367 'context_info = ' . $this->db->quote($this->getContextInfo(), 'text') . ', ' .
368 "completion = " . $this->db->quote($this->getCompletion(), 'integer') . ", " .
369 "is_milestone = " . $this->db->quote($this->isMilestone() ? 1 : 0, 'integer') . ", " .
370 'notification = ' . $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
371 "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
372 $res = $this->db->manipulate($query);
373 }

References $query, $res, getCompletion(), getContextId(), getContextInfo(), getDescription(), getEnd(), getEntryId(), getFurtherInformations(), getLocation(), getStart(), getSubtitle(), getTitle(), getTranslationType(), IL_CAL_DATETIME, IL_CAL_UNIX, isAutoGenerated(), isFullday(), isMilestone(), isNotificationEnabled(), and ilTimeZone\UTC.

+ Here is the call graph for this function:

◆ validate()

ilCalendarEntry::validate ( )

Definition at line 418 of file class.ilCalendarEntry.php.

418 : bool
419 {
420 $success = true;
421 $this->error->setMessage('');
422 if (!strlen($this->getTitle())) {
423 $success = false;
424 $this->error->appendMessage($this->lng->txt('err_missing_title'));
425 }
426 if (!$this->getStart() || !$this->getEnd()) {
427 $success = false;
428 } elseif (ilDateTime::_before($this->getEnd(), $this->getStart(), '')) {
429 $success = false;
430 $this->error->appendMessage($this->lng->txt('err_end_before_start'));
431 }
432 return $success;
433 }
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.

References ilDateTime\_before(), error(), getEnd(), getStart(), getTitle(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ writeResponsibleUsers()

ilCalendarEntry::writeResponsibleUsers ( array  $a_users)

Definition at line 485 of file class.ilCalendarEntry.php.

485 : void
486 {
487 $this->db->manipulateF(
488 "DELETE FROM cal_entry_responsible WHERE cal_id = %s",
489 array("integer"),
490 array($this->getEntryId())
491 );
492
493 if (is_array($a_users)) {
494 foreach ($a_users as $user_id) {
495 $this->db->manipulateF(
496 "INSERT INTO cal_entry_responsible (cal_id, user_id) " .
497 " VALUES (%s,%s)",
498 array("integer", "integer"),
499 array($this->getEntryId(), $user_id)
500 );
501 }
502 }
503
504 $this->responsible_users = $a_users;
505 }

References getEntryId().

+ Here is the call graph for this function:

Field Documentation

◆ $completion

int ilCalendarEntry::$completion = 0
protected

Definition at line 53 of file class.ilCalendarEntry.php.

Referenced by getCompletion().

◆ $context_id

int ilCalendarEntry::$context_id = 0
protected

Definition at line 49 of file class.ilCalendarEntry.php.

Referenced by getContextId().

◆ $context_info

string ilCalendarEntry::$context_info = ''
protected

Definition at line 50 of file class.ilCalendarEntry.php.

Referenced by getContextInfo().

◆ $db

ilDBInterface ilCalendarEntry::$db
protected

Definition at line 33 of file class.ilCalendarEntry.php.

◆ $description

string ilCalendarEntry::$description = ''
protected

Definition at line 42 of file class.ilCalendarEntry.php.

Referenced by getDescription().

◆ $end

ilDateTime ilCalendarEntry::$end = null
protected

Definition at line 47 of file class.ilCalendarEntry.php.

Referenced by getEnd().

◆ $entry_id

int ilCalendarEntry::$entry_id = 0
protected

Definition at line 37 of file class.ilCalendarEntry.php.

Referenced by getEntryId().

◆ $error

ilErrorHandling ilCalendarEntry::$error
protected

Definition at line 35 of file class.ilCalendarEntry.php.

◆ $fullday

bool ilCalendarEntry::$fullday = false
protected

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

Referenced by isFullday().

◆ $further_informations

string ilCalendarEntry::$further_informations = ''
protected

Definition at line 44 of file class.ilCalendarEntry.php.

Referenced by getFurtherInformations().

◆ $is_auto_generated

bool ilCalendarEntry::$is_auto_generated = false
protected

Definition at line 48 of file class.ilCalendarEntry.php.

Referenced by isAutoGenerated().

◆ $is_milestone

bool ilCalendarEntry::$is_milestone = false
protected

Definition at line 52 of file class.ilCalendarEntry.php.

Referenced by isMilestone().

◆ $last_update

ilDateTime ilCalendarEntry::$last_update = null
protected

Definition at line 38 of file class.ilCalendarEntry.php.

◆ $lng

ilLanguage ilCalendarEntry::$lng
protected

Definition at line 34 of file class.ilCalendarEntry.php.

Referenced by appointmentToMailString().

◆ $location

string ilCalendarEntry::$location = ''
protected

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

Referenced by getLocation().

◆ $log

ilLogger ilCalendarEntry::$log
protected

Definition at line 32 of file class.ilCalendarEntry.php.

◆ $notification

bool ilCalendarEntry::$notification = false
protected

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

Referenced by isNotificationEnabled().

◆ $presentation_style

string ilCalendarEntry::$presentation_style = ''
protected

Definition at line 40 of file class.ilCalendarEntry.php.

Referenced by getPresentationStyle().

◆ $responsible_users

array ilCalendarEntry::$responsible_users = []
protected

Definition at line 55 of file class.ilCalendarEntry.php.

◆ $start

ilDateTime ilCalendarEntry::$start = null
protected

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

Referenced by getStart().

◆ $subtitle

string ilCalendarEntry::$subtitle = ''
protected

Definition at line 41 of file class.ilCalendarEntry.php.

Referenced by getPresentationTitle(), and getSubtitle().

◆ $title

string ilCalendarEntry::$title = ''
protected

Definition at line 39 of file class.ilCalendarEntry.php.

Referenced by getPresentationTitle(), getTitle(), and parseDynamicTitle().

◆ $translation_type

int ilCalendarEntry::$translation_type = ilCalendarEntry::TRANSLATION_NONE
protected

Definition at line 51 of file class.ilCalendarEntry.php.

Referenced by getTranslationType().

◆ TRANSLATION_NONE

const ilCalendarEntry::TRANSLATION_NONE = 0

◆ TRANSLATION_SYSTEM

const ilCalendarEntry::TRANSLATION_SYSTEM = 1

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