From 8ebe59fa3b65604653ebb14a2b7f9b6d5f205f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Wed, 25 Mar 2015 14:51:28 +0100 Subject: [PATCH] A simplier condition for the trash bin enabling --- app/controllers/dmsf_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 9877bc64..def3b251 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -129,12 +129,11 @@ class DmsfController < ApplicationController @ajax_upload_size = Setting.plugin_redmine_dmsf['dmsf_max_ajax_upload_filesize'].present? ? Setting.plugin_redmine_dmsf['dmsf_max_ajax_upload_filesize'] : 100 # Trash - @trash_visible = @folder_manipulation_allowed && @file_manipulation_allowed && @file_delete_allowed && !@locked_for_user && !@folder + @trash_visible = @folder_manipulation_allowed && @file_manipulation_allowed && + @file_delete_allowed && !@locked_for_user && !@folder @trash_enabled = DmsfFolder.deleted.where(:project_id => @project.id).any? || DmsfFile.deleted.where(:project_id => @project.id).any? || - DmsfLink.deleted.where(:project_id => @project.id, :target_type => DmsfFolder.model_name).any? || - DmsfLink.deleted.where(:project_id => @project.id, :target_type => DmsfFile.model_name).any? || - DmsfLink.deleted.where(:project_id => @project.id, :target_type => 'DmsfUrl').any? + DmsfLink.deleted.where(:project_id => @project.id).any? end def trash