Use group.iid

pull/2487/head
jmontoyaa 9 years ago
parent 039058374c
commit 2c664f1691
  1. 27
      main/document/document.php
  2. 6
      main/inc/lib/document.lib.php
  3. 3
      main/inc/lib/javascript/svgedit/extensions/imagelib/groups.php

@ -258,7 +258,7 @@ switch ($action) {
$base_work_dir,
$sessionId,
$_GET['deleteid'],
$groupId
$groupIid
);
if ($deleteDocument) {
@ -431,7 +431,7 @@ switch ($action) {
if (!isset($_GET['copy'])) {
Display::addFlash(Display::return_message($message, 'warning', false));
}
if (Security::remove_XSS($_GET['copy']) == 'yes') {
if ($_GET['copy'] === 'yes') {
if (!copy($file, $copyfile)) {
Display::addFlash(Display::return_message(get_lang('CopyFailed'), 'error'));
} else {
@ -578,7 +578,7 @@ if (isset($document_id) && empty($action)) {
api_get_course_id(),
$sessionId,
api_get_user_id(),
$groupId
$groupIid
);
if (!empty($document_data['filetype']) && $document_data['filetype'] == 'file') {
@ -903,10 +903,11 @@ $htmlHeadXtra[] = '<link rel="stylesheet" href="'.$js_path.'jquery-jplayer/skin/
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$js_path.'jquery-jplayer/jplayer/jquery.jplayer.min.js"></script>';
$mediaplayer_path = api_get_path(WEB_LIBRARY_PATH).'mediaplayer/player.swf';
$groupIid = isset($group_properties['iid']) ? $group_properties['iid'] : 0;
$documentAndFolders = DocumentManager::get_all_document_data(
$courseInfo,
$curdirpath,
$groupId,
$groupIid,
null,
$is_allowed_to_edit || $group_member_with_upload_rights,
false
@ -1010,7 +1011,7 @@ if ($is_allowed_to_edit ||
if (!empty($document_to_move)) {
$folders = DocumentManager::get_all_document_folders(
$courseInfo,
$groupId,
$groupIid,
$is_allowed_to_edit || $group_member_with_upload_rights
);
@ -1094,7 +1095,7 @@ if ($is_allowed_to_edit ||
$doc_id,
'FolderMoved',
api_get_user_id(),
$groupId,
$groupIid,
null,
null,
null,
@ -1108,7 +1109,7 @@ if ($is_allowed_to_edit ||
$doc_id,
'DocumentMoved',
api_get_user_id(),
$groupId,
$groupIid,
null,
null,
null,
@ -1234,7 +1235,7 @@ if ($is_allowed_to_edit ||
$base_work_dir,
$sessionId,
$documentId,
$groupId
$groupIid
);
if (!empty($deleteDocument)) {
$messages .= Display::return_message(
@ -1301,7 +1302,7 @@ if ($is_allowed_to_edit ||
$courseInfo,
api_get_user_id(),
$sessionId,
$groupId,
$groupIid,
$to_user_id,
$base_work_dir,
$dir_name,
@ -1512,7 +1513,7 @@ if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$documentAndFolders = DocumentManager::get_all_document_data(
$courseInfo,
$curdirpath,
$groupId,
$groupIid,
null,
$is_allowed_to_edit || $group_member_with_upload_rights,
true
@ -1521,7 +1522,7 @@ if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$documentAndFolders = DocumentManager::get_all_document_data(
$courseInfo,
$curdirpath,
$groupId,
$groupIid,
null,
$is_allowed_to_edit || $group_member_with_upload_rights,
false
@ -1537,14 +1538,14 @@ if ($groupId != 0) {
if ($userAccess) {
$folders = DocumentManager::get_all_document_folders(
$courseInfo,
$groupId,
$groupIid,
$is_allowed_to_edit || $group_member_with_upload_rights
);
}
} else {
$folders = DocumentManager::get_all_document_folders(
$courseInfo,
$groupId,
$groupIid,
$is_allowed_to_edit || $group_member_with_upload_rights
);
}

@ -739,7 +739,7 @@ class DocumentManager
* can show all folders (except for the deleted ones) or only visible ones
*
* @param array $_course
* @param int $to_group_id
* @param int $to_group_id iid
* @param boolean $can_see_invisible
*
* @return array with paths
@ -1113,7 +1113,7 @@ class DocumentManager
* @param string $base_work_dir, path to the documents folder (if not defined, $documentId must be used)
* @param int $sessionId The ID of the session, if any
* @param int $documentId The document id, if available
* @param int $groupId
* @param int $groupId iid
* @return boolean true/false
* @todo now only files/folders in a folder get visibility 2, we should rename them too.
* @todo We should be able to get rid of this later when using only documentId (check further usage)
@ -1124,7 +1124,7 @@ class DocumentManager
$base_work_dir = null,
$sessionId = null,
$documentId = null,
$groupId = null
$groupId = 0
) {
$TABLE_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);

@ -16,6 +16,7 @@ $course_info = api_get_course_info();
$groupId = api_get_group_id();
$group_properties = GroupManager::get_group_properties($groupId);
$groupIid = isset($group_properties['iid']) ? $group_properties['iid'] : 0;
$groupdirpath = $group_properties['directory'];
$group_disk_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$groupdirpath.'/';
$group_web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document'.$groupdirpath.'/';
@ -24,7 +25,7 @@ $group_web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document'
$docs_and_folders = DocumentManager::get_all_document_data(
$course_info,
$groupdirpath,
api_get_group_id(),
$groupIid,
null,
$is_allowed_to_edit,
false

Loading…
Cancel
Save