|
|
@@ -21,6 +21,7 @@
|
|
|
* @var int $min_days_overdue
|
|
|
* @var int $custom
|
|
|
* @var object $pagination_object
|
|
|
+ * @var bool $is_staff
|
|
|
*/
|
|
|
|
|
|
$filters_collapse = $filter_count ? "collapse show" : "collapse";
|
|
|
@@ -80,44 +81,56 @@ foreach($projects as $project) {
|
|
|
Toggle Filters <span class="badge badge-pill badge-danger"><?=$filter_count?></span>
|
|
|
</a>
|
|
|
</div>
|
|
|
- <div class="col">
|
|
|
- <div class="input-group">
|
|
|
- <div class="input-group-prepend">
|
|
|
- <label for="sort-dropdown" class="input-group-text">
|
|
|
- Sort
|
|
|
- </label>
|
|
|
+ <?php
|
|
|
+ if($sorts) {
|
|
|
+ ?>
|
|
|
+ <div class="col">
|
|
|
+ <div class="input-group">
|
|
|
+ <div class="input-group-prepend">
|
|
|
+ <label for="sort-dropdown" class="input-group-text">
|
|
|
+ Sort
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <select class="form-control" id="sort-dropdown" data-url-template="/account/tests?<?=htmlspecialchars(http_build_query($query))?>">
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions($sorts, $sort);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
- <select class="form-control" id="sort-dropdown" data-url-template="/account/tests?<?=htmlspecialchars(http_build_query($query))?>">
|
|
|
- <?php
|
|
|
- HtmlHelper::renderOptions($sorts, $sort);
|
|
|
- ?>
|
|
|
- </select>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="form-row my-3">
|
|
|
- <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
- <a class="btn btn-block btn-primary" href="/account/tests">Show All</a>
|
|
|
- </div>
|
|
|
- <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
- <a class="btn btn-block btn-secondary" href="/account/tests?status=<?=Test::STATUS_UNASSIGNED?>">Unassigned</a>
|
|
|
- </div>
|
|
|
- <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
- <a class="btn btn-block btn-warning" href="/account/tests?status=<?=Test::STATUS_CONFIRMED?>">Confirmed</a>
|
|
|
- </div>
|
|
|
- <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
- <a class="btn btn-block btn-success" href="/account/tests?status=<?=Test::STATUS_PENDING_VERIFICATION?>&sort=end">Pending Verification</a>
|
|
|
- </div>
|
|
|
- <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
- <a class="btn btn-block btn-danger" href="/account/tests?pass=0">Fails</a>
|
|
|
- </div>
|
|
|
- <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
- <a class="btn btn-block btn-secondary" href="/account/tests?status=<?=Test::STATUS_CANCELLED?>">Cancelled / Rejected</a>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <div class="form-row my-3">
|
|
|
+ <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
+ <a class="btn btn-block btn-primary" href="/account/tests">Show All</a>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
+ <a class="btn btn-block btn-secondary" href="/account/tests?status=<?=Test::STATUS_UNASSIGNED?>">Unassigned</a>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
+ <a class="btn btn-block btn-warning" href="/account/tests?status=<?=Test::STATUS_CONFIRMED?>">Confirmed</a>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
+ <a class="btn btn-block btn-success" href="/account/tests?status=<?=Test::STATUS_PENDING_VERIFICATION?>&sort=end">Pending Verification</a>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
+ <a class="btn btn-block btn-danger" href="/account/tests?pass=0">Fails</a>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl col-6 col-lg-4 mb-1">
|
|
|
+ <a class="btn btn-block btn-secondary" href="/account/tests?status=<?=Test::STATUS_CANCELLED?>">Cancelled / Rejected</a>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
|
|
|
<div class="<?=$filters_collapse?>" id="filters">
|
|
|
<form method="get">
|
|
|
@@ -127,50 +140,53 @@ foreach($projects as $project) {
|
|
|
|
|
|
<div class="row mb-1">
|
|
|
<div class="col-lg-6">
|
|
|
- <div class="row mb-1">
|
|
|
- <label class="col-form-label col-sm-4" for="status">Status</label>
|
|
|
- <div class="col-sm">
|
|
|
- <select class="form-control" name="status" id="status">
|
|
|
- <option value="">Any not rejected</option>
|
|
|
- <?php
|
|
|
- foreach(Test::STATUSES as $value => $display) {
|
|
|
- $selected = ($value === $status) ? "selected" : "";
|
|
|
- ?>
|
|
|
- <option value="<?=$value?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-form-label col-sm-4" for="status">Status</label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <select class="form-control" name="status" id="status">
|
|
|
+ <option value="">Any not rejected</option>
|
|
|
<?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="row mb-1">
|
|
|
- <label class="col-form-label col-sm-4" for="status-tester-invoice">Tester Invoice Status</label>
|
|
|
- <div class="col-sm">
|
|
|
- <select class="form-control" name="status_tester_invoice" id="status-tester-invoice">
|
|
|
- <option value="">Any</option>
|
|
|
- <?php
|
|
|
- foreach(Test::STATUSES_TESTER_INVOICE as $value) {
|
|
|
- $display = Test::getStatusTesterInvoiceText($value);
|
|
|
- $selected = ($value === $status_tester_invoice) ? "selected" : "";
|
|
|
+ HtmlHelper::renderOptions(Test::STATUSES, $status);
|
|
|
?>
|
|
|
- <option value="<?=$value?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-form-label col-sm-4" for="status-tester-invoice">Tester Invoice Status</label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <select class="form-control" name="status_tester_invoice" id="status-tester-invoice">
|
|
|
+ <option value="">Any</option>
|
|
|
<?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </select>
|
|
|
+ foreach(Test::STATUSES_TESTER_INVOICE as $value) {
|
|
|
+ $display = Test::getStatusTesterInvoiceText($value);
|
|
|
+ $selected = ($value === $status_tester_invoice) ? "selected" : "";
|
|
|
+ ?>
|
|
|
+ <option value="<?=$value?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="row mb-1">
|
|
|
- <label class="col-form-label col-sm-4" for="customer-id">Customer</label>
|
|
|
- <div class="col-sm">
|
|
|
- <select class="form-control" name="customer_id" id="customer-id">
|
|
|
- <option value="">Select customer</option>
|
|
|
- <?php
|
|
|
- HtmlHelper::renderOptions($customer_options, $customer_id);
|
|
|
- ?>
|
|
|
- </select>
|
|
|
+
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-form-label col-sm-4" for="customer-id">Customer</label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <select class="form-control" name="customer_id" id="customer-id">
|
|
|
+ <option value="">Select customer</option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions($customer_options, $customer_id);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<div class="row mb-1">
|
|
|
<label class="col-form-label col-sm-4" for="project-id">Project</label>
|
|
|
<div class="col-sm">
|
|
|
@@ -221,12 +237,18 @@ foreach($projects as $project) {
|
|
|
<input class="form-control" type="text" name="test_id" id="test-id" placeholder="Enter test ID" value="<?=$test_id?>" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row mb-1">
|
|
|
- <label class="col-sm-4 col-form-label" for="tester-id">Tester ID</label>
|
|
|
- <div class="col-sm">
|
|
|
- <input class="form-control" type="text" name="tester_id" id="tester-id" placeholder="Enter tester ID" value="<?=$tester_id?>" />
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-sm-4 col-form-label" for="tester-id">Tester ID</label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <input class="form-control" type="text" name="tester_id" id="tester-id" placeholder="Enter tester ID" value="<?=$tester_id?>" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<div class="row mb-1">
|
|
|
<label class="col-sm-4 col-form-label" for="location-id">Location ID</label>
|
|
|
<div class="col-sm">
|
|
|
@@ -245,25 +267,31 @@ foreach($projects as $project) {
|
|
|
<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">
|
|
|
- <label class="col-sm-4 col-form-label" for="min-days-overdue">
|
|
|
- <?=htmlspecialchars(__("Min. Days Overdue"))?>
|
|
|
- </label>
|
|
|
- <div class="col-sm">
|
|
|
- <input class="form-control" type="number" name="min_days_overdue" id="min-days-overdue" placeholder="<?=htmlspecialchars(__("Enter days"))?>" value="<?=$min_days_overdue?>" />
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-sm-4 col-form-label" for="min-days-overdue">
|
|
|
+ <?=htmlspecialchars(__("Min. Days Overdue"))?>
|
|
|
+ </label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <input class="form-control" type="number" name="min_days_overdue" id="min-days-overdue" placeholder="<?=htmlspecialchars(__("Enter days"))?>" value="<?=$min_days_overdue?>" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="row mb-1">
|
|
|
- <label class="col-sm-4 col-form-label" for="custom">Custom Filter</label>
|
|
|
- <div class="col-sm">
|
|
|
- <select class="form-control" name="custom" id="custom">
|
|
|
- <option value="">Select custom filter</option>
|
|
|
- <?php
|
|
|
- HtmlHelper::renderOptions($custom_filters, $custom);
|
|
|
- ?>
|
|
|
- </select>
|
|
|
+ <div class="row mb-1">
|
|
|
+ <label class="col-sm-4 col-form-label" for="custom">Custom Filter</label>
|
|
|
+ <div class="col-sm">
|
|
|
+ <select class="form-control" name="custom" id="custom">
|
|
|
+ <option value="">Select custom filter</option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions($custom_filters, $custom);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -310,24 +338,48 @@ foreach($projects as $project) {
|
|
|
<table class="table table-sm table-sm-text table-hover" style="min-width: 1024px;">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th>
|
|
|
- <label for="tests-table-select-all" class="sr-only">
|
|
|
- <?=htmlspecialchars(__("Select All"))?>
|
|
|
- </label>
|
|
|
- <input type="checkbox" id="tests-table-select-all" />
|
|
|
- </th>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <th>
|
|
|
+ <label for="tests-table-select-all" class="sr-only">
|
|
|
+ <?=htmlspecialchars(__("Select All"))?>
|
|
|
+ </label>
|
|
|
+ <input type="checkbox" id="tests-table-select-all" />
|
|
|
+ </th>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<th>ID</th>
|
|
|
<th>Location</th>
|
|
|
<th>Project</th>
|
|
|
- <th>Tester</th>
|
|
|
- <th>Due Date</th>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <th>Tester</th>
|
|
|
+ <th>Due Date</th>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<th>Test Date</th>
|
|
|
- <th>T. Costs</th>
|
|
|
- <th>P. Costs</th>
|
|
|
- <th>Status</th>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <th>T. Costs</th>
|
|
|
+ <th>P. Costs</th>
|
|
|
+ <th>Status</th>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<th>Result</th>
|
|
|
<th>Retest</th>
|
|
|
- <th>Actions</th>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <th>Actions</th>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
@@ -346,78 +398,98 @@ foreach($projects as $project) {
|
|
|
?>
|
|
|
|
|
|
<tr>
|
|
|
- <td>
|
|
|
- <label for="test-checkbox-<?=$test->id?>" class="sr-only">
|
|
|
- <?=htmlspecialchars(__("Select Test ID %d", $test->id))?>
|
|
|
- </label>
|
|
|
- <input type="checkbox" name="test_ids[]" id="test-checkbox-<?=$test->id?>" value="<?=$test->id?>" />
|
|
|
- </td>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <td>
|
|
|
+ <label for="test-checkbox-<?=$test->id?>" class="sr-only">
|
|
|
+ <?=htmlspecialchars(__("Select Test ID %d", $test->id))?>
|
|
|
+ </label>
|
|
|
+ <input type="checkbox" name="test_ids[]" id="test-checkbox-<?=$test->id?>" value="<?=$test->id?>" />
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<td>
|
|
|
<?=$test->id?>
|
|
|
</td>
|
|
|
<td class="align-middle">
|
|
|
<a href="/account/locations/<?=$location->id?>">
|
|
|
<?=htmlspecialchars($location->name)?>
|
|
|
- <?php
|
|
|
- if($location->internal_id) {
|
|
|
- ?>
|
|
|
- (Internal ID: <?=htmlspecialchars($location->internal_id)?>)
|
|
|
- <?php
|
|
|
- }
|
|
|
+ </a>
|
|
|
+ <?php
|
|
|
+ if($location->internal_id) {
|
|
|
?>
|
|
|
- </a><br />
|
|
|
+ <small class="text-muted">Internal ID: <?=htmlspecialchars($location->internal_id)?></small>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ <br />
|
|
|
<?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city"]))?>
|
|
|
</td>
|
|
|
<td class="align-middle">
|
|
|
<a href="/account/projects/<?=$project->id?>?location_id=<?=$test->location_id?>">
|
|
|
<?=htmlspecialchars($project->name)?>
|
|
|
- </a><br />
|
|
|
- <strong>Deadline:</strong> <?=date("d/m/Y", strtotime($project->dts_deadline . " UTC"))?>
|
|
|
- </td>
|
|
|
- <td class="align-middle">
|
|
|
- <?php
|
|
|
- if($tester) {
|
|
|
- ?>
|
|
|
- <a href="/account/users/<?=$tester->id?>"><?=htmlspecialchars($tester->getDisplayName())?></a>
|
|
|
+ </a>
|
|
|
<?php
|
|
|
- if($test->status_tester_invoice > 0) {
|
|
|
- $time = Util::getUnixTimeFromUTC($test->dts_tester_invoice_generated);
|
|
|
- $dts = Util::getDisplayDateTime($time);
|
|
|
+ if($is_staff) {
|
|
|
?>
|
|
|
<br />
|
|
|
- <span class="badge badge-<?=Test::getStatusTesterInvoiceClass($test->status_tester_invoice)?>" title="Generated on <?=$dts?>"><?=Test::getStatusTesterInvoiceText($test->status_tester_invoice)?></span>
|
|
|
+ <strong>Deadline:</strong> <?=date("d/m/Y", strtotime($project->dts_deadline . " UTC"))?>
|
|
|
<?php
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
?>
|
|
|
- <small class="text-muted">N/A</small>
|
|
|
- <?php
|
|
|
- }
|
|
|
- ?>
|
|
|
</td>
|
|
|
- <td class="align-middle <?=$due_class?>">
|
|
|
- <?php
|
|
|
- if($dt_due) {
|
|
|
- $days_overdue = $dt_due->diffInDays();
|
|
|
- ?>
|
|
|
- <strong><?=$dt_due->format("d/m/Y")?></strong>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <td class="align-middle">
|
|
|
<?php
|
|
|
- if($is_overdue && !$test->isDone()) {
|
|
|
- ?><br />
|
|
|
- <small>
|
|
|
- <?=htmlspecialchars(n__("%d day overdue", "%d days overdue", $days_overdue, $days_overdue))?>
|
|
|
- </small>
|
|
|
+ if($tester) {
|
|
|
+ ?>
|
|
|
+ <a href="/account/users/<?=$tester->id?>"><?=htmlspecialchars($tester->getDisplayName())?></a>
|
|
|
+ <?php
|
|
|
+ if($test->status_tester_invoice > 0) {
|
|
|
+ $time = Util::getUnixTimeFromUTC($test->dts_tester_invoice_generated);
|
|
|
+ $dts = Util::getDisplayDateTime($time);
|
|
|
+ ?>
|
|
|
+ <br />
|
|
|
+ <span class="badge badge-<?=Test::getStatusTesterInvoiceClass($test->status_tester_invoice)?>" title="Generated on <?=$dts?>"><?=Test::getStatusTesterInvoiceText($test->status_tester_invoice)?></span>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ?>
|
|
|
+ <small class="text-muted">N/A</small>
|
|
|
<?php
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
?>
|
|
|
- <small class="text-muted">N/A</small>
|
|
|
+ </td>
|
|
|
+ <td class="align-middle <?=$due_class?>">
|
|
|
<?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </td>
|
|
|
+ if($dt_due) {
|
|
|
+ $days_overdue = $dt_due->diffInDays();
|
|
|
+ ?>
|
|
|
+ <strong><?=$dt_due->format("d/m/Y")?></strong>
|
|
|
+ <?php
|
|
|
+ if($is_overdue && !$test->isDone()) {
|
|
|
+ ?><br />
|
|
|
+ <small>
|
|
|
+ <?=htmlspecialchars(n__("%d day overdue", "%d days overdue", $days_overdue, $days_overdue))?>
|
|
|
+ </small>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ?>
|
|
|
+ <small class="text-muted">N/A</small>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<td>
|
|
|
<?php
|
|
|
if($dt_end) {
|
|
|
@@ -430,28 +502,34 @@ foreach($projects as $project) {
|
|
|
}
|
|
|
?>
|
|
|
</td>
|
|
|
- <td class="text-right align-middle">
|
|
|
- <?php
|
|
|
- if($test->test_travel_cost > 0) {
|
|
|
- ?>
|
|
|
- £<?=number_format($test->test_travel_cost, 2)?>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
?>
|
|
|
- </td>
|
|
|
- <td class="text-right align-middle">
|
|
|
- <?php
|
|
|
- $tester_invoice_costs = $test->getTesterInvoiceCosts();
|
|
|
- if($tester_invoice_costs > 0) {
|
|
|
+ <td class="text-right align-middle">
|
|
|
+ <?php
|
|
|
+ if($test->test_travel_cost > 0) {
|
|
|
+ ?>
|
|
|
+ £<?=number_format($test->test_travel_cost, 2)?>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
?>
|
|
|
- £<?=number_format($tester_invoice_costs, 2)?>
|
|
|
+ </td>
|
|
|
+ <td class="text-right align-middle">
|
|
|
<?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </td>
|
|
|
- <td class="text-center align-middle">
|
|
|
- <span class="badge badge-<?=$test->getStatusClass()?>"><?=$test->getStatusText()?></span>
|
|
|
- </td>
|
|
|
+ $tester_invoice_costs = $test->getTesterInvoiceCosts();
|
|
|
+ if($tester_invoice_costs > 0) {
|
|
|
+ ?>
|
|
|
+ £<?=number_format($tester_invoice_costs, 2)?>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </td>
|
|
|
+ <td class="text-center align-middle">
|
|
|
+ <span class="badge badge-<?=$test->getStatusClass()?>"><?=$test->getStatusText()?></span>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<td class="text-center align-middle text-<?=$test->getPassClass()?>">
|
|
|
<div title="<?=$test->getPassText()?>">
|
|
|
<i class="fas fa-2x fa-fw fa-<?=$test->getPassIcon()?>"></i>
|
|
|
@@ -466,28 +544,34 @@ foreach($projects as $project) {
|
|
|
}
|
|
|
?>
|
|
|
</td>
|
|
|
- <td class="text-right align-middle">
|
|
|
- <div class="dropdown">
|
|
|
- <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="test-dropdown-<?=$test->id?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
- Actions
|
|
|
- </button>
|
|
|
- <div class="dropdown-menu" aria-labelledby="test-dropdown-<?=$test->id?>">
|
|
|
- <a class="dropdown-item" href="/account/tests/<?=$test->id?>">View</a>
|
|
|
- <?php
|
|
|
- if($test->hasTesterInvoicePDF()) {
|
|
|
- ?>
|
|
|
- <a class="dropdown-item" href="/account/tests/<?=$test->id?>/invoice">Download Tester Invoice</a>
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <td class="text-right align-middle">
|
|
|
+ <div class="dropdown">
|
|
|
+ <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="test-dropdown-<?=$test->id?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
+ Actions
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu" aria-labelledby="test-dropdown-<?=$test->id?>">
|
|
|
+ <a class="dropdown-item" href="/account/tests/<?=$test->id?>">View</a>
|
|
|
<?php
|
|
|
- }
|
|
|
- if($test->hasTravelCostsPhoto()) {
|
|
|
+ if($test->hasTesterInvoicePDF()) {
|
|
|
+ ?>
|
|
|
+ <a class="dropdown-item" href="/account/tests/<?=$test->id?>/invoice">Download Tester Invoice</a>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ if($test->hasTravelCostsPhoto()) {
|
|
|
+ ?>
|
|
|
+ <a class="dropdown-item" href="/account/tests/<?=$test->id?>/files/travel_costs">View Travel Costs Photo</a>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
?>
|
|
|
- <a class="dropdown-item" href="/account/tests/<?=$test->id?>/files/travel_costs">View Travel Costs Photo</a>
|
|
|
- <?php
|
|
|
- }
|
|
|
- ?>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</tr>
|
|
|
<?php
|
|
|
}
|
|
|
@@ -496,33 +580,38 @@ foreach($projects as $project) {
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
- <div class="row">
|
|
|
- <div class="col-md">
|
|
|
+ <?php
|
|
|
+ if($is_staff) {
|
|
|
+ ?>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md">
|
|
|
|
|
|
- </div>
|
|
|
- <div class="col-md-auto">
|
|
|
- <div class="input-group">
|
|
|
- <div class="input-group-prepend">
|
|
|
- <label class="input-group-text" for="batch-action">
|
|
|
- Batch Action
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <select class="form-control" name="batch_action" id="batch-action" required>
|
|
|
- <option value="">Select Action</option>
|
|
|
- <option value="unassign">Unassign</option>
|
|
|
- <option value="mark_tester_invoice_paid">Mark Tester Invoice as Paid</option>
|
|
|
- <option value="reject_tester_invoice">Reject Tester Invoices</option>
|
|
|
- <option value="send_test_assigned_email">Send Test Assigned Email</option>
|
|
|
- </select>
|
|
|
- <div class="input-group-append">
|
|
|
- <button type="submit" class="btn btn-primary" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">
|
|
|
- Submit
|
|
|
- </button>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-auto">
|
|
|
+ <div class="input-group">
|
|
|
+ <div class="input-group-prepend">
|
|
|
+ <label class="input-group-text" for="batch-action">
|
|
|
+ Batch Action
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <select class="form-control" name="batch_action" id="batch-action" required>
|
|
|
+ <option value="">Select Action</option>
|
|
|
+ <option value="unassign">Unassign</option>
|
|
|
+ <option value="mark_tester_invoice_paid">Mark Tester Invoice as Paid</option>
|
|
|
+ <option value="reject_tester_invoice">Reject Tester Invoices</option>
|
|
|
+ <option value="send_test_assigned_email">Send Test Assigned Email</option>
|
|
|
+ </select>
|
|
|
+ <div class="input-group-append">
|
|
|
+ <button type="submit" class="btn btn-primary" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">
|
|
|
+ Submit
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</form>
|
|
|
|
|
|
<div class="mt-3">
|