Selaa lähdekoodia

Add void filter on tests list

Alan Lam 1 vuosi sitten
vanhempi
commit
5e28aa6f5b
2 muutettua tiedostoa jossa 23 lisäystä ja 1 poistoa
  1. 7 1
      controllers/tests_admin_list.php
  2. 16 0
      views/test_list.php

+ 7 - 1
controllers/tests_admin_list.php

@@ -85,6 +85,7 @@ $tester_id = http::value("tester_id", "int");
 $location_internal_id = http::value("location_internal_id", "int");
 $location_internal_id = http::value("location_internal_id", "int");
 $pass = http::value("pass", "int");
 $pass = http::value("pass", "int");
 $retest = http::value("retest", "int");
 $retest = http::value("retest", "int");
+$void = http::value("void", "int");
 $min_days_overdue = http::value("min_days_overdue", "int");
 $min_days_overdue = http::value("min_days_overdue", "int");
 $custom = http::value("custom");
 $custom = http::value("custom");
 
 
@@ -145,6 +146,11 @@ if(isset($retest)) {
 	}
 	}
 }
 }
 
 
+// Void
+if(isset($void)) {
+	$nvp["void"] = (int) $void;
+}
+
 $filter_count = count($nvp);
 $filter_count = count($nvp);
 
 
 $sort = http::value("sort");
 $sort = http::value("sort");
@@ -290,4 +296,4 @@ $sorts = [
 Core::addScript("public/js/app-test-list.js");
 Core::addScript("public/js/app-test-list.js");
 
 
 View::includeOnce("header", compact("page_title"));
 View::includeOnce("header", compact("page_title"));
-View::include("test_list", compact("tests", "pagination_object", "sort", "sorts", "projects", "customers", "customer_id", "project_id", "location_id", "location_internal_id", "location_name", "pass", "retest", "min_days_overdue", "custom", "test_id", "tester_id", "filter_count", "status", "status_tester_invoice"));
+View::include("test_list", compact("tests", "pagination_object", "sort", "sorts", "projects", "customers", "customer_id", "project_id", "location_id", "location_internal_id", "location_name", "pass", "retest", "void", "min_days_overdue", "custom", "test_id", "tester_id", "filter_count", "status", "status_tester_invoice"));

+ 16 - 0
views/test_list.php

@@ -12,6 +12,7 @@
  * @var int $project_id
  * @var int $project_id
  * @var bool $pass
  * @var bool $pass
  * @var int $retest
  * @var int $retest
+ * @var int $void
  * @var int $test_id
  * @var int $test_id
  * @var int $tester_id
  * @var int $tester_id
  * @var int $location_id
  * @var int $location_id
@@ -39,6 +40,11 @@ $retest_options = [
 	"1" => "Retests Only"
 	"1" => "Retests Only"
 ];
 ];
 
 
+$void_options = [
+	"" => "Any",
+	"1" => "Voids Only"
+];
+
 $custom_filters = [
 $custom_filters = [
 	"overdue_project" => "Overdue (Project Deadline)",
 	"overdue_project" => "Overdue (Project Deadline)",
 	"overdue_test" => "Overdue (Test Due Date)",
 	"overdue_test" => "Overdue (Test Due Date)",
@@ -197,6 +203,16 @@ foreach($projects as $project) {
 									</select>
 									</select>
 								</div>
 								</div>
 							</div>
 							</div>
+							<div class="row mb-1">
+								<label class="col-sm-4 col-form-label" for="void">Void</label>
+								<div class="col-sm">
+									<select class="form-control" name="void" id="void">
+										<?php
+										HtmlHelper::renderOptions($void_options, $void);
+										?>
+									</select>
+								</div>
+							</div>
 						</div>
 						</div>
 						<div class="col-lg">
 						<div class="col-lg">
 							<div class="row mb-1">
 							<div class="row mb-1">