fixed the admin user who is used to scope the visibility

pull/981/head
Jonas Heinrich 11 years ago
parent 912ed6a6c0
commit 1854b3b1ff
  1. 3
      app/views/my/blocks/_issuesreportedbyme.html.erb
  2. 3
      app/views/users/show.html.erb

@ -30,8 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.
:limit => 10,
:include => [ :status, :project, :type ],
:order => "#{WorkPackage.table_name}.updated_at DESC") %>
<% admin_user = User.admin.count == 1 ? User.admin : User.admin.first %>
<% reported_count = WorkPackage.visible(admin_user).count(:conditions => { :author_id => User.current.id }) %>
<% reported_count = WorkPackage.visible(User.admin.first).count(:conditions => { :author_id => User.current.id }) %>
<h3><%=l(:label_reported_work_packages)%> (<%= reported_count %>)</h3>

@ -77,8 +77,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= link_to l(:label_activity), :controller => '/activities', :action => 'index', :id => nil, :user_id => @user, :from => @events_by_day.keys.first %>
</h3>
<p>
<% admin_user = User.admin.count == 1 ? User.admin : User.admin.first %>
<%=l(:label_reported_work_packages)%>: <%= WorkPackage.visible(admin_user).count(:conditions => ["author_id=?", @user.id]) %>
<%=l(:label_reported_work_packages)%>: <%= WorkPackage.visible(User.admin.first).count(:conditions => ["author_id=?", @user.id]) %>
</p>
<div id="activity">
<% @events_by_day.keys.sort.reverse.each do |day| %>

Loading…
Cancel
Save