@ -465,7 +512,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
======================================*/
if ((isset($_GET['set_invisible']) && !empty($_GET['set_invisible'])) || (isset($_GET['set_visible']) && !empty($_GET['set_visible'])) AND $_GET['set_visible']<>'*' AND $_GET['set_invisible']<>'*')
{
{
//make visible or invisible?
if(isset($_GET['set_visible']))
{
@ -476,7 +523,16 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
if (DocumentManager::is_folder($_course, $document_id))
{
if (!empty($file))
{
$path=$file;
$what_to_check_sql = "SELECT td.id, readonly, tp.insert_user_id FROM ".$TABLE_DOCUMENT." td , $TABLE_PROPERTY tp WHERE tp.ref= td.id and (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
$sql = "UPDATE $TABLE_DOCUMENT set path = '".$new_item_path."' WHERE id = ".$deleted_items['id'];
api_sql_query($sql, __FILE__, __LINE__);
}
@ -767,12 +891,12 @@ class DocumentManager
}
else
{
//Couldn't rename - file permissions problem?
//Couldn't rename - file permissions problem?
error_log(__FILE__.' '.__LINE__.': Error renaming '.$base_work_dir.$path.' to '.$base_work_dir.$new_path.'. This is probably due to file permissions',0);
}
}
else
{
{ //echo $base_work_dir.$path;
//The file or directory isn't there anymore (on the filesystem)
// This means it has been removed externally. To prevent a
// blocking error from happening, we drop the related items from the
@ -780,7 +904,8 @@ class DocumentManager
error_log(__FILE__.' '.__LINE__.': System inconsistency detected. The file or directory '.$base_work_dir.$path.' seems to have been removed from the filesystem independently from the web platform. To restore consistency, the elements using the same path will be removed from the database',0);
$sql = "SELECT id FROM $TABLE_DOCUMENT WHERE path='".$path."' OR path LIKE BINARY '".$path."/%'";
$res = Database::query($sql,__FILE__,__LINE__);
while ( $row = Database::fetch_array($res) ) {
while ( $row = Database::fetch_array($res) )
{
$sqlipd = "DELETE FROM $TABLE_ITEMPROPERTY WHERE ref = ".$row['id']." AND tool='".TOOL_DOCUMENT."'";