|
@@ -63,7 +63,7 @@ switch($action) {
|
|
|
<=>
|
|
<=>
|
|
|
Geolocation::getDistance($address->getGeolocation(), $b->getGeolocation());
|
|
Geolocation::getDistance($address->getGeolocation(), $b->getGeolocation());
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Get tests
|
|
// Get tests
|
|
|
$tests = Test::query([
|
|
$tests = Test::query([
|
|
|
"status" => (new Constraint("NOT_EQUALS"))->setValues(Test::STATUS_CANCELLED),
|
|
"status" => (new Constraint("NOT_EQUALS"))->setValues(Test::STATUS_CANCELLED),
|
|
@@ -87,10 +87,13 @@ switch($action) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Get projects
|
|
|
|
|
+ $projects = Project::load(array_column($location_test_array, "project_id"));
|
|
|
|
|
+
|
|
|
// Start output
|
|
// Start output
|
|
|
foreach($locations as $location) {
|
|
foreach($locations as $location) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Filter by distance
|
|
// Filter by distance
|
|
|
$distance = Geolocation::getDistance($address->getGeolocation(), $location->getGeolocation());
|
|
$distance = Geolocation::getDistance($address->getGeolocation(), $location->getGeolocation());
|
|
|
if($distance > $max_distance) continue;
|
|
if($distance > $max_distance) continue;
|
|
@@ -111,10 +114,11 @@ switch($action) {
|
|
|
// Icon
|
|
// Icon
|
|
|
$icon = null;
|
|
$icon = null;
|
|
|
$icon_file = "{$customer_slug}_none.png";
|
|
$icon_file = "{$customer_slug}_none.png";
|
|
|
-
|
|
|
|
|
- // Process test
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Process test
|
|
|
if($test) {
|
|
if($test) {
|
|
|
$tester = $test->getTester();
|
|
$tester = $test->getTester();
|
|
|
|
|
+ $project = $test->getProject();
|
|
|
|
|
|
|
|
if(!is_null($test->dts_start)) {
|
|
if(!is_null($test->dts_start)) {
|
|
|
$unix_start = strtotime($test->dts_start);
|
|
$unix_start = strtotime($test->dts_start);
|
|
@@ -128,7 +132,7 @@ switch($action) {
|
|
|
if(!is_null($test->dts_due)) {
|
|
if(!is_null($test->dts_due)) {
|
|
|
$unix_due = strtotime($test->dts_due);
|
|
$unix_due = strtotime($test->dts_due);
|
|
|
$formatted_due_dts = date("d/m/Y H:i", $unix_due);
|
|
$formatted_due_dts = date("d/m/Y H:i", $unix_due);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if($tester && time() > $unix_due) {
|
|
if($tester && time() > $unix_due) {
|
|
|
$icon_file = "{$customer_slug}_past_due.png";
|
|
$icon_file = "{$customer_slug}_past_due.png";
|
|
|
$past_due = true;
|
|
$past_due = true;
|
|
@@ -161,22 +165,33 @@ switch($action) {
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
if($test) {
|
|
if($test) {
|
|
|
|
|
+
|
|
|
|
|
+ $pass = is_null($test->pass) ? null : intval($test->pass);
|
|
|
|
|
+
|
|
|
$data["test"] = [
|
|
$data["test"] = [
|
|
|
- "id" => $test->id,
|
|
|
|
|
|
|
+ "id" => (int) $test->id,
|
|
|
|
|
+ "pass" => $pass,
|
|
|
"formattedStartDts" => $formatted_start_dts,
|
|
"formattedStartDts" => $formatted_start_dts,
|
|
|
"formattedDueDts" => $formatted_due_dts,
|
|
"formattedDueDts" => $formatted_due_dts,
|
|
|
"tester" => null,
|
|
"tester" => null,
|
|
|
"pastDue" => $past_due,
|
|
"pastDue" => $past_due,
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ if($project) {
|
|
|
|
|
+ $data["test"]["project"] = [
|
|
|
|
|
+ "id" => (int) $project->id,
|
|
|
|
|
+ "name" => $project->name,
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if($tester) {
|
|
if($tester) {
|
|
|
$data["test"]["tester"] = [
|
|
$data["test"]["tester"] = [
|
|
|
- "id" => $tester->id,
|
|
|
|
|
|
|
+ "id" => (int) $tester->id,
|
|
|
"name" => $tester->getDisplayName(),
|
|
"name" => $tester->getDisplayName(),
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$output[] = $data;
|
|
$output[] = $data;
|
|
|
}
|
|
}
|
|
|
|
|
|