Add support for public/internal updates, using the existing 'email update to client' checkbox
This commit is contained in:
@@ -4919,7 +4919,7 @@ if(isset($_POST['assign_ticket'])){
|
||||
|
||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_updated_at = NOW(), ticket_assigned_to = $assigned_to WHERE ticket_id = $ticket_id AND company_id = $session_company_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO ticket_replies SET ticket_reply = 'Ticket re-assigned', ticket_reply_created_at = NOW(), ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id, company_id = $session_company_id") or die(mysqli_error($mysqli));
|
||||
mysqli_query($mysqli,"INSERT INTO ticket_replies SET ticket_reply = 'Ticket re-assigned', ticket_reply_type = 'Internal', ticket_reply_created_at = NOW(), ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id, company_id = $session_company_id") or die(mysqli_error($mysqli));
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Modified', log_description = '$subject', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
|
||||
@@ -4951,7 +4951,14 @@ if(isset($_POST['add_ticket_reply'])){
|
||||
$ticket_status = trim(mysqli_real_escape_string($mysqli,$_POST['status']));
|
||||
$ticket_reply_time_worked = trim(mysqli_real_escape_string($mysqli,$_POST['time']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_created_at = NOW(), ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id, company_id = $session_company_id") or die(mysqli_error($mysqli));
|
||||
if(isset($_POST['public_reply_type'])){
|
||||
$ticket_reply_type = 'Public';
|
||||
}
|
||||
else{
|
||||
$ticket_reply_type = 'Internal';
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_type = '$ticket_reply_type', ticket_reply_created_at = NOW(), ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id, company_id = $session_company_id") or die(mysqli_error($mysqli));
|
||||
|
||||
//UPDATE Ticket Last Response Field
|
||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_status = '$ticket_status', ticket_updated_at = NOW() WHERE ticket_id = $ticket_id AND company_id = $session_company_id") or die(mysqli_error($mysqli));
|
||||
|
||||
+13
-9
@@ -149,6 +149,7 @@ if(isset($_GET['ticket_id'])){
|
||||
while($row = mysqli_fetch_array($sql)){;
|
||||
$ticket_reply_id = $row['ticket_reply_id'];
|
||||
$ticket_reply = $row['ticket_reply'];
|
||||
$ticket_reply_type = $row['ticket_reply_type'];
|
||||
$ticket_reply_created_at = $row['ticket_reply_created_at'];
|
||||
$ticket_reply_updated_at = $row['ticket_reply_updated_at'];
|
||||
$ticket_reply_by = $row['ticket_reply_by'];
|
||||
@@ -159,7 +160,8 @@ if(isset($_GET['ticket_id'])){
|
||||
$ticket_reply_time_worked = date_create($row['ticket_reply_time_worked']);
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card <?php if($ticket_reply_type == 'Internal') {echo "bg-dark";} ?> mb-3">
|
||||
<!-- Not sure how I feel about the dark background for internal notes, but we need a way to differentiate them from public updates? -->
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
@@ -234,22 +236,24 @@ if(isset($_GET['ticket_id'])){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(!empty($config_smtp_host) AND !empty($client_email)){ ?>
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<input class="form-control timepicker" id="time_worked" name="time" type="time" step="1" value="00:00:00" onchange="setTime()"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php //if(!empty($config_smtp_host) AND !empty($client_email)){ ?>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="customControlAutosizing" name="email_ticket_reply" value="1" checked>
|
||||
<label class="custom-control-label" for="customControlAutosizing">Email update to client</label>
|
||||
<input type="checkbox" class="custom-control-input" id="customControlAutosizing" name="public_reply_type" value="1" checked>
|
||||
<label class="custom-control-label" for="customControlAutosizing">Email update to client (Public Update)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<input id="time_worked" name="time" type="time" step="1" value="00:00:00" class="form-control timepicker" onchange="setTime()"/>
|
||||
</div>
|
||||
<?php //} ?>
|
||||
|
||||
<div class="col-md-2">
|
||||
<button type="submit" name="add_ticket_reply" class="btn btn-primary"><i class="fa fa-fw fa-check"></i> Save & Reply</button>
|
||||
|
||||
Reference in New Issue
Block a user