]> source.dussan.org Git - sonarqube.git/commitdiff
Rename ACTION_PLANS.DEAD_LINE to DEADLINE
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 13 Feb 2012 15:31:49 +0000 (16:31 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 13 Feb 2012 15:31:49 +0000 (16:31 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/actionPlans/action_plans.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/planned_reviews.html.erb
sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb
sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_new.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb

index 301583d8b5db147c255c18ea98a3012d69a55158..208641dca2b96f33772d75a9ca066806d8784bf8 100644 (file)
@@ -1,7 +1,7 @@
 <%
    if has_role?(:user, @project)
      open_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id], 
-                                         :include => 'reviews', :order => 'dead_line ASC')
+                                         :include => 'reviews', :order => 'deadline ASC')
      
      div_id = "action-plan-widget-#{widget.id.to_s}"
 %>
@@ -36,7 +36,7 @@
       %>
       <tr>
         <td class="nowrap"><%= h(plan.name) -%></td>
-        <td class="nowrap small <%= 'over-due' if plan.over_due? -%>" style="text-align: right; padding-left:10px"><%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' '  -%></td>
+        <td class="nowrap small <%= 'over-due' if plan.over_due? -%>" style="text-align: right; padding-left:10px"><%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' '  -%></td>
         <% if plan.progress[:total]==0 %>
         <td class="noprogress nowrap"><%= message('action_plans.no_reviews_linked_to_action_plan') -%></td>
         <% else %>
index cbb0a088b0b67a0504b333b4ad054327422a8c59..f09cff1e97060e7159b3e67aedcb749cc5b68647 100644 (file)
@@ -14,7 +14,7 @@
      title = message('widget.planned_reviews.name')
      
      open_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id], 
-                                         :include => 'reviews', :order => 'dead_line ASC')
+                                         :include => 'reviews', :order => 'deadline ASC')
      
      if open_action_plans.empty? 
 %>
index a34905e1662ef7983fe6b8887e688164079be203..347dab1c6085e07178bbb0a3f45963260e511e72 100644 (file)
@@ -44,12 +44,12 @@ class ActionPlansController < ApplicationController
     
     @action_plan.name = params[:name]
     @action_plan.description = params[:description]
-    unless params[:dead_line].blank?
+    unless params[:deadline].blank?
       begin
-        dead_line = DateTime.strptime(params[:dead_line], '%d/%m/%Y')
+        deadline = DateTime.strptime(params[:deadline], '%d/%m/%Y')
         # we check if the date is today or in the future
-        if dead_line > 1.day.ago
-          @action_plan.dead_line = dead_line
+        if deadline > 1.day.ago
+          @action_plan.deadline = deadline
         else
           date_not_valid = message('action_plans.date_cant_be_in_past')
         end 
@@ -93,8 +93,8 @@ class ActionPlansController < ApplicationController
   end
   
   def load_action_plans
-    @open_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_OPEN, @resource.id], :include => 'reviews', :order => 'dead_line ASC')
-    @closed_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_CLOSED, @resource.id], :include => 'reviews', :order => 'dead_line DESC')
+    @open_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_OPEN, @resource.id], :include => 'reviews', :order => 'deadline ASC')
+    @closed_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_CLOSED, @resource.id], :include => 'reviews', :order => 'deadline DESC')
   end
 
 end
index ebec35e6847c72d310f4d5e567e4864e7bddc035..4c532642ce8b90d2e2238c5bd08b005767ff3b34 100644 (file)
@@ -62,7 +62,7 @@ class ActionPlan < ActiveRecord::Base
   end
   
   def over_due?
-    dead_line ? status==STATUS_OPEN && dead_line.past? : false
+    deadline ? status==STATUS_OPEN && deadline.past? : false
   end
   
   private
index 838e644b9fb48d3798a18bbadb0c9dbb8baf1c30..0f920221930b345b87480e88726d85dbd4ef7f62 100644 (file)
@@ -17,7 +17,7 @@
         <td class="left" valign="top">
         <%= message('action_plans.col.due_for') -%>:
         <br/>
-        <input type="text" name="dead_line" id="dead_line" value="<%= @action_plan && @action_plan.dead_line ? @action_plan.dead_line.strftime('%d/%m/%Y') : params[:dead_line] -%>"/>
+        <input type="text" name="deadline" id="deadline" value="<%= @action_plan && @action_plan.deadline ? @action_plan.deadline.strftime('%d/%m/%Y') : params[:deadline] -%>"/>
         <br/>
         <span class="note"><%= message('action_plans.date_format_help') -%></span>
         </td>
index 5a6b01575fe0e6bb805f6a289104abc268296ebb..9b3dc1dbc51ff68a0e1f73dbfb6ec01244d9c673 100644 (file)
@@ -26,7 +26,7 @@
           <tr>
             <td class="thin nowrap center"><img src="<%= ApplicationController.root_context -%>/images/status/<%= plan.status -%>.png" title="<%= message(plan.status.downcase).capitalize -%>"/></td>
             <td class="thin nowrap"><%= h(plan.name) -%></td>
-            <td class="thin nowrap <%= 'over-due' if plan.over_due? -%>" align="right" x="<%= plan.dead_line ? plan.dead_line.tv_sec : '' -%>"><%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' '  -%></td>
+            <td class="thin nowrap <%= 'over-due' if plan.over_due? -%>" align="right" x="<%= plan.deadline ? plan.deadline.tv_sec : '' -%>"><%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' '  -%></td>
             <% if plan.progress[:total]==0 %>
             <td class="noprogress thin nowrap">
               <%= message('action_plans.no_reviews_linked_to_action_plan') -%>
@@ -83,7 +83,7 @@
           <tr>
             <td class="thin nowrap center"><img src="<%= ApplicationController.root_context -%>/images/status/<%= plan.status -%>.png" title="<%= message(plan.status.downcase).capitalize -%>"/></td>
             <td class="thin nowrap"><%= h(plan.name) -%></td>
-            <td class="thin nowrap <%= 'over-due' if plan.over_due? -%>" align="right" x="<%= plan.dead_line ? plan.dead_line.tv_sec : '' -%>"><%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' ' -%></td>
+            <td class="thin nowrap <%= 'over-due' if plan.over_due? -%>" align="right" x="<%= plan.deadline ? plan.deadline.tv_sec : '' -%>"><%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' ' -%></td>
             <td class="thin nowrap" align="right" x="<%= plan.updated_at.tv_sec -%>"><%= plan.updated_at.strftime("%d %b %Y") -%></td>
             <% if plan.progress[:total]==0 %>
             <td class="noprogress thin nowrap">