diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-07-29 17:52:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-07-29 17:52:27 +0000 |
commit | efc05bc73cf53e2c9d57147f7226f9b17a6350ce (patch) | |
tree | 3f7f5f239bf1e1a298f1d26cf459d0524fad3e4a /app/models/time_entry.rb | |
parent | 41e7210210b5e50bf57bbcf41259a4d343bba1f0 (diff) | |
download | redmine-efc05bc73cf53e2c9d57147f7226f9b17a6350ce.tar.gz redmine-efc05bc73cf53e2c9d57147f7226f9b17a6350ce.zip |
Add time entries custom fields to the context menu for quick bulk edit (#17484).
git-svn-id: http://svn.redmine.org/redmine/trunk@13335 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r-- | app/models/time_entry.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index cfca47639..103d5ae62 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -126,4 +126,14 @@ class TimeEntry < ActiveRecord::Base def editable_by?(usr) (usr == user && usr.allowed_to?(:edit_own_time_entries, project)) || usr.allowed_to?(:edit_time_entries, project) end + + # Returns the custom_field_values that can be edited by the given user + def editable_custom_field_values(user=nil) + visible_custom_field_values + end + + # Returns the custom fields that can be edited by the given user + def editable_custom_fields(user=nil) + editable_custom_field_values(user).map(&:custom_field).uniq + end end |