Merge pull request #2 from finnlabs/feature/add_link_to_issue_index

Add link to XLS formatted issue list to issue index using hook
pull/6827/head
sschu 11 years ago
commit 0a369c591c
  1. 7
      app/views/hooks/different_formats/_view_issues_sidebar_issues_bottom.rhtml
  2. 3
      features/step_definitions/format_steps.rb
  3. 7
      features/xls_export_link.feature
  4. 7
      lib/open_project/xls_export/hooks/issue_hook.rb

@ -1,7 +0,0 @@
<h3><%= l(:different_formats) %></h3>
<% if params[:action] == "index" or params[:action] == "all" %>
<%= link_to l(:print_with_description), :controller => 'issues', :action => 'printable', :project_id => @project %><br />
<% if User.current.allowed_to? :export_issues, @project, :global => @project.nil? %>
<%= link_to l(:export_to_excel), :controller => 'issues', :action => 'index', :format => 'xls', :project_id => @project %><br />
<% end %>
<% end %>

@ -0,0 +1,3 @@
Then /^there should be a link to the issue list in ([^ ]+) format$/ do |format|
find_link(format)[:href].should == project_issues_path(:project_id => 1, :format => 'xls')
end

@ -0,0 +1,7 @@
Feature: Show link to XLS format below issue list
Scenario: There is a link to the issue list in XML format
Given there is a project named "Test Project"
And I am already admin
When I go to the issues index page for the project "Test Project"
Then there should be a link to the issue list in XLS format

@ -1,7 +1,8 @@
# Hooks to attach to the Redmine Issues.
module PrintableIssues
class IssueHook < Redmine::Hook::ViewListener
# Renders the Cost Object subject and basic costs information
render_on :view_issues_sidebar_issues_bottom, :partial => 'hooks/different_formats/view_issues_sidebar_issues_bottom'
# Add XLS format link below issue list
def view_issues_index_other_formats(context)
context[:link_formatter].link_to 'XLS', :url => { :project_id => context[:project].id }
end
end
end

Loading…
Cancel
Save