|
@@ -11,26 +11,27 @@ Core::addBreadcrumb("/account/locations", "Locations");
|
|
|
Core::addBreadcrumb("/account/locations/$location->id", $page_title);
|
|
Core::addBreadcrumb("/account/locations/$location->id", $page_title);
|
|
|
|
|
|
|
|
$status_constraint = new Constraint("BETWEEN");
|
|
$status_constraint = new Constraint("BETWEEN");
|
|
|
-$status_constraint->setValues(Test::STATUS_ASSIGNED, Test::STATUS_PENDING_VERIFICATION);
|
|
|
|
|
|
|
|
|
|
-$pending_tests = Test::query([
|
|
|
|
|
|
|
+if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
|
|
+ $status_constraint->setValues(Test::STATUS_UNASSIGNED, Test::STATUS_COMPLETED);
|
|
|
|
|
+}
|
|
|
|
|
+else {
|
|
|
|
|
+ $status_constraint->setValues(Test::STATUS_COMPLETED, Test::STATUS_COMPLETED);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+$tests = Test::query([
|
|
|
"location_id" => $location->id,
|
|
"location_id" => $location->id,
|
|
|
"status" => $status_constraint,
|
|
"status" => $status_constraint,
|
|
|
], [
|
|
], [
|
|
|
- "sort" => "id",
|
|
|
|
|
- "order" => "desc",
|
|
|
|
|
|
|
+ "sort" => "status",
|
|
|
|
|
+ "order" => "asc",
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
-$completed_tests = Test::query([
|
|
|
|
|
- "location_id" => $location->id,
|
|
|
|
|
- "status" => Test::STATUS_COMPLETED,
|
|
|
|
|
-], [
|
|
|
|
|
- "sort" => "dts_end",
|
|
|
|
|
- "order" => "desc",
|
|
|
|
|
-]);
|
|
|
|
|
|
|
+$projects = Project::load(array_column($tests, "project_id"));
|
|
|
|
|
+
|
|
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
-View::include("location", compact("location"));
|
|
|
|
|
|
|
+View::include("location", compact("location", "tests"));
|
|
|
View::includeOnce("footer");
|
|
View::includeOnce("footer");
|
|
|
|
|
|
|
|
?>
|
|
?>
|