ILIAS  release_7 Revision v7.30-3-g800a261c036
ilAppointmentBaseFileHandler Class Reference

Base file handler class for appointment classes. More...

+ Inheritance diagram for ilAppointmentBaseFileHandler:
+ Collaboration diagram for ilAppointmentBaseFileHandler:

Public Member Functions

 __construct ($a_appointment)
 Constructor. More...
 
 getCatId ($a_entry_id)
 
 getCatInfo ()
 

Static Public Member Functions

static getInstance ($a_appointment)
 Get instance. More...
 

Protected Attributes

 $appointment
 
 $logger
 

Detailed Description

Base file handler class for appointment classes.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 11 of file class.ilAppointmentBaseFileHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilAppointmentBaseFileHandler::__construct (   $a_appointment)

Constructor.

Parameters

Definition at line 25 of file class.ilAppointmentBaseFileHandler.php.

References $DIC, and user().

26  {
27  global $DIC;
28 
29  $this->access = $DIC->access();
30  $this->rbacsystem = $DIC->rbac()->system();
31  $this->user = $DIC->user();
32  $this->logger = $DIC->logger()->cal();
33  $this->appointment = $a_appointment;
34  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ getCatId()

ilAppointmentBaseFileHandler::getCatId (   $a_entry_id)

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

References ilCalendarCategoryAssignments\_lookupCategory().

Referenced by getCatInfo().

47  {
49  }
static _lookupCategory($a_cal_id)
Lookup category id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCatInfo()

ilAppointmentBaseFileHandler::getCatInfo ( )

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

References ilObject\_getAllReferences(), ilCalendarSettings\_getInstance(), ilObject\_lookupType(), getCatId(), ilCalendarCategory\getInstanceByCategoryId(), ilCalendarCategory\TYPE_GLOBAL, ilCalendarCategory\TYPE_OBJ, ilCalendarCategory\TYPE_USR, and user().

Referenced by ilAppointmentCourseFileHandler\getFiles(), and ilAppointmentSessionFileHandler\getFiles().

52  {
53  $cat_id = $this->getCatId($this->appointment['event']->getEntryId());
54 
56  $cat_info = array();
57  $cat_info["type"] = $cat->getType();
58  $cat_info["obj_id"] = $cat->getObjId();
59  $cat_info["title"] = $cat->getTitle();
60  $cat_info["cat_id"] = $cat_id;
61  $cat_info["editable"] = false;
62 
63  switch ($cat_info["type"]) {
65  if ($cat_info["obj_id"] == $this->user->getId()) {
66  $cat_info["editable"] = true;
67  }
68  break;
69 
71  $obj_type = ilObject::_lookupType($cat_info["obj_id"]);
72  if ($obj_type == 'crs' or $obj_type == 'grp') {
73  if (ilCalendarSettings::_getInstance()->lookupCalendarActivated($cat_info["obj_id"])) {
74  foreach (ilObject::_getAllReferences($cat_info["obj_id"]) as $ref_id) {
75  if ($this->access->checkAccess('edit_event', '', $ref_id)) {
76  $cat_info["editable"] = true;
77  }
78  }
79  }
80  }
81  break;
82 
84  if ($this->rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) {
85  $cat_info["editable"] = true;
86  }
87  break;
88  }
89 
90  return $cat_info;
91  }
static _getInstance()
get singleton instance
user()
Definition: user.php:4
static _getAllReferences($a_id)
get all reference ids of object
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

static ilAppointmentBaseFileHandler::getInstance (   $a_appointment)
static

Get instance.

Returns
self

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

42  {
43  return new static($a_appointment);
44  }

Field Documentation

◆ $appointment

ilAppointmentBaseFileHandler::$appointment
protected

Definition at line 13 of file class.ilAppointmentBaseFileHandler.php.

◆ $logger

ilAppointmentBaseFileHandler::$logger
protected

Definition at line 18 of file class.ilAppointmentBaseFileHandler.php.


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