2011-04-04 15:51:17 +04:00
|
|
|
<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 }) %>
|
|
|
|
|
2011-09-18 03:10:11 +04:00
|
|
|
<% if @activities.present? -%>
|
2011-09-18 05:58:32 +04:00
|
|
|
<li class="folder">
|
2011-09-18 03:10:11 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_activity) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @activities.each do |u| -%>
|
2011-12-14 23:20:19 +04:00
|
|
|
<li><%= context_menu_link h(u.name), {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => u}, :back_url => @back}, :method => :post,
|
2011-11-25 01:31:21 +04:00
|
|
|
:selected => (@time_entry && u == @time_entry.activity), :disabled => !@can[:edit] %></li>
|
2011-09-18 03:10:11 +04:00
|
|
|
<% end -%>
|
2011-12-14 23:20:19 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => 'none'}, :back_url => @back}, :method => :post,
|
2011-11-25 01:31:21 +04:00
|
|
|
:selected => (@time_entry && @time_entry.activity.nil?), :disabled => !@can[:edit] %></li>
|
2011-09-18 03:10:11 +04:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2011-04-04 15:51:17 +04:00
|
|
|
|
|
|
|
<%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
|
2011-04-04 15:54:47 +04:00
|
|
|
|
|
|
|
<li>
|
2011-09-17 10:01:59 +04:00
|
|
|
<%= context_menu_link l(:button_delete),
|
2011-04-04 15:54:47 +04:00
|
|
|
{:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back},
|
2012-07-07 18:36:49 +04:00
|
|
|
:method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon-del', :disabled => !@can[:delete] %>
|
2011-04-04 15:54:47 +04:00
|
|
|
</li>
|
2011-04-04 15:51:17 +04:00
|
|
|
</ul>
|