|
|
@@ -2,6 +2,9 @@
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
+use App\Enums\TicketStatuses;
|
|
|
+use App\Helpers\HtmlHelper;
|
|
|
+
|
|
|
/**
|
|
|
* @var Ticket[] $tickets
|
|
|
*/
|
|
|
@@ -9,6 +12,12 @@ namespace App;
|
|
|
$core = Core::getInstance();
|
|
|
$user = $core->getUser();
|
|
|
|
|
|
+$staff_users = User::query(["admin" => 1]);
|
|
|
+$staff_options = [];
|
|
|
+foreach($staff_users as $staff_user) {
|
|
|
+ $staff_options[$staff_user->id] = $staff_user->getDisplayName();
|
|
|
+}
|
|
|
+
|
|
|
?>
|
|
|
|
|
|
<div class="row mb-3">
|
|
|
@@ -34,54 +43,94 @@ if(!$tickets) {
|
|
|
}
|
|
|
else {
|
|
|
?>
|
|
|
- <table class="table table-bordered table-hover">
|
|
|
- <colgroup>
|
|
|
- <col style="width: 1%;" />
|
|
|
- <col style="width: 1%;" />
|
|
|
- <col style="width: 30%;" />
|
|
|
- <col style="width: 15%;" />
|
|
|
- <col style="width: 15%;" />
|
|
|
- <col style="width: 15%;" />
|
|
|
- <col style="width: 15%;" />
|
|
|
- </colgroup>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th></th>
|
|
|
- <th><?=htmlspecialchars("#")?></th>
|
|
|
- <th><?=htmlspecialchars(__("Subject / Location"))?></th>
|
|
|
- <th><?=htmlspecialchars(__("Status"))?></th>
|
|
|
- <th><?=htmlspecialchars(__("Assigned To"))?></th>
|
|
|
- <th><?=htmlspecialchars(__("Created"))?></th>
|
|
|
- <th><?=htmlspecialchars(__("Updated"))?></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <?php
|
|
|
- foreach($tickets as $ticket) {
|
|
|
- $location = $ticket->getLocation();
|
|
|
- ?>
|
|
|
+ <form method="post">
|
|
|
+ <table class="table table-bordered table-hover">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width: 1%;" />
|
|
|
+ <col style="width: 1%;" />
|
|
|
+ <col style="width: 30%;" />
|
|
|
+ <col style="width: 15%;" />
|
|
|
+ <col style="width: 15%;" />
|
|
|
+ <col style="width: 15%;" />
|
|
|
+ <col style="width: 15%;" />
|
|
|
+ </colgroup>
|
|
|
+ <thead>
|
|
|
<tr>
|
|
|
- <td>
|
|
|
- <label for="ticket-checkbox-<?=$ticket->id?>" class="sr-only"></label>
|
|
|
- <input type="checkbox" id="ticket-checkbox-<?=$ticket->id?>" name="ticket_ids[]" value="<?=$ticket->id?>" />
|
|
|
- </td>
|
|
|
- <td class="text-end"><?=$ticket->id?></td>
|
|
|
- <td>
|
|
|
- <strong>
|
|
|
- <a href="/tickets/<?=$ticket->id?>"><?=htmlspecialchars($ticket->subject)?></a>
|
|
|
- </strong><br />
|
|
|
- <?=htmlspecialchars($location->name)?>
|
|
|
- </td>
|
|
|
- <td><?=htmlspecialchars($ticket->getDisplayStatus())?></td>
|
|
|
- <td><?=htmlspecialchars($ticket->getDisplayAssignedTo())?></td>
|
|
|
- <td><?=htmlspecialchars($user->formatDateTime($ticket->getDateTimeCreated()))?></td>
|
|
|
- <td><?=htmlspecialchars($user->formatDateTime($ticket->getDateTimeUpdated()))?></td>
|
|
|
+ <th></th>
|
|
|
+ <th><?=htmlspecialchars("#")?></th>
|
|
|
+ <th><?=htmlspecialchars(__("Subject / Location"))?></th>
|
|
|
+ <th><?=htmlspecialchars(__("Status"))?></th>
|
|
|
+ <th><?=htmlspecialchars(__("Assigned To"))?></th>
|
|
|
+ <th><?=htmlspecialchars(__("Created"))?></th>
|
|
|
+ <th><?=htmlspecialchars(__("Updated"))?></th>
|
|
|
</tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
<?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ foreach($tickets as $ticket) {
|
|
|
+ $location = $ticket->getLocation();
|
|
|
+ ?>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <div class="form-check">
|
|
|
+ <label for="ticket-checkbox-<?=$ticket->id?>" class="form-check-label"></label>
|
|
|
+ <input class="form-check-input" type="checkbox" id="ticket-checkbox-<?=$ticket->id?>" name="ticket_ids[]" value="<?=$ticket->id?>" />
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td class="text-end"><?=$ticket->id?></td>
|
|
|
+ <td>
|
|
|
+ <strong>
|
|
|
+ <a href="/tickets/<?=$ticket->id?>"><?=htmlspecialchars($ticket->subject)?></a>
|
|
|
+ </strong><br />
|
|
|
+ <?=htmlspecialchars($location->name)?>
|
|
|
+ </td>
|
|
|
+ <td><?=htmlspecialchars($ticket->getDisplayStatus())?></td>
|
|
|
+ <td><?=htmlspecialchars($ticket->getDisplayAssignedTo())?></td>
|
|
|
+ <td><?=htmlspecialchars($user->formatDateTime($ticket->getDateTimeCreated()))?></td>
|
|
|
+ <td><?=htmlspecialchars($user->formatDateTime($ticket->getDateTimeUpdated()))?></td>
|
|
|
+ </tr>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-header">
|
|
|
+ <?=htmlspecialchars(__("Batch Actions"))?>
|
|
|
+ </div>
|
|
|
+ <div class="card-body">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-lg">
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="form-label" for="assign-to"><?=htmlspecialchars(__("Assign To"))?></label>
|
|
|
+ <select class="form-control" name="assign_to" id="assign-to">
|
|
|
+ <option value=""><?=htmlspecialchars(__("Select User"))?></option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions($staff_options);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-lg">
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="form-label" for="status"><?=htmlspecialchars(__("Status"))?></label>
|
|
|
+ <select class="form-control" name="status" id="status">
|
|
|
+ <option value=""><?=htmlspecialchars(__("Select Status"))?></option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions(TicketStatuses::options());
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button type="submit" class="btn btn-primary" name="batch_submit" value="1">
|
|
|
+ <?=htmlspecialchars(__("Submit"))?>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
<?php
|
|
|
}
|
|
|
|