ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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)
 
 setContextId (int $a_context_id)
 
 getContextId ()
 
 setTranslationType (int $a_type)
 
 getTranslationType ()
 
 enableNotification (bool $a_status)
 
 isNotificationEnabled ()
 
 update ()
 
 save ()
 
 delete ()
 
 validate ()
 
 appointmentToMailString (ilLanguage $lng)
 

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 $notification = false
 

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 54 of file class.ilCalendarEntry.php.

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

55  {
56  global $DIC;
57 
58  $this->log = $DIC->logger()->cal();
59  $this->lng = $DIC->language();
60  $this->db = $DIC->database();
61  $this->error = $DIC['ilErr'];
62  $this->entry_id = $a_id;
63  if ($this->entry_id > 0) {
64  $this->read();
65  }
66  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilCalendarEntry::__clone ( )

clone instance

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

72  {
73  $this->entry_id = 0;
74  }

◆ _delete()

static ilCalendarEntry::_delete ( int  $a_entry_id)
static

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

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

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

76  : void
77  {
78  global $DIC;
79 
80  $ilDB = $DIC['ilDB'];
81  ilCalendarRecurrence::_delete($a_entry_id);
82 
83  $query = "DELETE FROM cal_entries " .
84  "WHERE cal_id = " . $ilDB->quote($a_entry_id, 'integer') . " ";
85  $res = $ilDB->manipulate($query);
86  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
static _delete(int $a_cal_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appointmentToMailString()

ilCalendarEntry::appointmentToMailString ( ilLanguage  $lng)

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

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

444  : string
445  {
446  $body = $lng->txt('cal_details');
447  $body .= "\n\n";
448  $body .= $lng->txt('title') . ': ' . $this->getTitle() . "\n";
449 
451  $body .= $lng->txt('date') . ': ' . ilDatePresentation::formatPeriod($this->getStart(), $this->getEnd()) . "\n";
453 
454  if (strlen($this->getLocation())) {
455  $body .= $lng->txt('cal_where') . ': ' . $this->getLocation() . "\n";
456  }
457 
458  if (strlen($this->getDescription())) {
459  $body .= $lng->txt('description') . ': ' . $this->getDescription() . "\n";
460  }
461  return $body;
462  }
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...
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
+ Here is the call graph for this function:

◆ delete()

ilCalendarEntry::delete ( )

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

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

Referenced by ilCalendarAppointmentGUI\delete(), and ilBookingObject\deleteReservationsAndCalEntries().

388  : void
389  {
391 
392  $query = "DELETE FROM cal_entries " .
393  "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
394  $res = $this->db->manipulate($query);
395 
397  }
$res
Definition: ltiservices.php:69
static _deleteByAppointmentId(int $a_app_id)
Delete appointment assignment.
static _delete(int $a_cal_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enableNotification()

ilCalendarEntry::enableNotification ( bool  $a_status)

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

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

Referenced by read().

317  : void
318  {
319  $this->notification = $a_status;
320  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContextId()

◆ getContextInfo()

ilCalendarEntry::getContextInfo ( )

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

References $context_info.

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

93  : string
94  {
95  return $this->context_info;
96  }
+ Here is the caller graph for this function:

◆ getDescription()

ilCalendarEntry::getDescription ( )

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

References $description.

Referenced by appointmentToMailString(), ilCalendarExport\createVEVENT(), save(), and update().

247  : string
248  {
249  return $this->description;
250  }
+ Here is the caller graph for this function:

◆ getEnd()

ilCalendarEntry::getEnd ( )

Get end of period.

Implements ilDatePeriod.

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

References $end.

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

123  : ?ilDateTime
124  {
125  return $this->end;
126  }
+ Here is the caller graph for this function:

◆ getEntryId()

◆ getFurtherInformations()

ilCalendarEntry::getFurtherInformations ( )

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

References $further_informations.

Referenced by save(), and update().

267  : string
268  {
270  }
+ Here is the caller graph for this function:

◆ getLastUpdate()

ilCalendarEntry::getLastUpdate ( )

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

References IL_CAL_UNIX.

Referenced by ilCalendarExport\createVEVENT().

103  : ilDateTime
104  {
105  return $this->last_update ?: new ilDateTime(time(), IL_CAL_UNIX);
106  }
const IL_CAL_UNIX
+ Here is the caller graph for this function:

◆ getLocation()

ilCalendarEntry::getLocation ( )

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

References $location.

Referenced by appointmentToMailString(), ilCalendarExport\createVEVENT(), save(), and update().

257  : string
258  {
259  return $this->location;
260  }
+ Here is the caller graph for this function:

◆ getPresentationStyle()

ilCalendarEntry::getPresentationStyle ( )

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

References $presentation_style.

222  : string
223  {
225  }

◆ getPresentationTitle()

ilCalendarEntry::getPresentationTitle ( bool  $a_shorten = true)

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

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

Referenced by ilCalendarExport\createVEVENT(), ilCalendarViewGUI\getAppointmentShyButton(), and ilCalendarScheduleFilterTimings\modifyEvent().

143  : string
144  {
146  $title = $this->getTitle();
147  } elseif (strlen($this->getSubtitle())) {
148  // parse dynamic title?
149  if (preg_match("/#([a-z]+)#/", $this->getSubtitle(), $matches)) {
150  $subtitle = $this->parseDynamicTitle($matches[1]);
151  } else {
152  $subtitle = $this->lng->txt($this->getSubtitle());
153  }
154  $title = $this->getTitle() .
155  (strlen($subtitle)
156  ? ' (' . $subtitle . ')'
157  : '');
158  } else {
159  $title = $this->lng->txt($this->getTitle());
160  }
161 
162  if ($a_shorten) {
164  }
165  return $title;
166  }
parseDynamicTitle(string $a_type)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStart()

ilCalendarEntry::getStart ( )

◆ getSubtitle()

ilCalendarEntry::getSubtitle ( )

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

References $subtitle.

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

237  : string
238  {
239  return $this->subtitle;
240  }
+ Here is the caller graph for this function:

◆ getTitle()

ilCalendarEntry::getTitle ( )

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

References $title.

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

138  : string
139  {
140  return $this->title;
141  }
+ Here is the caller graph for this function:

◆ getTranslationType()

ilCalendarEntry::getTranslationType ( )

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

References $translation_type.

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

312  : int
313  {
315  }
+ Here is the caller graph for this function:

◆ isAutoGenerated()

ilCalendarEntry::isAutoGenerated ( )

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

References $is_auto_generated.

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

287  : bool
288  {
290  }
+ Here is the caller graph for this function:

◆ isFullday()

ilCalendarEntry::isFullday ( )

is event a fullday period

Implements ilDatePeriod.

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

References $fullday.

Referenced by ilCalendarExport\createVEVENT(), read(), save(), and update().

282  : bool
283  {
284  return $this->fullday;
285  }
+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilCalendarEntry::isNotificationEnabled ( )

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

References $notification.

Referenced by save(), and update().

322  : bool
323  {
324  return $this->notification;
325  }
+ Here is the caller graph for this function:

◆ parseDynamicTitle()

ilCalendarEntry::parseDynamicTitle ( string  $a_type)
protected

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

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

Referenced by getPresentationTitle().

168  : string
169  {
170  $title = $style = "";
171  switch ($a_type) {
172  case "consultationhour":
173  $entry = new ilBookingEntry($this->getContextId());
174  if ($entry) {
175  if ($entry->isOwner()) {
176  $max = $entry->getNumberOfBookings();
177  $current = $entry->getCurrentNumberOfBookings($this->getEntryId());
178  if (!$current) {
179  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
180  $title = $this->lng->txt('cal_book_free');
181  } elseif ($current >= $max) {
182  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
183  $title = $this->lng->txt('cal_booked_out');
184  } else {
185  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: yellow';
186  $title = $current . '/' . $max;
187  }
188  } else {
190  $entry->getObjId(),
191  $this->getContextId(),
192  $this->getStart()
193  );
194  if ($apps === []) {
195  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
196  $title = $this->lng->txt('cal_booked_out');
197  } else {
198  $orig_event = $apps[0];
199  $max = $entry->getNumberOfBookings();
200  $current = $entry->getCurrentNumberOfBookings($this->getEntryId());
201  if ($entry->hasBooked($orig_event)) {
202  $title = $this->lng->txt('cal_date_booked');
203  } elseif ($current >= $max) {
204  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
205  $title = $this->lng->txt('cal_booked_out');
206  } else {
207  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
208  $title = $this->lng->txt('cal_book_free');
209  }
210  }
211  }
212  }
213  break;
214  }
215  if (strlen($style)) {
216  $this->presentation_style = $style;
217  }
218 
219  return $title;
220  }
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)
getStart()
Get start of date period.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilCalendarEntry::read ( )
protected

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

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

Referenced by __construct().

416  : void
417  {
418  $query = "SELECT * FROM cal_entries WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
419  $res = $this->db->query($query);
420  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
421  $this->setLastUpdate(new ilDateTime((string) $row->last_update, IL_CAL_DATETIME, 'UTC'));
422  $this->setTitle((string) $row->title);
423  $this->setSubtitle((string) $row->subtitle);
424  $this->setDescription((string) $row->description);
425  $this->setLocation((string) $row->location);
426  $this->setFurtherInformations((string) $row->informations);
427  $this->setFullday((bool) $row->fullday);
428  $this->setAutoGenerated((bool) $row->auto_generated);
429  $this->setContextId((int) $row->context_id);
430  $this->setContextInfo((string) $row->context_info);
431  $this->setTranslationType((int) $row->translation_type);
432  $this->enableNotification((bool) $row->notification);
433 
434  if ($this->isFullday()) {
435  $this->start = new ilDate((string) $row->starta, IL_CAL_DATETIME);
436  $this->end = new ilDate((string) $row->enda, IL_CAL_DATETIME);
437  } else {
438  $this->start = new ilDateTime((string) $row->starta, IL_CAL_DATETIME, 'UTC');
439  $this->end = new ilDateTime((string) $row->enda, IL_CAL_DATETIME, 'UTC');
440  }
441  }
442  }
$res
Definition: ltiservices.php:69
setTitle(string $a_title)
const IL_CAL_DATETIME
setAutoGenerated(bool $a_status)
setContextId(int $a_context_id)
setSubtitle(string $a_subtitle)
set subtitle Used for automatic generated appointments.
setLocation(string $a_location)
setFullday(bool $a_fullday)
set fullday event Fullday events do not change their time in different timezones. ...
setFurtherInformations(string $a_informations)
isFullday()
is event a fullday period
setTranslationType(int $a_type)
setContextInfo(string $a_info)
enableNotification(bool $a_status)
setLastUpdate(ilDateTime $a_date)
setDescription(string $a_description)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilCalendarEntry::save ( )

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

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

354  : void
355  {
356  $next_id = $this->db->nextId('cal_entries');
357  $now = new ilDateTime(time(), IL_CAL_UNIX);
358  $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
359 
360  $query = "INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, " .
361  "informations,auto_generated,context_id,context_info,translation_type, notification) " .
362  "VALUES( " .
363  $this->db->quote($next_id, 'integer') . ", " .
364  /*
365  * The title needs to be truncated to fit into the table column. This is a pretty
366  * brute force method for doing so, but right now I can't find a better place for it.
367  */
368  $this->db->quote(mb_substr($this->getTitle(), 0, 128), 'text') . ", " .
369  $this->db->quote($utc_timestamp, 'timestamp') . ", " .
370  $this->db->quote($this->getSubtitle(), 'text') . ", " .
371  $this->db->quote($this->getDescription(), 'text') . ", " .
372  $this->db->quote($this->getLocation(), 'text') . ", " .
373  $this->db->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
374  $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
375  $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
376  $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
377  $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
378  $this->db->quote($this->getContextId(), 'integer') . ", " .
379  $this->db->quote($this->getContextInfo(), 'text') . ', ' .
380  $this->db->quote($this->getTranslationType(), 'integer') . ", " .
381  $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
382  ")";
383  $res = $this->db->manipulate($query);
384 
385  $this->entry_id = $next_id;
386  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
const IL_CAL_UNIX
getEnd()
Get end of period.
isFullday()
is event a fullday period
getStart()
Get start of date period.
+ Here is the call graph for this function:

◆ setAutoGenerated()

ilCalendarEntry::setAutoGenerated ( bool  $a_status)

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

Referenced by read().

292  : void
293  {
294  $this->is_auto_generated = $a_status;
295  }
+ Here is the caller graph for this function:

◆ setContextId()

ilCalendarEntry::setContextId ( int  $a_context_id)

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

Referenced by read().

297  : void
298  {
299  $this->context_id = $a_context_id;
300  }
+ Here is the caller graph for this function:

◆ setContextInfo()

ilCalendarEntry::setContextInfo ( string  $a_info)

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

Referenced by read().

88  : void
89  {
90  $this->context_info = $a_info;
91  }
+ Here is the caller graph for this function:

◆ setDescription()

ilCalendarEntry::setDescription ( string  $a_description)

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

Referenced by read().

242  : void
243  {
244  $this->description = $a_description;
245  }
+ Here is the caller graph for this function:

◆ setEnd()

ilCalendarEntry::setEnd ( ?ilDateTime  $a_end)

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

Referenced by ilCalendarScheduleFilterBookingPool\modifyEvent().

128  : void
129  {
130  $this->end = $a_end;
131  }
+ 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 277 of file class.ilCalendarEntry.php.

Referenced by read().

277  : void
278  {
279  $this->fullday = $a_fullday;
280  }
+ Here is the caller graph for this function:

◆ setFurtherInformations()

ilCalendarEntry::setFurtherInformations ( string  $a_informations)

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

Referenced by read().

262  : void
263  {
264  $this->further_informations = $a_informations;
265  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilCalendarEntry::setLastUpdate ( ilDateTime  $a_date)

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

Referenced by read().

108  : void
109  {
110  $this->last_update = $a_date;
111  }
+ Here is the caller graph for this function:

◆ setLocation()

ilCalendarEntry::setLocation ( string  $a_location)

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

Referenced by read().

252  : void
253  {
254  $this->location = $a_location;
255  }
+ Here is the caller graph for this function:

◆ setStart()

ilCalendarEntry::setStart ( ?ilDateTime  $a_start)

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

118  : void
119  {
120  $this->start = $a_start;
121  }

◆ setSubtitle()

ilCalendarEntry::setSubtitle ( string  $a_subtitle)

set subtitle Used for automatic generated appointments.

Will be appended to the title.

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

Referenced by read().

232  : void
233  {
234  $this->subtitle = $a_subtitle;
235  }
+ Here is the caller graph for this function:

◆ setTitle()

ilCalendarEntry::setTitle ( string  $a_title)

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

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

133  : void
134  {
135  $this->title = $a_title;
136  }
+ Here is the caller graph for this function:

◆ setTranslationType()

ilCalendarEntry::setTranslationType ( int  $a_type)

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

Referenced by read().

307  : void
308  {
309  $this->translation_type = $a_type;
310  }
+ Here is the caller graph for this function:

◆ update()

ilCalendarEntry::update ( )

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

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

327  : void
328  {
329  $now = new ilDateTime(time(), IL_CAL_UNIX);
330  $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
331  $query = "UPDATE cal_entries " .
332  /*
333  * The title needs to be truncated to fit into the table column. This is a pretty
334  * brute force method for doing so, but right now I can't find a better place for it.
335  */
336  "SET title = " . $this->db->quote(mb_substr($this->getTitle(), 0, 128), 'text') . ", " .
337  "last_update = " . $this->db->quote($utc_timestamp, 'timestamp') . ", " .
338  "subtitle = " . $this->db->quote($this->getSubtitle(), 'text') . ", " .
339  "description = " . $this->db->quote($this->getDescription(), 'text') . ", " .
340  "location = " . $this->db->quote($this->getLocation(), 'text') . ", " .
341  "fullday = " . $this->db->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
342  "starta = " . $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
343  "enda = " . $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
344  "informations = " . $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
345  "auto_generated = " . $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
346  "translation_type = " . $this->db->quote($this->getTranslationType(), 'integer') . ", " .
347  "context_id = " . $this->db->quote($this->getContextId(), 'integer') . ", " .
348  'context_info = ' . $this->db->quote($this->getContextInfo(), 'text') . ', ' .
349  'notification = ' . $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
350  "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
351  $res = $this->db->manipulate($query);
352  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
const IL_CAL_UNIX
getEnd()
Get end of period.
isFullday()
is event a fullday period
getStart()
Get start of date period.
+ Here is the call graph for this function:

◆ validate()

ilCalendarEntry::validate ( )

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

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

399  : bool
400  {
401  $success = true;
402  $this->error->setMessage('');
403  if (!strlen($this->getTitle())) {
404  $success = false;
405  $this->error->appendMessage($this->lng->txt('err_missing_title'));
406  }
407  if (!$this->getStart() || !$this->getEnd()) {
408  $success = false;
409  } elseif (ilDateTime::_before($this->getEnd(), $this->getStart(), '')) {
410  $success = false;
411  $this->error->appendMessage($this->lng->txt('err_end_before_start'));
412  }
413  return $success;
414  }
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.
getEnd()
Get end of period.
getStart()
Get start of date period.
+ Here is the call graph for this function:

Field Documentation

◆ $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().

◆ $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.

◆ $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 52 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().

◆ $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 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


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