issue.set_severity.submit=Set Severity
issue.do_plan=Plan
issue.plan.submit=Plan
+issue.unplanned=Unplanned
issue.unplan.submit=Unplan
issue.plan_must_be_created_first=An action plan should be first created to plan the remediation effort of this issue.
issue.status.REOPENED=Reopened
and ap.status='OPEN'
and ap.project_id=p.id
</where>
+ order by deadline
</select>
<select id="findByNameAndProjectId" parameterType="long" resultType="ActionPlanIssue">
@action_plan = action_plan_result.get()
redirect_to :action => 'index', :id => @resource.id
else
- flash[:error] = ""
- action_plan_result.errors().each_with_index do |msg, index|
- flash[:error] << message(msg.text(), {:params => msg.params()}).capitalize
- flash[:error] += "<br/>" if index < action_plan_result.errors().size() - 1
- end
+ flash[:error] = action_plan_result.errors().map{|error| error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)}.join('<br/>')
load_action_plans()
render 'index'
end
#
# == Options
# * :format - See Ruby on Rails localization options
+ # * :time_if_today - true to only display the time when the date is today.
#
def format_datetime(object, options={})
return nil unless object
else
dt = object
end
- l(dt, options)
+ if options[:time_if_today] && (Date.today - date.to_date == 0)
+ dt.strftime('%H:%M')
+ else
+ l(dt, options)
+ end
end
# Since 3.6
# java.util.Date is supported
#
# == Options
- # * :format - See Ruby on Rails localization options
+ # * :format - values are :short, :default, :long. See Ruby on Rails localization for more details.
+ # * :time_if_today - true to only display the time when the date is today.
#
def format_date(object, options={})
return nil unless object
+
+ dt = object
+ date = object
if object.is_a?(Java::JavaUtil::Date)
- date = Api::Utils.java_to_ruby_datetime(object).to_date
- elsif object.respond_to?(:to_date)
+ dt = Api::Utils.java_to_ruby_datetime(object)
+ date = dt.to_date
+ elsif object.is_a?(DateTime)
+ dt = object
date = object.to_date
+ end
+ if options[:time_if_today] && (Date.today - date.to_date == 0)
+ dt.strftime('%H:%M')
else
- date = object
+ l(date, options)
end
- l(date, options)
end
def sonar_version
<%
plans_select_box_id = "plans-#{params[:issue]}"
- plans = Internal.issues.findOpenActionPlans(params[:issue]).sort_by { |plan| plan.deadLine }
+ plans = Internal.issues.findOpenActionPlans(params[:issue])
if plans.empty?
<%
else
first_plan = plans[0]
- plan_options = options_for_select([[]] + plans.map { |plan|
+ plan_options = options_for_select([[message('issue.unplanned'), '']] + plans.map { |plan|
if plan.deadLine
label = "#{h plan.name} (#{format_date(plan.deadLine)})"
else
<tr>
<td class="thin nowrap center"><img src="<%= ApplicationController.root_context -%>/images/status/<%= plan.status() -%>.png" title="<%= message('issues_action_plans.status' + plan.status()) -%>"/></td>
<td class="thin nowrap"><%= h(plan.name()) -%></td>
- <td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right" x="<%= deadline ? deadline.tv_sec : '' -%>"><%= format_date(plan.deadLine()) -%></td>
+ <td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right" x="<%= deadline ? deadline.tv_sec : '' -%>"><%= format_date(plan.deadLine(), :time_if_today => true) -%></td>
<% if plan.totalIssues()==0 %>
<td class="noprogress thin nowrap">
<%= message('issues_action_plans.no_issues_linked_to_action_plan') -%>