ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 getEntryId ()
 get entry id More...
 
 getLastUpdate ()
 get last update More...
 
 setLastUpdate ($a_date)
 set last update More...
 
 getStart ()
 get start More...
 
 setStart ($a_start)
 @access public More...
 
 getEnd ()
 get end @access public More...
 
 setEnd ($a_end)
 set end @access 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)
 @access 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...
 
 isFullday ()
 is fullday More...
 

Static Public Member Functions

static _delete ($a_entry_id)
 delete entry More...
 
 getStart ()
 Interface method get start. More...
 
 getEnd ()
 Interface method get end. More...
 

Protected Member Functions

 parseDynamicTitle ($a_type)
 
 read ()
 @access 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
 
 $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.

@access public

Parameters
intcal_entry id

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

52 {
53 global $ilDB,$ilLog;
54
55 $this->log = $ilLog;
56 $this->db = $ilDB;
57
58 if ($this->entry_id = $a_id) {
59 $this->read();
60 }
61 }
read()
@access protected
global $ilDB

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

+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilCalendarEntry::__clone ( )

clone instance

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

67 {
68 $this->entry_id = null;
69 }

◆ _delete()

static ilCalendarEntry::_delete (   $a_entry_id)
static

delete entry

@access public

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

79 {
80 global $ilDB;
81
82 include_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');
84
85 $query = "DELETE FROM cal_entries " .
86 "WHERE cal_id = " . $ilDB->quote($a_entry_id, 'integer') . " ";
87 $res = $ilDB->manipulate($query);
88
89 return true;
90 }
static _delete($a_cal_id)
delete
$query
foreach($_POST as $key=> $value) $res

References $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 (   $lng)
Parameters
ilLanguage$lng
Returns

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

693 {
694 $body = $lng->txt('cal_details');
695 $body .= "\n\n";
696 $body .= $lng->txt('title') . ': ' . $this->getTitle() . "\n";
697
699 $body .= $lng->txt('date') . ': ' . ilDatePresentation::formatPeriod($this->getStart(), $this->getEnd()) . "\n";
701
702 if (strlen($this->getLocation())) {
703 $body .= $lng->txt('cal_where') . ': ' . $this->getLocation() . "\n";
704 }
705
706 if (strlen($this->getDescription())) {
707 $body .= $lng->txt('description') . ': ' . $this->getDescription() . "\n";
708 }
709 return $body;
710 }
getEnd()
get end @access public
getDescription()
get description
static setUseRelativeDates($a_status)
set use relative dates
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
global $lng
Definition: privfeed.php:17

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

+ Here is the call graph for this function:

◆ delete()

ilCalendarEntry::delete ( )

delete

@access public

Returns

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

608 {
609 global $ilDB;
610
611 include_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');
613
614 $query = "DELETE FROM cal_entries " .
615 "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
616 $res = $ilDB->manipulate($query);
617
618 include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
620
621 return true;
622 }
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
getEntryId()
get entry id

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

+ Here is the call graph for this function:

◆ enableNotification()

ilCalendarEntry::enableNotification (   $a_status)

Enable course group notification.

Parameters
bool$a_status

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

512 {
513 $this->notification = $a_status;
514 }
notification()
Definition: notification.php:2

References notification().

Referenced by read().

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

457 {
458 return $this->completion;
459 }

References $completion.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getContextId()

ilCalendarEntry::getContextId ( )

get context id

@access public

Returns

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

480 {
481 return $this->context_id;
482 }

References $context_id.

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

+ Here is the caller graph for this function:

◆ getDescription()

ilCalendarEntry::getDescription ( )

get description

@access public

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

321 {
322 return $this->description;
323 }

References $description.

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

+ Here is the caller graph for this function:

◆ getEnd()

ilCalendarEntry::getEnd ( )

get end @access public

Returns
ilDateTime end

Implements ilDatePeriod.

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

156 {
157 return $this->end;
158 }

References $end.

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

+ Here is the caller graph for this function:

◆ getEntryId()

◆ getFurtherInformations()

ilCalendarEntry::getFurtherInformations ( )

get further informations

@access public

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

References $further_informations.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getLastUpdate()

ilCalendarEntry::getLastUpdate ( )

get last update

@access public

Parameters

return

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

111 {
112 return $this->last_update ? $this->last_update : new ilDateTime(time(), IL_CAL_UNIX);
113 }
const IL_CAL_UNIX
@classDescription Date and time handling

References IL_CAL_UNIX.

◆ getLocation()

ilCalendarEntry::getLocation ( )

get location

@access public

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

343 {
344 return $this->location;
345 }

References $location.

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

+ Here is the caller graph for this function:

◆ getPresentationStyle()

ilCalendarEntry::getPresentationStyle ( )

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

228 {
229 // see parseDynamicTitle()
230 return $this->presentation_style;
231 }

◆ getPresentationTitle()

ilCalendarEntry::getPresentationTitle (   $a_shorten = true)

get title for presentation.

Special handling for auto generated appointments

@access public

Returns

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

201 {
202 global $lng;
203
205 $title = $this->getTitle();
206 } elseif (strlen($this->getSubtitle())) {
207 // parse dynamic title?
208 if (preg_match("/#([a-z]+)#/", $this->getSubtitle(), $matches)) {
209 $subtitle = $this->parseDynamicTitle($matches[1]);
210 } else {
211 $subtitle = $lng->txt($this->getSubtitle());
212 }
213 $title = $this->getTitle() .
214 (strlen($subtitle)
215 ? ' (' . $subtitle . ')'
216 : '');
217 } else {
218 $title = $lng->txt($this->getTitle());
219 }
220
221 if ($a_shorten) {
222 return ilUtil::shortenText(ilUtil::shortenWords($title, 20), 40, true);
223 }
224 return $title;
225 }
const IL_CAL_TRANSLATION_NONE
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.

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

+ Here is the call graph for this function:

◆ getStart()

ilCalendarEntry::getStart ( )

get start

@access public

Returns

Implements ilDatePeriod.

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

135 {
136 return $this->start;
137 }

References $start.

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

+ Here is the caller graph for this function:

◆ getSubtitle()

ilCalendarEntry::getSubtitle ( )

get subtitle

@access public

Returns

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

299 {
300 return $this->subtitle;
301 }

References $subtitle.

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

+ Here is the caller graph for this function:

◆ getTitle()

ilCalendarEntry::getTitle ( )

get title

@access public

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

189 {
190 return $this->title;
191 }

References $title.

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

+ Here is the caller graph for this function:

◆ getTranslationType()

ilCalendarEntry::getTranslationType ( )

get translation type

@access public

Returns
int translation type

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

503 {
505 }

References $translation_type.

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

+ Here is the caller graph for this function:

◆ isAutoGenerated()

ilCalendarEntry::isAutoGenerated ( )

is auto generated

@access public

Parameters

return

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

401 {
402 return (bool) $this->is_auto_generated;
403 }

References $is_auto_generated.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ isFullday()

ilCalendarEntry::isFullday ( )

is fullday

@access public

Implements ilDatePeriod.

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

389 {
390 return (bool) $this->fullday;
391 }

References $fullday.

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

+ Here is the caller graph for this function:

◆ isMilestone()

ilCalendarEntry::isMilestone ( )

is milestone

@access public

Parameters

return

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

425 {
426 return (bool) $this->is_milestone;
427 }

References $is_milestone.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilCalendarEntry::isNotificationEnabled ( )

Check if course group notification is enabled.

Returns
bool

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

521 {
522 return (bool) $this->notification;
523 }

References $notification.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ parseDynamicTitle()

ilCalendarEntry::parseDynamicTitle (   $a_type)
protected

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

234 {
235 global $lng;
236
237 $title = $style = "";
238 switch ($a_type) {
239 case "consultationhour":
240 include_once 'Services/Booking/classes/class.ilBookingEntry.php';
241 $entry = new ilBookingEntry($this->getContextId());
242 if ($entry) {
243 if ($entry->isOwner()) {
244 $max = (int) $entry->getNumberOfBookings();
245 $current = (int) $entry->getCurrentNumberOfBookings($this->getEntryId());
246 if (!$current) {
247 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
248 $title = $lng->txt('cal_book_free');
249 } elseif ($current >= $max) {
250 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
251 $title = $lng->txt('cal_booked_out');
252 } else {
253 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: yellow';
254 $title = $current . '/' . $max;
255 }
256 } else {
257 /*
258 * if($entry->hasBooked($this->getEntryId()))
259 */
260 include_once 'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
261 $apps = ilConsultationHourAppointments::getAppointmentIds($entry->getObjId(), $this->getContextId(), $this->getStart());
262 $orig_event = $apps[0];
263 if ($entry->hasBooked($orig_event)) {
264 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
265 $title = $lng->txt('cal_date_booked');
266 }
267 }
268 }
269 break;
270 }
271
272 if ($style) {
273 $this->presentation_style = $style;
274 }
275 return $title;
276 }
Booking definition.
getContextId()
get context id
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
$style
Definition: example_012.php:70
$a_type
Definition: workflow.php:92

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

Referenced by getPresentationTitle().

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

◆ read()

ilCalendarEntry::read ( )
protected

@access protected

Parameters

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

657 {
658 global $ilDB;
659
660 $query = "SELECT * FROM cal_entries WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
661 $res = $this->db->query($query);
662 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
663 $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, 'UTC'));
664 $this->setTitle($row->title);
665 $this->setSubtitle($row->subtitle);
666 $this->setDescription($row->description);
667 $this->setLocation($row->location);
668 $this->setFurtherInformations($row->informations);
669 $this->setFullday((bool) $row->fullday);
670 $this->setAutoGenerated($row->auto_generated);
671 $this->setContextId($row->context_id);
672 $this->setTranslationType($row->translation_type);
673 $this->setCompletion($row->completion);
674 $this->setMilestone($row->is_milestone);
675 $this->enableNotification((bool) $row->notification);
676
677 if ($this->isFullday()) {
678 $this->start = new ilDate($row->starta, IL_CAL_DATETIME);
679 $this->end = new ilDate($row->enda, IL_CAL_DATETIME);
680 } else {
681 $this->start = new ilDateTime($row->starta, IL_CAL_DATETIME, 'UTC');
682 $this->end = new ilDateTime($row->enda, IL_CAL_DATETIME, 'UTC');
683 }
684 }
685 }
const IL_CAL_DATETIME
setTranslationType($a_type)
@access public
enableNotification($a_status)
Enable course group notification.
setLastUpdate($a_date)
set last update
setAutoGenerated($a_status)
set auto generated
setFullday($a_fullday)
set fullday event Fullday events do not change their time in different timezones.
setLocation($a_location)
set location
setTitle($a_title)
set title
setCompletion($a_completion)
Set Completion.
setFurtherInformations($a_informations)
set further informations
setMilestone($a_status)
set milestone
setContextId($a_context_id)
set context id
setSubtitle($a_subtitle)
set subtitle Used for automatic generated appointments.
setDescription($a_description)
set description
Class for single dates.

References $ilDB, $query, $res, $row, enableNotification(), ilDBConstants\FETCHMODE_OBJECT, getEntryId(), IL_CAL_DATETIME, isFullday(), setAutoGenerated(), setCompletion(), setContextId(), 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 ( )

Read responsible users.

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

744 {
745 global $ilDB;
746
747 $set = $ilDB->queryF(
748 "SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
749 array("integer"),
750 array($this->getEntryId())
751 );
752
753 $return = array();
754 while ($rec = $ilDB->fetchAssoc($set)) {
755 $n = ilObjUser::_lookupName($rec["user_id"]);
756 $return[] = array_merge(
757 $n,
758 array("login" => ilObjUser::_lookupLogin($rec["user_id"]))
759 );
760 }
761
762 return $return;
763 }
$n
Definition: RandomTest.php:85
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name

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

+ Here is the call graph for this function:

◆ save()

ilCalendarEntry::save ( )

save one entry

@access public

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

568 {
569 global $ilDB;
570
571 $next_id = $ilDB->nextId('cal_entries');
572 $now = new ilDateTime(time(), IL_CAL_UNIX);
573 $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
574
575 $query = "INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, " .
576 "informations,auto_generated,context_id,translation_type, completion, is_milestone, notification) " .
577 "VALUES( " .
578 $ilDB->quote($next_id, 'integer') . ", " .
579 $this->db->quote($this->getTitle(), 'text') . ", " .
580 $ilDB->quote($utc_timestamp, 'timestamp') . ", " .
581 $this->db->quote($this->getSubtitle(), 'text') . ", " .
582 $this->db->quote($this->getDescription(), 'text') . ", " .
583 $this->db->quote($this->getLocation(), 'text') . ", " .
584 $ilDB->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
585 $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
586 $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
587 $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
588 $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
589 $this->db->quote($this->getContextId(), 'integer') . ", " .
590 $this->db->quote($this->getTranslationType(), 'integer') . ", " .
591 $this->db->quote($this->getCompletion(), 'integer') . ", " .
592 $this->db->quote($this->isMilestone() ? 1 : 0, 'integer') . ", " .
593 $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
594 ")";
595 $res = $ilDB->manipulate($query);
596
597 $this->entry_id = $next_id;
598 return true;
599 }
getCompletion()
Get Completion.
isAutoGenerated()
is auto generated
isNotificationEnabled()
Check if course group notification is enabled.
getFurtherInformations()
get further informations

References $ilDB, $query, $res, getCompletion(), getContextId(), 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 (   $a_status)

set auto generated

@access public

Parameters

return

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

413 {
414 $this->is_auto_generated = $a_status;
415 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCompletion()

ilCalendarEntry::setCompletion (   $a_completion)

Set Completion.

Parameters
int$a_completionCompletion

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

447 {
448 $this->completion = $a_completion;
449 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setContextId()

ilCalendarEntry::setContextId (   $a_context_id)

set context id

@access public

Parameters
intcontext id
Returns

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

469 {
470 $this->context_id = $a_context_id;
471 }
$a_context_id
Definition: workflow.php:97

References $a_context_id.

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescription()

ilCalendarEntry::setDescription (   $a_description)

set description

@access public

Parameters
stringdescription

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

311 {
312 $this->description = $a_description;
313 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEnd()

ilCalendarEntry::setEnd (   $a_end)

set end @access public

Parameters

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

166 {
167 $this->end = $a_end;
168 }

Referenced by ilCalendarScheduleFilterBookingPool\modifyEvent().

+ 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.

@access public

Parameters
boolfullday

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

379 {
380 $this->fullday = (bool) $a_fullday;
381 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setFurtherInformations()

ilCalendarEntry::setFurtherInformations (   $a_informations)

set further informations

@access public

Parameters
stringfurther informations

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

355 {
356 $this->further_informations = $a_informations;
357 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilCalendarEntry::setLastUpdate (   $a_date)

set last update

@access public

Parameters

return

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

123 {
124 $this->last_update = $a_date;
125 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocation()

ilCalendarEntry::setLocation (   $a_location)

set location

@access public

Parameters
stringlocation

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

333 {
334 $this->location = $a_location;
335 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMilestone()

ilCalendarEntry::setMilestone (   $a_status)

set milestone

@access public

Parameters

return

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

437 {
438 $this->is_milestone = $a_status;
439 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStart()

ilCalendarEntry::setStart (   $a_start)

@access public

Parameters

return

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

146 {
147 $this->start = $a_start;
148 }

Referenced by ilObjBookingPoolGUI\processBooking().

+ 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.

@access public

Parameters
stringsubtitle
Returns

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

288 {
289 $this->subtitle = $a_subtitle;
290 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilCalendarEntry::setTitle (   $a_title)

set title

@access public

Parameters
stringtitle

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

178 {
179 $this->title = $a_title;
180 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTranslationType()

ilCalendarEntry::setTranslationType (   $a_type)

@access public

Parameters

return

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

492 {
493 $this->translation_type = $a_type;
494 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilCalendarEntry::update ( )

update

@access public

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

532 {
533 global $ilDB;
534
535 $now = new ilDateTime(time(), IL_CAL_UNIX);
536 $utc_timestamp = $now->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
537
538
539 $query = "UPDATE cal_entries " .
540 "SET title = " . $this->db->quote($this->getTitle(), 'text') . ", " .
541 "last_update = " . $ilDB->quote($utc_timestamp, 'timestamp') . ", " .
542 "subtitle = " . $this->db->quote($this->getSubtitle(), 'text') . ", " .
543 "description = " . $this->db->quote($this->getDescription(), 'text') . ", " .
544 "location = " . $this->db->quote($this->getLocation(), 'text') . ", " .
545 "fullday = " . $ilDB->quote($this->isFullday() ? 1 : 0, 'integer') . ", " .
546 "starta = " . $this->db->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
547 "enda = " . $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
548 "informations = " . $this->db->quote($this->getFurtherInformations(), 'text') . ", " .
549 "auto_generated = " . $this->db->quote($this->isAutoGenerated(), 'integer') . ", " .
550 "translation_type = " . $this->db->quote($this->getTranslationType(), 'integer') . ", " .
551 "context_id = " . $this->db->quote($this->getContextId(), 'integer') . ", " .
552 "completion = " . $this->db->quote($this->getCompletion(), 'integer') . ", " .
553 "is_milestone = " . $this->db->quote($this->isMilestone() ? 1 : 0, 'integer') . ", " .
554 'notification = ' . $this->db->quote($this->isNotificationEnabled() ? 1 : 0, 'integer') . ' ' .
555 "WHERE cal_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
556 $res = $ilDB->manipulate($query);
557
558 return true;
559 }

References $ilDB, $query, $res, getCompletion(), getContextId(), 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 ( )

validate

@access public

Returns

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

631 {
632 global $ilErr,$lng;
633
634 $success = true;
635 $ilErr->setMessage('');
636 if (!strlen($this->getTitle())) {
637 $success = false;
638 $ilErr->appendMessage($lng->txt('err_missing_title'));
639 }
640 if (!$this->getStart() || !$this->getEnd()) {
641 $success = false;
642 } elseif (ilDateTime::_before($this->getEnd(), $this->getStart(), '')) {
643 $success = false;
644 $ilErr->appendMessage($lng->txt('err_end_before_start'));
645 }
646 return $success;
647 }
$success
Definition: Utf8Test.php:86
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.
global $ilErr
Definition: raiseError.php:16

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

+ Here is the call graph for this function:

◆ writeResponsibleUsers()

ilCalendarEntry::writeResponsibleUsers (   $a_users)

Write users responsible for a milestone.

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

717 {
718 global $ilDB;
719
720 $ilDB->manipulateF(
721 "DELETE FROM cal_entry_responsible WHERE cal_id = %s",
722 array("integer"),
723 array($this->getEntryId())
724 );
725
726 if (is_array($a_users)) {
727 foreach ($a_users as $user_id) {
728 $ilDB->manipulateF(
729 "INSERT INTO cal_entry_responsible (cal_id, user_id) " .
730 " VALUES (%s,%s)",
731 array("integer", "integer"),
732 array($this->getEntryId(), $user_id)
733 );
734 }
735 }
736
737 $this->responsible_users = $a_users;
738 }

References $ilDB, and getEntryId().

+ Here is the call graph for this function:

Field Documentation

◆ $completion

ilCalendarEntry::$completion = 0
protected

Definition at line 40 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().

◆ $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 39 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 42 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 38 of file class.ilCalendarEntry.php.

Referenced by getTranslationType().


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