Skip to content

Commit

Permalink
Added missing 'group in charge of the task'
Browse files Browse the repository at this point in the history
In Planning recall notifications is missing the 'group in charge of the task'
  • Loading branch information
tomolimo authored and trasher committed Sep 14, 2021
1 parent 03a3687 commit 703c4c1
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions inc/notificationtargetplanningrecall.class.php
Expand Up @@ -53,29 +53,49 @@ function getEvents() {
function addNotificationTargets($entity) {
$this->addTarget(Notification::AUTHOR, _n('Requester', 'Requesters', 1));
$this->addTarget(Notification::TASK_ASSIGN_TECH, __('Technician in charge of the task'));
$this->addTarget(Notification::TASK_ASSIGN_GROUP, __('Group in charge of the task'));
$this->addTarget(Notification::PLANNING_EVENT_GUESTS, __('Guests'));
}


/**
* @see NotificationTarget::addSpecificTargets()
**/
function addSpecificTargets($data, $options) {
switch ($data['type']) {
case Notification::USER_TYPE :
switch ($data['items_id']) {
//Send to the ITIL object followup author
//Send to the ITIL object task author
case Notification::TASK_ASSIGN_TECH :
$this->addTaskAssignUser($options);
$this->addTaskAssignUser();
break;

case Notification::PLANNING_EVENT_GUESTS :
$this->addGuests($options);
$this->addGuests();
break;

//Send to the ITIL object task group assigned
case Notification::TASK_ASSIGN_GROUP :
$this->addTaskAssignGroup();
break;
}
break;
}
}


/**
* Get group assigned to the task
*/
function addTaskAssignGroup() {
$item = new $this->obj->fields['itemtype'];
if ($item->getFromDB($this->obj->fields['items_id'])
&& $item->isField('groups_id_tech')) {
$this->addForGroup(0, $item->fields['groups_id_tech']);
}
}


/**
* Get tech related to the task
**/
Expand Down

0 comments on commit 703c4c1

Please sign in to comment.