|
|
@@ -14,7 +14,8 @@
|
|
|
* @var int $test_id
|
|
|
* @var int $tester_id
|
|
|
* @var int $location_id
|
|
|
- * @var int $location_internal_id
|
|
|
+ * @var string $location_internal_id
|
|
|
+ * @var string $location_name
|
|
|
* @var int $min_days_overdue
|
|
|
* @var int $custom
|
|
|
* @var object $pagination_object
|
|
|
@@ -26,8 +27,7 @@ unset($query["path"]);
|
|
|
|
|
|
$query["sort"] = "SORT";
|
|
|
|
|
|
-$results = [
|
|
|
- "" => "Any",
|
|
|
+$result_options = [
|
|
|
"1" => "Pass",
|
|
|
"0" => "Fail",
|
|
|
];
|
|
|
@@ -37,6 +37,16 @@ $custom_filters = [
|
|
|
"overdue_test" => "Overdue (Test Due Date)",
|
|
|
];
|
|
|
|
|
|
+$customer_options = [];
|
|
|
+foreach($customers as $customer) {
|
|
|
+ $customer_options[$customer->id] = $customer->name;
|
|
|
+}
|
|
|
+
|
|
|
+$project_options = [];
|
|
|
+foreach($projects as $project) {
|
|
|
+ $project_options[$project->id] = $project->name;
|
|
|
+}
|
|
|
+
|
|
|
?>
|
|
|
<div class="mt-3 py-4">
|
|
|
<div class="container-fluid">
|
|
|
@@ -63,12 +73,7 @@ $custom_filters = [
|
|
|
</div>
|
|
|
<select class="form-control" id="sort-dropdown" data-url-template="/account/tests?<?=htmlspecialchars(http_build_query($query))?>">
|
|
|
<?php
|
|
|
- foreach($sorts as $value => $display) {
|
|
|
- $selected = ($value == $sort) ? "selected" : "";
|
|
|
- ?>
|
|
|
- <option value="<?=$value?>" <?=$selected?>><?=$display?></option>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions($sorts, $sort);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -142,12 +147,7 @@ $custom_filters = [
|
|
|
<select class="form-control" name="customer_id" id="customer-id">
|
|
|
<option value="">Select customer</option>
|
|
|
<?php
|
|
|
- foreach($customers as $customer) {
|
|
|
- $selected = ($customer->id == $customer_id) ? "selected" : "";
|
|
|
- ?>
|
|
|
- <option value="<?=$customer->id?>" <?=$selected?>><?=htmlspecialchars($customer->name)?></option>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions($customer_options, $customer_id);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -158,12 +158,7 @@ $custom_filters = [
|
|
|
<select class="form-control" name="project_id" id="project-id">
|
|
|
<option value="">Select project</option>
|
|
|
<?php
|
|
|
- foreach($projects as $project) {
|
|
|
- $selected = ($project->id == $project_id) ? "selected" : "";
|
|
|
- ?>
|
|
|
- <option value="<?=$project->id?>" <?=$selected?>><?=htmlspecialchars($project->name)?></option>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions($project_options, $project_id);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -172,13 +167,9 @@ $custom_filters = [
|
|
|
<label class="col-sm-4 col-form-label" for="pass">Result</label>
|
|
|
<div class="col-sm">
|
|
|
<select class="form-control" name="pass" id="pass">
|
|
|
+ <option value=""><?=htmlspecialchars(__("Any"))?></option>
|
|
|
<?php
|
|
|
- foreach($results as $value => $display) {
|
|
|
- $selected = (strval($value) === strval($pass)) ? "selected" : "";
|
|
|
- ?>
|
|
|
- <option value="<?=$value?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions($result_options, $pass);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -206,7 +197,13 @@ $custom_filters = [
|
|
|
<div class="row mb-1">
|
|
|
<label class="col-sm-4 col-form-label" for="location-internal-id">Internal ID</label>
|
|
|
<div class="col-sm">
|
|
|
- <input class="form-control" type="text" name="location_internal_id" id="location-internal-id" placeholder="Enter location internal ID" value="<?=$location_internal_id?>" />
|
|
|
+ <input class="form-control" type="text" name="location_internal_id" id="location-internal-id" placeholder="Enter location internal ID" value="<?=htmlspecialchars($location_internal_id)?>" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-sm-4 col-form-label" for="location-name">Location Name</label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <input class="form-control" type="text" name="location_name" id="location-name" placeholder="Enter location name" value="<?=htmlspecialchars($location_name)?>" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row mb-1">
|
|
|
@@ -223,12 +220,7 @@ $custom_filters = [
|
|
|
<select class="form-control" name="custom" id="custom">
|
|
|
<option value="">Select custom filter</option>
|
|
|
<?php
|
|
|
- foreach($custom_filters as $value => $display) {
|
|
|
- $selected = (strval($value) === strval($custom)) ? "selected" : "";
|
|
|
- ?>
|
|
|
- <option value="<?=$value?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions($custom_filters, $custom);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|