issue.transition.falsepositive=False-Positive
issue.transition.reopen=Reopen
issue.transition.close=Close
-issue.set_severity=Set Severity
-issue.set_severity.submit=Set Severity
+issue.set_severity=Change Severity
+issue.set_severity.submit=Change Severity
issue.do_plan=Plan
issue.plan.submit=Plan
issue.unplanned=Unplanned
action_plans.create_form_title=Create Action Plan
action_plans.edit_action_plan=Edit Action Plan
action_plans.same_name_in_same_project=An action plan with this name already exists in this project.
-action_plans.date_format_help=The date should be entered using the following pattern: 'day/month/year'. For instance, '31/12/2011'.
+action_plans.date_format_help=The date should be entered using the following pattern: 'year-month-day'. For instance, '2014-12-31'.
action_plans.date_not_valid=Date not valid
action_plans.date_cant_be_in_past=The dead-line can't be in the past
action_plans.closed_action_plan=Closed Action Plans
<div class="line-block">
<% if has_role?(:admin, @project) %>
<div style="float:right">
- <a href="<%= url_for :controller => 'issues_action_plans', :action => 'index', :id => @project.id -%>">
+ <a href="<%= url_for :controller => 'action_plans', :action => 'index', :id => @project.id -%>">
<%= message('widgets.more') -%>
</a>
</div>
import com.google.common.base.Objects;
import com.google.common.base.Strings;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.time.DateUtils;
import org.sonar.api.ServerComponent;
import org.sonar.api.issue.ActionPlan;
import org.sonar.api.issue.Issue;
import org.sonar.api.issue.IssueComment;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.Severity;
+import org.sonar.api.utils.DateUtils;
+import org.sonar.api.utils.SonarException;
import org.sonar.core.issue.ActionPlanStats;
import org.sonar.core.issue.DefaultActionPlan;
import org.sonar.core.issue.DefaultIssue;
import org.sonar.server.util.RubyUtils;
import javax.annotation.Nullable;
-import java.text.SimpleDateFormat;
+
import java.util.Collection;
import java.util.Date;
import java.util.List;
if (!Strings.isNullOrEmpty(deadLineParam)) {
try {
- SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
- deadLine = dateFormat.parse(deadLineParam);
+ deadLine = DateUtils.parseDate(deadLineParam);
Date today = new Date();
- if (deadLine.before(today) && !DateUtils.isSameDay(deadLine, today)) {
+ if (deadLine.before(today) && !org.apache.commons.lang.time.DateUtils.isSameDay(deadLine, today)) {
result.addError(Result.Message.ofL10n("action_plans.date_cant_be_in_past"));
}
- } catch (Exception e) {
+ } catch (SonarException e) {
result.addError(Result.Message.ofL10n("errors.is_not_valid", "date"));
}
}
Internal.issues.setSeverity(issue_key, params[:severity])
elsif action_type=='plan'
Internal.issues.plan(issue_key, params[:plan])
+ elsif action_type=='unplan'
+ Internal.issues.plan(issue_key, nil)
end
@issue_results = Api.issues.find(issue_key)
<td class="thin nowrap center">
<img src="<%= ApplicationController.root_context -%>/images/status/<%= plan.status() -%>.png" title="<%= message("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"><%= format_date(plan.deadLine(), :time_if_today => true) -%></td>
+ <td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right"><%= format_date(plan.deadLine()) -%></td>
<% if plan.totalIssues()==0 %>
<td class="noprogress thin nowrap">
<%= message('action_plans.no_issues_linked_to_action_plan') -%>
<%
else
first_plan = plans[0]
- plan_options = options_for_select([[message('issue.unplanned'), '']] + plans.map { |plan|
+ plan_options = options_for_select(plans.map { |plan|
if plan.deadLine
label = "#{h plan.name} (#{format_date(plan.deadLine)})"
else
%>
<form method="POST">
<input type="hidden" name="issue" value="<%= params[:issue] -%>"/>
- <input type="hidden" name="id" value="plan"/>
+ <input type="hidden" id="action-<%= plans_select_box_id %>" name="id" value="plan"/>
<%= dropdown_tag('plan', plan_options, {:show_search_box => false}, {:id => plans_select_box_id}) -%>
<% if @issue.actionPlanKey %>
<%= image_tag 'sep12.png' -%>
- <input type="button" value="<%= message('issue.unplan.submit') -%>" onclick="$j('#<%= plans_select_box_id -%>').val('');$j('#<%= plans_select_box_id -%>').prop('disabled', false);submitIssueForm(this)">
+ <input type="button" value="<%= message('issue.unplan.submit') -%>"
+ onclick="$j('#action-<%= plans_select_box_id %>').val('unplan'); $j('#<%= plans_select_box_id -%>').prop('disabled', false); submitIssueForm(this)">
<% end %>
<%= link_to_function message('cancel'), 'closeIssueForm(this)' -%>
<span class="loading hidden"></span>
parameters.put("name", "Long term");
parameters.put("description", "Long term issues");
parameters.put("project", "org.sonar.Sample");
- parameters.put("deadLine", "13/05/2113");
+ parameters.put("deadLine", "2113-05-13");
ArgumentCaptor<ActionPlan> actionPlanCaptor = ArgumentCaptor.forClass(ActionPlan.class);
Result result = internalRubyIssueService.createActionPlan(parameters);
Map<String, String> parameters = newHashMap();
parameters.put("name", "New Long term");
parameters.put("description", "New Long term issues");
- parameters.put("deadLine", "13/05/2113");
+ parameters.put("deadLine", "2113-05-13");
ArgumentCaptor<ActionPlan> actionPlanCaptor = ArgumentCaptor.forClass(ActionPlan.class);
Result result = internalRubyIssueService.updateActionPlan("ABCD", parameters);
Map<String, String> parameters = newHashMap();
parameters.put("name", "New Long term");
parameters.put("description", "New Long term issues");
- parameters.put("deadLine", "13/05/2113");
+ parameters.put("deadLine", "2113-05-13");
parameters.put("project", "org.sonar.MultiSample");
ArgumentCaptor<ActionPlan> actionPlanCaptor = ArgumentCaptor.forClass(ActionPlan.class);
parameters.put("name", "Long term");
parameters.put("description", "Long term issues");
parameters.put("project", "org.sonar.Sample");
- parameters.put("deadLine", "2013-05-18");
+ parameters.put("deadLine", "18/05/2013");
Result result = internalRubyIssueService.createActionPlanResult(parameters);
assertThat(result.ok()).isFalse();
parameters.put("name", "Long term");
parameters.put("description", "Long term issues");
parameters.put("project", "org.sonar.Sample");
- parameters.put("deadLine", "01/01/2000");
+ parameters.put("deadLine", "2000-01-01");
Result result = internalRubyIssueService.createActionPlanResult(parameters);
assertThat(result.ok()).isFalse();