|
|
@@ -8,11 +8,22 @@ use App\Helpers\HtmlHelper;
|
|
|
/**
|
|
|
* @var Ticket[] $tickets
|
|
|
* @var Pagination $pagination
|
|
|
+ * @var int $customer_id
|
|
|
+ * @var int $location_id
|
|
|
+ * @var int $status
|
|
|
+ * @var int $assigned_user_id
|
|
|
+ * @var string $custom_filter
|
|
|
*/
|
|
|
|
|
|
$core = Core::getInstance();
|
|
|
$user = $core->getUser();
|
|
|
|
|
|
+$custom_filter_options = [
|
|
|
+ "open" => __("Open Tickets"),
|
|
|
+ "unsolved" => __("Unsolved Tickets"),
|
|
|
+ "unassigned" => __("Unassigned Tickets"),
|
|
|
+];
|
|
|
+
|
|
|
?>
|
|
|
|
|
|
<div class="row mb-3">
|
|
|
@@ -27,6 +38,64 @@ $user = $core->getUser();
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+<div class="card mb-3">
|
|
|
+ <div class="card-header">
|
|
|
+ <?=htmlspecialchars(__("Filters"))?>
|
|
|
+ </div>
|
|
|
+ <div class="card-body">
|
|
|
+ <form action="/tickets" method="post">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <?php
|
|
|
+ View::include("components/customer_id_field", compact("customer_id"));
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <?php
|
|
|
+ View::include("components/location_id_field", compact("location_id"));
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="mb-3">
|
|
|
+ <label class="form-label" for="status"><?=htmlspecialchars(__("Status"))?></label>
|
|
|
+ <select class="form-control" name="status" id="status">
|
|
|
+ <option value=""><?=htmlspecialchars(__("Any status"))?></option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions(TicketStatuses::options(), $status);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="mb-3">
|
|
|
+ <label class="form-label" for="assigned-user-id"><?=htmlspecialchars(__("Assigned User"))?></label>
|
|
|
+ <select class="form-control" name="assigned_user_id" id="assigned-user-id">
|
|
|
+ <option value=""><?=htmlspecialchars(__("Any user"))?></option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions(User::getOptions(), $assigned_user_id);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="mb-3">
|
|
|
+ <label class="form-label" for="custom-filter"><?=htmlspecialchars(__("Custom Filter"))?></label>
|
|
|
+ <select class="form-control" name="custom_filter" id="custom-filter">
|
|
|
+ <option value=""><?=htmlspecialchars(__("All tickets"))?></option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions($custom_filter_options, $custom_filter);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <button class="btn btn-primary" type="submit">
|
|
|
+ <?=htmlspecialchars(__("Submit"))?>
|
|
|
+ </button>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
<?php
|
|
|
if(!$tickets) {
|
|
|
?>
|