Skip to content

Commit

Permalink
Merge pull request #1114 from itflow-org/tt-bulk-reply
Browse files Browse the repository at this point in the history
Add time tracking for bulk ticket replies
  • Loading branch information
wrongecho authored Dec 4, 2024
2 parents a313877 + 4213a33 commit 8954287
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 4 additions & 2 deletions post/user/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@

// POST variables
$details = mysqli_escape_string($mysqli, $_POST['bulk_details']);
$ticket_reply_time_worked = sanitizeInput($_POST['time']);
$private_note = intval($_POST['bulk_private_note']);
if ($private_note == 1) {
$ticket_reply_type = 'Internal';
Expand Down Expand Up @@ -930,7 +931,7 @@
// Update ticket & insert reply
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 4, ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");

mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$details', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$details', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");

// Logging
logAction("Ticket", "Resolve", "$session_name resolved $ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id);
Expand Down Expand Up @@ -1019,6 +1020,7 @@
// POST variables
$ticket_reply = mysqli_escape_string($mysqli, $_POST['bulk_reply_details']);
$ticket_status = intval($_POST['bulk_status']);
$ticket_reply_time_worked = sanitizeInput($_POST['time']);
$private_note = intval($_POST['bulk_private_reply']);
if ($private_note == 1) {
$ticket_reply_type = 'Internal';
Expand Down Expand Up @@ -1046,7 +1048,7 @@
$client_id = intval($row['ticket_client_id']);

// Add reply
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_time_worked = '00:01:00', ticket_reply_type = '$ticket_reply_type', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
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_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");

$ticket_reply_id = mysqli_insert_id($mysqli);

Expand Down
7 changes: 7 additions & 0 deletions ticket_bulk_reply_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
<textarea class="form-control tinymce" rows="5" name="bulk_reply_details" placeholder="Type an update here"></textarea>
</div>

<div class="col-3">
<div class="form-group">
<label>Time worked</label>
<input class="form-control timepicker" id="time_worked" name="time" type="text" placeholder="HH:MM:SS" pattern="([01]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])" value="00:01:00" required/>
</div>
</div>

<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="bulkPrivateReplyCheckbox" name="bulk_private_reply" value="1">
Expand Down
7 changes: 7 additions & 0 deletions ticket_bulk_resolve_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
<textarea class="form-control tinymce" rows="5" name="bulk_details" placeholder="Enter closing remarks"></textarea>
</div>
<div class="col-3">
<div class="form-group">
<label>Time worked</label>
<input class="form-control timepicker" id="time_worked" name="time" type="text" placeholder="HH:MM:SS" pattern="([01]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])" value="00:01:00" required/>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="bulkPrivateCheckbox" name="bulk_private_note" value="1">
Expand Down
3 changes: 1 addition & 2 deletions ticket_reply_edit_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
</div>

<?php if (!empty($ticket_reply_time_worked)) { ?>

<div class="col-3">
<div class="form-group">
<label>Time worked</label>
<input class="form-control timepicker" id="time_worked" name="time" type="text" value="<?php echo date_format($ticket_reply_time_worked, 'H:i:s') ?>"/>
<input class="form-control timepicker" id="time_worked" name="time" type="text" placeholder="HH:MM:SS" pattern="([01]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])" value="<?php echo date_format($ticket_reply_time_worked, 'H:i:s') ?>" required/>
</div>
</div>
<?php } ?>
Expand Down

0 comments on commit 8954287

Please sign in to comment.