|
|
|
@ -58,6 +58,7 @@ if( |
|
|
|
unlink($_SESSION['temp_realpath_image']); |
|
|
|
unlink($_SESSION['temp_realpath_image']); |
|
|
|
} |
|
|
|
} |
|
|
|
$courseInfo = api_get_course_info(); |
|
|
|
$courseInfo = api_get_course_info(); |
|
|
|
|
|
|
|
$courseId = $courseInfo['real_id']; |
|
|
|
$course_dir = $courseInfo['directory'] . '/document'; |
|
|
|
$course_dir = $courseInfo['directory'] . '/document'; |
|
|
|
$sys_course_path = api_get_path(SYS_COURSE_PATH); |
|
|
|
$sys_course_path = api_get_path(SYS_COURSE_PATH); |
|
|
|
$base_work_dir = $sys_course_path . $course_dir; |
|
|
|
$base_work_dir = $sys_course_path . $course_dir; |
|
|
|
@ -131,6 +132,7 @@ if (!empty($groupId)) { |
|
|
|
$group_properties = GroupManager::get_group_properties($groupId); |
|
|
|
$group_properties = GroupManager::get_group_properties($groupId); |
|
|
|
// Let's assume the user cannot upload files for the group |
|
|
|
// Let's assume the user cannot upload files for the group |
|
|
|
$group_member_with_upload_rights = false; |
|
|
|
$group_member_with_upload_rights = false; |
|
|
|
|
|
|
|
$groupMemberWithEditRights = $is_allowed_to_edit || GroupManager::is_tutor_of_group($userId, $groupId, $courseId); |
|
|
|
|
|
|
|
|
|
|
|
if ($group_properties['doc_state'] == 2) { |
|
|
|
if ($group_properties['doc_state'] == 2) { |
|
|
|
// Documents are private |
|
|
|
// Documents are private |
|
|
|
@ -160,7 +162,10 @@ if (!empty($groupId)) { |
|
|
|
'name' => get_lang('GroupSpace').' '.$group_properties['name'] |
|
|
|
'name' => get_lang('GroupSpace').' '.$group_properties['name'] |
|
|
|
); |
|
|
|
); |
|
|
|
//allowed to upload? |
|
|
|
//allowed to upload? |
|
|
|
if ($is_allowed_to_edit || GroupManager::is_subscribed($userId, $groupId)) { |
|
|
|
if ($is_allowed_to_edit || |
|
|
|
|
|
|
|
GroupManager::is_subscribed($userId, $groupId) || |
|
|
|
|
|
|
|
GroupManager::is_tutor_of_group($userId, $groupId, $courseId) |
|
|
|
|
|
|
|
) { |
|
|
|
// Only courseadmin or group members can upload |
|
|
|
// Only courseadmin or group members can upload |
|
|
|
$group_member_with_upload_rights = true; |
|
|
|
$group_member_with_upload_rights = true; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -835,7 +840,7 @@ if ($is_certificate_mode) { |
|
|
|
$interbreadcrumb[] = array('url' => '../gradebook/index.php', 'name' => get_lang('Gradebook')); |
|
|
|
$interbreadcrumb[] = array('url' => '../gradebook/index.php', 'name' => get_lang('Gradebook')); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if ((isset($_GET['id']) && $_GET['id'] != 0) || isset($_GET['curdirpath']) || isset($_GET['createdir'])) { |
|
|
|
if ((isset($_GET['id']) && $_GET['id'] != 0) || isset($_GET['curdirpath']) || isset($_GET['createdir'])) { |
|
|
|
$interbreadcrumb[] = array('url' => 'document.php', 'name' => get_lang('Documents')); |
|
|
|
$interbreadcrumb[] = array('url' => 'document.php?'.api_get_cidreq(), 'name' => get_lang('Documents')); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Documents')); |
|
|
|
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Documents')); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1653,7 +1658,6 @@ if ($is_allowed_to_edit || |
|
|
|
$table_footer = ''; |
|
|
|
$table_footer = ''; |
|
|
|
$total_size = 0; |
|
|
|
$total_size = 0; |
|
|
|
$sortable_data = array(); |
|
|
|
$sortable_data = array(); |
|
|
|
|
|
|
|
|
|
|
|
if (isset($documentAndFolders) && is_array($documentAndFolders)) { |
|
|
|
if (isset($documentAndFolders) && is_array($documentAndFolders)) { |
|
|
|
if ($groupId == 0 || |
|
|
|
if ($groupId == 0 || |
|
|
|
GroupManager::user_has_access( |
|
|
|
GroupManager::user_has_access( |
|
|
|
@ -1680,6 +1684,7 @@ if (isset($documentAndFolders) && is_array($documentAndFolders)) { |
|
|
|
false |
|
|
|
false |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$invisibility_span_open = ($is_visible == 0) ? '<span class="muted">' : ''; |
|
|
|
$invisibility_span_open = ($is_visible == 0) ? '<span class="muted">' : ''; |
|
|
|
$invisibility_span_close = ($is_visible == 0) ? '</span>' : ''; |
|
|
|
$invisibility_span_close = ($is_visible == 0) ? '</span>' : ''; |
|
|
|
|
|
|
|
|
|
|
|
@ -1749,10 +1754,10 @@ if (isset($documentAndFolders) && is_array($documentAndFolders)) { |
|
|
|
' <div class="muted"><small>'.$last_edit_date."</small></div>"; |
|
|
|
' <div class="muted"><small>'.$last_edit_date."</small></div>"; |
|
|
|
|
|
|
|
|
|
|
|
$row[] = $invisibility_span_open.$display_date.$invisibility_span_close; |
|
|
|
$row[] = $invisibility_span_open.$display_date.$invisibility_span_close; |
|
|
|
|
|
|
|
|
|
|
|
// Admins get an edit column |
|
|
|
// Admins get an edit column |
|
|
|
if ($is_allowed_to_edit || $group_member_with_upload_rights || |
|
|
|
if ($is_allowed_to_edit || $groupMemberWithEditRights || |
|
|
|
is_my_shared_folder(api_get_user_id(), $curdirpath, $sessionId) |
|
|
|
is_my_shared_folder(api_get_user_id(), $curdirpath, $sessionId) || |
|
|
|
|
|
|
|
$document_data['insert_user_id'] == api_get_user_id() |
|
|
|
) { |
|
|
|
) { |
|
|
|
$is_template = isset($document_data['is_template']) ? $document_data['is_template'] : false; |
|
|
|
$is_template = isset($document_data['is_template']) ? $document_data['is_template'] : false; |
|
|
|
// If readonly, check if it the owner of the file or if the user is an admin |
|
|
|
// If readonly, check if it the owner of the file or if the user is an admin |
|
|
|
@ -1774,6 +1779,8 @@ if (isset($documentAndFolders) && is_array($documentAndFolders)) { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
$row[] = $edit_icons; |
|
|
|
$row[] = $edit_icons; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$row[] = ''; |
|
|
|
} |
|
|
|
} |
|
|
|
$row[] = $last_edit_date; |
|
|
|
$row[] = $last_edit_date; |
|
|
|
$row[] = $size; |
|
|
|
$row[] = $size; |
|
|
|
|