diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-19 09:58:46 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-19 10:03:44 +0200 |
commit | 945e973014404c31b0c99caa0481d4ef3b979bba (patch) | |
tree | 82a670a22911dd0efdbcf4be9a9442105d3d037c /sonar-server | |
parent | b6129546f9b6140246da78f49b18cce35fd4e7d6 (diff) | |
download | sonarqube-945e973014404c31b0c99caa0481d4ef3b979bba.tar.gz sonarqube-945e973014404c31b0c99caa0481d4ef3b979bba.zip |
SONAR-2426 Allow to directly assign a violation to users
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb | 4 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb | 3 |
2 files changed, 5 insertions, 2 deletions
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 2fe120b3e34..d4680a507d4 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 @@ -224,6 +224,7 @@ class ReviewsController < ApplicationController if !params[:comment_id].blank? && @violation.review @comment = @violation.review.comments.find(params[:comment_id]) end + @user_options = options_for_users() render :partial => 'reviews/violation_comment_form' end @@ -237,8 +238,9 @@ class ReviewsController < ApplicationController sanitize_violation(violation) unless violation.review + assignee = User.find params[:assignee_id] violation.create_review!( - :assignee => (params['assign_to_me']=='me' ? current_user : nil), + :assignee => assignee, :user => current_user) end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb index fbdd6635866..9d24f828639 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb @@ -18,7 +18,8 @@ <% if @violation.review.nil? || @violation.review.comments.size==0 %> - <%= check_box_tag "assign_to_me", "me", true -%> <label for="assign_to_me">Assign to me</label> + Assign to: + <%= select_tag "assignee_id", options_for_select(@user_options, current_user.id.to_s) %> <% end %> </td> <td class="sep"></td> |