Tags new behavior in redmine_dmsf v1.6.0 and v1.6.1 #794

This commit is contained in:
Karel Picman 2017-11-02 12:49:09 +01:00
parent f7266c2efc
commit cb2ffafdda

View File

@ -595,8 +595,8 @@ class DmsfController < ApplicationController
else else
if tag if tag
@subfolders = [] @subfolders = []
folder_id = @folder.id if @folder @folder = nil
DmsfFolder.where(:project_id => @project.id, :dmsf_folder_id => folder_id, :system => false).visible.each do |f| DmsfFolder.where(:project_id => @project.id, :system => false).visible.each do |f|
f.custom_field_values.each do |v| f.custom_field_values.each do |v|
if v.custom_field_id == params[:custom_field_id].to_i if v.custom_field_id == params[:custom_field_id].to_i
if v.custom_field.compare_values?(v.value, params[:custom_value]) if v.custom_field.compare_values?(v.value, params[:custom_value])
@ -607,7 +607,7 @@ class DmsfController < ApplicationController
end end
end end
@files = [] @files = []
DmsfFile.where(:project_id => @project.id, :dmsf_folder_id => folder_id).visible.each do |f| DmsfFile.where(:project_id => @project.id).visible.each do |f|
r = f.last_revision r = f.last_revision
if r if r
r.custom_field_values.each do |v| r.custom_field_values.each do |v|
@ -621,7 +621,8 @@ class DmsfController < ApplicationController
end end
end end
@dir_links = [] @dir_links = []
DmsfLink.where(:project_id => @project.id, :target_type => DmsfFolder.model_name.to_s, :dmsf_folder_id => folder_id).where('target_id IS NOT NULL').visible.each do |l| DmsfLink.where(:project_id => @project.id, :target_type => DmsfFolder.model_name.to_s).where(
'target_id IS NOT NULL').visible.each do |l|
l.target_folder.custom_field_values.each do |v| l.target_folder.custom_field_values.each do |v|
if v.custom_field_id == params[:custom_field_id].to_i if v.custom_field_id == params[:custom_field_id].to_i
if v.custom_field.compare_values?(v.value, params[:custom_value]) if v.custom_field.compare_values?(v.value, params[:custom_value])
@ -632,7 +633,7 @@ class DmsfController < ApplicationController
end end
end end
@file_links = [] @file_links = []
DmsfLink.where(:project_id => @project.id, :target_type => DmsfFile.model_name.to_s, :dmsf_folder_id => folder_id).visible.each do |l| DmsfLink.where(:project_id => @project.id, :target_type => DmsfFile.model_name.to_s).visible.each do |l|
r = l.target_file.last_revision if l.target_file r = l.target_file.last_revision if l.target_file
if r if r
r.custom_field_values.each do |v| r.custom_field_values.each do |v|