mirror of https://github.com/itflow-org/itflow
parent
973307524d
commit
4060bea7a6
|
|
@ -204,6 +204,7 @@ $asset_status_array = array (
|
||||||
$ticket_status_array = array (
|
$ticket_status_array = array (
|
||||||
'Pending-Assignment',
|
'Pending-Assignment',
|
||||||
'Assigned',
|
'Assigned',
|
||||||
|
'Client-Replied',
|
||||||
'In-Progress',
|
'In-Progress',
|
||||||
'Pending-Shipment',
|
'Pending-Shipment',
|
||||||
'Pending-Client',
|
'Pending-Client',
|
||||||
|
|
|
||||||
29
tickets.php
29
tickets.php
|
|
@ -6,35 +6,24 @@ $order = "DESC";
|
||||||
|
|
||||||
require_once "inc_all.php";
|
require_once "inc_all.php";
|
||||||
|
|
||||||
// Get Statuses from DB
|
|
||||||
$statuses = array();
|
|
||||||
$query = "SELECT DISTINCT ticket_status FROM tickets ORDER BY ticket_status";
|
|
||||||
$result = mysqli_query($mysqli, $query);
|
|
||||||
while ($row = mysqli_fetch_assoc($result)) {
|
|
||||||
$statuses[] = $row['ticket_status'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set Ticket statuses sort
|
// Set Statuses from URL
|
||||||
if (isset($_GET['status']) && !empty($_GET['status'])) {
|
if (!empty($_GET['status'])) {
|
||||||
$ticket_statuses = $_GET['status'];
|
$raw_statuses = is_array($_GET['status']) ? $_GET['status'] : array($_GET['status']);
|
||||||
|
$ticket_statuses = array_map(function($status) use ($mysqli) {
|
||||||
|
return mysqli_real_escape_string($mysqli, $status);
|
||||||
|
}, $raw_statuses);
|
||||||
} else {
|
} else {
|
||||||
$ticekt_status = "Open";
|
$ticket_statuses = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Status Clause for SQL Query
|
// Set Status Clause for SQL Query
|
||||||
if (!isset($_GET['status']) || empty($_GET['status'])) {
|
if (empty($ticket_statuses)) {
|
||||||
$ticket_status_clause = "ticket_status != 'Closed'";
|
$ticket_status_clause = "ticket_status != 'Closed'";
|
||||||
} else {
|
} else {
|
||||||
$ticket_status_clause = "ticket_status IN ('" . implode("','", $ticket_statuses) . "')";
|
$ticket_status_clause = "ticket_status IN ('" . implode("','", $ticket_statuses) . "')";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Statuses
|
|
||||||
if (!empty($_GET['status'])) {
|
|
||||||
$ticket_statuses = is_array($_GET['status']) ? $_GET['status'] : array($_GET['status']);
|
|
||||||
} else {
|
|
||||||
$ticket_statuses = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ticket assignment status filter
|
// Ticket assignment status filter
|
||||||
if (isset($_GET['assigned']) & !empty($_GET['assigned'])) {
|
if (isset($_GET['assigned']) & !empty($_GET['assigned'])) {
|
||||||
if ($_GET['assigned'] == 'unassigned') {
|
if ($_GET['assigned'] == 'unassigned') {
|
||||||
|
|
@ -204,7 +193,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
<label>Ticket Status</label>
|
<label>Ticket Status</label>
|
||||||
<select class="form-control select2" name="status[]" multiple>
|
<select class="form-control select2" name="status[]" multiple>
|
||||||
<?php
|
<?php
|
||||||
foreach ($statuses as $statusValue) {
|
foreach ($ticket_status_array as $statusValue) {
|
||||||
echo '<option value="' . htmlspecialchars($statusValue) . '"';
|
echo '<option value="' . htmlspecialchars($statusValue) . '"';
|
||||||
|
|
||||||
// Check if the current status is in the array of selected statuses
|
// Check if the current status is in the array of selected statuses
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue