|
|
|
@ -60,25 +60,19 @@ class Agenda |
|
|
|
$this->set_course($courseInfo); |
|
|
|
$this->set_course($courseInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Check if teacher |
|
|
|
// Check if teacher/admin rights. |
|
|
|
if (empty($sessionId)) { |
|
|
|
$isAllowToEdit = api_is_allowed_to_edit(false, true); |
|
|
|
$isAllowToEdit = api_is_allowed_to_edit(false, true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$isAllowToEdit = api_is_allowed_to_session_edit( |
|
|
|
|
|
|
|
false, |
|
|
|
|
|
|
|
true |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check |
|
|
|
// Check course setting. |
|
|
|
if (api_get_course_setting('allow_user_edit_agenda') && api_is_allowed_in_course()) { |
|
|
|
if (api_get_course_setting('allow_user_edit_agenda') == '1' |
|
|
|
|
|
|
|
&& api_is_allowed_in_course() |
|
|
|
|
|
|
|
) { |
|
|
|
$isAllowToEdit = true; |
|
|
|
$isAllowToEdit = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$groupId = api_get_group_id(); |
|
|
|
$groupId = api_get_group_id(); |
|
|
|
if (!empty($groupId)) { |
|
|
|
if (!empty($groupId)) { |
|
|
|
$groupInfo = GroupManager::get_group_properties($groupId); |
|
|
|
$groupInfo = GroupManager::get_group_properties($groupId); |
|
|
|
|
|
|
|
|
|
|
|
$userHasAccess = GroupManager::user_has_access( |
|
|
|
$userHasAccess = GroupManager::user_has_access( |
|
|
|
api_get_user_id(), |
|
|
|
api_get_user_id(), |
|
|
|
$groupInfo['iid'], |
|
|
|
$groupInfo['iid'], |
|
|
|
|