Handles events (create,update,delete) for autmatic generated calendar events from course, groups, ...
More...
|
static | handleEvent ($a_component, $a_event, $a_parameter) |
| Handle events like create, update, delete. More...
|
|
static | createCategory ($a_obj, $a_check_existing=false) |
| Create a category for a new object (crs,grp, ...) More...
|
|
static | updateCategory ($a_obj) |
| Create a category for a new object (crs,grp, ...) More...
|
|
static | createAppointments ($a_obj, $a_appointments) |
| Create appointments. More...
|
|
static | deleteAppointments ($a_obj_id, array $a_context_ids=null) |
| Delete automatic generated appointments. More...
|
|
static | deleteCategory ($a_obj_id) |
| delete category More...
|
|
Handles events (create,update,delete) for autmatic generated calendar events from course, groups, ...
- Author
- Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 35 of file class.ilCalendarAppEventListener.php.
◆ createAppointments()
static ilCalendarAppEventListener::createAppointments |
( |
|
$a_obj, |
|
|
|
$a_appointments |
|
) |
| |
|
static |
Create appointments.
public
- Parameters
-
Definition at line 192 of file class.ilCalendarAppEventListener.php.
References $ilLog, ilCalendarCategories\_lookupCategoryIdByObjId(), and ilCalendarCategoryAssignments\addAssignment().
196 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
197 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
198 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
202 $ilLog->write(__METHOD__.
': Cannot find calendar category for obj_id '.$a_obj->getId());
203 $cat_id = self::createCategory($a_obj);
206 foreach($a_appointments as $app_templ)
209 $app->setContextId($app_templ->getContextId());
210 $app->setTitle($app_templ->getTitle());
211 $app->setSubtitle($app_templ->getSubtitle());
212 $app->setDescription($app_templ->getDescription());
213 $app->setFurtherInformations($app_templ->getInformation());
214 $app->setLocation($app_templ->getLocation());
215 $app->setStart($app_templ->getStart());
216 $app->setEnd($app_templ->getEnd());
217 $app->setFullday($app_templ->isFullday());
218 $app->setAutoGenerated(
true);
219 $app->setTranslationType($app_templ->getTranslationType());
Model for a calendar entry.
static _lookupCategoryIdByObjId($a_obj_id)
lookup category by obj_id
addAssignment($a_cal_cat_id)
add assignment
◆ createCategory()
static ilCalendarAppEventListener::createCategory |
( |
|
$a_obj, |
|
|
|
$a_check_existing = false |
|
) |
| |
|
static |
Create a category for a new object (crs,grp, ...)
public
- Parameters
-
object | ilias object ('crs','grp',...) |
Definition at line 142 of file class.ilCalendarAppEventListener.php.
References $lng, ilCalendarCategory\_getInstanceByObjId(), ilCalendarAppointmentColors\_getRandomColorByType(), and ilCalendarCategory\TYPE_OBJ.
146 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
147 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentColors.php');
150 if($a_check_existing &&
153 return self::updateCategory($a_obj);
157 $cat->setTitle($a_obj->getTitle() ? $a_obj->getTitle() : $lng->txt(
'obj_'.$a_obj->getType()));
160 $cat->setObjId($a_obj->getId());
Stores calendar categories.
static _getInstanceByObjId($a_obj_id)
get instance by obj_id
static _getRandomColorByType($a_type)
get random color entry for type
◆ deleteAppointments()
static ilCalendarAppEventListener::deleteAppointments |
( |
|
$a_obj_id, |
|
|
array |
$a_context_ids = null |
|
) |
| |
|
static |
◆ deleteCategory()
static ilCalendarAppEventListener::deleteCategory |
( |
|
$a_obj_id | ) |
|
|
static |
◆ handleEvent()
static ilCalendarAppEventListener::handleEvent |
( |
|
$a_component, |
|
|
|
$a_event, |
|
|
|
$a_parameter |
|
) |
| |
|
static |
Handle events like create, update, delete.
public
- Parameters
-
string | $a_component | component, e.g. "Modules/Forum" or "Services/User" |
string | $a_event | event e.g. "createUser", "updateUser", "deleteUser", ... |
array | $a_parameter | parameter array (assoc), array("name" => ..., "phone_office" => ...) * |
Implements ilAppEventListener.
Definition at line 46 of file class.ilCalendarAppEventListener.php.
References $ilLog, $ilUser, ilCalendarCategories\deletePDItemsCache(), and ilCalendarCategories\deleteRepositoryCache().
50 $delete_cache =
false;
54 case 'Modules/Session':
56 case 'Modules/Course':
60 $ilLog->write(__METHOD__.
': Handling create event');
61 self::createCategory($a_parameter[
'object']);
62 self::createAppointments($a_parameter[
'object'],$a_parameter[
'appointments']);
67 $ilLog->write(__METHOD__.
': Handling update event');
68 self::updateCategory($a_parameter[
'object']);
69 self::deleteAppointments($a_parameter[
'obj_id']);
70 self::createAppointments($a_parameter[
'object'],$a_parameter[
'appointments']);
75 $ilLog->write(__METHOD__.
': Handling delete event');
76 self::deleteCategory($a_parameter[
'obj_id']);
82 case 'Services/Booking':
94 case 'Modules/Exercise':
97 case 'createAssignment':
98 $ilLog->write(__METHOD__.
': Handling create event (exercise assignment)');
99 self::createCategory($a_parameter[
'object'],
true);
100 self::createAppointments($a_parameter[
'object'],$a_parameter[
'appointments']);
101 $delete_cache =
true;
104 case 'updateAssignment':
105 $ilLog->write(__METHOD__.
': Handling update event (exercise assignment)');
106 self::createCategory($a_parameter[
'object'],
true);
107 self::deleteAppointments($a_parameter[
'obj_id'],$a_parameter[
'context_ids']);
108 self::createAppointments($a_parameter[
'object'],$a_parameter[
'appointments']);
109 $delete_cache =
true;
112 case 'deleteAssignment':
113 $ilLog->write(__METHOD__.
': Handling delete event (exercise assignment)');
114 self::deleteAppointments($a_parameter[
'obj_id'],$a_parameter[
'context_ids']);
115 $delete_cache =
true;
119 $ilLog->write(__METHOD__.
': Handling delete event');
120 self::deleteCategory($a_parameter[
'obj_id']);
121 $delete_cache =
true;
129 include_once
'./Services/Calendar/classes/class.ilCalendarCategories.php';
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
static deleteRepositoryCache($a_usr_id)
Delete cache.
◆ updateCategory()
static ilCalendarAppEventListener::updateCategory |
( |
|
$a_obj | ) |
|
|
static |
Create a category for a new object (crs,grp, ...)
public
- Parameters
-
object | ilias object ('crs','grp',...) |
Definition at line 171 of file class.ilCalendarAppEventListener.php.
References ilCalendarCategory\_getInstanceByObjId().
173 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
174 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentColors.php');
178 $cat->setTitle($a_obj->getTitle());
static _getInstanceByObjId($a_obj_id)
get instance by obj_id
The documentation for this class was generated from the following file: