ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCalendarEntry Class Reference

Model for a calendar entry. More...

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

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 __clone ()
 clone instance More...
 
 setContextInfo ($a_info)
 Set context info. More...
 
 getContextInfo ()
 
 getEntryId ()
 get entry id More...
 
 getLastUpdate ()
 get last update More...
 
 setLastUpdate ($a_date)
 set last update More...
 
 getStart ()
 get start More...
 
 setStart ($a_start)
 public More...
 
 getEnd ()
 get end public More...
 
 setEnd ($a_end)
 set end public More...
 
 setTitle ($a_title)
 set title More...
 
 getTitle ()
 get title More...
 
 getPresentationTitle ($a_shorten=true)
 get title for presentation. More...
 
 getPresentationStyle ()
 
 setSubtitle ($a_subtitle)
 set subtitle Used for automatic generated appointments. More...
 
 getSubtitle ()
 get subtitle More...
 
 setDescription ($a_description)
 set description More...
 
 getDescription ()
 get description More...
 
 setLocation ($a_location)
 set location More...
 
 getLocation ()
 get location More...
 
 setFurtherInformations ($a_informations)
 set further informations More...
 
 getFurtherInformations ()
 get further informations More...
 
 setFullday ($a_fullday)
 set fullday event Fullday events do not change their time in different timezones. More...
 
 isFullday ()
 is fullday More...
 
 isAutoGenerated ()
 is auto generated More...
 
 setAutoGenerated ($a_status)
 set auto generated More...
 
 isMilestone ()
 is milestone More...
 
 setMilestone ($a_status)
 set milestone More...
 
 setCompletion ($a_completion)
 Set Completion. More...
 
 getCompletion ()
 Get Completion. More...
 
 setContextId ($a_context_id)
 set context id More...
 
 getContextId ()
 get context id More...
 
 setTranslationType ($a_type)
 public More...
 
 getTranslationType ()
 get translation type More...
 
 enableNotification ($a_status)
 Enable course group notification. More...
 
 isNotificationEnabled ()
 Check if course group notification is enabled. More...
 
 update ()
 update More...
 
 save ()
 save one entry More...
 
 delete ()
 delete More...
 
 validate ()
 validate More...
 
 appointmentToMailString ($lng)
 
 writeResponsibleUsers ($a_users)
 Write users responsible for a milestone. More...
 
 readResponsibleUsers ()
 Read responsible users. More...
 

Static Public Member Functions

static _delete ($a_entry_id)
 delete entry More...
 

Protected Member Functions

 parseDynamicTitle ($a_type)
 
 read ()
 protected More...
 

Protected Attributes

 $log
 
 $db
 
 $entry_id
 
 $last_update
 
 $title
 
 $subtitle
 
 $description
 
 $location
 
 $further_informations
 
 $start = null
 
 $fullday
 
 $end = null
 
 $is_auto_generated = false
 
 $context_id = 0
 
 $context_info = ''
 
 $translation_type = IL_CAL_TRANSLATION_NONE
 
 $is_milestone = false
 
 $completion = 0
 
 $notification = false
 

Detailed Description

Model for a calendar entry.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilCalendarEntry::__construct (   $a_id = 0)

Constructor.

public

Parameters
intcal_entry id

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

References $DIC, $ilDB, and read().

53  {
54  global $DIC;
55 
56  $ilDB = $DIC['ilDB'];
57  $this->log = $DIC->logger()->cal();
58 
59  $this->db = $ilDB;
60 
61  if ($this->entry_id = $a_id) {
62  $this->read();
63  }
64  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilCalendarEntry::__clone ( )

clone instance

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

70  {
71  $this->entry_id = null;
72  }

◆ _delete()

static ilCalendarEntry::_delete (   $a_entry_id)
static

delete entry

public

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

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

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

82  {
83  global $DIC;
84 
85  $ilDB = $DIC['ilDB'];
86 
87  include_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');
88  ilCalendarRecurrence::_delete($a_entry_id);
89 
90  $query = "DELETE FROM cal_entries " .
91  "WHERE cal_id = " . $ilDB->quote($a_entry_id, 'integer') . " ";
92  $res = $ilDB->manipulate($query);
93 
94  return true;
95  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
static _delete($a_cal_id)
delete
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appointmentToMailString()

ilCalendarEntry::appointmentToMailString (   $lng)
Parameters
ilLanguage$lng
Returns

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

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

733  {
734  $body = $lng->txt('cal_details');
735  $body .= "\n\n";
736  $body .= $lng->txt('title') . ': ' . $this->getTitle() . "\n";
737 
739  $body .= $lng->txt('date') . ': ' . ilDatePresentation::formatPeriod($this->getStart(), $this->getEnd()) . "\n";
741 
742  if (strlen($this->getLocation())) {
743  $body .= $lng->txt('cal_where') . ': ' . $this->getLocation() . "\n";
744  }
745 
746  if (strlen($this->getDescription())) {
747  $body .= $lng->txt('description') . ': ' . $this->getDescription() . "\n";
748  }
749  return $body;
750  }
static setUseRelativeDates($a_status)
set use relative dates
getDescription()
get description
getEnd()
get end public
$lng
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
getLocation()
get location
+ Here is the call graph for this function:

◆ delete()

ilCalendarEntry::delete ( )

delete

public

Returns

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

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

640  {
641  global $DIC;
642 
643  $ilDB = $DIC['ilDB'];
644 
645  include_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');
647 
648  $query = "DELETE FROM cal_entries " .
649  "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
650  $res = $ilDB->manipulate($query);
651 
652  include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
654 
655  return true;
656  }
global $DIC
Definition: saml.php:7
getEntryId()
get entry id
foreach($_POST as $key=> $value) $res
$query
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
static _delete($a_cal_id)
delete
global $ilDB
+ Here is the call graph for this function:

◆ enableNotification()

ilCalendarEntry::enableNotification (   $a_status)

Enable course group notification.

Parameters
bool$a_status

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

References notification().

Referenced by read().

538  {
539  $this->notification = $a_status;
540  }
notification()
Definition: notification.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCompletion()

ilCalendarEntry::getCompletion ( )

Get Completion.

Returns
int Completion

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

References $completion.

Referenced by save(), and update().

483  {
484  return $this->completion;
485  }
+ Here is the caller graph for this function:

◆ getContextId()

ilCalendarEntry::getContextId ( )

get context id

public

Returns

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

References $context_id.

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

506  {
507  return $this->context_id;
508  }
+ Here is the caller graph for this function:

◆ getContextInfo()

ilCalendarEntry::getContextInfo ( )
Returns
string

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

References $context_info.

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

110  {
111  return $this->context_info;
112  }
+ Here is the caller graph for this function:

◆ getDescription()

ilCalendarEntry::getDescription ( )

get description

public

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

References $description.

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

347  {
348  return $this->description;
349  }
+ Here is the caller graph for this function:

◆ getEnd()

ilCalendarEntry::getEnd ( )

get end public

Returns
ilDateTime end

Implements ilDatePeriod.

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

References $end.

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

178  {
179  return $this->end;
180  }
+ Here is the caller graph for this function:

◆ getEntryId()

◆ getFurtherInformations()

ilCalendarEntry::getFurtherInformations ( )

get further informations

public

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

References $further_informations.

Referenced by save(), and update().

391  {
393  }
+ Here is the caller graph for this function:

◆ getLastUpdate()

ilCalendarEntry::getLastUpdate ( )

get last update

public

Parameters

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

References IL_CAL_UNIX.

133  {
134  return $this->last_update ? $this->last_update : new ilDateTime(time(), IL_CAL_UNIX);
135  }
const IL_CAL_UNIX
Date and time handling

◆ getLocation()

ilCalendarEntry::getLocation ( )

get location

public

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

References $location.

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

369  {
370  return $this->location;
371  }
+ Here is the caller graph for this function:

◆ getPresentationStyle()

ilCalendarEntry::getPresentationStyle ( )

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

252  {
253  // see parseDynamicTitle()
254  return $this->presentation_style;
255  }

◆ getPresentationTitle()

ilCalendarEntry::getPresentationTitle (   $a_shorten = true)

get title for presentation.

Special handling for auto generated appointments

public

Returns

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

References $DIC, $lng, $subtitle, $title, getSubtitle(), getTitle(), getTranslationType(), IL_CAL_TRANSLATION_NONE, parseDynamicTitle(), ilUtil\shortenText(), and ilUtil\shortenWords().

Referenced by ilCalendarScheduleFilterTimings\modifyEvent().

223  {
224  global $DIC;
225 
226  $lng = $DIC['lng'];
227 
229  $title = $this->getTitle();
230  } elseif (strlen($this->getSubtitle())) {
231  // parse dynamic title?
232  if (preg_match("/#([a-z]+)#/", $this->getSubtitle(), $matches)) {
233  $subtitle = $this->parseDynamicTitle($matches[1]);
234  } else {
235  $subtitle = $lng->txt($this->getSubtitle());
236  }
237  $title = $this->getTitle() .
238  (strlen($subtitle)
239  ? ' (' . $subtitle . ')'
240  : '');
241  } else {
242  $title = $lng->txt($this->getTitle());
243  }
244 
245  if ($a_shorten) {
246  return ilUtil::shortenText(ilUtil::shortenWords($title, 20), 40, true);
247  }
248  return $title;
249  }
getTranslationType()
get translation type
static shortenWords($a_str, $a_len=30, $a_dots=true)
Ensure that the maximum word lenght within a text is not longer than $a_len.
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
const IL_CAL_TRANSLATION_NONE
global $DIC
Definition: saml.php:7
getSubtitle()
get subtitle
$lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStart()

ilCalendarEntry::getStart ( )

get start

public

Returns

Implements ilDatePeriod.

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

References $start.

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

157  {
158  return $this->start;
159  }
+ Here is the caller graph for this function:

◆ getSubtitle()

ilCalendarEntry::getSubtitle ( )

get subtitle

public

Returns

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

References $subtitle.

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

325  {
326  return $this->subtitle;
327  }
+ Here is the caller graph for this function:

◆ getTitle()

ilCalendarEntry::getTitle ( )

get title

public

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

References $title.

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

211  {
212  return $this->title;
213  }
+ Here is the caller graph for this function:

◆ getTranslationType()

ilCalendarEntry::getTranslationType ( )

get translation type

public

Returns
int translation type

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

References $translation_type.

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

529  {
531  }
+ Here is the caller graph for this function:

◆ isAutoGenerated()

ilCalendarEntry::isAutoGenerated ( )

is auto generated

public

Parameters

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

References $is_auto_generated.

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

427  {
428  return (bool) $this->is_auto_generated;
429  }
+ Here is the caller graph for this function:

◆ isFullday()

ilCalendarEntry::isFullday ( )

is fullday

public

Implements ilDatePeriod.

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

References $fullday.

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

415  {
416  return (bool) $this->fullday;
417  }
+ Here is the caller graph for this function:

◆ isMilestone()

ilCalendarEntry::isMilestone ( )

is milestone

public

Parameters

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

References $is_milestone.

Referenced by save(), and update().

451  {
452  return (bool) $this->is_milestone;
453  }
+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilCalendarEntry::isNotificationEnabled ( )

Check if course group notification is enabled.

Returns
bool

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

References $notification.

Referenced by save(), and update().

547  {
548  return (bool) $this->notification;
549  }
+ Here is the caller graph for this function:

◆ parseDynamicTitle()

ilCalendarEntry::parseDynamicTitle (   $a_type)
protected

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

References $a_type, $current, $DIC, $lng, $style, $title, ilConsultationHourAppointments\getAppointmentIds(), getContextId(), and getStart().

Referenced by getPresentationTitle().

258  {
259  global $DIC;
260 
261  $lng = $DIC['lng'];
262 
263  $title = $style = "";
264  switch ($a_type) {
265  case "consultationhour":
266  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
267  $entry = new ilBookingEntry($this->getContextId());
268  if ($entry) {
269  if ($entry->isOwner()) {
270  $max = (int) $entry->getNumberOfBookings();
271  $current = (int) $entry->getCurrentNumberOfBookings($this->getEntryId());
272  if (!$current) {
273  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
274  $title = $lng->txt('cal_book_free');
275  } elseif ($current >= $max) {
276  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
277  $title = $lng->txt('cal_booked_out');
278  } else {
279  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: yellow';
280  $title = $current . '/' . $max;
281  }
282  } else {
283  /*
284  * if($entry->hasBooked($this->getEntryId()))
285  */
286  include_once 'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
287  $apps = ilConsultationHourAppointments::getAppointmentIds($entry->getObjId(), $this->getContextId(), $this->getStart());
288  $orig_event = $apps[0];
289  if ($entry->hasBooked($orig_event)) {
290  $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
291  $title = $lng->txt('cal_date_booked');
292  }
293  }
294  }
295  break;
296  }
297 
298  if ($style) {
299  $this->presentation_style = $style;
300  }
301  return $title;
302  }
$style
Definition: example_012.php:70
global $DIC
Definition: saml.php:7
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
Booking definition.
$a_type
Definition: workflow.php:92
$lng
getContextId()
get context id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilCalendarEntry::read ( )
protected

protected

Parameters

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

References $DIC, $ilDB, $query, $res, $row, 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().

694  {
695  global $DIC;
696 
697  $ilDB = $DIC['ilDB'];
698 
699  $query = "SELECT * FROM cal_entries WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
700  $res = $this->db->query($query);
701  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
702  $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, 'UTC'));
703  $this->setTitle($row->title);
704  $this->setSubtitle($row->subtitle);
705  $this->setDescription($row->description);
706  $this->setLocation($row->location);
707  $this->setFurtherInformations($row->informations);
708  $this->setFullday((bool) $row->fullday);
709  $this->setAutoGenerated($row->auto_generated);
710  $this->setContextId($row->context_id);
711  $this->setContextInfo($row->context_info);
712  $this->setTranslationType($row->translation_type);
713  $this->setCompletion($row->completion);
714  $this->setMilestone($row->is_milestone);
715  $this->enableNotification((bool) $row->notification);
716 
717  if ($this->isFullday()) {
718  $this->start = new ilDate($row->starta, IL_CAL_DATETIME);
719  $this->end = new ilDate($row->enda, IL_CAL_DATETIME);
720  } else {
721  $this->start = new ilDateTime($row->starta, IL_CAL_DATETIME, 'UTC');
722  $this->end = new ilDateTime($row->enda, IL_CAL_DATETIME, 'UTC');
723  }
724  }
725  }
setContextId($a_context_id)
set context id
setTitle($a_title)
set title
const IL_CAL_DATETIME
setLastUpdate($a_date)
set last update
enableNotification($a_status)
Enable course group notification.
global $DIC
Definition: saml.php:7
setFurtherInformations($a_informations)
set further informations
setDescription($a_description)
set description
getEntryId()
get entry id
setSubtitle($a_subtitle)
set subtitle Used for automatic generated appointments.
setFullday($a_fullday)
set fullday event Fullday events do not change their time in different timezones. ...
Class for single dates.
foreach($_POST as $key=> $value) $res
Date and time handling
$query
setCompletion($a_completion)
Set Completion.
$row
setTranslationType($a_type)
public
setLocation($a_location)
set location
setMilestone($a_status)
set milestone
setContextInfo($a_info)
Set context info.
global $ilDB
setAutoGenerated($a_status)
set auto generated
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readResponsibleUsers()

ilCalendarEntry::readResponsibleUsers ( )

Read responsible users.

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

References $DIC, $ilDB, $n, ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), and getEntryId().

786  {
787  global $DIC;
788 
789  $ilDB = $DIC['ilDB'];
790 
791  $set = $ilDB->queryF(
792  "SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
793  array("integer"),
794  array($this->getEntryId())
795  );
796 
797  $return = array();
798  while ($rec = $ilDB->fetchAssoc($set)) {
799  $n = ilObjUser::_lookupName($rec["user_id"]);
800  $return[] = array_merge(
801  $n,
802  array("login" => ilObjUser::_lookupLogin($rec["user_id"]))
803  );
804  }
805 
806  return $return;
807  }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
global $DIC
Definition: saml.php:7
getEntryId()
get entry id
$n
Definition: RandomTest.php:85
global $ilDB
+ Here is the call graph for this function:

◆ save()

ilCalendarEntry::save ( )

save one entry

public

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

References $DIC, $ilDB, $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.

597  {
598  global $DIC;
599 
600  $ilDB = $DIC['ilDB'];
601 
602  $next_id = $ilDB->nextId('cal_entries');
603  $now = new ilDateTime(time(), IL_CAL_UNIX);
604  $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
605 
606  $query = "INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, " .
607  "informations,auto_generated,context_id,context_info,translation_type, completion, is_milestone, notification) " .
608  "VALUES( " .
609  $ilDB->quote($next_id, 'integer') . ", " .
610  $this->db->quote($this->getTitle(), 'text') . ", " .
611  $ilDB->quote($utc_timestamp, 'timestamp') . ", " .
612  $this->db->quote($this->getSubtitle(), 'text') . ", " .
613  $this->db->quote($this->getDescription(), 'text') . ", " .
614  $this->db->quote($this->getLocation(), 'text') . ", " .
615  $ilDB->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
616  $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
617  $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
618  $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
619  $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
620  $this->db->quote($this->getContextId(), 'integer') . ", " .
621  $this->db->quote($this->getContextInfo(), 'text') . ', ' .
622  $this->db->quote($this->getTranslationType(), 'integer') . ", " .
623  $this->db->quote($this->getCompletion(), 'integer') . ", " .
624  $this->db->quote($this->isMilestone() ? 1 : 0, 'integer') . ", " .
625  $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
626  ")";
627  $res = $ilDB->manipulate($query);
628 
629  $this->entry_id = $next_id;
630  return true;
631  }
getTranslationType()
get translation type
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
getFurtherInformations()
get further informations
const IL_CAL_UNIX
getSubtitle()
get subtitle
isMilestone()
is milestone
getDescription()
get description
getEnd()
get end public
getCompletion()
Get Completion.
foreach($_POST as $key=> $value) $res
isAutoGenerated()
is auto generated
Date and time handling
$query
getContextId()
get context id
getLocation()
get location
global $ilDB
isNotificationEnabled()
Check if course group notification is enabled.
+ Here is the call graph for this function:

◆ setAutoGenerated()

ilCalendarEntry::setAutoGenerated (   $a_status)

set auto generated

public

Parameters

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

Referenced by read().

439  {
440  $this->is_auto_generated = $a_status;
441  }
+ Here is the caller graph for this function:

◆ setCompletion()

ilCalendarEntry::setCompletion (   $a_completion)

Set Completion.

Parameters
int$a_completionCompletion

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

Referenced by read().

473  {
474  $this->completion = $a_completion;
475  }
+ Here is the caller graph for this function:

◆ setContextId()

ilCalendarEntry::setContextId (   $a_context_id)

set context id

public

Parameters
intcontext id
Returns

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

References $a_context_id.

Referenced by read().

495  {
496  $this->context_id = $a_context_id;
497  }
$a_context_id
Definition: workflow.php:97
+ Here is the caller graph for this function:

◆ setContextInfo()

ilCalendarEntry::setContextInfo (   $a_info)

Set context info.

Parameters
$a_info

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

Referenced by read().

102  {
103  $this->context_info = $a_info;
104  }
+ Here is the caller graph for this function:

◆ setDescription()

ilCalendarEntry::setDescription (   $a_description)

set description

public

Parameters
stringdescription

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

Referenced by read().

337  {
338  $this->description = $a_description;
339  }
+ Here is the caller graph for this function:

◆ setEnd()

ilCalendarEntry::setEnd (   $a_end)

set end public

Parameters

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

Referenced by ilCalendarScheduleFilterBookingPool\modifyEvent().

188  {
189  $this->end = $a_end;
190  }
+ Here is the caller graph for this function:

◆ setFullday()

ilCalendarEntry::setFullday (   $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.

public

Parameters
boolfullday

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

Referenced by read().

405  {
406  $this->fullday = (bool) $a_fullday;
407  }
+ Here is the caller graph for this function:

◆ setFurtherInformations()

ilCalendarEntry::setFurtherInformations (   $a_informations)

set further informations

public

Parameters
stringfurther informations

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

Referenced by read().

381  {
382  $this->further_informations = $a_informations;
383  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilCalendarEntry::setLastUpdate (   $a_date)

set last update

public

Parameters

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

Referenced by read().

145  {
146  $this->last_update = $a_date;
147  }
+ Here is the caller graph for this function:

◆ setLocation()

ilCalendarEntry::setLocation (   $a_location)

set location

public

Parameters
stringlocation

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

Referenced by read().

359  {
360  $this->location = $a_location;
361  }
+ Here is the caller graph for this function:

◆ setMilestone()

ilCalendarEntry::setMilestone (   $a_status)

set milestone

public

Parameters

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

Referenced by read().

463  {
464  $this->is_milestone = $a_status;
465  }
+ Here is the caller graph for this function:

◆ setStart()

ilCalendarEntry::setStart (   $a_start)

public

Parameters

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

Referenced by ilObjBookingPoolGUI\processBooking().

168  {
169  $this->start = $a_start;
170  }
+ Here is the caller graph for this function:

◆ setSubtitle()

ilCalendarEntry::setSubtitle (   $a_subtitle)

set subtitle Used for automatic generated appointments.

Will be appended to the title.

public

Parameters
stringsubtitle
Returns

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

Referenced by read().

314  {
315  $this->subtitle = $a_subtitle;
316  }
+ Here is the caller graph for this function:

◆ setTitle()

ilCalendarEntry::setTitle (   $a_title)

set title

public

Parameters
stringtitle

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

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

200  {
201  $this->title = $a_title;
202  }
+ Here is the caller graph for this function:

◆ setTranslationType()

ilCalendarEntry::setTranslationType (   $a_type)

public

Parameters

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

References $a_type.

Referenced by read().

518  {
519  $this->translation_type = $a_type;
520  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ update()

ilCalendarEntry::update ( )

update

public

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

References $DIC, $ilDB, $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.

558  {
559  global $DIC;
560 
561  $ilDB = $DIC['ilDB'];
562 
563  $now = new ilDateTime(time(), IL_CAL_UNIX);
564  $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
565 
566 
567  $query = "UPDATE cal_entries " .
568  "SET title = " . $this->db->quote($this->getTitle(), 'text') . ", " .
569  "last_update = " . $ilDB->quote($utc_timestamp, 'timestamp') . ", " .
570  "subtitle = " . $this->db->quote($this->getSubtitle(), 'text') . ", " .
571  "description = " . $this->db->quote($this->getDescription(), 'text') . ", " .
572  "location = " . $this->db->quote($this->getLocation(), 'text') . ", " .
573  "fullday = " . $ilDB->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
574  "starta = " . $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
575  "enda = " . $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
576  "informations = " . $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
577  "auto_generated = " . $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
578  "translation_type = " . $this->db->quote($this->getTranslationType(), 'integer') . ", " .
579  "context_id = " . $this->db->quote($this->getContextId(), 'integer') . ", " .
580  'context_info = ' . $this->db->quote($this->getContextInfo(), 'text') . ', ' .
581  "completion = " . $this->db->quote($this->getCompletion(), 'integer') . ", " .
582  "is_milestone = " . $this->db->quote($this->isMilestone() ? 1 : 0, 'integer') . ", " .
583  'notification = ' . $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
584  "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
585  $res = $ilDB->manipulate($query);
586 
587  return true;
588  }
getTranslationType()
get translation type
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
getFurtherInformations()
get further informations
getEntryId()
get entry id
const IL_CAL_UNIX
getSubtitle()
get subtitle
isMilestone()
is milestone
getDescription()
get description
getEnd()
get end public
getCompletion()
Get Completion.
foreach($_POST as $key=> $value) $res
isAutoGenerated()
is auto generated
Date and time handling
$query
getContextId()
get context id
getLocation()
get location
global $ilDB
isNotificationEnabled()
Check if course group notification is enabled.
+ Here is the call graph for this function:

◆ validate()

ilCalendarEntry::validate ( )

validate

public

Returns

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

References $DIC, $ilErr, $lng, $success, ilDateTime\_before(), getEnd(), getStart(), and getTitle().

665  {
666  global $DIC;
667 
668  $ilErr = $DIC['ilErr'];
669  $lng = $DIC['lng'];
670 
671  $success = true;
672  $ilErr->setMessage('');
673  if (!strlen($this->getTitle())) {
674  $success = false;
675  $ilErr->appendMessage($lng->txt('err_missing_title'));
676  }
677  if (!$this->getStart() || !$this->getEnd()) {
678  $success = false;
679  } elseif (ilDateTime::_before($this->getEnd(), $this->getStart(), '')) {
680  $success = false;
681  $ilErr->appendMessage($lng->txt('err_end_before_start'));
682  }
683  return $success;
684  }
global $DIC
Definition: saml.php:7
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
$ilErr
Definition: raiseError.php:18
getEnd()
get end public
$success
Definition: Utf8Test.php:86
$lng
+ Here is the call graph for this function:

◆ writeResponsibleUsers()

ilCalendarEntry::writeResponsibleUsers (   $a_users)

Write users responsible for a milestone.

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

References $DIC, $ilDB, and getEntryId().

757  {
758  global $DIC;
759 
760  $ilDB = $DIC['ilDB'];
761 
762  $ilDB->manipulateF(
763  "DELETE FROM cal_entry_responsible WHERE cal_id = %s",
764  array("integer"),
765  array($this->getEntryId())
766  );
767 
768  if (is_array($a_users)) {
769  foreach ($a_users as $user_id) {
770  $ilDB->manipulateF(
771  "INSERT INTO cal_entry_responsible (cal_id, user_id) " .
772  " VALUES (%s,%s)",
773  array("integer", "integer"),
774  array($this->getEntryId(), $user_id)
775  );
776  }
777  }
778 
779  $this->responsible_users = $a_users;
780  }
global $DIC
Definition: saml.php:7
getEntryId()
get entry id
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $completion

ilCalendarEntry::$completion = 0
protected

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

Referenced by getCompletion().

◆ $context_id

ilCalendarEntry::$context_id = 0
protected

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

Referenced by getContextId().

◆ $context_info

ilCalendarEntry::$context_info = ''
protected

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

Referenced by getContextInfo().

◆ $db

ilCalendarEntry::$db
protected

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

◆ $description

ilCalendarEntry::$description
protected

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

Referenced by getDescription().

◆ $end

ilCalendarEntry::$end = null
protected

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

Referenced by getEnd().

◆ $entry_id

ilCalendarEntry::$entry_id
protected

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

Referenced by getEntryId().

◆ $fullday

ilCalendarEntry::$fullday
protected

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

Referenced by isFullday().

◆ $further_informations

ilCalendarEntry::$further_informations
protected

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

Referenced by getFurtherInformations().

◆ $is_auto_generated

ilCalendarEntry::$is_auto_generated = false
protected

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

Referenced by isAutoGenerated().

◆ $is_milestone

ilCalendarEntry::$is_milestone = false
protected

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

Referenced by isMilestone().

◆ $last_update

ilCalendarEntry::$last_update
protected

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

◆ $location

ilCalendarEntry::$location
protected

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

Referenced by getLocation().

◆ $log

ilCalendarEntry::$log
protected

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

◆ $notification

ilCalendarEntry::$notification = false
protected

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

Referenced by isNotificationEnabled().

◆ $start

ilCalendarEntry::$start = null
protected

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

Referenced by getStart().

◆ $subtitle

ilCalendarEntry::$subtitle
protected

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

Referenced by getPresentationTitle(), and getSubtitle().

◆ $title

ilCalendarEntry::$title
protected

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

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

◆ $translation_type

ilCalendarEntry::$translation_type = IL_CAL_TRANSLATION_NONE
protected

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

Referenced by getTranslationType().


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