Skip to content

Commit 425b06e

Browse files
author
wrongecho
committed
Add time tracking for bulk ticket replies
- TT for bulk replies - Encourage the correct time format using a placeholder and pattern (client-side validation only)
1 parent a313877 commit 425b06e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

post/user/ticket.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@
10191019
// POST variables
10201020
$ticket_reply = mysqli_escape_string($mysqli, $_POST['bulk_reply_details']);
10211021
$ticket_status = intval($_POST['bulk_status']);
1022+
$ticket_reply_time_worked = sanitizeInput($_POST['time']);
10221023
$private_note = intval($_POST['bulk_private_reply']);
10231024
if ($private_note == 1) {
10241025
$ticket_reply_type = 'Internal';
@@ -1046,7 +1047,7 @@
10461047
$client_id = intval($row['ticket_client_id']);
10471048

10481049
// Add reply
1049-
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");
1050+
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");
10501051

10511052
$ticket_reply_id = mysqli_insert_id($mysqli);
10521053

ticket_bulk_reply_modal.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
<textarea class="form-control tinymce" rows="5" name="bulk_reply_details" placeholder="Type an update here"></textarea>
3636
</div>
3737

38+
<div class="col-3">
39+
<div class="form-group">
40+
<label>Time worked</label>
41+
<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:00:00"/>
42+
</div>
43+
</div>
44+
3845
<div class="form-group">
3946
<div class="custom-control custom-checkbox">
4047
<input type="checkbox" class="custom-control-input" id="bulkPrivateReplyCheckbox" name="bulk_private_reply" value="1">

ticket_reply_edit_modal.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
</div>
3030

3131
<?php if (!empty($ticket_reply_time_worked)) { ?>
32-
3332
<div class="col-3">
3433
<div class="form-group">
3534
<label>Time worked</label>
36-
<input class="form-control timepicker" id="time_worked" name="time" type="text" value="<?php echo date_format($ticket_reply_time_worked, 'H:i:s') ?>"/>
35+
<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') ?>"/>
3736
</div>
3837
</div>
3938
<?php } ?>

0 commit comments

Comments
 (0)