diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-03-12 11:46:13 +0100 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-03-12 19:07:27 +0100 |
commit | 18cf6708dd84434f12ddd5753696b63e45ea8f2b (patch) | |
tree | ffce6c411e66b2b08636e760b4c529395a488674 /sonar-server/src/main/webapp/WEB-INF | |
parent | 07db63ba9bfa369959817d23bf44bc9a594b82c1 (diff) | |
download | sonarqube-18cf6708dd84434f12ddd5753696b63e45ea8f2b.tar.gz sonarqube-18cf6708dd84434f12ddd5753696b63e45ea8f2b.zip |
SONAR-3278 Incorrect breadcrumb link on review listing
=> when someone clicks on the links of an action plan.
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
4 files changed, 13 insertions, 10 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_reviews_controller.rb index 1c51b408fd4..bb973147d3e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_reviews_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_reviews_controller.rb @@ -30,7 +30,8 @@ class ProjectReviewsController < ApplicationController # lists all the reviews of a project, filtered using the same parameters as for the review WS API def index - @project=Project.by_key(params[:projects]) + @project=Project.by_key(params[:id]) + @project=Project.by_key(params[:projects]) unless @project if @project access_denied unless has_role?(:user, @project) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb index 44fceda2fef..b6325df13f3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb @@ -306,9 +306,9 @@ class ReviewsController < ApplicationController end unless @id == '' if Api::Utils.is_integer? @id - options['id'] = @id + options['ids'] = @id else - options['id'] = -1 + options['ids'] = '-1' end end options['sort'] = @sort unless @sort.blank? diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb index 55e139b8d15..56d566ae9c1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb @@ -260,13 +260,15 @@ class Review < ActiveRecord::Base conditions=[] values={} - if options['id'].present? - conditions << 'id=:id' - values[:id]=options['id'].to_i - elsif options['ids'].present? + if options['ids'].present? ids=options['ids'].split(',') - conditions << 'id in (:ids)' - values[:ids]=ids.map { |id| id.to_i } + if ids.size > 1 + conditions << 'id in (:ids)' + values[:ids]=ids.map { |id| id.to_i } + else + conditions << 'id=:id' + values[:id]=ids[0].to_i + end else # --- 'review_type' is deprecated since 2.9 --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb index acb27dfee64..8948b7dbaee 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb @@ -1,6 +1,6 @@ <% unless action_plan.progress[:total]==0 - options = {:controller => 'project_reviews', :action => 'index', :action_plan_id => action_plan.id, :projects => action_plan.project_id} + options = {:controller => 'project_reviews', :action => 'index', :action_plan_id => action_plan.id, :id => action_plan.project_id} resolved_reviews_link = action_plan.progress[:resolved].to_s resolved_reviews_link = link_to action_plan.progress[:resolved].to_s, options.merge({:statuses => "#{Review::STATUS_RESOLVED},#{Review::STATUS_CLOSED}"}) unless action_plan.progress[:resolved]==0 |