Browse Source

Do not count default filter as an active filter.

Alan Lam 8 years ago
parent
commit
22d50bb5ea
1 changed files with 4 additions and 0 deletions
  1. 4 0
      controllers/tests.php

+ 4 - 0
controllers/tests.php

@@ -18,10 +18,13 @@ if($user->level >= User::LEVEL_ADMIN) {
 	$location_internal_id = http::value("location_internal_id", "int");
 	$pass = http::value("pass", "int");
 
+	$filter_count_offset = 0;
+
 	$nvp = [];
 	if(strlen($status) > 0) $nvp["status"] = $status;
 	else {
 		$nvp["status"] = (new Constraint("NOT_EQUALS"))->setValues(Test::STATUS_CANCELLED);
+		$filter_count_offset--;
 	}
 	if($project_id) $nvp["project_id"] = $project_id;
 	else if($customer_id) {
@@ -39,6 +42,7 @@ if($user->level >= User::LEVEL_ADMIN) {
 	if(strlen($pass) > 0) $nvp["pass"] = $pass;
 
 	$filter_count = count($nvp);
+	$filter_count += $filter_count_offset;
 	if(!$filter_count) $filter_count = "";
 
 	$sort = http::value("sort");