From b56f77322ac2f6a900ba011e767446e17401cf6f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 19 Apr 2016 18:40:38 +0000 Subject: Adds a "New issue" link on the global issue list (#6204). git-svn-id: http://svn.redmine.org/redmine/trunk@15345 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/routes_helper.rb | 8 ++++++++ app/views/issues/index.html.erb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb index 06f292d36..b8415a510 100644 --- a/app/helpers/routes_helper.rb +++ b/app/helpers/routes_helper.rb @@ -29,6 +29,14 @@ module RoutesHelper end end + def _new_project_issue_path(project, *args) + if project + new_project_issue_path(project, *args) + else + new_issue_path(*args) + end + end + def _project_calendar_path(project, *args) project ? project_calendar_path(project, *args) : issues_calendar_path(*args) end diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 2e971711f..7dcba2629 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,6 +1,6 @@
- <% if @project && User.current.allowed_to?(:add_issues, @project) && @project.trackers.any? %> - <%= link_to l(:label_issue_new), new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> + <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || @project.trackers.any?) %> + <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> <% end %>
-- cgit v1.2.3