Fix: due to a bad if in Lockable::lock did not traverse the heirarchy as expected

This commit is contained in:
Daniel Munn 2012-06-27 11:41:03 +01:00
parent c9d6c32ba4
commit 86bc901965
2 changed files with 3 additions and 3 deletions

View File

@ -154,8 +154,8 @@
<%= file.last_revision.updated_at.strftime("%Y-%m-%d %H:%M") %>
<% if file.locked_for_user? %>
<%= link_to(image_tag("locked.png", :plugin => :redmine_dmsf),
{:controller => "users", :action => "show", :id => file.locks[0].user },
:title => l(:title_locked_by_user, :user => file.locks[0].user.to_s)) %>
{:controller => "users", :action => "show", :id => file.lock.reverse[0].user },
:title => l(:title_locked_by_user, :user => file.lock.reverse[0].user.to_s)) %>
<% elsif file.locked? %>
<%= image_tag("lockedbycurrent.png", :title => l(:title_locked_by_you), :plugin => :redmine_dmsf) %>
<% end %>

View File

@ -16,7 +16,7 @@ module RedmineDmsf
}
end
if tree
ret = ret | (folder.locks || folder.lock) unless folder.nil?
ret = ret | (folder.locks.empty? ? folder.lock : folder.locks) unless folder.nil?
end
return ret
end