From 32bcb9ddfed96638498af04980077600b690e9fd Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 26 Apr 2016 13:41:09 -0400 Subject: [PATCH 1/2] I think this should work, still needto test --- inc/pipe_functions.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/pipe_functions.inc.php b/inc/pipe_functions.inc.php index 8b7ee1c2..3a1f23ed 100755 --- a/inc/pipe_functions.inc.php +++ b/inc/pipe_functions.inc.php @@ -220,7 +220,11 @@ function hesk_email2ticket($results, $pop3 = 0, $set_category = 1, $set_priority $ticket['lastreplier'] = ($tmpvar['name'] == $hesklang['pde']) ? $tmpvar['email'] : $tmpvar['name'];; // If staff hasn't replied yet, keep ticket status "New", otherwise set it to "Waiting reply from staff" - $ticket['status'] = $ticket['status'] ? 1 : 0; + $new_status_rs = hesk_dbQuery("SELECT `id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `IsNewTicketStatus` = 1"); + $waiting_reply_rs = hesk_dbQuery("SELECT `id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `IsCustomerReplyStatus` = 1"); + $new_status = hesk_dbFetchAssoc($new_status_rs); + $waiting_reply_rs = hesk_dbFetchAssoc($waiting_reply_rs); + $ticket['status'] = $ticket['status'] ? $waiting_reply_rs['id'] : $new_status['id']; // Update ticket as necessary hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `lastchange`=NOW(),`status`='{$ticket['status']}',`replies`=`replies`+1,`lastreplier`='0' WHERE `id`='" . intval($ticket['id']) . "' LIMIT 1"); From e9dfaa346070858a25db78944d8c96333f3b2d25 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 26 Apr 2016 21:56:30 -0400 Subject: [PATCH 2/2] Add blank due date when piping in a ticket --- inc/pipe_functions.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/pipe_functions.inc.php b/inc/pipe_functions.inc.php index 3a1f23ed..0719fd20 100755 --- a/inc/pipe_functions.inc.php +++ b/inc/pipe_functions.inc.php @@ -310,6 +310,7 @@ function hesk_email2ticket($results, $pop3 = 0, $set_category = 1, $set_priority $tmpvar['user_agent'] = NULL; $tmpvar['screen_resolution_width'] = "NULL"; $tmpvar['screen_resolution_height'] = "NULL"; + $tmpvar['due_date'] = ""; // Insert ticket to database $ticket = hesk_newTicket($tmpvar);