<% if unresolved_issues_size == 0 %>
<%= unresolved_issues_size -%>
<% else %>
- <a href="<%= url_for({:controller => 'issues', :action => 'index',
+ <a href="<%= url_for({:controller => 'issues', :action => 'search',
:actionPlans => plan.key, :resolved => 'false'}) -%>"
title="<%= message('widget.issues_action_plans.x_unresolved_issues', :params => unresolved_issues_size.to_s) -%>"><%= unresolved_issues_size -%></a>
<% end %>
%>
<tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>">
<td class="max-width">
- <%= link_to results.user(assignee).name, {:controller => 'issues', :action => 'index', :assignees => assignee}.merge(options) -%>
+ <%= link_to results.user(assignee).name,
+ {:controller => 'issues', :action => 'search', :assignees => assignee}.merge(options) -%>
</td>
<td class="nowrap">
<%= '+' if @dashboard_configuration.selected_period? -%><%= count.to_s -%>
<tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>">
<td class="max-width">
<%= link_to message('widget.unresolved_issues_per_assignee.not_assigned'),
- {:controller => 'issues', :action => 'index', :assigned => 'false'}.merge(options) -%>
+ {:controller => 'issues', :action => 'search', :assigned => 'false'}.merge(options) -%>
</td>
<td class="nowrap">
<%= '+' if @dashboard_configuration.selected_period? -%><%= counter_no_assignee.to_s -%>
.create();
public static final String FUNCTION_COMPLEXITY_KEY = "function_complexity";
+
+ /**
+ * Information about the cyclomatic complexity per function, calculated by divided the complexity in functions by the number of functions.
+ * If the complexity in functions is not available, the complexity of the file is used.
+ */
public static final Metric FUNCTION_COMPLEXITY = new Metric.Builder(FUNCTION_COMPLEXITY_KEY, "Complexity /method", Metric.ValueType.FLOAT)
.setDescription("Complexity average by method")
.setDirection(Metric.DIRECTION_WORST)
return issueService.listTransitions(issue);
}
+ public List<String> listStatus() {
+ return issueService.listStatus();
+ }
+
public Issue doTransition(String issueKey, String transitionKey) {
return issueService.doTransition(issueKey, transitionKey, UserSession.get());
}
import org.sonar.server.platform.UserSession;
import javax.annotation.Nullable;
+
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
return finder.findByKey(issueKey, UserRole.USER);
}
+ public List<String> listStatus(){
+ return workflow.statusKeys();
+ }
+
private void verifyLoggedIn(UserSession userSession) {
if (!userSession.isLoggedIn()) {
// must be logged
class IssuesController < ApplicationController
+ before_filter :init
+
def index
@filter = IssueFilter.new
render :action => 'search'
private
+ def init
+ status = Internal.issues.listStatus()
+ @options_for_status = status.map {|s| [message('issue.status.' + s), s]}
+ end
+
def criteria_params
params.merge({:controller => nil, :action => nil, :search => nil, :widget_id => nil, :edit => nil})
end
user = options[:selected_user]
if user
- options[:selected_id]=user.login
+ # the login is a string so it have to be surrounded by quote to be taken in account by select2
+ options[:selected_id]="'" + user.login + "'"
options[:selected_text]=user.name
end
{:width => '100%', :placeholder => message('issue_filter.criteria.severities')},
{:id => 'select-severities', :multiple => true}-%>
</li>
+ <li id="criteria-status" class="marginbottom5">
+ <%= message 'issue_filter.criteria.status' -%>:
+ <%= dropdown_tag 'statuses[]', options_for_select(@options_for_status, @filter.criteria('statuses')),
+ {:width => '100%', :placeholder => message('issue_filter.criteria.status')},
+ {:id => 'select-status', :multiple => true}-%>
+ </li>
+ <li>
+ <%= message 'issue_filter.criteria.assignee' -%>:
+ <% selected_user = @filter.issues_result.user(@filter.criteria('assignees')) if @filter.issues_result %>
+ <%= user_select_tag('assignees', {:selected_user => selected_user, :width => '100%', :placeholder => message('issue_filter.criteria.assignee'),
+ :html_id => 'select-assignee', :open => false, :allow_clear => true}) -%>
+ </li>
<li>
<input type="submit" name="search" value="<%= message('search_verb') -%>" id="search-button" />
<a href="<%= ApplicationController.root_context -%>/issues" class="link-action"><%= message 'issue_filter.new_search' -%></a>
<%
unless action_plan.totalIssues()==0
- # TODO add links to issues page
- options = {:controller => 'issues', :action => 'index', :actionPlans => action_plan.key}
+ options = {:controller => 'issues', :action => 'search', :actionPlans => action_plan.key}
resolved_issues_link = action_plan.resolvedIssues().to_s
resolved_issues_link = link_to action_plan.resolvedIssues().to_s, options.merge({:resolved => 'true'}) unless action_plan.resolvedIssues()==0
<tfoot>
<tr>
<td colspan="3">
- <%= link_to(total_number, {:controller => "issues", :action => "index" }.merge(search_options)) %> <%= message('results').downcase -%>
+ <%= link_to(total_number, {:controller => 'issues', :action => 'search' }.merge(search_options)) -%> <%= message('results').downcase -%>
<%
if page_count
page_count = 20 if page_count>20