mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 03:15:57 +01:00
Replaces TimeEntry.visible_by with a visible scope.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5149 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@@ -156,11 +156,10 @@ class ProjectsController < ApplicationController
|
||||
:include => [:project, :status, :tracker],
|
||||
:conditions => cond)
|
||||
|
||||
TimeEntry.visible_by(User.current) do
|
||||
@total_hours = TimeEntry.sum(:hours,
|
||||
:include => :project,
|
||||
:conditions => cond).to_f
|
||||
if User.current.allowed_to?(:view_time_entries, @project)
|
||||
@total_hours = TimeEntry.visible.sum(:hours, :include => :project, :conditions => cond).to_f
|
||||
end
|
||||
|
||||
@key = User.current.rss_key
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
Reference in New Issue
Block a user