|
|
|
@ -5,7 +5,7 @@ |
|
|
|
* @package chamilo.calendar |
|
|
|
* @package chamilo.calendar |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
use \ChamiloSession as Session; |
|
|
|
use ChamiloSession as Session; |
|
|
|
|
|
|
|
|
|
|
|
// use anonymous mode when accessing this course tool |
|
|
|
// use anonymous mode when accessing this course tool |
|
|
|
$use_anonymous = true; |
|
|
|
$use_anonymous = true; |
|
|
|
@ -63,7 +63,7 @@ $nameTools = get_lang('Agenda'); |
|
|
|
Event::event_access_tool(TOOL_CALENDAR_EVENT); |
|
|
|
Event::event_access_tool(TOOL_CALENDAR_EVENT); |
|
|
|
|
|
|
|
|
|
|
|
// permission stuff - also used by loading from global in agenda.inc.php |
|
|
|
// permission stuff - also used by loading from global in agenda.inc.php |
|
|
|
$is_allowed_to_edit = api_is_allowed_to_edit(false, true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()); |
|
|
|
$is_allowed_to_edit = api_is_allowed_to_edit(false, true) || (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()); |
|
|
|
$agenda = new Agenda(); |
|
|
|
$agenda = new Agenda(); |
|
|
|
$agenda->type = $type; |
|
|
|
$agenda->type = $type; |
|
|
|
$actions = $agenda->displayActions('calendar'); |
|
|
|
$actions = $agenda->displayActions('calendar'); |
|
|
|
@ -88,10 +88,10 @@ $agenda->type = $event_type; |
|
|
|
$message = null; |
|
|
|
$message = null; |
|
|
|
$content = null; |
|
|
|
$content = null; |
|
|
|
|
|
|
|
|
|
|
|
if (api_is_allowed_to_edit(false, true) OR |
|
|
|
if (api_is_allowed_to_edit(false, true) || |
|
|
|
(api_get_course_setting('allow_user_edit_agenda') && |
|
|
|
(api_get_course_setting('allow_user_edit_agenda') && |
|
|
|
!api_is_anonymous() && |
|
|
|
!api_is_anonymous() && |
|
|
|
api_is_allowed_to_session_edit(false, true)) OR |
|
|
|
api_is_allowed_to_session_edit(false, true)) || |
|
|
|
GroupManager::user_has_access(api_get_user_id(), $group_id, GroupManager::GROUP_TOOL_CALENDAR) && |
|
|
|
GroupManager::user_has_access(api_get_user_id(), $group_id, GroupManager::GROUP_TOOL_CALENDAR) && |
|
|
|
GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) |
|
|
|
GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) |
|
|
|
) { |
|
|
|
) { |
|
|
|
@ -239,7 +239,7 @@ if (api_is_allowed_to_edit(false, true) OR |
|
|
|
header("Location: $agendaUrl"); |
|
|
|
header("Location: $agendaUrl"); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$content = $form->return_form(); |
|
|
|
$content = $form->returnForm(); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'importical': |
|
|
|
case 'importical': |
|
|
|
|