|
@@ -25,6 +25,18 @@ if($submit) {
|
|
|
Core::addAlert("success", "$test_unassigned_count of $test_count test(s) unassigned successfully.");
|
|
Core::addAlert("success", "$test_unassigned_count of $test_count test(s) unassigned successfully.");
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
+
|
|
|
|
|
+ case "mark_tester_invoice_paid":
|
|
|
|
|
+
|
|
|
|
|
+ $actioned_count = 0;
|
|
|
|
|
+
|
|
|
|
|
+ foreach($tests as $test) {
|
|
|
|
|
+ $actioned_count += ($test->markTesterInvoicePaid()) ? 1 : 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Core::addAlert("success", "{$actioned_count} of {$test_count} test(s) marked as paid successfully.");
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
default:
|
|
default:
|
|
|
throw new Exception("Invalid action.");
|
|
throw new Exception("Invalid action.");
|
|
|
}
|
|
}
|
|
@@ -40,10 +52,12 @@ if($submit) {
|
|
|
// Batch Action End
|
|
// Batch Action End
|
|
|
|
|
|
|
|
$status = http::value("status", "int");
|
|
$status = http::value("status", "int");
|
|
|
|
|
+$status_tester_invoice = http::value("status_tester_invoice");
|
|
|
$customer_id = http::value("customer_id", "int");
|
|
$customer_id = http::value("customer_id", "int");
|
|
|
$project_id = http::value("project_id", "int");
|
|
$project_id = http::value("project_id", "int");
|
|
|
$location_id = http::value("location_id", "int");
|
|
$location_id = http::value("location_id", "int");
|
|
|
$test_id = http::value("test_id", "int");
|
|
$test_id = http::value("test_id", "int");
|
|
|
|
|
+$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");
|
|
|
$custom = http::value("custom");
|
|
$custom = http::value("custom");
|
|
@@ -51,16 +65,28 @@ $custom = http::value("custom");
|
|
|
$filter_count_offset = 0;
|
|
$filter_count_offset = 0;
|
|
|
|
|
|
|
|
$nvp = [];
|
|
$nvp = [];
|
|
|
|
|
+
|
|
|
|
|
+// Status
|
|
|
if(strlen($status) > 0) $nvp["status"] = $status;
|
|
if(strlen($status) > 0) $nvp["status"] = $status;
|
|
|
else {
|
|
else {
|
|
|
$nvp["status"] = (new Constraint("NOT_EQUALS"))->setValues(Test::STATUS_CANCELLED);
|
|
$nvp["status"] = (new Constraint("NOT_EQUALS"))->setValues(Test::STATUS_CANCELLED);
|
|
|
$filter_count_offset--;
|
|
$filter_count_offset--;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// Status Tester Invoice
|
|
|
|
|
+if(strlen($status_tester_invoice)) {
|
|
|
|
|
+ $status_tester_invoice = (int) $status_tester_invoice;
|
|
|
|
|
+ $nvp["status_tester_invoice"] = $status_tester_invoice;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// Project
|
|
|
if($project_id) $nvp["project_id"] = $project_id;
|
|
if($project_id) $nvp["project_id"] = $project_id;
|
|
|
else if($customer_id) {
|
|
else if($customer_id) {
|
|
|
$projects = Project::query(["customer_id" => $customer_id]);
|
|
$projects = Project::query(["customer_id" => $customer_id]);
|
|
|
$nvp["project_id"] = array_column($projects, "id");
|
|
$nvp["project_id"] = array_column($projects, "id");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// Location
|
|
|
if($location_id) $nvp["location_id"] = $location_id;
|
|
if($location_id) $nvp["location_id"] = $location_id;
|
|
|
else if($location_internal_id) {
|
|
else if($location_internal_id) {
|
|
|
$locations = Location::query(["internal_id" => $location_internal_id]);
|
|
$locations = Location::query(["internal_id" => $location_internal_id]);
|
|
@@ -68,7 +94,14 @@ else if($location_internal_id) {
|
|
|
$nvp["location_id"] = array_column($locations, "id");
|
|
$nvp["location_id"] = array_column($locations, "id");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// Test ID
|
|
|
if($test_id) $nvp["id"] = $test_id;
|
|
if($test_id) $nvp["id"] = $test_id;
|
|
|
|
|
+
|
|
|
|
|
+// Tester ID
|
|
|
|
|
+if($tester_id) $nvp["tester_id"] = $tester_id;
|
|
|
|
|
+
|
|
|
|
|
+// Pass
|
|
|
if(strlen($pass) > 0) $nvp["pass"] = $pass;
|
|
if(strlen($pass) > 0) $nvp["pass"] = $pass;
|
|
|
|
|
|
|
|
$filter_count = count($nvp);
|
|
$filter_count = count($nvp);
|
|
@@ -128,7 +161,6 @@ $tests = array_slice($tests, $pagination_object->offset, $pagination_object->pag
|
|
|
$testers = User::load(array_column($tests, "tester_id"));
|
|
$testers = User::load(array_column($tests, "tester_id"));
|
|
|
$customers = Customer::query([], ["sort" => "name"]);
|
|
$customers = Customer::query([], ["sort" => "name"]);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
usort($projects, function($a, $b) {
|
|
usort($projects, function($a, $b) {
|
|
|
return $a->name <=> $b->name;
|
|
return $a->name <=> $b->name;
|
|
|
});
|
|
});
|
|
@@ -140,6 +172,4 @@ $sorts = [
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
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", "pass", "custom", "test_id", "filter_count", "status"));
|
|
|
|
|
-
|
|
|
|
|
-?>
|
|
|
|
|
|
|
+View::include("test_list", compact("tests", "pagination_object", "sort", "sorts", "projects", "customers", "customer_id", "project_id", "location_id", "location_internal_id", "pass", "custom", "test_id", "tester_id", "filter_count", "status", "status_tester_invoice"));
|