diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-04 11:51:17 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-04 11:51:17 +0000 |
commit | 87945f2ff536a3a734f2e19bc286dce402c0a10b (patch) | |
tree | 119e5d46542bf269db1e67e792338786d4477404 | |
parent | 3b20bd76a8e59259f7d2e98fe8ede27826abe397 (diff) | |
download | redmine-87945f2ff536a3a734f2e19bc286dce402c0a10b.tar.gz redmine-87945f2ff536a3a734f2e19bc286dce402c0a10b.zip |
add context menu in time entries for bulk edit (#7996).
Contributed by Adam Soltys.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5309 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/context_menus/time_entries.html.erb | 27 | ||||
-rw-r--r-- | config/locales/en.yml | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/app/views/context_menus/time_entries.html.erb b/app/views/context_menus/time_entries.html.erb new file mode 100644 index 000000000..0eeac9787 --- /dev/null +++ b/app/views/context_menus/time_entries.html.erb @@ -0,0 +1,27 @@ +<ul> + <% if !@time_entry.nil? -%> + <li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry}, + :class => 'icon-edit', :disabled => !@can[:edit] %></li> + <% else %> + <li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)}, + :class => 'icon-edit', :disabled => !@can[:edit] %></li> + <% end %> + + <%= call_hook(:view_time_entries_context_menu_start, {:time_entries => @time_entries, :can => @can, :back => @back }) %> + + <% if @activities.present? -%> + <li class="folder"> + <a href="#" class="submenu"><%= l(:field_activity) %></a> + <ul> + <% @activities.each do |u| -%> + <li><%= context_menu_link u.name, {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => u}, :back_url => @back}, :method => :post, + :selected => (@time_entry && u == @time_entry.activity), :disabled => !@can[:update] %></li> + <% end -%> + <li><%= context_menu_link l(:label_nobody), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => 'none'}, :back_url => @back}, :method => :post, + :selected => (@time_entry && @time_entry.activity.nil?), :disabled => !@can[:update] %></li> + </ul> + </li> + <% end %> + + <%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %> +</ul> diff --git a/config/locales/en.yml b/config/locales/en.yml index c8f08307a..2d8efb4dd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -735,6 +735,7 @@ en: label_default_columns: Default columns label_no_change_option: (No change) label_bulk_edit_selected_issues: Bulk edit selected issues + label_bulk_edit_selected_time_entries: Bulk edit selected time entries label_theme: Theme label_default: Default label_search_titles_only: Search titles only |