ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 (ilDateTime $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 {
60 $this->read();
61 }
62 }
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 67 of file class.ilCalendarEntry.php.

68 {
69 $this->entry_id = NULL;
70 }

◆ _delete()

static ilCalendarEntry::_delete (   $a_entry_id)
static

delete entry

@access public

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

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

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

721 {
722 $body = $lng->txt('cal_details');
723 $body .= "\n\n";
724 $body .= $lng->txt('title').': '.$this->getTitle()."\n";
725
727 $body .= $lng->txt('date').': '.ilDatePresentation::formatPeriod($this->getStart(), $this->getEnd())."\n";
729
730 if(strlen($this->getLocation()))
731 {
732 $body .= $lng->txt('cal_where').': '.$this->getLocation()."\n";
733 }
734
735 if(strlen($this->getDescription()))
736 {
737 $body .= $lng->txt('description').': '.$this->getDescription()."\n";
738 }
739 return $body;
740 }
getEnd()
get end @access public
getDescription()
get description
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
static setUseRelativeDates($a_status)
set use relative dates
global $lng
Definition: privfeed.php:40

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

631 {
632 global $ilDB;
633
634 include_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');
636
637 $query = "DELETE FROM cal_entries ".
638 "WHERE cal_id = ".$this->db->quote($this->getEntryId() ,'integer')." ";
639 $res = $ilDB->manipulate($query);
640
641 include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
643
644 return true;
645 }
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 534 of file class.ilCalendarEntry.php.

535 {
536 $this->notification = $a_status;
537 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getCompletion()

ilCalendarEntry::getCompletion ( )

Get Completion.

Returns
int Completion

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

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

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

503 {
504 return $this->context_id;
505 }

References $context_id.

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

+ Here is the caller graph for this function:

◆ getDescription()

ilCalendarEntry::getDescription ( )

get description

@access public

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

344 {
345 return $this->description;
346 }

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

158 {
159 return $this->end ? $this->end : $this->end = new ilDateTime();
160 }
@classDescription Date and time handling

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

+ Here is the caller graph for this function:

◆ getEntryId()

◆ getFurtherInformations()

ilCalendarEntry::getFurtherInformations ( )

get further informations

@access public

Definition at line 387 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 111 of file class.ilCalendarEntry.php.

112 {
113 return $this->last_update ? $this->last_update : new ilDateTime(time(),IL_CAL_UNIX);
114 }
const IL_CAL_UNIX

References IL_CAL_UNIX.

◆ getLocation()

ilCalendarEntry::getLocation ( )

get location

@access public

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

366 {
367 return $this->location;
368 }

References $location.

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

+ Here is the caller graph for this function:

◆ getPresentationStyle()

ilCalendarEntry::getPresentationStyle ( )

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

239 {
240 // see parseDynamicTitle()
241 return $this->presentation_style;
242 }

◆ getPresentationTitle()

ilCalendarEntry::getPresentationTitle (   $a_shorten = true)

get title for presentation.

Special handling for auto generated appointments

@access public

Returns

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

203 {
204 global $lng;
205
207 {
208 $title = $this->getTitle();
209 }
210 elseif(strlen($this->getSubtitle()))
211 {
212 // parse dynamic title?
213 if(preg_match("/#([a-z]+)#/", $this->getSubtitle(), $matches))
214 {
215 $subtitle = $this->parseDynamicTitle($matches[1]);
216 }
217 else
218 {
219 $subtitle = $lng->txt($this->getSubtitle());
220 }
221 $title = $this->getTitle().
222 (strlen($subtitle)
223 ? ' ('.$subtitle.')'
224 : '');
225 }
226 else
227 {
228 $title = $lng->txt($this->getTitle());
229 }
230
231 if($a_shorten)
232 {
234 }
235 return $title;
236 }
const IL_CAL_TRANSLATION_NONE
getTranslationType()
get translation type
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
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.

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

136 {
137 return $this->start ? $this->start : $this->start = new ilDateTime();
138
139 }

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

+ Here is the caller graph for this function:

◆ getSubtitle()

ilCalendarEntry::getSubtitle ( )

get subtitle

@access public

Returns

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

322 {
323 return $this->subtitle;
324 }

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

191 {
192 return $this->title;
193 }

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

526 {
528 }

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

424 {
425 return (bool) $this->is_auto_generated;
426 }

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

412 {
413 return (bool) $this->fullday;
414 }

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

448 {
449 return (bool) $this->is_milestone;
450 }

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

544 {
545 return (bool) $this->notification;
546 }

References $notification.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ parseDynamicTitle()

ilCalendarEntry::parseDynamicTitle (   $a_type)
protected

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

245 {
246 global $lng;
247
248 $title = $style = "";
249 switch($a_type)
250 {
251 case "consultationhour":
252 include_once 'Services/Booking/classes/class.ilBookingEntry.php';
253 $entry = new ilBookingEntry($this->getContextId());
254 if($entry)
255 {
256 if($entry->isOwner())
257 {
258 $max = (int)$entry->getNumberOfBookings();
259 $current = (int)$entry->getCurrentNumberOfBookings($this->getEntryId());
260 if(!$current)
261 {
262 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
263 $title = $lng->txt('cal_book_free');
264 }
265 elseif($current >= $max)
266 {
267 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: red';
268 $title = $lng->txt('cal_booked_out');
269 }
270 else
271 {
272 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: yellow';
273 $title = $current.'/'.$max;
274 }
275 }
276 else
277 {
278 /*
279 * if($entry->hasBooked($this->getEntryId()))
280 */
281 include_once 'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
282 $apps = ilConsultationHourAppointments::getAppointmentIds($entry->getObjId(), $this->getContextId(), $this->getStart());
283 $orig_event = $apps[0];
284 if($entry->hasBooked($orig_event))
285 {
286 $style = ';border-left-width: 5px; border-left-style: solid; border-left-color: green';
287 $title = $lng->txt('cal_date_booked');
288 }
289 }
290 }
291 break;
292 }
293
294 if($style)
295 {
296 $this->presentation_style = $style;
297 }
298 return $title;
299 }
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

References $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 679 of file class.ilCalendarEntry.php.

680 {
681 global $ilDB;
682
683 $query = "SELECT * FROM cal_entries WHERE cal_id = ".$this->db->quote($this->getEntryId() ,'integer')." ";
684 $res = $this->db->query($query);
685 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
686 {
687 $this->setLastUpdate(new ilDateTime($row->last_update,IL_CAL_DATETIME,'UTC'));
688 $this->setTitle($row->title);
689 $this->setSubtitle($row->subtitle);
690 $this->setDescription($row->description);
691 $this->setLocation($row->location);
692 $this->setFurtherInformations($row->informations);
693 $this->setFullday((bool) $row->fullday);
694 $this->setAutoGenerated($row->auto_generated);
695 $this->setContextId($row->context_id);
696 $this->setTranslationType($row->translation_type);
697 $this->setCompletion($row->completion);
698 $this->setMilestone($row->is_milestone);
699 $this->enableNotification((bool) $row->notification);
700
701 if($this->isFullday())
702 {
703 $this->start = new ilDate($row->starta,IL_CAL_DATETIME);
704 $this->end = new ilDate($row->enda,IL_CAL_DATETIME);
705 }
706 else
707 {
708 $this->start = new ilDateTime($row->starta,IL_CAL_DATETIME,'UTC');
709 $this->end = new ilDateTime($row->enda,IL_CAL_DATETIME,'UTC');
710 }
711 }
712
713 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
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, DB_FETCHMODE_OBJECT, enableNotification(), 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 769 of file class.ilCalendarEntry.php.

770 {
771 global $ilDB;
772
773 $set = $ilDB->queryF("SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
774 array("integer"), array($this->getEntryId()));
775
776 $return = array();
777 while($rec = $ilDB->fetchAssoc($set))
778 {
779 $n = ilObjUser::_lookupName($rec["user_id"]);
780 $return[] = array_merge($n,
781 array("login" => ilObjUser::_lookupLogin($rec["user_id"])));
782 }
783
784 return $return;
785 }
$n
Definition: RandomTest.php:80
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 590 of file class.ilCalendarEntry.php.

591 {
592 global $ilDB;
593
594 $next_id = $ilDB->nextId('cal_entries');
595 $now = new ilDateTime(time(),IL_CAL_UNIX);
596 $utc_timestamp = $now->get(IL_CAL_DATETIME,'',ilTimeZone::UTC);
597
598 $query = "INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, ".
599 "informations,auto_generated,context_id,translation_type, completion, is_milestone, notification) ".
600 "VALUES( ".
601 $ilDB->quote($next_id,'integer').", ".
602 $this->db->quote($this->getTitle(),'text').", ".
603 $ilDB->quote($utc_timestamp,'timestamp').", ".
604 $this->db->quote($this->getSubtitle(),'text').", ".
605 $this->db->quote($this->getDescription() ,'text').", ".
606 $this->db->quote($this->getLocation() ,'text').", ".
607 $ilDB->quote($this->isFullday() ? 1 : 0,'integer').", ".
608 $this->db->quote($this->getStart()->get(IL_CAL_DATETIME,'','UTC'),'timestamp').", ".
609 $this->db->quote($this->getEnd()->get(IL_CAL_DATETIME,'','UTC'),'timestamp').", ".
610 $this->db->quote($this->getFurtherInformations() ,'text').", ".
611 $this->db->quote($this->isAutoGenerated() ,'integer').", ".
612 $this->db->quote($this->getContextId() ,'integer').", ".
613 $this->db->quote($this->getTranslationType() ,'integer').", ".
614 $this->db->quote($this->getCompletion(), 'integer').", ".
615 $this->db->quote($this->isMilestone() ? 1 : 0, 'integer').", ".
616 $this->db->quote($this->isNotificationEnabled() ? 1 : 0,'integer').' '.
617 ")";
618 $res = $ilDB->manipulate($query);
619
620 $this->entry_id = $next_id;
621 return true;
622 }
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 435 of file class.ilCalendarEntry.php.

436 {
437 $this->is_auto_generated = $a_status;
438 }

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

470 {
471 $this->completion = $a_completion;
472 }

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

492 {
493 $this->context_id = $a_context_id;
494 }

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

334 {
335 $this->description = $a_description;
336 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEnd()

ilCalendarEntry::setEnd (   $a_end)

set end @access public

Parameters

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

168 {
169 $this->end = $a_end;
170 }

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

402 {
403 $this->fullday = (bool) $a_fullday;
404 }

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

378 {
379 $this->further_informations = $a_informations;
380 }

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

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

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

356 {
357 $this->location = $a_location;
358 }

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

460 {
461 $this->is_milestone = $a_status;
462 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStart()

ilCalendarEntry::setStart ( ilDateTime  $a_start)

@access public

Parameters

return

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

148 {
149 $this->start = $a_start;
150 }

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

311 {
312 $this->subtitle = $a_subtitle;
313 }

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

180 {
181 $this->title = $a_title;
182 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTranslationType()

ilCalendarEntry::setTranslationType (   $a_type)

@access public

Parameters

return

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

515 {
516 $this->translation_type = $a_type;
517 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilCalendarEntry::update ( )

update

@access public

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

555 {
556 global $ilDB;
557
558 $now = new ilDateTime(time(),IL_CAL_UNIX);
559 $utc_timestamp = $now->get(IL_CAL_DATETIME,'',ilTimeZone::UTC);
560
561
562 $query = "UPDATE cal_entries ".
563 "SET title = ".$this->db->quote($this->getTitle() ,'text').", ".
564 "last_update = ".$ilDB->quote($utc_timestamp,'timestamp').", ".
565 "subtitle = ".$this->db->quote($this->getSubtitle() ,'text').", ".
566 "description = ".$this->db->quote($this->getDescription(),'text').", ".
567 "location = ".$this->db->quote($this->getLocation() ,'text').", ".
568 "fullday = ".$ilDB->quote($this->isFullday() ? 1 : 0,'integer').", ".
569 "starta = ".$this->db->quote($this->getStart()->get(IL_CAL_DATETIME,'','UTC'),'timestamp').", ".
570 "enda = ".$this->db->quote($this->getEnd()->get(IL_CAL_DATETIME,'','UTC'),'timestamp').", ".
571 "informations = ".$this->db->quote($this->getFurtherInformations() ,'text').", ".
572 "auto_generated = ".$this->db->quote($this->isAutoGenerated() ,'integer').", ".
573 "translation_type = ".$this->db->quote($this->getTranslationType() ,'integer').", ".
574 "context_id = ".$this->db->quote($this->getContextId() ,'integer').", ".
575 "completion = ".$this->db->quote($this->getCompletion(), 'integer').", ".
576 "is_milestone = ".$this->db->quote($this->isMilestone() ? 1 : 0, 'integer').", ".
577 'notification = '.$this->db->quote($this->isNotificationEnabled() ? 1 : 0,'integer').' '.
578 "WHERE cal_id = ".$this->db->quote($this->getEntryId() ,'integer')." ";
579 $res = $ilDB->manipulate($query);
580
581 return true;
582 }

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

654 {
655 global $ilErr,$lng;
656
657 $success = true;
658 $ilErr->setMessage('');
659 if(!strlen($this->getTitle()))
660 {
661 $success = false;
662 $ilErr->appendMessage($lng->txt('err_missing_title'));
663 }
664 if(ilDateTime::_before($this->getEnd(),$this->getStart(),''))
665 {
666 $success = false;
667 $ilErr->appendMessage($lng->txt('err_end_before_start'));
668 }
669 return $success;
670 }
$success
Definition: Utf8Test.php:87
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.

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

747 {
748 global $ilDB;
749
750 $ilDB->manipulateF("DELETE FROM cal_entry_responsible WHERE cal_id = %s",
751 array("integer"), array($this->getEntryId()));
752
753 if (is_array($a_users))
754 {
755 foreach ($a_users as $user_id)
756 {
757 $ilDB->manipulateF("INSERT INTO cal_entry_responsible (cal_id, user_id) ".
758 " VALUES (%s,%s)", array("integer", "integer"),
759 array($this->getEntryId(), $user_id));
760 }
761 }
762
763 $this->responsible_users = $a_users;
764 }

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.

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

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