|
|
|
@ -1065,33 +1065,16 @@ class Agenda |
|
|
|
|
break; |
|
|
|
|
case 'course': |
|
|
|
|
$courseId = api_get_course_int_id(); |
|
|
|
|
$sessionId = api_get_session_id(); |
|
|
|
|
$isAllowToEdit = api_is_allowed_to_edit(null, true); |
|
|
|
|
|
|
|
|
|
if ($isAllowToEdit == false && !empty($sessionId)) { |
|
|
|
|
$allowDhrToEdit = api_get_configuration_value('allow_agenda_edit_for_hrm'); |
|
|
|
|
if ($allowDhrToEdit) { |
|
|
|
|
$isHrm = SessionManager::isUserSubscribedAsHRM( |
|
|
|
|
$sessionId, |
|
|
|
|
api_get_user_id() |
|
|
|
|
); |
|
|
|
|
if ($isHrm) { |
|
|
|
|
$isAllowToEdit = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$isAllowToEdit = $this->getIsAllowedToEdit(); |
|
|
|
|
|
|
|
|
|
if (!empty($courseId) && $isAllowToEdit) { |
|
|
|
|
// Delete |
|
|
|
|
$eventInfo = $this->get_event($id); |
|
|
|
|
if ($deleteAllItemsFromSerie) { |
|
|
|
|
/* This is one of the children. |
|
|
|
|
Getting siblings and delete 'Em all + the father! */ |
|
|
|
|
if (isset($eventInfo['parent_event_id']) && !empty($eventInfo['parent_event_id'])) { |
|
|
|
|
// Removing items. |
|
|
|
|
$events = $this->getAllRepeatEvents( |
|
|
|
|
$eventInfo['parent_event_id'] |
|
|
|
|
); |
|
|
|
|
$events = $this->getAllRepeatEvents($eventInfo['parent_event_id']); |
|
|
|
|
if (!empty($events)) { |
|
|
|
|
foreach ($events as $event) { |
|
|
|
|
$this->deleteEvent($event['id']); |
|
|
|
@ -1510,9 +1493,7 @@ class Agenda |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!empty($event['parent_event_id'])) { |
|
|
|
|
$event['parent_info'] = $this->get_event( |
|
|
|
|
$event['parent_event_id'] |
|
|
|
|
); |
|
|
|
|
$event['parent_info'] = $this->get_event($event['parent_event_id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$event['attachment'] = $this->getAttachmentList( |
|
|
|
|