From 01bf1146e15ad3c100d36702978714066135c89f Mon Sep 17 00:00:00 2001 From: Pererinha Date: Thu, 15 Jan 2015 21:03:25 -0200 Subject: [PATCH] partial #4437 --- include/library/Crunchbutton/Community/Shift.php | 2 +- include/library/Crunchbutton/Support.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/library/Crunchbutton/Community/Shift.php b/include/library/Crunchbutton/Community/Shift.php index af93817fd..74aafb581 100644 --- a/include/library/Crunchbutton/Community/Shift.php +++ b/include/library/Crunchbutton/Community/Shift.php @@ -652,7 +652,7 @@ class Crunchbutton_Community_Shift extends Cana_Table { $num = ( $txt != '' ) ? $txt : $phone; $cs_message = 'Driver notificaton: ' . str_replace( '|', '
', $message ); - // Crunchbutton_Support::createNewWarning( [ 'body' => $cs_message, 'phone' => $num ] ); + Crunchbutton_Support::createNewWarning( [ 'dont_open_ticket' => false, 'body' => $cs_message, 'phone' => $num ] ); if (strpos( $message, '|') > 0) { $message = str_replace('|', "\n", $message); diff --git a/include/library/Crunchbutton/Support.php b/include/library/Crunchbutton/Support.php index b0102c9aa..87972ccef 100644 --- a/include/library/Crunchbutton/Support.php +++ b/include/library/Crunchbutton/Support.php @@ -284,7 +284,10 @@ class Crunchbutton_Support extends Cana_Table { } if( $support && $support->id_support ){ - $support->status = Crunchbutton_Support::STATUS_OPEN; + $open = isset( $params[ 'dont_open_ticket' ] ) ? false : true; + if( $open ){ + $support->status = Crunchbutton_Support::STATUS_OPEN; + } } else { $support = new Crunchbutton_Support(); $support->type = Crunchbutton_Support::TYPE_WARNING;