|
@@ -9,6 +9,8 @@
|
|
|
* @var Template $template
|
|
* @var Template $template
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+$user = Core::$user;
|
|
|
|
|
+
|
|
|
// Get test counts for current year cycle
|
|
// Get test counts for current year cycle
|
|
|
$tests = Test::query([
|
|
$tests = Test::query([
|
|
|
"status" => Constraint::notEquals(Test::STATUS_CANCELLED),
|
|
"status" => Constraint::notEquals(Test::STATUS_CANCELLED),
|
|
@@ -27,6 +29,8 @@ foreach($tests as $test) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+$latest_tests = $customer->getLatestTestByLocation();
|
|
|
|
|
+
|
|
|
$dt_start = $project->getDateTimeStart();
|
|
$dt_start = $project->getDateTimeStart();
|
|
|
$dt_deadline = $project->getDateTimeDeadline();
|
|
$dt_deadline = $project->getDateTimeDeadline();
|
|
|
|
|
|
|
@@ -54,7 +58,7 @@ $deselected_locations = array_filter($locations, static function(Location $l) us
|
|
|
* @param bool $selected
|
|
* @param bool $selected
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
-$output_locations = static function(array $locations, bool $selected) use ($location_test, $test_counts, $customer) {
|
|
|
|
|
|
|
+$output_locations = static function(array $locations, bool $selected) use ($location_test, $test_counts, $customer, $latest_tests, $user) {
|
|
|
foreach($locations as $location) {
|
|
foreach($locations as $location) {
|
|
|
$address = $location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]);
|
|
$address = $location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]);
|
|
|
|
|
|
|
@@ -100,6 +104,20 @@ $output_locations = static function(array $locations, bool $selected) use ($loca
|
|
|
?>
|
|
?>
|
|
|
</div>
|
|
</div>
|
|
|
<small><?=htmlspecialchars($address)?></small><br />
|
|
<small><?=htmlspecialchars($address)?></small><br />
|
|
|
|
|
+ <small>
|
|
|
|
|
+ <strong>Last Test:</strong>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $test = $latest_tests[$location->id] ?? null;
|
|
|
|
|
+ if($test) {
|
|
|
|
|
+ $test->renderTestStatus($user);
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ None
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </small><br />
|
|
|
<small title="<?=htmlspecialchars(__("Number of tests completed between %s", $customer->getDisplayYearCycle()))?>">
|
|
<small title="<?=htmlspecialchars(__("Number of tests completed between %s", $customer->getDisplayYearCycle()))?>">
|
|
|
<strong>Completed:</strong>
|
|
<strong>Completed:</strong>
|
|
|
<?=htmlspecialchars(sprintf("%d / %d", $test_counts[$location->id] ?? 0, $location->annual_test_count))?>
|
|
<?=htmlspecialchars(sprintf("%d / %d", $test_counts[$location->id] ?? 0, $location->annual_test_count))?>
|