|
@@ -43,6 +43,9 @@ if($submit) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $tester_ids = array_column($location_test_array, "tester_id");
|
|
|
|
|
+ User::load($tester_ids);
|
|
|
|
|
+
|
|
|
$output = [];
|
|
$output = [];
|
|
|
|
|
|
|
|
foreach($locations as $location) {
|
|
foreach($locations as $location) {
|
|
@@ -51,18 +54,27 @@ if($submit) {
|
|
|
|
|
|
|
|
$customer_slug = str_replace("-", "_", Util::slug($customer->name));
|
|
$customer_slug = str_replace("-", "_", Util::slug($customer->name));
|
|
|
|
|
|
|
|
|
|
+ $tester = null;
|
|
|
|
|
+ $formatted_due_dts = null;
|
|
|
|
|
+
|
|
|
$icon = null;
|
|
$icon = null;
|
|
|
$icon_file = "{$customer_slug}_none.png";
|
|
$icon_file = "{$customer_slug}_none.png";
|
|
|
|
|
|
|
|
|
|
+ $past_due = false;
|
|
|
|
|
+
|
|
|
if($test) {
|
|
if($test) {
|
|
|
|
|
|
|
|
- $unix_due = Util::getUnixTimeFromUTC($test->dts_due);
|
|
|
|
|
|
|
+ $tester = $test->getTester();
|
|
|
|
|
+
|
|
|
|
|
+ $unix_due = strtotime($test->dts_due);
|
|
|
|
|
+ $formatted_due_dts = date("d/m/Y H:i", $unix_due);
|
|
|
|
|
|
|
|
if(is_null($test->pass)) {
|
|
if(is_null($test->pass)) {
|
|
|
$icon_file = "{$customer_slug}_pending.png";
|
|
$icon_file = "{$customer_slug}_pending.png";
|
|
|
|
|
|
|
|
- if(time() > $unix_due) {
|
|
|
|
|
|
|
+ if($tester && $test->dts_due && time() > $unix_due) {
|
|
|
$icon_file = "{$customer_slug}_past_due.png";
|
|
$icon_file = "{$customer_slug}_past_due.png";
|
|
|
|
|
+ $past_due = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else if($test->pass) {
|
|
else if($test->pass) {
|
|
@@ -84,9 +96,26 @@ if($submit) {
|
|
|
"name" => $location->name,
|
|
"name" => $location->name,
|
|
|
"latitude" => (float) $location->latitude,
|
|
"latitude" => (float) $location->latitude,
|
|
|
"longitude" => (float) $location->longitude,
|
|
"longitude" => (float) $location->longitude,
|
|
|
- "icon" => $icon
|
|
|
|
|
|
|
+ "icon" => $icon,
|
|
|
|
|
+ "test" => null,
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ if($test) {
|
|
|
|
|
+ $data["test"] = [
|
|
|
|
|
+ "id" => $test->id,
|
|
|
|
|
+ "formattedDueDts" => $formatted_due_dts,
|
|
|
|
|
+ "tester" => null,
|
|
|
|
|
+ "pastDue" => $past_due,
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ if($tester) {
|
|
|
|
|
+ $data["test"]["tester"] = [
|
|
|
|
|
+ "id" => $tester->id,
|
|
|
|
|
+ "name" => $tester->getDisplayName(),
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$output[] = $data;
|
|
$output[] = $data;
|
|
|
}
|
|
}
|
|
|
|
|
|