WebDAV folder listing optimization
This commit is contained in:
parent
8955ac1b37
commit
51f355b861
@ -49,10 +49,10 @@ module RedmineDmsf
|
||||
unless @childern
|
||||
@children = []
|
||||
if collection?
|
||||
folder.subfolders.visible.map do |p|
|
||||
folder.subfolders.select(:title).visible.map do |p|
|
||||
@children.push child(p.title)
|
||||
end
|
||||
folder.files.visible.map do |p|
|
||||
folder.files.select(:name).visible.map do |p|
|
||||
@children.push child(p.name)
|
||||
end
|
||||
end
|
||||
|
||||
@ -26,7 +26,8 @@ module RedmineDmsf
|
||||
def children
|
||||
unless @projects
|
||||
@projects = []
|
||||
Project.has_module(:dmsf).where(Project.allowed_to_condition(
|
||||
Project.select(:identifier).has_module(:dmsf).where(
|
||||
Project.allowed_to_condition(
|
||||
User.current, :view_dmsf_folders)).order('lft').all.each do |p|
|
||||
@projects << child(p.identifier)
|
||||
end
|
||||
|
||||
@ -27,10 +27,10 @@ module RedmineDmsf
|
||||
unless @children
|
||||
@children = []
|
||||
if project
|
||||
project.dmsf_folders.visible.map do |p|
|
||||
project.dmsf_folders.select(:title).visible.map do |p|
|
||||
@children.push child(p.title)
|
||||
end
|
||||
project.dmsf_files.visible.map do |p|
|
||||
project.dmsf_files.select(:name).visible.map do |p|
|
||||
@children.push child(p.name)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user