Merge pull request #1050 from itflow-org/ticket-reply-layout

Adjust ticket reply layout
This commit is contained in:
Johnny 2024-09-12 12:16:02 -04:00 committed by GitHub
commit 412eed7554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 282 additions and 284 deletions

View File

@ -331,7 +331,7 @@ if (isset($_GET['ticket_id'])) {
// The user names in a comma-separated string
$ticket_collaborators = nullable_htmlentities($row['user_names']);
?>
?>
<!-- Breadcrumbs-->
<ol class="breadcrumb d-print-none">
@ -362,70 +362,70 @@ if (isset($_GET['ticket_id'])) {
<div class="btn-toolbar">
<?php if ($config_module_enable_accounting && $ticket_billable == 1 && empty($invoice_id)) { ?>
<a href="#" class="btn btn-light btn-sm ml-3" href="#" data-toggle="modal" data-target="#addInvoiceFromTicketModal">
<i class="fas fa-fw fa-file-invoice mr-2"></i>Invoice
</a>
<a href="#" class="btn btn-light btn-sm ml-3" href="#" data-toggle="modal" data-target="#addInvoiceFromTicketModal">
<i class="fas fa-fw fa-file-invoice mr-2"></i>Invoice
</a>
<?php }
if (empty($ticket_closed_at)) { ?>
<?php if (!empty($ticket_resolved_at)) { ?>
<a href="post.php?reopen_ticket=<?php echo $ticket_id; ?>" class="btn btn-light btn-sm ml-3">
<i class="fas fa-fw fa-redo mr-2"></i>Reopen
</a>
&nbsp;
<?php } ?>
<?php if (!empty($ticket_resolved_at)) { ?>
<a href="post.php?reopen_ticket=<?php echo $ticket_id; ?>" class="btn btn-light btn-sm ml-3">
<i class="fas fa-fw fa-redo mr-2"></i>Reopen
</a>
&nbsp;
<?php } ?>
<?php if (empty($ticket_resolved_at) && $task_count == $completed_task_count) { ?>
<a href="post.php?resolve_ticket=<?php echo $ticket_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>" class="btn btn-dark btn-sm confirm-link ml-3" id="ticket_close">
<i class="fas fa-fw fa-check mr-2"></i>Resolve
</a>
<?php } ?>
<?php if (empty($ticket_resolved_at) && $task_count == $completed_task_count) { ?>
<a href="post.php?resolve_ticket=<?php echo $ticket_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>" class="btn btn-dark btn-sm confirm-link ml-3" id="ticket_close">
<i class="fas fa-fw fa-check mr-2"></i>Resolve
</a>
<?php } ?>
<?php if (!empty($ticket_resolved_at) && $task_count == $completed_task_count) { ?>
<a href="post.php?close_ticket=<?php echo $ticket_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>" class="btn btn-dark btn-sm confirm-link ml-3" id="ticket_close">
<i class="fas fa-fw fa-gavel mr-2"></i>Close
</a>
<?php } ?>
<?php if (!empty($ticket_resolved_at) && $task_count == $completed_task_count) { ?>
<a href="post.php?close_ticket=<?php echo $ticket_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>" class="btn btn-dark btn-sm confirm-link ml-3" id="ticket_close">
<i class="fas fa-fw fa-gavel mr-2"></i>Close
</a>
<?php } ?>
<div class="dropdown dropleft text-center ml-3">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown">
<i class="fas fa-fw fa-ellipsis-v"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-edit mr-2"></i>Edit
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#mergeTicketModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-clone mr-2"></i>Merge
</a>
<?php if (empty($ticket_closed_at)) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketContactModal<?php echo $ticket_id; ?>">
<i class="fa fa-fw fa-user mr-2"></i>Add Contact
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketAssetModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-desktop mr-2"></i>Add Asset
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketVendorModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-building mr-2"></i>Add Vendor
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addTicketWatcherModal">
<i class="fas fa-fw fa-users mr-2"></i>Add Watcher
</a>
<?php } ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" id="clientChangeTicketModalLoad" data-target="#clientChangeTicketModal">
<i class="fas fa-fw fa-people-carry mr-2"></i>Change Client
</a>
<?php if ($session_user_role == 3) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_ticket=<?php echo $ticket_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
<i class="fas fa-fw fa-trash mr-2"></i>Delete
<div class="dropdown dropleft text-center ml-3">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown">
<i class="fas fa-fw fa-ellipsis-v"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-edit mr-2"></i>Edit
</a>
<?php } ?>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#mergeTicketModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-clone mr-2"></i>Merge
</a>
<?php if (empty($ticket_closed_at)) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketContactModal<?php echo $ticket_id; ?>">
<i class="fa fa-fw fa-user mr-2"></i>Add Contact
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketAssetModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-desktop mr-2"></i>Add Asset
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketVendorModal<?php echo $ticket_id; ?>">
<i class="fas fa-fw fa-building mr-2"></i>Add Vendor
</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addTicketWatcherModal">
<i class="fas fa-fw fa-users mr-2"></i>Add Watcher
</a>
<?php } ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" id="clientChangeTicketModalLoad" data-target="#clientChangeTicketModal">
<i class="fas fa-fw fa-people-carry mr-2"></i>Change Client
</a>
<?php if ($session_user_role == 3) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_ticket=<?php echo $ticket_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
<i class="fas fa-fw fa-trash mr-2"></i>Delete
</a>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
@ -453,7 +453,7 @@ if (isset($_GET['ticket_id'])) {
$row = mysqli_fetch_array($sql_closed_by);
$ticket_closed_by_display = nullable_htmlentities($row['user_name']);
}
?>
?>
<div class="mt-1">
<i class="fa fa-fw fa-user text-secondary mr-2"></i>Closed by: <?php echo ucwords($ticket_closed_by_display); ?>
</div>
@ -464,9 +464,9 @@ if (isset($_GET['ticket_id'])) {
<i class="fas fa-fw fa-user mr-2 text-secondary"></i><?php echo $ticket_assigned_to_display; ?>
</div>
<?php if($ticket_feedback) { ?>
<div class="mt-1">
<i class="fa fa-fw fa-comment-dots text-secondary mr-2"></i>Feedback: <?php echo $ticket_feedback; ?>
</div>
<div class="mt-1">
<i class="fa fa-fw fa-comment-dots text-secondary mr-2"></i>Feedback: <?php echo $ticket_feedback; ?>
</div>
<?php } ?>
<?php } else { ?>
<div class="mt-1">
@ -493,32 +493,32 @@ if (isset($_GET['ticket_id'])) {
// Billable
if ($config_module_enable_accounting) { ?>
<?php if($invoice_id) { ?>
<div class="mt-1">
<i class="fa fa-fw fa-dollar-sign text-secondary mr-2"></i>Invoiced: <?php echo "$invoice_prefix$invoice_number"; ?>
</div>
<div class="mt-1">
<i class="fa fa-fw fa-dollar-sign text-secondary mr-2"></i>Invoiced: <?php echo "$invoice_prefix$invoice_number"; ?>
</div>
<?php } else { ?>
<div class="mt-1">
<i class="fa fa-fw fa-dollar-sign text-secondary mr-2"></i>Ticket is
<a href="#" data-toggle="modal" data-target="#editTicketBillableModal<?php echo $ticket_id; ?>">
<?php
if ($ticket_billable == 1) {
echo "<span class='text-bold text-dark'>Billable</span>";
} else {
echo "<span class='text-muted'>Not Billable</span>";
}
?>
</a>
</div>
<div class="mt-1">
<i class="fa fa-fw fa-dollar-sign text-secondary mr-2"></i>Ticket is
<a href="#" data-toggle="modal" data-target="#editTicketBillableModal<?php echo $ticket_id; ?>">
<?php
if ($ticket_billable == 1) {
echo "<span class='text-bold text-dark'>Billable</span>";
} else {
echo "<span class='text-muted'>Not Billable</span>";
}
?>
</a>
</div>
<?php } // End if Invoice ?>
<?php } // End If Accounting mod enabled ?>
</div>
<div class="col-sm-4">
<?php if ($task_count) { ?>
Tasks Completed<span class="float-right text-bold"><?php echo $tasks_completed_percent; ?>%</span>
<div class="progress mt-2" style="height: 20px;">
<div class="progress-bar" style="width: <?php echo $tasks_completed_percent; ?>%;"><?php echo $completed_task_count; ?> / <?php echo $task_count; ?></div>
</div>
Tasks Completed<span class="float-right text-bold"><?php echo $tasks_completed_percent; ?>%</span>
<div class="progress mt-2" style="height: 20px;">
<div class="progress-bar" style="width: <?php echo $tasks_completed_percent; ?>%;"><?php echo $completed_task_count; ?> / <?php echo $task_count; ?></div>
</div>
<?php } ?>
<?php
@ -530,9 +530,9 @@ if (isset($_GET['ticket_id'])) {
<?php } ?>
<?php if ($ticket_collaborators) { ?>
<div class="mt-2">
<i class="fas fa-fw fa-users mr-2 text-secondary"></i><?php echo $ticket_collaborators; ?>
</div>
<div class="mt-2">
<i class="fas fa-fw fa-users mr-2 text-secondary"></i><?php echo $ticket_collaborators; ?>
</div>
<?php } ?>
<?php if ($ticket_category > 0) { ?>
@ -560,13 +560,13 @@ if (isset($_GET['ticket_id'])) {
<div class="card-header">
<h3 class="card-title">
Ticket Details
Ticket Details
</h3>
</div>
<div class="card-header bg-light">
<h3 class="card-title">
<span class="text-muted">Subject:</span> <span><?php echo $ticket_subject; ?></span>
<span class="text-muted">Subject:</span> <span><?php echo $ticket_subject; ?></span>
</h3>
</div>
@ -589,92 +589,92 @@ if (isset($_GET['ticket_id'])) {
<div class="card card-body d-print-none pb-0">
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="ticket_id" id="ticket_id" value="<?php echo $ticket_id; ?>">
<input type="hidden" name="client_id" id="client_id" value="<?php echo $client_id; ?>">
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="ticket_id" id="ticket_id" value="<?php echo $ticket_id; ?>">
<input type="hidden" name="client_id" id="client_id" value="<?php echo $client_id; ?>">
<div class="form-group">
<div class="btn-group btn-block btn-group-toggle" data-toggle="buttons">
<label class="btn btn-outline-secondary active">
<input type="radio" name="public_reply_type" value="0" checked>Internal Note
</label>
<label class="btn btn-outline-secondary">
<input type="radio" name="public_reply_type" value="2">Public Comment & Email
</label>
<label class="btn btn-outline-secondary">
<input type="radio" name="public_reply_type" value="1">Public Comment
</label>
<div class="form-group">
<div class="btn-group btn-block btn-group-toggle" data-toggle="buttons">
<label class="btn btn-outline-secondary active">
<input type="radio" name="public_reply_type" value="0" checked>Internal Note
</label>
<label class="btn btn-outline-secondary">
<input type="radio" name="public_reply_type" value="2">Public Comment & Email
</label>
<label class="btn btn-outline-secondary">
<input type="radio" name="public_reply_type" value="1">Public Comment
</label>
</div>
</div>
</div>
<div class="form-group">
<textarea class="form-control tinymce<?php if ($config_ai_enable) { echo "ai"; } ?>" id="textInput" name="ticket_reply" placeholder="Type a response"></textarea>
</div>
<div class="form-group">
<textarea class="form-control tinymce<?php if ($config_ai_enable) { echo "ai"; } ?>" id="textInput" name="ticket_reply" placeholder="Type a response"></textarea>
</div>
<div class="form-row">
<div class="col-md-3">
<div class="input-group mb-3">
<select class="form-control select2" name="status" required>
<div class="form-row">
<div class="col-md-3">
<div class="input-group mb-3">
<select class="form-control select2" name="status" required>
<!-- Show all active ticket statuses, apart from new or closed as these are system-managed -->
<?php
$status_snippet = '';
if ($task_count !== $completed_task_count) {
$status_snippet = "AND ticket_status_id != 4";
}
$sql_ticket_status = mysqli_query($mysqli, "SELECT * FROM ticket_statuses WHERE ticket_status_id != 1 AND ticket_status_id != 5 AND ticket_status_active = 1 $status_snippet");
while ($row = mysqli_fetch_array($sql_ticket_status)) {
$ticket_status_id_select = intval($row['ticket_status_id']);
$ticket_status_name_select = nullable_htmlentities($row['ticket_status_name']); ?>
<!-- Show all active ticket statuses, apart from new or closed as these are system-managed -->
<?php
$status_snippet = '';
if ($task_count !== $completed_task_count) {
$status_snippet = "AND ticket_status_id != 4";
}
$sql_ticket_status = mysqli_query($mysqli, "SELECT * FROM ticket_statuses WHERE ticket_status_id != 1 AND ticket_status_id != 5 AND ticket_status_active = 1 $status_snippet");
while ($row = mysqli_fetch_array($sql_ticket_status)) {
$ticket_status_id_select = intval($row['ticket_status_id']);
$ticket_status_name_select = nullable_htmlentities($row['ticket_status_name']); ?>
<option value="<?php echo $ticket_status_id_select ?>" <?php if ($ticket_status == $ticket_status_id_select) { echo 'selected'; } ?>> <?php echo $ticket_status_name_select ?> </option>
<option value="<?php echo $ticket_status_id_select ?>" <?php if ($ticket_status == $ticket_status_id_select) { echo 'selected'; } ?>> <?php echo $ticket_status_name_select ?> </option>
<?php } ?>
</select>
</div>
</div>
<!-- Time Tracking -->
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group-prepend px-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="hours" name="hours" placeholder="Hrs" min="0" max="23" pattern="0?[0-9]|1[0-9]|2[0-3]">
</div>
<div class="px-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="minutes" name="minutes" placeholder="Mins" min="0" max="59" pattern="[0-5]?[0-9]">
</div>
<div class="input-group-append px-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="seconds" name="seconds" placeholder="Secs" min="0" max="59" pattern="[0-5]?[0-9]">
</div>
<div class="btn-group">
<button type="button" class="btn btn-light" id="startStopTimer"><i class="fas fa-play"></i></button>
<button type="button" class="btn btn-light" id="resetTimer"><i class="fas fa-redo-alt"></i></button>
</div>
</div>
</div>
<div class="col-md-3">
<div class="btn-toolbar float-right">
<?php if ($config_ai_enable) { ?>
<button id="rewordButton" class="btn btn-secondary ml-3" type="button"><i class="fas fa-fw fa-robot mr-2"></i>Reword</button>
<button id="undoButton" class="btn btn-secondary ml-3" type="button" style="display:none;"><i class="fas fa-fw fa-redo-alt mr-2"></i>Undo</button>
<?php } ?>
</select>
</div>
</div>
<!-- Time Tracking -->
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group-prepend px-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="hours" name="hours" placeholder="Hrs" min="0" max="23" pattern="0?[0-9]|1[0-9]|2[0-3]">
</div>
<div class="px-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="minutes" name="minutes" placeholder="Mins" min="0" max="59" pattern="[0-5]?[0-9]">
</div>
<div class="input-group-append px-0 col-2">
<input type="text" class="form-control" inputmode="numeric" id="seconds" name="seconds" placeholder="Secs" min="0" max="59" pattern="[0-5]?[0-9]">
</div>
<div class="btn-group">
<button type="button" class="btn btn-light" id="startStopTimer"><i class="fas fa-play"></i></button>
<button type="button" class="btn btn-light" id="resetTimer"><i class="fas fa-redo-alt"></i></button>
<button type="submit" id="ticket_add_reply" name="add_ticket_reply" class="btn btn-success ml-3"><i class="fas fa-check mr-2"></i>Submit</button>
</div>
</div>
</div>
<div class="col-md-3">
<div class="btn-toolbar float-right">
<?php if ($config_ai_enable) { ?>
<button id="rewordButton" class="btn btn-secondary ml-3" type="button"><i class="fas fa-fw fa-robot mr-2"></i>Reword</button>
<button id="undoButton" class="btn btn-secondary ml-3" type="button" style="display:none;"><i class="fas fa-fw fa-redo-alt mr-2"></i>Undo</button>
<?php } ?>
<button type="submit" id="ticket_add_reply" name="add_ticket_reply" class="btn btn-success ml-3"><i class="fas fa-check mr-2"></i>Submit</button>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
<!-- End IF for reply modal -->
<?php } ?>
<!-- Ticket Responses -->
<h6>Responses <?php echo $ticket_all_comments_count; ?></h6>
<h6>Responses: <?php echo $ticket_all_comments_count; ?></h6>
<!-- Ticket replies -->
<?php
@ -710,17 +710,14 @@ if (isset($_GET['ticket_id'])) {
AND ticket_attachment_ticket_id = $ticket_id"
);
?>
?>
<div class="card border-left border-<?php if ($ticket_reply_type == 'Internal') { echo "dark";
} elseif ($ticket_reply_type == 'Client') {
echo "warning";
} else {
echo "info";
} ?> mb-3">
<!-- Begin ticket reply card -->
<div class="card border-left border-<?php if ($ticket_reply_type == 'Internal') { echo "dark"; } elseif ($ticket_reply_type == 'Client') { echo "warning"; } else { echo "info"; } ?> mb-3">
<div class="card-header">
<h3 class="card-title">
<div class="media">
<div class="d-flex justify-content-between align-items-center w-100">
<!-- Left side content -->
<div class="d-flex align-items-center">
<?php if (!empty($user_avatar)) { ?>
<img src="<?php echo $avatar_link; ?>" alt="User Avatar" class="img-size-50 mr-3 img-circle">
<?php } else { ?>
@ -730,50 +727,49 @@ if (isset($_GET['ticket_id'])) {
</span>
<?php } ?>
<div class="media-body">
<?php echo $ticket_reply_by_display; ?>
<div class="ml-3">
<h3 class="card-title"><?php echo $ticket_reply_by_display; ?></h3>
<div>
<small class="text-muted">
<div title="<?php echo $ticket_reply_created_at; ?>">
<?php echo $ticket_reply_created_at_ago; ?>
<?php if ($ticket_reply_type !== "Client") { ?>
<div>
<br><small class="text-muted">Time worked: <?php echo date_format($ticket_reply_time_worked, 'H:i:s'); ?></small>
</div>
<?php if ($ticket_reply_updated_at) { ?>
<div title="<?php echo $ticket_reply_updated_at; ?>">
modified: <?php echo $ticket_reply_updated_at_ago; ?>
</div>
<?php } ?>
</small>
</div>
<?php if ($ticket_reply_type !== "Client") { ?>
<div>
<small class="text-muted">Time worked: <?php echo date_format($ticket_reply_time_worked, 'H:i:s'); ?></small>
</div>
<?php } ?>
</div>
</div>
</h3>
<?php if ($ticket_reply_type !== "Client" && empty($ticket_closed_at)) { ?>
<div class="card-tools d-print-none">
<div class="dropdown dropleft">
<button class="btn btn-tool" type="button" id="dropdownMenuButton" data-toggle="dropdown">
<i class="fas fa-fw fa-ellipsis-v"></i>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#replyEditTicketModal<?php echo $ticket_reply_id; ?>">
<i class="fas fa-fw fa-edit text-secondary mr-2"></i>Edit
</a>
<?php if ($session_user_role == 3) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_ticket_reply=<?php echo $ticket_reply_id; ?>">
<i class="fas fa-fw fa-archive mr-2"></i>Archive
</a>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
<!-- Right-side content -->
<div class="text-right d-flex flex-column align-items-end">
<?php if ($ticket_reply_type !== "Client" && empty($ticket_closed_at)) { ?>
<div class="card-tools d-print-none mb-2">
<div class="dropdown dropleft">
<button class="btn btn-sm btn-tool" type="button" id="dropdownMenuButton" data-toggle="dropdown">
<i class="fas fa-fw fa-ellipsis-v"></i>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#replyEditTicketModal<?php echo $ticket_reply_id; ?>">
<i class="fas fa-fw fa-edit text-secondary mr-2"></i>Edit
</a>
<?php if ($session_user_role == 3) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_ticket_reply=<?php echo $ticket_reply_id; ?>">
<i class="fas fa-fw fa-archive mr-2"></i>Archive
</a>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
<small class="text-muted">
<div title="Created: <?php echo $ticket_reply_created_at; if ($ticket_reply_updated_at) { echo '. Edited: ' . $ticket_reply_updated_at; } ?>">
<?php echo $ticket_reply_type . " - " . $ticket_reply_created_at_ago; if ($ticket_reply_updated_at) { echo '*'; } ?>
</div>
</small>
</div>
</div>
</div>
<div class="card-body prettyContent">
@ -787,10 +783,12 @@ if (isset($_GET['ticket_id'])) {
}
?>
</div>
</div>
<?php
<!-- End ticket reply card -->
<?php
require "ticket_reply_edit_modal.php";
}
@ -803,65 +801,65 @@ if (isset($_GET['ticket_id'])) {
<!-- Contact card -->
<?php if ($contact_id) { ?>
<div class="card card-body mb-3">
<h5 class="text-secondary">Contact</h5>
<div>
<i class="fa fa-fw fa-user text-secondary mr-2"></i><a href="#" data-toggle="modal" data-target="#editTicketContactModal<?php echo $ticket_id; ?>"><strong><?php echo $contact_name; ?></strong>
</a>
</div>
<?php
if (!empty($location_name)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-map-marker-alt text-secondary mr-2"></i><?php echo $location_name; ?>
</div>
<?php }
if (!empty($contact_email)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-envelope text-secondary mr-2"></i><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a>
</div>
<?php }
if (!empty($contact_phone)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-phone text-secondary mr-2"></i><a href="tel:<?php echo $contact_phone; ?>"><?php echo $contact_phone; ?></a>
</div>
<?php }
if (!empty($contact_mobile)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><a href="tel:<?php echo $contact_mobile; ?>"><?php echo $contact_mobile; ?></a>
</div>
<?php } ?>
<?php
// Previous tickets
$prev_ticket_id = $prev_ticket_subject = $prev_ticket_status = ''; // Default blank
$sql_prev_ticket = "SELECT ticket_id, ticket_created_at, ticket_subject, ticket_status, ticket_assigned_to FROM tickets WHERE ticket_contact_id = $contact_id AND ticket_id <> $ticket_id ORDER BY ticket_id DESC LIMIT 1";
$prev_ticket_row = mysqli_fetch_assoc(mysqli_query($mysqli, $sql_prev_ticket));
if ($prev_ticket_row) {
$prev_ticket_id = intval($prev_ticket_row['ticket_id']);
$prev_ticket_subject = nullable_htmlentities($prev_ticket_row['ticket_subject']);
$prev_ticket_status = nullable_htmlentities( getTicketStatusName($prev_ticket_row['ticket_status']));
?>
<hr>
<div class="card card-body mb-3">
<h5 class="text-secondary">Contact</h5>
<div>
<i class="fa fa-fw fa-history text-secondary mr-2"></i><b>Previous ticket:</b>
<a href="ticket.php?ticket_id=<?php echo $prev_ticket_id; ?>"><?php echo $prev_ticket_subject; ?></a>
<i class="fa fa-fw fa-user text-secondary mr-2"></i><a href="#" data-toggle="modal" data-target="#editTicketContactModal<?php echo $ticket_id; ?>"><strong><?php echo $contact_name; ?></strong>
</a>
</div>
<div class="mt-1">
<i class="fa fa-fw fa-hourglass-start text-secondary mr-2"></i><strong>Status:</strong>
<span class="text-success"><?php echo $prev_ticket_status; ?></span>
</div>
<?php } ?>
</div>
<?php
if (!empty($location_name)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-map-marker-alt text-secondary mr-2"></i><?php echo $location_name; ?>
</div>
<?php }
if (!empty($contact_email)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-envelope text-secondary mr-2"></i><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a>
</div>
<?php }
if (!empty($contact_phone)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-phone text-secondary mr-2"></i><a href="tel:<?php echo $contact_phone; ?>"><?php echo $contact_phone; ?></a>
</div>
<?php }
if (!empty($contact_mobile)) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><a href="tel:<?php echo $contact_mobile; ?>"><?php echo $contact_mobile; ?></a>
</div>
<?php } ?>
<?php
// Previous tickets
$prev_ticket_id = $prev_ticket_subject = $prev_ticket_status = ''; // Default blank
$sql_prev_ticket = "SELECT ticket_id, ticket_created_at, ticket_subject, ticket_status, ticket_assigned_to FROM tickets WHERE ticket_contact_id = $contact_id AND ticket_id <> $ticket_id ORDER BY ticket_id DESC LIMIT 1";
$prev_ticket_row = mysqli_fetch_assoc(mysqli_query($mysqli, $sql_prev_ticket));
if ($prev_ticket_row) {
$prev_ticket_id = intval($prev_ticket_row['ticket_id']);
$prev_ticket_subject = nullable_htmlentities($prev_ticket_row['ticket_subject']);
$prev_ticket_status = nullable_htmlentities( getTicketStatusName($prev_ticket_row['ticket_status']));
?>
<hr>
<div>
<i class="fa fa-fw fa-history text-secondary mr-2"></i><b>Previous ticket:</b>
<a href="ticket.php?ticket_id=<?php echo $prev_ticket_id; ?>"><?php echo $prev_ticket_subject; ?></a>
</div>
<div class="mt-1">
<i class="fa fa-fw fa-hourglass-start text-secondary mr-2"></i><strong>Status:</strong>
<span class="text-success"><?php echo $prev_ticket_status; ?></span>
</div>
<?php } ?>
</div>
<?php } ?>
<!-- End contact card -->
@ -893,15 +891,15 @@ if (isset($_GET['ticket_id'])) {
$task_order = intval($row['task_order']);
//$task_description = nullable_htmlentities($row['task_description']); // not in db yet
$task_completed_at = nullable_htmlentities($row['task_completed_at']);
?>
?>
<tr>
<td>
<?php if ($task_completed_at) { ?>
<i class="far fa-fw fa-check-square text-primary"></i>
<i class="far fa-fw fa-check-square text-primary"></i>
<?php } else { ?>
<a href="post.php?complete_task=<?php echo $task_id; ?>">
<i class="far fa-fw fa-square text-secondary"></i>
</a>
<a href="post.php?complete_task=<?php echo $task_id; ?>">
<i class="far fa-fw fa-square text-secondary"></i>
</a>
<?php } ?>
</td>
<td><?php echo $task_name; ?></td>
@ -932,10 +930,10 @@ if (isset($_GET['ticket_id'])) {
</td>
</tr>
<?php
<?php
require "task_edit_modal.php";
} ?>
require "task_edit_modal.php";
} ?>
</table>
</div>
<!-- End Tasks Card -->
@ -962,13 +960,13 @@ if (isset($_GET['ticket_id'])) {
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<!-- End Ticket watchers card -->
<!-- Asset card -->
<?php if ($asset_id) { ?>
<?php if ($asset_id) { ?>
<div class="card card-body mb-3">
<h5 class="text-secondary">Asset</h5>
<div>
@ -1036,12 +1034,12 @@ if (isset($_GET['ticket_id'])) {
$service_ticket_status = nullable_htmlentities($row['ticket_status']);
$service_ticket_created_at = nullable_htmlentities($row['ticket_created_at']);
$service_ticket_updated_at = nullable_htmlentities($row['ticket_updated_at']);
?>
?>
<p>
<i class="fas fa-fw fa-ticket-alt"></i>
Ticket: <a href="ticket.php?ticket_id=<?php echo $service_ticket_id; ?>"><?php echo "$service_ticket_prefix$service_ticket_number" ?></a> <?php echo "on $service_ticket_created_at - <b>$service_ticket_subject</b> ($service_ticket_status)"; ?>
</p>
<?php
<?php
}
?>
</div>
@ -1105,19 +1103,19 @@ if (isset($_GET['ticket_id'])) {
<!-- project card -->
<?php if ($project_id) { ?>
<div class="card card-body mb-3">
<h5 class="text-secondary">Project</h5>
<div>
<i class="fa fa-fw fa-project-diagram text-secondary mr-3"></i><a href="project_details.php?project_id=<?php echo $project_id; ?>" target="_blank"><strong><?php echo $project_name; ?><i class="fa fa-fw fa-external-link-alt text-secondary ml-2"></i></strong>
</a>
</div>
<div class="card card-body mb-3">
<h5 class="text-secondary">Project</h5>
<div>
<i class="fa fa-fw fa-project-diagram text-secondary mr-3"></i><a href="project_details.php?project_id=<?php echo $project_id; ?>" target="_blank"><strong><?php echo $project_name; ?><i class="fa fa-fw fa-external-link-alt text-secondary ml-2"></i></strong>
</a>
</div>
<?php if ($project_manager) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-user-tie text-secondary mr-3"></i><?php echo $project_manager_name; ?>
<?php if ($project_manager) { ?>
<div class="mt-2">
<i class="fa fa-fw fa-user-tie text-secondary mr-3"></i><?php echo $project_manager_name; ?>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
<!-- End project card -->
@ -1125,7 +1123,7 @@ if (isset($_GET['ticket_id'])) {
</div> <!-- End row -->
<?php
<?php
if (empty($ticket_closed_at)) {
require_once "ticket_edit_modal.php";
@ -1146,7 +1144,7 @@ if (isset($_GET['ticket_id'])) {
require_once "ticket_edit_schedule_modal.php";
require_once "ticket_merge_modal.php";
}
}
if ($config_module_enable_accounting) {
require_once "ticket_edit_billable_modal.php";

View File

@ -16,7 +16,7 @@ require_once "inc_all_user.php";
<?php if (empty($session_avatar)) { ?>
<i class="fas fa-user-circle fa-8x text-secondary"></i>
<?php } else { ?>
<img alt="User avatar" src="<?php echo "uploads/users/$session_user_id/" . nullable_htmlentities($session_avatar); ?>" class="img-fluid">
<img alt="User avatar" src="<?php echo "uploads/users/$session_user_id/" . nullable_htmlentities($session_avatar); ?>" class="img-size-64">
<?php } ?>
<h4 class="text-secondary mt-2"><?php echo nullable_htmlentities($session_user_role_display); ?></h4>
</center>