]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2399 Make the differential mode work on Derby and "More" links
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 7 Dec 2011 16:39:49 +0000 (17:39 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 7 Dec 2011 16:39:49 +0000 (17:39 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/my_reviews.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb
sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb

index e0429e02b3ac4dccb0398b7548670dcf026103f7..6dcd5a29f2a42b232c61b6983a96a788e608551f 100644 (file)
@@ -1,12 +1,17 @@
 <% 
   if has_role?(:user, @project)
     limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
+    
+    if @dashboard_configuration.selected_period?
+      from_date = @dashboard_configuration.from_datetime
+      to_date = @snapshot.created_at
+    end
 %>
 
 <div class="line-block">
   <div style="float:right">
     <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id], :false_positives => 'only',
-                         :assignee_login => '', :statuses => [''] -%>">
+                         :assignee_login => '', :statuses => [''], :from => from_date, :to => to_date -%>">
       <%= message('widgets.more') -%>
     </a>
   </div>
index 52fe8206a86f7285bc80b646af77f15e632f3376..9e51c9ab19e632e6fc4aa285b32e28e1bcd096e5 100644 (file)
@@ -1,11 +1,16 @@
 <% 
   if current_user && has_role?(:user, @project)
     limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
+    
+    if @dashboard_configuration.selected_period?
+      from_date = @dashboard_configuration.from_datetime
+      to_date = @snapshot.created_at
+    end
 %>
 
 <div class="line-block">
   <div style="float:right">
-    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id] -%>">
+    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id], :from => from_date, :to => to_date -%>">
       <%= message('widgets.more') -%>
     </a>
   </div>
index a82e6bb5e05605c180d9f230398c1e8cf56bdd91..0f4017e1615accc7cc9fedd9397d4d55df453f94 100644 (file)
@@ -1,11 +1,17 @@
 <% 
   if has_role?(:user, @project)
     limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
+    
+    if @dashboard_configuration.selected_period?
+      from_date = @dashboard_configuration.from_datetime
+      to_date = @snapshot.created_at
+    end
 %>
 
 <div class="line-block">
   <div style="float:right">
-    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id], :assignee_login => '' -%>">
+    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id], 
+                         :assignee_login => '', :from => from_date, :to => to_date -%>">
       <%= message('widgets.more') -%>
     </a>
   </div>
index 9c9495522900180cb183a755b6a683f0365f69aa..8631455ae9635dfb3062706822ba2ef2dbf936f4 100644 (file)
@@ -330,8 +330,8 @@ class ReviewsController < ApplicationController
     @id = params[:review_id] || ''
     @sort = params[:sort]
     @asc = params[:asc] == "true"
-    @from = params[:from]
-    @to = params[:to]
+    @from = Time.parse(params[:from]) if params[:from]
+    @to = Time.parse(params[:to]) if params[:to]
   end
 
   def filter_any(array)