Просмотр исходного кода

Cancelled tests do not show by default.

Alan Lam 8 лет назад
Родитель
Сommit
e4afa4779d
2 измененных файлов с 5 добавлено и 2 удалено
  1. 4 1
      controllers/tests.php
  2. 1 1
      views/test_list.php

+ 4 - 1
controllers/tests.php

@@ -26,7 +26,10 @@ if($user->level >= User::LEVEL_ADMIN) {
 	$pass = http::value("pass", "int");
 
 	$nvp = [];
-	if($status) $nvp["status"] = $status;
+	if(strlen($status) > 0) $nvp["status"] = $status;
+	else {
+		$nvp["status"] = (new Constraint("NOT_EQUALS"))->setValues(Test::STATUS_CANCELLED);
+	}
 	if($project_id) $nvp["project_id"] = $project_id;
 	else if($customer_id) {
 		$projects = Project::query(["customer_id" => $customer_id]);

+ 1 - 1
views/test_list.php

@@ -82,7 +82,7 @@ $results = [
 								<label class="col-form-label col-sm-4" for="status">Status</label>
 								<div class="col-sm">
 									<select class="form-control" name="status" id="status">
-										<option value="">Any</option>
+										<option value="">Any not cancelled</option>
 										<?php
 										foreach(Test::STATUSES as $value => $display) {
 											$selected = ($value === $status) ? "selected" : "";