Merge pull request #878 from wrongecho/scheduling

Ticket scheduling enhancements
This commit is contained in:
Johnny 2024-02-12 15:00:30 -05:00 committed by GitHub
commit 85f55a629b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 8 deletions

View File

@ -47,7 +47,7 @@ $key = randomString(156);
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="expire" max="2999-12-31" required>
<input type="date" class="form-control" name="expire" min="<?php echo date('Y-m-d')?>" max="2999-12-31" required>
</div>
</div>

View File

@ -1475,6 +1475,7 @@ if (isset($_POST['edit_ticket_schedule'])) {
$mysqli,
"UPDATE tickets SET
ticket_schedule = '$schedule',
ticket_onsite = '$onsite',
ticket_status = 'Scheduled'
WHERE ticket_id = $ticket_id"
);
@ -1558,7 +1559,7 @@ if (isset($_POST['edit_ticket_schedule'])) {
'recipient' => $user_email,
'recipient_name' => $user_name,
'subject' => "Ticket Scheduled - [$ticket_prefix$ticket_number] - $ticket_subject",
'body' => "Hello, " . $user_name . "<br><br>The ticket regarding $ticket_subject has been scheduled for $email_datetime.<br><br>--------------------------------<br><a href=\"https://$config_base_url/portal/ticket.php?id=$ticket_id\">$ticket_link</a><br>--------------------------------<br><br>Please do not reply to this email. <br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Portal: https://$config_base_url/ticket.php?id=$ticket_id<br><br>~<br>$session_company_name<br>Support Department<br>$config_ticket_from_email",
'body' => "Hello, " . $user_name . "<br><br>The ticket regarding $ticket_subject has been scheduled for $email_datetime.<br><br>--------------------------------<br><a href=\"https://$config_base_url/ticket.php?id=$ticket_id\">$ticket_link</a><br>--------------------------------<br><br>Please do not reply to this email. <br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Portal: https://$config_base_url/ticket.php?id=$ticket_id<br><br>~<br>$session_company_name<br>Support Department<br>$config_ticket_from_email",
'cal_str' => $cal_str
]
];
@ -1604,7 +1605,8 @@ if (isset($_POST['edit_ticket_schedule'])) {
// Update ticket reply
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket scheduled for $schedule', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:05:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
$ticket_reply_note = "Ticket scheduled for $email_datetime " . (boolval($onsite) ? '(onsite).' : '(remote).');
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply_note', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
//Logging
mysqli_query(

View File

@ -13,18 +13,20 @@
<form action="post.php" method="post" autocomplete="off">
<div class="modal-body bg-white">
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
<div class="form-group">
<label>Scheduled Date and Time</label>
<label>Scheduled Date and Time </label>
<?php if (!$ticket_scheduled_for) { ?>
<input type="datetime-local" class="form-control" name="scheduled_date_time" placeholder="Scheduled Date & Time">
<input type="datetime-local" class="form-control" name="scheduled_date_time" placeholder="Scheduled Date & Time" min="<?php echo date('Y-m-d\TH:i'); ?>">
<?php } else { ?>
<input type="datetime-local" class="form-control" name="scheduled_date_time" value="<?php echo $ticket_scheduled_for; ?>">
<input type="datetime-local" class="form-control" name="scheduled_date_time" min="<?php echo date('Y-m-d\TH:i'); ?>" value="<?php echo $ticket_scheduled_for; ?>">
<?php } ?>
</div>
<div class="form-group">
<label>Onsite</label>
<select class="form-control" name="onsite">
<label>Onsite </label>
<select class="form-control" name="onsite" required>
<option value="0" <?php if ($ticket_onsite == 0) echo "selected"; ?>>No</option>
<option value="1" <?php if ($ticket_onsite == 1) echo "selected"; ?>>Yes</option>
</select>