mirror of https://github.com/itflow-org/itflow
commit
ef14e95adf
|
|
@ -161,15 +161,14 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||||
$event_title = json_encode($row['ticket_prefix'] . $row['ticket_number'] . " created - " . $row['ticket_subject'] . " " . $username . "{" . $ticket_status . "}");
|
$event_title = json_encode($row['ticket_prefix'] . $row['ticket_number'] . " created - " . $row['ticket_subject'] . " " . $username . "{" . $ticket_status . "}");
|
||||||
$event_start = json_encode($row['ticket_created_at']);
|
$event_start = json_encode($row['ticket_created_at']);
|
||||||
|
|
||||||
|
if ($ticket_status == "New") {
|
||||||
if ($ticket_status == "Closed") {
|
|
||||||
$event_color = "black";
|
|
||||||
} else if ($ticket_status == "Scheduled") {
|
|
||||||
$event_color = "grey";
|
|
||||||
} else if ($ticket_status == "Pending-Assignment") {
|
|
||||||
$event_color = "red";
|
$event_color = "red";
|
||||||
} else {
|
} elseif ($ticket_status == "Open") {
|
||||||
$event_color = "blue";
|
$event_color = "blue";
|
||||||
|
} elseif ($ticket_status == "On Hold") {
|
||||||
|
$event_color = "grey";
|
||||||
|
} else {
|
||||||
|
$event_color = "black";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "{ id: $event_id, title: $event_title, start: $event_start, color: '$event_color', url: 'ticket.php?ticket_id=$event_id' },";
|
echo "{ id: $event_id, title: $event_title, start: $event_start, color: '$event_color', url: 'ticket.php?ticket_id=$event_id' },";
|
||||||
|
|
@ -188,7 +187,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strtotime($row['ticket_schedule']) < time()) {
|
if (strtotime($row['ticket_schedule']) < time()) {
|
||||||
if ($row['ticket_status'] == 'Scheduled') {
|
if ($row['ticket_status'] == 'On Hold') {
|
||||||
$event_color = "red";
|
$event_color = "red";
|
||||||
} else {
|
} else {
|
||||||
$event_color = "green";
|
$event_color = "green";
|
||||||
|
|
|
||||||
|
|
@ -161,15 +161,14 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||||
$event_title = json_encode($row['ticket_prefix'] . $row['ticket_number'] . " created - " . $row['ticket_subject'] . " " . $username . "{" . $ticket_status . "}");
|
$event_title = json_encode($row['ticket_prefix'] . $row['ticket_number'] . " created - " . $row['ticket_subject'] . " " . $username . "{" . $ticket_status . "}");
|
||||||
$event_start = json_encode($row['ticket_created_at']);
|
$event_start = json_encode($row['ticket_created_at']);
|
||||||
|
|
||||||
|
if ($ticket_status == "New") {
|
||||||
if ($ticket_status == "Closed") {
|
|
||||||
$event_color = "black";
|
|
||||||
} else if ($ticket_status == "Scheduled") {
|
|
||||||
$event_color = "grey";
|
|
||||||
} else if ($ticket_status == "Pending-Assignment") {
|
|
||||||
$event_color = "red";
|
$event_color = "red";
|
||||||
} else {
|
} elseif ($ticket_status == "Open") {
|
||||||
$event_color = "blue";
|
$event_color = "blue";
|
||||||
|
} elseif ($ticket_status == "On Hold") {
|
||||||
|
$event_color = "grey";
|
||||||
|
} else {
|
||||||
|
$event_color = "black";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "{ id: $event_id, title: $event_title, start: $event_start, color: '$event_color', url: 'ticket.php?ticket_id=$event_id' },";
|
echo "{ id: $event_id, title: $event_title, start: $event_start, color: '$event_color', url: 'ticket.php?ticket_id=$event_id' },";
|
||||||
|
|
|
||||||
|
|
@ -160,16 +160,16 @@ $total_scheduled_tickets = intval($row['total_scheduled_tickets']);
|
||||||
}
|
}
|
||||||
$ticket_closed_at = nullable_htmlentities($row['ticket_closed_at']);
|
$ticket_closed_at = nullable_htmlentities($row['ticket_closed_at']);
|
||||||
|
|
||||||
if ($ticket_status == "Pending-Assignment") {
|
if ($ticket_status == "New") {
|
||||||
$ticket_status_color = "danger";
|
$ticket_status_color = "danger";
|
||||||
} elseif ($ticket_status == "Assigned") {
|
} elseif ($ticket_status == "Open") {
|
||||||
$ticket_status_color = "primary";
|
$ticket_status_color = "primary";
|
||||||
} elseif ($ticket_status == "In-Progress") {
|
} elseif ($ticket_status == "On Hold") {
|
||||||
$ticket_status_color = "success";
|
$ticket_status_color = "success";
|
||||||
|
} elseif ($ticket_status == "Auto Close") {
|
||||||
|
$ticket_status_color = "dark";
|
||||||
} elseif ($ticket_status == "Closed") {
|
} elseif ($ticket_status == "Closed") {
|
||||||
$ticket_status_color = "dark";
|
$ticket_status_color = "dark";
|
||||||
} else{
|
|
||||||
$ticket_status_color = "secondary";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ticket_priority == "High") {
|
if ($ticket_priority == "High") {
|
||||||
|
|
@ -181,6 +181,7 @@ $total_scheduled_tickets = intval($row['total_scheduled_tickets']);
|
||||||
} else{
|
} else{
|
||||||
$ticket_priority_display = "-";
|
$ticket_priority_display = "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
$ticket_assigned_to = intval($row['ticket_assigned_to']);
|
$ticket_assigned_to = intval($row['ticket_assigned_to']);
|
||||||
if (empty($ticket_assigned_to)) {
|
if (empty($ticket_assigned_to)) {
|
||||||
if ($ticket_status == "Closed") {
|
if ($ticket_status == "Closed") {
|
||||||
|
|
|
||||||
14
cron.php
14
cron.php
|
|
@ -219,20 +219,20 @@ foreach ($warranty_alert_array as $day) {
|
||||||
// Logging
|
// Logging
|
||||||
//mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for asset warranties expiring'");
|
//mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for asset warranties expiring'");
|
||||||
|
|
||||||
// Notify of Tickets Pending Assignment
|
// Notify of New Tickets
|
||||||
// Get Ticket Pending Assignment
|
// Get Ticket Pending Assignment
|
||||||
$sql_tickets_pending_assignment = mysqli_query($mysqli,"SELECT ticket_id FROM tickets
|
$sql_tickets_pending_assignment = mysqli_query($mysqli,"SELECT ticket_id FROM tickets
|
||||||
WHERE ticket_status = 'Pending-Assignment'"
|
WHERE ticket_status = 'New'"
|
||||||
);
|
);
|
||||||
|
|
||||||
$tickets_pending_assignment = mysqli_num_rows($sql_tickets_pending_assignment);
|
$tickets_pending_assignment = mysqli_num_rows($sql_tickets_pending_assignment);
|
||||||
|
|
||||||
if($tickets_pending_assignment > 0){
|
if($tickets_pending_assignment > 0){
|
||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Pending Tickets', notification = 'There are $tickets_pending_assignment Tickets pending assignment', notification_action = 'tickets.php?status=Pending-Assignment'");
|
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Pending Tickets', notification = 'There are $tickets_pending_assignment new tickets pending assignment', notification_action = 'tickets.php?status=New'");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for tickets that are pending assignment'");
|
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for new tickets that are pending assignment'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recurring (Scheduled) tickets
|
// Recurring (Scheduled) tickets
|
||||||
|
|
@ -262,7 +262,7 @@ if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
|
||||||
mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1");
|
mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1");
|
||||||
|
|
||||||
// Raise the ticket
|
// Raise the ticket
|
||||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 'Open', ticket_created_by = $created_id, ticket_contact_id = $contact_id, ticket_client_id = $client_id, ticket_asset_id = $asset_id");
|
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 'New', ticket_created_by = $created_id, ticket_contact_id = $contact_id, ticket_client_id = $client_id, ticket_asset_id = $asset_id");
|
||||||
$id = mysqli_insert_id($mysqli);
|
$id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
|
|
@ -366,7 +366,7 @@ if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
|
||||||
// AUTO CLOSE TICKET - CLOSE
|
// AUTO CLOSE TICKET - CLOSE
|
||||||
// Automatically silently closes tickets 22 hrs after the last chase
|
// Automatically silently closes tickets 22 hrs after the last chase
|
||||||
|
|
||||||
// Check to make sure autoclose is enabled
|
// Check to make sure auto-close is enabled
|
||||||
if ($config_ticket_autoclose == 1) {
|
if ($config_ticket_autoclose == 1) {
|
||||||
$sql_tickets_to_chase = mysqli_query(
|
$sql_tickets_to_chase = mysqli_query(
|
||||||
$mysqli,
|
$mysqli,
|
||||||
|
|
@ -420,7 +420,7 @@ if ($config_ticket_autoclose == 1) {
|
||||||
$ticket_reply = $ticket_reply_row['ticket_reply'];
|
$ticket_reply = $ticket_reply_row['ticket_reply'];
|
||||||
|
|
||||||
$subject = "Ticket pending closure - [$ticket_prefix$ticket_number] - $ticket_subject";
|
$subject = "Ticket pending closure - [$ticket_prefix$ticket_number] - $ticket_subject";
|
||||||
$body = "<i style=\'color: #808080\'>##- Please type your reply above this line -##</i><br><br>Hello, $contact_name<br><br>This is an automatic friendly reminder that your ticket regarding $ticket_subject will be closed, unless you respond.<br><br>--------------------------------<br>$ticket_reply--------------------------------<br><br>If your issue is resolved, you can ignore this email - the ticket will automatically close. If you need further assistance, please respond to this email. <br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: $ticket_status<br>Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id<br><br>--<br>$company_name - Support<br>$config_ticket_from_email<br>$company_phone";
|
$body = "<i style=\'color: #808080\'>##- Please type your reply above this line -##</i><br><br>Hello, $contact_name<br><br>This is an automatic friendly reminder that your ticket regarding $ticket_subject will be closed, unless you respond.<br><br>--------------------------------<br>$ticket_reply--------------------------------<br><br>If your issue is resolved, you can ignore this email - the ticket will automatically close shortly. If you need further assistance, please respond to this email. <br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: $ticket_status<br>Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id<br><br>--<br>$company_name - Support<br>$config_ticket_from_email<br>$company_phone";
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ $allowed_extensions = array('jpg', 'jpeg', 'gif', 'png', 'webp', 'pdf', 'txt', '
|
||||||
function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message, $attachments) {
|
function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message, $attachments) {
|
||||||
|
|
||||||
// Access global variables
|
// Access global variables
|
||||||
global $mysqli, $company_name, $company_phone, $config_ticket_prefix, $config_ticket_client_general_notifications, $config_ticket_new_ticket_notification_email, $config_base_url, $config_ticket_from_name, $config_ticket_from_email, $config_smtp_host, $config_smtp_port, $config_smtp_encryption, $config_smtp_username, $config_smtp_password, $allowed_extensions;
|
global $mysqli,$config_app_name, $company_name, $company_phone, $config_ticket_prefix, $config_ticket_client_general_notifications, $config_ticket_new_ticket_notification_email, $config_base_url, $config_ticket_from_name, $config_ticket_from_email, $config_smtp_host, $config_smtp_port, $config_smtp_encryption, $config_smtp_username, $config_smtp_password, $allowed_extensions;
|
||||||
|
|
||||||
// Get the next Ticket Number and add 1 for the new ticket number
|
// Get the next Ticket Number and add 1 for the new ticket number
|
||||||
$ticket_number_sql = mysqli_fetch_array(mysqli_query($mysqli, "SELECT config_ticket_next_number FROM settings WHERE company_id = 1"));
|
$ticket_number_sql = mysqli_fetch_array(mysqli_query($mysqli, "SELECT config_ticket_next_number FROM settings WHERE company_id = 1"));
|
||||||
|
|
@ -118,7 +118,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
||||||
$message = nl2br($message);
|
$message = nl2br($message);
|
||||||
$message = mysqli_escape_string($mysqli, "<i>Email from: $contact_email at $date:-</i> <br><br>$message");
|
$message = mysqli_escape_string($mysqli, "<i>Email from: $contact_email at $date:-</i> <br><br>$message");
|
||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$message', ticket_priority = 'Low', ticket_status = 'Pending-Assignment', ticket_created_by = 0, ticket_contact_id = $contact_id, ticket_client_id = $client_id");
|
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$message', ticket_priority = 'Low', ticket_status = 'New', ticket_created_by = 0, ticket_contact_id = $contact_id, ticket_client_id = $client_id");
|
||||||
$id = mysqli_insert_id($mysqli);
|
$id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
|
|
@ -164,7 +164,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
||||||
if ($config_ticket_client_general_notifications == 1) {
|
if ($config_ticket_client_general_notifications == 1) {
|
||||||
|
|
||||||
$subject_email = "Ticket created - [$config_ticket_prefix$ticket_number] - $subject";
|
$subject_email = "Ticket created - [$config_ticket_prefix$ticket_number] - $subject";
|
||||||
$body = "<i style=\'color: #808080\'>##- Please type your reply above this line -##</i><br><br>Hello $contact_name,<br><br>Thank you for your email. A ticket regarding \"$subject\" has been automatically created for you.<br><br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $subject<br>Status: Open<br>https://$config_base_url/portal/ticket.php?id=$id<br><br>--<br>$company_name - Support<br>$config_ticket_from_email<br>$company_phone";
|
$body = "<i style=\'color: #808080\'>##- Please type your reply above this line -##</i><br><br>Hello $contact_name,<br><br>Thank you for your email. A ticket regarding \"$subject\" has been automatically created for you.<br><br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $subject<br>Status: New<br>https://$config_base_url/portal/ticket.php?id=$id<br><br>--<br>$company_name - Support<br>$config_ticket_from_email<br>$company_phone";
|
||||||
|
|
||||||
$data[] = [
|
$data[] = [
|
||||||
'from' => $config_ticket_from_email,
|
'from' => $config_ticket_from_email,
|
||||||
|
|
@ -184,7 +184,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
||||||
$client_row = mysqli_fetch_array($client_sql);
|
$client_row = mysqli_fetch_array($client_sql);
|
||||||
$client_name = sanitizeInput($client_row['client_name']);
|
$client_name = sanitizeInput($client_row['client_name']);
|
||||||
|
|
||||||
$email_subject = "ITFlow - New Ticket - $client_name: $subject";
|
$email_subject = "$config_app_name - New Ticket - $client_name: $subject";
|
||||||
$email_body = "Hello, <br><br>This is a notification that a new ticket has been raised in ITFlow. <br>Client: $client_name<br>Priority: Low (email parsed)<br>Link: https://$config_base_url/ticket.php?ticket_id=$id <br><br>--------------------------------<br><br><b>$subject</b><br>$details";
|
$email_body = "Hello, <br><br>This is a notification that a new ticket has been raised in ITFlow. <br>Client: $client_name<br>Priority: Low (email parsed)<br>Link: https://$config_base_url/ticket.php?ticket_id=$id <br><br>--------------------------------<br><br><b>$subject</b><br>$details";
|
||||||
|
|
||||||
$data[] = [
|
$data[] = [
|
||||||
|
|
@ -209,7 +209,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
||||||
// Add email as a comment/reply to an existing ticket
|
// Add email as a comment/reply to an existing ticket
|
||||||
|
|
||||||
// Access global variables
|
// Access global variables
|
||||||
global $mysqli, $company_name, $company_phone, $config_ticket_prefix, $config_base_url, $config_ticket_from_name, $config_ticket_from_email, $config_smtp_host, $config_smtp_port, $config_smtp_encryption, $config_smtp_username, $config_smtp_password, $allowed_extensions;
|
global $mysqli, $config_app_name, $company_name, $company_phone, $config_ticket_prefix, $config_base_url, $config_ticket_from_name, $config_ticket_from_email, $config_smtp_host, $config_smtp_port, $config_smtp_encryption, $config_smtp_username, $config_smtp_password, $allowed_extensions;
|
||||||
|
|
||||||
// Set default reply type
|
// Set default reply type
|
||||||
$ticket_reply_type = 'Client';
|
$ticket_reply_type = 'Client';
|
||||||
|
|
@ -221,19 +221,22 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
||||||
$message = mysqli_escape_string($mysqli, "<i>Email from: $from_email at $date:-</i> <br><br>$message");
|
$message = mysqli_escape_string($mysqli, "<i>Email from: $from_email at $date:-</i> <br><br>$message");
|
||||||
|
|
||||||
// Lookup the ticket ID
|
// Lookup the ticket ID
|
||||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_id, ticket_subject, ticket_status, ticket_contact_id, ticket_client_id, contact_email
|
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_id, ticket_subject, ticket_status, ticket_contact_id, ticket_client_id, contact_email, client_name
|
||||||
FROM tickets
|
FROM tickets
|
||||||
LEFT JOIN contacts on tickets.ticket_contact_id = contacts.contact_id
|
LEFT JOIN contacts on tickets.ticket_contact_id = contacts.contact_id
|
||||||
|
LEFT JOIN clients on tickets.ticket_client_id = clients.client_id
|
||||||
WHERE ticket_number = $ticket_number LIMIT 1"));
|
WHERE ticket_number = $ticket_number LIMIT 1"));
|
||||||
|
|
||||||
if ($row) {
|
if ($row) {
|
||||||
|
|
||||||
// Get ticket details
|
// Get ticket details
|
||||||
$ticket_id = intval($row['ticket_id']);
|
$ticket_id = intval($row['ticket_id']);
|
||||||
|
$ticket_subject = sanitizeInput($row['ticket_subject']);
|
||||||
$ticket_status = sanitizeInput($row['ticket_status']);
|
$ticket_status = sanitizeInput($row['ticket_status']);
|
||||||
$ticket_reply_contact = intval($row['ticket_contact_id']);
|
$ticket_reply_contact = intval($row['ticket_contact_id']);
|
||||||
$ticket_contact_email = sanitizeInput($row['contact_email']);
|
$ticket_contact_email = sanitizeInput($row['contact_email']);
|
||||||
$client_id = intval($row['ticket_client_id']);
|
$client_id = intval($row['ticket_client_id']);
|
||||||
|
$client_name = sanitizeInput($row['client_name']);
|
||||||
|
|
||||||
// Check ticket isn't closed - tickets can't be re-opened
|
// Check ticket isn't closed - tickets can't be re-opened
|
||||||
if ($ticket_status == "Closed") {
|
if ($ticket_status == "Closed") {
|
||||||
|
|
@ -332,8 +335,8 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
||||||
$tech_email = sanitizeInput($tech_row['user_email']);
|
$tech_email = sanitizeInput($tech_row['user_email']);
|
||||||
$tech_name = sanitizeInput($tech_row['user_name']);
|
$tech_name = sanitizeInput($tech_row['user_name']);
|
||||||
|
|
||||||
$subject = "Ticket updated - [$config_ticket_prefix$ticket_number] - $subject";
|
$email_subject = "$config_app_name - Ticket updated - [$config_ticket_prefix$ticket_number] $ticket_subject";
|
||||||
$body = "<i style=\'color: #808080\'>##- Please type your reply above this line -##</i><br><br>Hello $tech_name,<br><br>A new reply has been added to the ticket \"$subject\".<br><br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $subject<br>Status: Open<br>https://$config_base_url/portal/ticket.php?id=$ticket_id<br><br>--<br>$company_name - Support<br>$config_ticket_from_email<br>$company_phone";
|
$email_body = "Hello $tech_name,<br><br>A new reply has been added to the below ticket, check ITFlow for full details.<br><br>Client: $client_name<br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $ticket_subject<br><br>https://$config_base_url/ticket.php?ticket_id=$ticket_id";
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
[
|
[
|
||||||
|
|
@ -341,8 +344,8 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
||||||
'from_name' => $config_ticket_from_name,
|
'from_name' => $config_ticket_from_name,
|
||||||
'recipient' => $tech_email,
|
'recipient' => $tech_email,
|
||||||
'recipient_name' => $tech_name,
|
'recipient_name' => $tech_name,
|
||||||
'subject' => $subject,
|
'subject' => $email_subject,
|
||||||
'body' => $body
|
'body' => $email_body
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -353,7 +356,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update Ticket Last Response Field & set ticket to open as client has replied
|
// Update Ticket Last Response Field & set ticket to open as client has replied
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 'Client-Replied' WHERE ticket_id = $ticket_id AND ticket_client_id = $client_id LIMIT 1");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 'Open' WHERE ticket_id = $ticket_id AND ticket_client_id = $client_id LIMIT 1");
|
||||||
|
|
||||||
echo "Updated existing ticket.<br>";
|
echo "Updated existing ticket.<br>";
|
||||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Ticket', log_action = 'Update', log_description = 'Email parser: Client contact $from_email updated ticket $config_ticket_prefix$ticket_number ($subject)', log_client_id = $client_id");
|
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Ticket', log_action = 'Update', log_description = 'Email parser: Client contact $from_email updated ticket $config_ticket_prefix$ticket_number ($subject)', log_client_id = $client_id");
|
||||||
|
|
|
||||||
|
|
@ -795,16 +795,17 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||||
$client_name = nullable_htmlentities($row['client_name']);
|
$client_name = nullable_htmlentities($row['client_name']);
|
||||||
$contact_id = intval($row['ticket_contact_id']);
|
$contact_id = intval($row['ticket_contact_id']);
|
||||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||||
if ($ticket_status == "Pending-Assignment") {
|
|
||||||
|
if ($ticket_status == "New") {
|
||||||
$ticket_status_color = "danger";
|
$ticket_status_color = "danger";
|
||||||
} elseif ($ticket_status == "Assigned") {
|
} elseif ($ticket_status == "Open") {
|
||||||
$ticket_status_color = "primary";
|
$ticket_status_color = "primary";
|
||||||
} elseif ($ticket_status == "In-Progress") {
|
} elseif ($ticket_status == "On Hold") {
|
||||||
$ticket_status_color = "success";
|
$ticket_status_color = "success";
|
||||||
|
} elseif ($ticket_status == "Auto Close") {
|
||||||
|
$ticket_status_color = "dark";
|
||||||
} elseif ($ticket_status == "Closed") {
|
} elseif ($ticket_status == "Closed") {
|
||||||
$ticket_status_color = "dark";
|
$ticket_status_color = "dark";
|
||||||
} else {
|
|
||||||
$ticket_status_color = "secondary";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ticket_priority == "High") {
|
if ($ticket_priority == "High") {
|
||||||
|
|
|
||||||
|
|
@ -727,7 +727,7 @@ function sanitizeInput($input)
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
|
|
||||||
// Remove HTML and PHP tags
|
// Remove HTML and PHP tags
|
||||||
$input = strip_tags($input);
|
$input = strip_tags((string) $input);
|
||||||
|
|
||||||
// Remove white space from beginning and end of input
|
// Remove white space from beginning and end of input
|
||||||
$input = trim($input);
|
$input = trim($input);
|
||||||
|
|
@ -1029,7 +1029,11 @@ function addToMailQueue($mysqli, $data)
|
||||||
$recipient_name = strval($email['recipient_name']);
|
$recipient_name = strval($email['recipient_name']);
|
||||||
$subject = strval($email['subject']);
|
$subject = strval($email['subject']);
|
||||||
$body = strval($email['body']);
|
$body = strval($email['body']);
|
||||||
$cal_str = mysqli_escape_string($mysqli,$email['cal_str']);
|
|
||||||
|
$cal_str = '';
|
||||||
|
if (isset($email['cal_str'])) {
|
||||||
|
$cal_str = mysqli_escape_string($mysqli,$email['cal_str']);
|
||||||
|
}
|
||||||
|
|
||||||
// Check if 'email_queued_at' is set and not empty
|
// Check if 'email_queued_at' is set and not empty
|
||||||
if (isset($email['queued_at']) && !empty($email['queued_at'])) {
|
if (isset($email['queued_at']) && !empty($email['queued_at'])) {
|
||||||
|
|
|
||||||
|
|
@ -238,17 +238,10 @@ $asset_status_array = array (
|
||||||
);
|
);
|
||||||
|
|
||||||
$ticket_status_array = array (
|
$ticket_status_array = array (
|
||||||
'Pending-Assignment',
|
|
||||||
'Assigned',
|
|
||||||
'Client-Replied',
|
|
||||||
'In-Progress',
|
|
||||||
'Pending-Shipment',
|
|
||||||
'Pending-Client',
|
|
||||||
'Pending-Vendor',
|
|
||||||
'Scheduled',
|
|
||||||
'Closed',
|
|
||||||
'Open',
|
'Open',
|
||||||
'Auto Close'
|
'On Hold',
|
||||||
|
'Auto Close',
|
||||||
|
'Closed'
|
||||||
);
|
);
|
||||||
|
|
||||||
$industry_select_array = array(
|
$industry_select_array = array(
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ if (isset($_POST['add_ticket'])) {
|
||||||
$new_config_ticket_next_number = $config_ticket_next_number + 1;
|
$new_config_ticket_next_number = $config_ticket_next_number + 1;
|
||||||
mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1");
|
mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1");
|
||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 'Open', ticket_created_by = 0, ticket_contact_id = $contact, ticket_client_id = $client_id");
|
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 'New', ticket_created_by = 0, ticket_contact_id = $contact, ticket_client_id = $client_id");
|
||||||
$id = mysqli_insert_id($mysqli);
|
$id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Notify agent DL of the new ticket, if populated with a valid email
|
// Notify agent DL of the new ticket, if populated with a valid email
|
||||||
|
|
@ -88,6 +88,40 @@ if (isset($_POST['add_ticket_comment'])) {
|
||||||
// Update Ticket Last Response Field & set ticket to open as client has replied
|
// Update Ticket Last Response Field & set ticket to open as client has replied
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 'Open' WHERE ticket_id = $ticket_id AND ticket_client_id = $session_client_id LIMIT 1");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 'Open' WHERE ticket_id = $ticket_id AND ticket_client_id = $session_client_id LIMIT 1");
|
||||||
|
|
||||||
|
|
||||||
|
// Get ticket details & Notify the assigned tech (if any)
|
||||||
|
$ticket_details = mysqli_fetch_array(mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN clients ON ticket_client_id = client_id WHERE ticket_id = $ticket_id LIMIT 1"));
|
||||||
|
|
||||||
|
$ticket_number = intval($ticket_details['ticket_number']);
|
||||||
|
$ticket_assigned_to = intval($ticket_details['ticket_assigned_to']);
|
||||||
|
$ticket_subject = sanitizeInput($ticket_details['ticket_subject']);
|
||||||
|
$client_name = sanitizeInput($ticket_details['client_name']);
|
||||||
|
|
||||||
|
if ($ticket_details && $ticket_assigned_to !== 0) {
|
||||||
|
|
||||||
|
// Get tech details
|
||||||
|
$tech_details = mysqli_fetch_array(mysqli_query($mysqli, "SELECT user_email, user_name FROM users WHERE user_id = $ticket_assigned_to LIMIT 1"));
|
||||||
|
$tech_email = sanitizeInput($tech_details['user_email']);
|
||||||
|
$tech_name = sanitizeInput($tech_details['user_name']);
|
||||||
|
|
||||||
|
$subject = "$config_app_name Ticket updated - [$config_ticket_prefix$ticket_number] $ticket_subject";
|
||||||
|
$body = "Hello $tech_name,<br><br>A new reply has been added to the below ticket, check ITFlow for full details.<br><br>Client: $client_name<br>Ticket: $config_ticket_prefix$ticket_number<br>Subject: $ticket_subject<br><br>https://$config_base_url/ticket.php?ticket_id=$ticket_id";
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
[
|
||||||
|
'from' => $config_ticket_from_email,
|
||||||
|
'from_name' => $config_ticket_from_name,
|
||||||
|
'recipient' => $tech_email,
|
||||||
|
'recipient_name' => $tech_name,
|
||||||
|
'subject' => $subject,
|
||||||
|
'body' => $body
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
addToMailQueue($mysqli, $data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Store any attached any files
|
// Store any attached any files
|
||||||
if (!empty($_FILES)) {
|
if (!empty($_FILES)) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ if (isset($_POST['add_ticket'])) {
|
||||||
$client_id = intval($_POST['client']);
|
$client_id = intval($_POST['client']);
|
||||||
$assigned_to = intval($_POST['assigned_to']);
|
$assigned_to = intval($_POST['assigned_to']);
|
||||||
if ($assigned_to == 0) {
|
if ($assigned_to == 0) {
|
||||||
$ticket_status = 'Pending-Assignment';
|
$ticket_status = 'New';
|
||||||
} else {
|
} else {
|
||||||
$ticket_status = 'Assigned';
|
$ticket_status = 'Open';
|
||||||
}
|
}
|
||||||
$contact = intval($_POST['contact']);
|
$contact = intval($_POST['contact']);
|
||||||
$subject = sanitizeInput($_POST['subject']);
|
$subject = sanitizeInput($_POST['subject']);
|
||||||
|
|
@ -329,15 +329,14 @@ if (isset($_POST['assign_ticket'])) {
|
||||||
$ticket_id = intval($_POST['ticket_id']);
|
$ticket_id = intval($_POST['ticket_id']);
|
||||||
$assigned_to = intval($_POST['assigned_to']);
|
$assigned_to = intval($_POST['assigned_to']);
|
||||||
$ticket_status = sanitizeInput($_POST['ticket_status']);
|
$ticket_status = sanitizeInput($_POST['ticket_status']);
|
||||||
if ($ticket_status == 'Pending-Assignment' && $assigned_to > 0) {
|
if ($ticket_status == 'New' && $assigned_to !== 0) {
|
||||||
$ticket_status = 'Assigned';
|
$ticket_status = 'Open';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow for un-assigning tickets
|
// Allow for un-assigning tickets
|
||||||
if ($assigned_to == 0) {
|
if ($assigned_to == 0) {
|
||||||
$ticket_reply = "Ticket unassigned, pending re-assignment.";
|
$ticket_reply = "Ticket unassigned.";
|
||||||
$agent_name = "No One";
|
$agent_name = "No One";
|
||||||
$ticket_status = "Pending-Assignment";
|
|
||||||
} else {
|
} else {
|
||||||
// Get & verify assigned agent details
|
// Get & verify assigned agent details
|
||||||
$agent_details_sql = mysqli_query($mysqli, "SELECT user_name, user_email FROM users LEFT JOIN user_settings ON users.user_id = user_settings.user_id WHERE users.user_id = $assigned_to AND user_settings.user_role > 1");
|
$agent_details_sql = mysqli_query($mysqli, "SELECT user_name, user_email FROM users LEFT JOIN user_settings ON users.user_id = user_settings.user_id WHERE users.user_id = $assigned_to AND user_settings.user_role > 1");
|
||||||
|
|
@ -356,13 +355,14 @@ if (isset($_POST['assign_ticket'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get & verify ticket details
|
// Get & verify ticket details
|
||||||
$ticket_details_sql = mysqli_query($mysqli, "SELECT ticket_prefix, ticket_number, ticket_subject, ticket_client_id FROM tickets WHERE ticket_id = '$ticket_id' AND ticket_status != 'Closed'");
|
$ticket_details_sql = mysqli_query($mysqli, "SELECT ticket_prefix, ticket_number, ticket_subject, ticket_client_id, client_name FROM tickets LEFT JOIN clients ON ticket_client_id = client_id WHERE ticket_id = '$ticket_id' AND ticket_status != 'Closed'");
|
||||||
$ticket_details = mysqli_fetch_array($ticket_details_sql);
|
$ticket_details = mysqli_fetch_array($ticket_details_sql);
|
||||||
|
|
||||||
$ticket_prefix = sanitizeInput($ticket_details['ticket_prefix']);
|
$ticket_prefix = sanitizeInput($ticket_details['ticket_prefix']);
|
||||||
$ticket_number = intval($ticket_details['ticket_number']);
|
$ticket_number = intval($ticket_details['ticket_number']);
|
||||||
$ticket_subject = sanitizeInput($ticket_details['ticket_subject']);
|
$ticket_subject = sanitizeInput($ticket_details['ticket_subject']);
|
||||||
$client_id = intval($ticket_details['ticket_client_id']);
|
$client_id = intval($ticket_details['ticket_client_id']);
|
||||||
|
$client_name = sanitizeInput($ticket_details['client_name']);
|
||||||
|
|
||||||
if (!$ticket_subject) {
|
if (!$ticket_subject) {
|
||||||
$_SESSION['alert_type'] = "error";
|
$_SESSION['alert_type'] = "error";
|
||||||
|
|
@ -394,8 +394,8 @@ if (isset($_POST['assign_ticket'])) {
|
||||||
$config_ticket_from_email = sanitizeInput($config_ticket_from_email);
|
$config_ticket_from_email = sanitizeInput($config_ticket_from_email);
|
||||||
$company_name = sanitizeInput($session_company_name);
|
$company_name = sanitizeInput($session_company_name);
|
||||||
|
|
||||||
$subject = "$config_app_name - ticket $ticket_prefix$ticket_number assigned to you";
|
$subject = "$config_app_name - Ticket $ticket_prefix$ticket_number assigned to you - $ticket_subject";
|
||||||
$body = "Hi $agent_name, <br><br>A ticket has been assigned to you!<br><br>Ticket Number: $ticket_prefix$ticket_number<br> Subject: $ticket_subject <br><br>Thanks, <br>$session_name<br>$company_name";
|
$body = "Hi $agent_name, <br><br>A ticket has been assigned to you!<br><br>Client: $client_name<br>Ticket Number: $ticket_prefix$ticket_number<br> Subject: $ticket_subject<br><br>https://$config_base_url/ticket.php?ticket_id=$ticket_id <br><br>Thanks, <br>$session_name<br>$company_name";
|
||||||
|
|
||||||
// Email Ticket Agent
|
// Email Ticket Agent
|
||||||
// Queue Mail
|
// Queue Mail
|
||||||
|
|
@ -477,15 +477,14 @@ if (isset($_POST['bulk_assign_ticket'])) {
|
||||||
$ticket_subject = sanitizeInput($row['ticket_subject']);
|
$ticket_subject = sanitizeInput($row['ticket_subject']);
|
||||||
$client_id = intval($row['ticket_client_id']);
|
$client_id = intval($row['ticket_client_id']);
|
||||||
|
|
||||||
if ($ticket_status == 'Pending-Assignment' && $assign_to > 0) {
|
if ($ticket_status == 'New' && $assigned_to !== 0) {
|
||||||
$ticket_status = 'Assigned';
|
$ticket_status = 'Open';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow for un-assigning tickets
|
// Allow for un-assigning tickets
|
||||||
if ($assign_to == 0) {
|
if ($assign_to == 0) {
|
||||||
$ticket_reply = "Ticket unassigned, pending re-assignment.";
|
$ticket_reply = "Ticket unassigned, pending re-assignment.";
|
||||||
$agent_name = "No One";
|
$agent_name = "No One";
|
||||||
$ticket_status = "Pending-Assignment";
|
|
||||||
} else {
|
} else {
|
||||||
// Get & verify assigned agent details
|
// Get & verify assigned agent details
|
||||||
$agent_details_sql = mysqli_query($mysqli, "SELECT user_name, user_email FROM users LEFT JOIN user_settings ON users.user_id = user_settings.user_id WHERE users.user_id = $assign_to AND user_settings.user_role > 1");
|
$agent_details_sql = mysqli_query($mysqli, "SELECT user_name, user_email FROM users LEFT JOIN user_settings ON users.user_id = user_settings.user_id WHERE users.user_id = $assign_to AND user_settings.user_role > 1");
|
||||||
|
|
@ -1437,8 +1436,8 @@ if (isset($_POST['set_billable_status'])) {
|
||||||
mysqli_query(
|
mysqli_query(
|
||||||
$mysqli,
|
$mysqli,
|
||||||
"UPDATE tickets SET
|
"UPDATE tickets SET
|
||||||
ticket_billable = '$billable_status'
|
ticket_billable = '$billable_status'
|
||||||
WHERE ticket_id = $ticket_id"
|
WHERE ticket_id = $ticket_id"
|
||||||
);
|
);
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
|
|
@ -1475,7 +1474,7 @@ if (isset($_POST['edit_ticket_schedule'])) {
|
||||||
"UPDATE tickets SET
|
"UPDATE tickets SET
|
||||||
ticket_schedule = '$schedule',
|
ticket_schedule = '$schedule',
|
||||||
ticket_onsite = '$onsite',
|
ticket_onsite = '$onsite',
|
||||||
ticket_status = 'Scheduled'
|
ticket_status = 'On Hold'
|
||||||
WHERE ticket_id = $ticket_id"
|
WHERE ticket_id = $ticket_id"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
26
ticket.php
26
ticket.php
|
|
@ -59,7 +59,7 @@ if (isset($_GET['ticket_id'])) {
|
||||||
$ticket_scheduled_for = nullable_htmlentities($row['ticket_schedule']);
|
$ticket_scheduled_for = nullable_htmlentities($row['ticket_schedule']);
|
||||||
$ticket_onsite = nullable_htmlentities($row['ticket_onsite']);
|
$ticket_onsite = nullable_htmlentities($row['ticket_onsite']);
|
||||||
|
|
||||||
//Set Ticket Bage Color based of priority
|
//Set Ticket Badge Color based of priority
|
||||||
if ($ticket_priority == "High") {
|
if ($ticket_priority == "High") {
|
||||||
$ticket_priority_display = "<span class='p-2 badge badge-danger'>$ticket_priority</span>";
|
$ticket_priority_display = "<span class='p-2 badge badge-danger'>$ticket_priority</span>";
|
||||||
} elseif ($ticket_priority == "Medium") {
|
} elseif ($ticket_priority == "Medium") {
|
||||||
|
|
@ -72,16 +72,16 @@ if (isset($_GET['ticket_id'])) {
|
||||||
$ticket_feedback = nullable_htmlentities($row['ticket_feedback']);
|
$ticket_feedback = nullable_htmlentities($row['ticket_feedback']);
|
||||||
|
|
||||||
$ticket_status = nullable_htmlentities($row['ticket_status']);
|
$ticket_status = nullable_htmlentities($row['ticket_status']);
|
||||||
if ($ticket_status == "Pending-Assignment") {
|
if ($ticket_status == "New") {
|
||||||
$ticket_status_display = "<span class='p-2 badge badge-danger'>$ticket_status</span>";
|
$ticket_status_display = "<span class='p-2 badge badge-danger'>$ticket_status</span>";
|
||||||
} elseif ($ticket_status == "Assigned") {
|
} elseif ($ticket_status == "Open") {
|
||||||
$ticket_status_display = "<span class='p-2 badge badge-primary'>$ticket_status</span>";
|
$ticket_status_display = "<span class='p-2 badge badge-primary'>$ticket_status</span>";
|
||||||
} elseif ($ticket_status == "In-Progress") {
|
} elseif ($ticket_status == "On Hold") {
|
||||||
$ticket_status_display = "<span class='p-2 badge badge-success'>$ticket_status</span>";
|
$ticket_status_display = "<span class='p-2 badge badge-success'>$ticket_status</span>";
|
||||||
} elseif ($ticket_status == "Closed") {
|
} elseif ($ticket_status == "Auto Close" || $ticket_status == "Closed") {
|
||||||
$ticket_status_display = "<span class='p-2 badge badge-dark'>$ticket_status</span>";
|
$ticket_status_display = "<span class='p-2 badge badge-dark'>$ticket_status</span>";
|
||||||
} else {
|
} else {
|
||||||
$ticket_status_display = "<span class='p-2 badge badge-secondary'>$ticket_status</span>";
|
$ticket_status_display = "<span class='p-2 badge badge-secondary'>$ticket_status</span>"; // To be removed
|
||||||
}
|
}
|
||||||
|
|
||||||
$ticket_vendor_ticket_number = nullable_htmlentities($row['ticket_vendor_ticket_number']);
|
$ticket_vendor_ticket_number = nullable_htmlentities($row['ticket_vendor_ticket_number']);
|
||||||
|
|
@ -328,18 +328,12 @@ if (isset($_GET['ticket_id'])) {
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="status" required>
|
<select class="form-control select2" name="status" required>
|
||||||
<option <?php if ($ticket_status == "In-Progress") {
|
<option <?php if ($ticket_status == "Open") {
|
||||||
echo "selected";
|
echo "selected";
|
||||||
} ?>>In-Progress</option>
|
} ?>>Open</option>
|
||||||
<option <?php if ($ticket_status == "Pending-Client") {
|
<option <?php if ($ticket_status == "On Hold") {
|
||||||
echo "selected";
|
echo "selected";
|
||||||
} ?>>Pending-Client</option>
|
} ?>>On Hold</option>
|
||||||
<option <?php if ($ticket_status == "Pending-Vendor") {
|
|
||||||
echo "selected";
|
|
||||||
} ?>>Pending-Vendor</option>
|
|
||||||
<option <?php if ($ticket_status == "Pending-Shipment") {
|
|
||||||
echo "selected";
|
|
||||||
} ?>>Pending-Shipment</option>
|
|
||||||
<?php if ($config_ticket_autoclose) { ?>
|
<?php if ($config_ticket_autoclose) { ?>
|
||||||
<option <?php if ($ticket_status == 'Auto Close') {
|
<option <?php if ($ticket_status == 'Auto Close') {
|
||||||
echo "selected";
|
echo "selected";
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" class="custom-control-input" id="bulkPrivateCheckbox" name="bulk_private_note" value="1">
|
<input type="checkbox" class="custom-control-input" id="bulkPrivateCheckbox" name="bulk_private_note" value="1">
|
||||||
<label class="custom-control-label" for="bulkPrivateCheckbox">Mark as a Private</label>
|
<label class="custom-control-label" for="bulkPrivateCheckbox">Mark as Internal</label>
|
||||||
<small class="form-text text-muted">If checked the contact and any watcher will not be informed</small>
|
<small class="form-text text-muted">If checked this note will only be visible to agents. The contact / watcher will not be informed this ticket was closed.</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-lg">
|
||||||
<div class="modal-content bg-dark">
|
<div class="modal-content bg-dark">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-paper-plane mr-2"></i>Bulk Reply</h5>
|
<h5 class="modal-title"><i class="fas fa-fw fa-paper-plane mr-2"></i>Bulk Update/Reply</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -16,11 +16,8 @@
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="bulk_status">
|
<select class="form-control select2" name="bulk_status">
|
||||||
<option>In-Progress</option>
|
<option>Open</option>
|
||||||
<option>Pending-Client</option>
|
<option>On Hold</option>
|
||||||
<option>Pending-Vendor</option>
|
|
||||||
<option>Pending-Shipment</option>
|
|
||||||
<option>Scheduled</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -31,8 +28,8 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" class="custom-control-input" id="bulkPrivateReplyCheckbox" name="bulk_private_reply" value="1">
|
<input type="checkbox" class="custom-control-input" id="bulkPrivateReplyCheckbox" name="bulk_private_reply" value="1">
|
||||||
<label class="custom-control-label" for="bulkPrivateReplyCheckbox">Mark as a Private</label>
|
<label class="custom-control-label" for="bulkPrivateReplyCheckbox">Mark as internal</label>
|
||||||
<small class="form-text text-muted">If checked the contact and any watcher will not be informed</small>
|
<small class="form-text text-muted">If checked this note will only be visible to agents.</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
52
tickets.php
52
tickets.php
|
|
@ -163,7 +163,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkReplyTicketModal">
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkReplyTicketModal">
|
||||||
<i class="fas fa-fw fa-paper-plane mr-2"></i>Bulk Reply
|
<i class="fas fa-fw fa-paper-plane mr-2"></i>Bulk Update/Reply
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -236,24 +236,18 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Ticket Status</label>
|
<label>Ticket Status</label>
|
||||||
<select class="form-control select2" name="status[]" data-placeholder="Select Status" multiple>
|
<select class="form-control select2" name="status[]" data-placeholder="Select Status" multiple>
|
||||||
<option value="In-Progress" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('In-Progress', $_GET['status'])) {
|
<option value="New" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('New', $_GET['status'])) {
|
||||||
echo 'selected';
|
echo 'selected';
|
||||||
} ?>>In-Progress</option>
|
} ?>>New</option>
|
||||||
<option value="Client-Replied" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Client-Replied', $_GET['status'])) {
|
<option value="Open" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Open', $_GET['status'])) {
|
||||||
echo 'selected';
|
echo 'selected';
|
||||||
} ?>>Client-Replied</option>
|
} ?>>Open</option>
|
||||||
<option value="Pending-Client" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Pending-Client', $_GET['status'])) {
|
<option value="On Hold" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('On Hold', $_GET['status'])) {
|
||||||
echo 'selected';
|
echo 'selected';
|
||||||
} ?>>Pending-Client</option>
|
} ?>>On Hold</option>
|
||||||
<option value="Pending-Vendor" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Pending-Vendor', $_GET['status'])) {
|
<option value="Auto Close" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Auto Close', $_GET['status'])) {
|
||||||
echo 'selected';
|
echo 'selected';
|
||||||
} ?>>Pending-Vendor</option>
|
} ?>>Auto Close</option>
|
||||||
<option value="Pending-Shipment" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Pending-Shipment', $_GET['status'])) {
|
|
||||||
echo 'selected';
|
|
||||||
} ?>>Pending-Shipment</option>
|
|
||||||
<option value="Scheduled" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Scheduled', $_GET['status'])) {
|
|
||||||
echo 'selected';
|
|
||||||
} ?>>Scheduled</option>
|
|
||||||
<option value="Closed" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Closed', $_GET['status'])) {
|
<option value="Closed" <?php if (isset($_GET['status']) && is_array($_GET['status']) && in_array('Closed', $_GET['status'])) {
|
||||||
echo 'selected';
|
echo 'selected';
|
||||||
} ?>>Closed</option>
|
} ?>>Closed</option>
|
||||||
|
|
@ -338,6 +332,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
$ticket_priority = nullable_htmlentities($row['ticket_priority']);
|
$ticket_priority = nullable_htmlentities($row['ticket_priority']);
|
||||||
$ticket_status = nullable_htmlentities($row['ticket_status']);
|
$ticket_status = nullable_htmlentities($row['ticket_status']);
|
||||||
$ticket_billable = intval($row['ticket_billable']);
|
$ticket_billable = intval($row['ticket_billable']);
|
||||||
|
$ticket_scheduled_for = nullable_htmlentities($row['ticket_schedule']);
|
||||||
$ticket_vendor_ticket_number = nullable_htmlentities($row['ticket_vendor_ticket_number']);
|
$ticket_vendor_ticket_number = nullable_htmlentities($row['ticket_vendor_ticket_number']);
|
||||||
$ticket_created_at = nullable_htmlentities($row['ticket_created_at']);
|
$ticket_created_at = nullable_htmlentities($row['ticket_created_at']);
|
||||||
$ticket_created_at_time_ago = timeAgo($row['ticket_created_at']);
|
$ticket_created_at_time_ago = timeAgo($row['ticket_created_at']);
|
||||||
|
|
@ -362,20 +357,17 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||||
$contact_extension = nullable_htmlentities($row['contact_extension']);
|
$contact_extension = nullable_htmlentities($row['contact_extension']);
|
||||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||||
if ($ticket_status == "Pending-Assignment") {
|
|
||||||
|
if ($ticket_status == "New") {
|
||||||
$ticket_status_color = "danger";
|
$ticket_status_color = "danger";
|
||||||
} elseif ($ticket_status == "Assigned") {
|
} elseif ($ticket_status == "Open") {
|
||||||
$ticket_status_color = "primary";
|
$ticket_status_color = "primary";
|
||||||
} elseif ($ticket_status == "In-Progress") {
|
} elseif ($ticket_status == "On Hold") {
|
||||||
$ticket_status_color = "success";
|
$ticket_status_color = "success";
|
||||||
} elseif ($ticket_status == "Closed") {
|
|
||||||
$ticket_status_color = "dark";
|
|
||||||
} elseif ($ticket_status == "Auto Close") {
|
} elseif ($ticket_status == "Auto Close") {
|
||||||
$ticket_status_color = "dark";
|
$ticket_status_color = "dark";
|
||||||
} elseif ($ticket_status == "Client-Replied") {
|
} elseif ($ticket_status == "Closed") {
|
||||||
$ticket_status_color = "warning";
|
$ticket_status_color = "dark";
|
||||||
} else {
|
|
||||||
$ticket_status_color = "secondary";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ticket_priority == "High") {
|
if ($ticket_priority == "High") {
|
||||||
|
|
@ -385,6 +377,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
} else {
|
} else {
|
||||||
$ticket_priority_color = "info";
|
$ticket_priority_color = "info";
|
||||||
}
|
}
|
||||||
|
|
||||||
$ticket_assigned_to = intval($row['ticket_assigned_to']);
|
$ticket_assigned_to = intval($row['ticket_assigned_to']);
|
||||||
if (empty($ticket_assigned_to)) {
|
if (empty($ticket_assigned_to)) {
|
||||||
if ($ticket_status == "Closed") {
|
if ($ticket_status == "Closed") {
|
||||||
|
|
@ -430,8 +423,8 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
|
|
||||||
<div class="mt-1"><?php echo $contact_display; ?></div>
|
<div class="mt-1"><?php echo $contact_display; ?></div>
|
||||||
</td>
|
</td>
|
||||||
<?php if ($config_module_enable_accounting) {
|
|
||||||
?>
|
<?php if ($config_module_enable_accounting) { ?>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="#" data-toggle="modal" data-target="#editTicketBillableModal<?php echo $ticket_id; ?>">
|
<a href="#" data-toggle="modal" data-target="#editTicketBillableModal<?php echo $ticket_id; ?>">
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -442,11 +435,10 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
<td><a href="#" data-toggle="modal" data-target="#editTicketPriorityModal<?php echo $ticket_id; ?>"><span class='p-2 badge badge-pill badge-<?php echo $ticket_priority_color; ?>'><?php echo $ticket_priority; ?></span></a></td>
|
<td><a href="#" data-toggle="modal" data-target="#editTicketPriorityModal<?php echo $ticket_id; ?>"><span class='p-2 badge badge-pill badge-<?php echo $ticket_priority_color; ?>'><?php echo $ticket_priority; ?></span></a></td>
|
||||||
<td><span class='p-2 badge badge-pill badge-<?php echo $ticket_status_color; ?>'><?php echo $ticket_status; ?></span></td>
|
<td><span class='p-2 badge badge-pill badge-<?php echo $ticket_status_color; ?>'><?php echo $ticket_status; ?></span> <?php if ($ticket_status == 'On Hold' && isset ($ticket_scheduled_for)) { echo "<div class=\"mt-1\"> <small class='text-secondary'> $ticket_scheduled_for </small></div>"; } ?></td>
|
||||||
<td><a href="#" data-toggle="modal" data-target="#assignTicketModal<?php echo $ticket_id; ?>"><?php echo $ticket_assigned_to_display; ?></a></td>
|
<td><a href="#" data-toggle="modal" data-target="#assignTicketModal<?php echo $ticket_id; ?>"><?php echo $ticket_assigned_to_display; ?></a></td>
|
||||||
<td><?php echo $ticket_updated_at_display; ?></td>
|
<td><?php echo $ticket_updated_at_display; ?></td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue