mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Ticket scheduling
- Prevent scheduling dates in the past (also for API keys expiry date) - Correct the ticket URL in the agent email - Update the onsite value in the database when scheduling a ticket - Reword the internal note to include a user friendly time and whether the ticket is onsite/remote
This commit is contained in:
@@ -47,7 +47,7 @@ $key = randomString(156);
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1475,6 +1475,7 @@ if (isset($_POST['edit_ticket_schedule'])) {
|
|||||||
$mysqli,
|
$mysqli,
|
||||||
"UPDATE tickets SET
|
"UPDATE tickets SET
|
||||||
ticket_schedule = '$schedule',
|
ticket_schedule = '$schedule',
|
||||||
|
ticket_onsite = '$onsite',
|
||||||
ticket_status = 'Scheduled'
|
ticket_status = 'Scheduled'
|
||||||
WHERE ticket_id = $ticket_id"
|
WHERE ticket_id = $ticket_id"
|
||||||
);
|
);
|
||||||
@@ -1558,7 +1559,7 @@ if (isset($_POST['edit_ticket_schedule'])) {
|
|||||||
'recipient' => $user_email,
|
'recipient' => $user_email,
|
||||||
'recipient_name' => $user_name,
|
'recipient_name' => $user_name,
|
||||||
'subject' => "Ticket Scheduled - [$ticket_prefix$ticket_number] - $ticket_subject",
|
'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
|
'cal_str' => $cal_str
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
@@ -1604,7 +1605,8 @@ if (isset($_POST['edit_ticket_schedule'])) {
|
|||||||
|
|
||||||
|
|
||||||
// Update ticket reply
|
// 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
|
//Logging
|
||||||
mysqli_query(
|
mysqli_query(
|
||||||
|
|||||||
@@ -13,18 +13,20 @@
|
|||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Scheduled Date and Time</label>
|
<label>Scheduled Date and Time </label>
|
||||||
|
|
||||||
<?php if (!$ticket_scheduled_for) { ?>
|
<?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 { ?>
|
<?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 } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Onsite</label>
|
<label>Onsite </label>
|
||||||
<select class="form-control" name="onsite">
|
<select class="form-control" name="onsite" required>
|
||||||
<option value="0" <?php if ($ticket_onsite == 0) echo "selected"; ?>>No</option>
|
<option value="0" <?php if ($ticket_onsite == 0) echo "selected"; ?>>No</option>
|
||||||
<option value="1" <?php if ($ticket_onsite == 1) echo "selected"; ?>>Yes</option>
|
<option value="1" <?php if ($ticket_onsite == 1) echo "selected"; ?>>Yes</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user