From 79c40bc505c9f9834b6b7424f407d00c2fd4889f Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 9 Dec 2019 22:51:49 -0800 Subject: [PATCH 01/14] Fix starred conversations counter --- app/Conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Conversation.php b/app/Conversation.php index 43b78f804..254a40166 100644 --- a/app/Conversation.php +++ b/app/Conversation.php @@ -816,7 +816,7 @@ public static function clearStarredByUserCache($user_id) */ public static function getUserStarredConversationIds($mailbox_id, $user_id = null) { - return \Cache::rememberForever('user_starred_conversations_'.$user_id, function () use ($mailbox_id, $user_id) { + return \Cache::rememberForever('user_starred_conversations_'.$user_id.'_'.$mailbox_id, function () use ($mailbox_id, $user_id) { // Get user's folder $folder = Folder::select('id') ->where('mailbox_id', $mailbox_id) From 046f0ce79df975da04f3a3f16d9698f45d981297 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 9 Dec 2019 23:12:58 -0800 Subject: [PATCH 02/14] Remove user variables from the mailbox signature - closes #383 --- public/js/main.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public/js/main.js b/public/js/main.js index 54f73d6f8..ae64b2132 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -287,7 +287,10 @@ function mailboxUpdateInit(from_name_custom) { $(document).ready(function(){ - summernoteInit('#signature', {insertVar: true}); + summernoteInit('#signature', { + insertVar: true, + excludeVars: ['%user.'] + }); $('#from_name').change(function(event) { if ($(this).val() == from_name_custom) { @@ -370,6 +373,18 @@ function summernoteInit(selector, new_options) $(this).val(''); }); } + + // Hide some variables + if (typeof(new_options.excludeVars) != "undefined" || new_options.excludeVars) { + $(selector).parent().children().find('.summernote-inservar:first option').each(function(i, el) { + for (var var_i = 0; var_i < new_options.excludeVars.length; var_i++) { + if ($(el).val().indexOf(new_options.excludeVars[var_i]) != -1) { + $(el).parent().hide(); + break; + } + } + }); + } } } }; From 1b3020d99a22c66524e9219087b87566e0957add Mon Sep 17 00:00:00 2001 From: FreeScout Date: Tue, 10 Dec 2019 00:21:01 -0800 Subject: [PATCH 03/14] Text Before The Reply option for the mailbox - closes #349 --- app/Mailbox.php | 2 +- ...before_reply_column_to_mailboxes_table.php | 32 +++++++++++++++++++ .../emails/customer/reply_fancy.blade.php | 3 ++ .../customer/reply_fancy_text.blade.php | 4 ++- resources/views/mailboxes/update.blade.php | 14 ++++++++ 5 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2019_12_10_0856000_add_before_reply_column_to_mailboxes_table.php diff --git a/app/Mailbox.php b/app/Mailbox.php index 912f44bce..2883df50a 100644 --- a/app/Mailbox.php +++ b/app/Mailbox.php @@ -107,7 +107,7 @@ class Mailbox extends Model * * @var [type] */ - protected $fillable = ['name', 'slug', 'email', 'aliases', 'auto_bcc', 'from_name', 'from_name_custom', 'ticket_status', 'ticket_assignee', 'template', 'signature', 'out_method', 'out_server', 'out_username', 'out_password', 'out_port', 'out_encryption', 'in_server', 'in_port', 'in_username', 'in_password', 'in_protocol', 'in_encryption', 'in_validate_cert', 'auto_reply_enabled', 'auto_reply_subject', 'auto_reply_message', 'office_hours_enabled', 'ratings', 'ratings_placement', 'ratings_text']; + protected $fillable = ['name', 'slug', 'email', 'aliases', 'auto_bcc', 'from_name', 'from_name_custom', 'ticket_status', 'ticket_assignee', 'template', 'before_reply', 'signature', 'out_method', 'out_server', 'out_username', 'out_password', 'out_port', 'out_encryption', 'in_server', 'in_port', 'in_username', 'in_password', 'in_protocol', 'in_encryption', 'in_validate_cert', 'auto_reply_enabled', 'auto_reply_subject', 'auto_reply_message', 'office_hours_enabled', 'ratings', 'ratings_placement', 'ratings_text']; protected static function boot() { diff --git a/database/migrations/2019_12_10_0856000_add_before_reply_column_to_mailboxes_table.php b/database/migrations/2019_12_10_0856000_add_before_reply_column_to_mailboxes_table.php new file mode 100644 index 000000000..56199f025 --- /dev/null +++ b/database/migrations/2019_12_10_0856000_add_before_reply_column_to_mailboxes_table.php @@ -0,0 +1,32 @@ +text('before_reply')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('mailboxes', function (Blueprint $table) { + $table->dropColumn('before_reply'); + }); + } +} diff --git a/resources/views/emails/customer/reply_fancy.blade.php b/resources/views/emails/customer/reply_fancy.blade.php index 2675a01e1..63b607943 100644 --- a/resources/views/emails/customer/reply_fancy.blade.php +++ b/resources/views/emails/customer/reply_fancy.blade.php @@ -43,6 +43,9 @@
+ @if ($thread->source_via == App\Thread::PERSON_USER && $mailbox->before_reply) + {{ $mailbox->before_reply }}

+ @endif {!! $thread->body !!} @action('reply_email.before_signature', $thread, $loop, $threads, $conversation, $mailbox) diff --git a/resources/views/emails/customer/reply_fancy_text.blade.php b/resources/views/emails/customer/reply_fancy_text.blade.php index 46476c7cf..99f817f09 100644 --- a/resources/views/emails/customer/reply_fancy_text.blade.php +++ b/resources/views/emails/customer/reply_fancy_text.blade.php @@ -2,7 +2,9 @@ @foreach ($threads as $thread) ----------------------------------------------------------- @if (!$loop->first)## {{--@if ($loop->last){{ __(':person sent a message', ['person' => $thread->getFromName($mailbox)]) }}@else {{ __(':person replied', ['person' => $thread->getFromName($mailbox)]) }}@endif--}}{{ $thread->getFromName($mailbox) }}, {{ __('on :date', ['date' => App\Customer::dateFormat($thread->created_at, 'M j @ H:i')]) }} ({{ \Config::get('app.timezone') }}):@endif -{{-- Html2Text\Html2Text::convert($thread->body) - this was causing "AttValue: " expected in Entity" error sometimes --}}{{ (new Html2Text\Html2Text($thread->body))->getText() }} +{{-- Html2Text\Html2Text::convert($thread->body) - this was causing "AttValue: " expected in Entity" error sometimes --}}@if ($thread->source_via == App\Thread::PERSON_USER && $mailbox->before_reply){{ (new Html2Text\Html2Text($mailbox->before_reply))->getText() }} + +@endif{{ (new Html2Text\Html2Text($thread->body))->getText() }} @if ($thread->source_via == App\Thread::PERSON_USER) {{-- Html2Text\Html2Text::convert($conversation->mailbox->signature) --}}{{ (new Html2Text\Html2Text($conversation->getSignatureProcessed(['thread' => $thread])))->getText() }} diff --git a/resources/views/mailboxes/update.blade.php b/resources/views/mailboxes/update.blade.php index de5edb12c..9c3371845 100644 --- a/resources/views/mailboxes/update.blade.php +++ b/resources/views/mailboxes/update.blade.php @@ -141,6 +141,20 @@
+
+ + +
+
+ + + +
+ + @include('partials/field_error', ['field'=>'before_reply']) +
+
+
From 52bc01dede8d439e4953923ea7f118846d6877fc Mon Sep 17 00:00:00 2001 From: FreeScout Date: Tue, 10 Dec 2019 02:00:12 -0800 Subject: [PATCH 04/14] Create customer from Change customer dialog - closes #49 --- app/Http/Controllers/CustomersController.php | 53 +++++++++++++ public/css/style.css | 3 + public/js/laroute.js | 6 +- public/js/main.js | 78 ++++++++++++++----- .../ajax_html/change_customer.blade.php | 4 +- routes/web.php | 9 ++- 6 files changed, 126 insertions(+), 27 deletions(-) diff --git a/app/Http/Controllers/CustomersController.php b/app/Http/Controllers/CustomersController.php index 72b70effc..d995ecbe3 100644 --- a/app/Http/Controllers/CustomersController.php +++ b/app/Http/Controllers/CustomersController.php @@ -316,4 +316,57 @@ public function ajaxSearch(Request $request) return \Response::json($response); } + + /** + * Ajax controller. + */ + public function ajax(Request $request) + { + $response = [ + 'status' => 'error', + 'msg' => '', // this is error message + ]; + + $user = auth()->user(); + + switch ($request->action) { + + // Change conversation user + case 'create': + // First name or email must be specified + $validator = Validator::make($request->all(), [ + 'first_name' => 'required|string|max:255', + 'last_name' => 'nullable|string|max:255', + 'email' => 'required|email|unique:emails,email', + ]); + + if ($validator->fails()) { + foreach ($validator->errors()->getMessages()as $errors) { + foreach ($errors as $field => $message) { + $response['msg'] .= $message.' '; + } + } + } + + if (!$response['msg']) { + + $customer = Customer::create($request->email, $request->all()); + if ($customer) { + $response['email'] = $request->email; + $response['status'] = 'success'; + } + } + break; + + default: + $response['msg'] = 'Unknown action'; + break; + } + + if ($response['status'] == 'error' && empty($response['msg'])) { + $response['msg'] = 'Unknown error occured'; + } + + return \Response::json($response); + } } diff --git a/public/css/style.css b/public/css/style.css index 46dc422e0..1a97d1838 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -3880,6 +3880,9 @@ a.disabled:focus { .clickable { cursor: pointer; } +#change-customer-create .form-group { + margin-bottom: 4px; +} /** * Only main content is visible diff --git a/public/js/laroute.js b/public/js/laroute.js index cdfc35624..6f99e1466 100644 --- a/public/js/laroute.js +++ b/public/js/laroute.js @@ -44,9 +44,13 @@ "name": "mailboxes.ajax" }, { - "uri": "customer\/ajax-search", + "uri": "customers\/ajax-search", "name": "customers.ajax_search" }, + { + "uri": "customers\/ajax", + "name": "customers.ajax" + }, { "uri": "modules\/ajax", "name": "modules.ajax" diff --git a/public/js/main.js b/public/js/main.js index ae64b2132..f28cf7967 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -2070,7 +2070,8 @@ function changeCustomerInit() data: function (params) { return { q: params.term, - exclude_email: input.attr('data-customer_email') + exclude_email: input.attr('data-customer_email'), + search_by: 'all' //use_id: true }; } @@ -2105,33 +2106,70 @@ function changeCustomerInit() size: 'sm', on_show: function(modal) { modal.children().find('.change-customer-ok:first').click(function(e) { - fsAjax({ - action: 'conversation_change_customer', - customer_email: $(this).attr('data-customer_email'), - conversation_id: getGlobalAttr('conversation_id') - }, - laroute.route('conversations.ajax'), - function(response) { - if (typeof(response.status) != "undefined" && response.status == 'success') { - if (typeof(response.redirect_url) != "undefined") { - window.location.href = response.redirect_url; - } else { - window.location.href = ''; - } - } else { - showAjaxError(response); - loaderHide(); - } - } - ); + conversationChangeCustomer($(this).attr('data-customer_email')); }); } }); e.preventDefault(); }); + + $("#change-customer-create-trigger a:first").click(function(e){ + $('#change-customer-create').removeClass('hidden'); + $(this).hide(); + e.preventDefault(); + }); + + $("#change-customer-create form:first").submit(function(e){ + e.preventDefault(); + }); + + $("#change-customer-create button:first").click(function(e){ + var button = $(this); + + button.button('loading'); + + var data = button.parents('form:first').serialize(); + data += '&action=create'; + + fsAjax(data, + laroute.route('customers.ajax'), + function(response) { + showAjaxResult(response); + + if (typeof(response.status) != "undefined" && response.status == 'success') { + conversationChangeCustomer(response.email); + } + + ajaxFinish(); + } + ); + }); }); } +function conversationChangeCustomer(email) +{ + fsAjax({ + action: 'conversation_change_customer', + customer_email: email, + conversation_id: getGlobalAttr('conversation_id') + }, + laroute.route('conversations.ajax'), + function(response) { + if (typeof(response.status) != "undefined" && response.status == 'success') { + if (typeof(response.redirect_url) != "undefined") { + window.location.href = response.redirect_url; + } else { + window.location.href = ''; + } + } else { + showAjaxError(response); + loaderHide(); + } + } + ); +} + // Move conversation modal function initMoveConv() { diff --git a/resources/views/conversations/ajax_html/change_customer.blade.php b/resources/views/conversations/ajax_html/change_customer.blade.php index 5fab64338..893c9fbd3 100644 --- a/resources/views/conversations/ajax_html/change_customer.blade.php +++ b/resources/views/conversations/ajax_html/change_customer.blade.php @@ -28,12 +28,12 @@
- +
\ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 272817f09..6e1457139 100644 --- a/routes/web.php +++ b/routes/web.php @@ -77,10 +77,11 @@ Route::post('/mailbox/ajax', ['uses' => 'MailboxesController@ajax', 'laroute' => true])->name('mailboxes.ajax'); // Customers -Route::get('/customer/{id}/edit', 'CustomersController@update')->name('customers.update'); -Route::post('/customer/{id}/edit', 'CustomersController@updateSave'); -Route::get('/customer/{id}/', 'CustomersController@conversations')->name('customers.conversations'); -Route::get('/customer/ajax-search', ['uses' => 'CustomersController@ajaxSearch', 'laroute' => true])->name('customers.ajax_search'); +Route::get('/customers/{id}/edit', 'CustomersController@update')->name('customers.update'); +Route::post('/customers/{id}/edit', 'CustomersController@updateSave'); +Route::get('/customers/{id}/', 'CustomersController@conversations')->name('customers.conversations'); +Route::get('/customers/ajax-search', ['uses' => 'CustomersController@ajaxSearch', 'laroute' => true])->name('customers.ajax_search'); +Route::post('/customers/ajax', ['uses' => 'CustomersController@ajax', 'laroute' => true])->name('customers.ajax'); // Translate Route::post('/translations/send', ['uses' => 'TranslateController@postSend', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('translations.send'); From eaf5bb245b93d5eace19e1b248b2962449650709 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Tue, 10 Dec 2019 02:04:27 -0800 Subject: [PATCH 05/14] Text Before The Reply option for the mailbox --- resources/views/mailboxes/update.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/mailboxes/update.blade.php b/resources/views/mailboxes/update.blade.php index 9c3371845..68c5b4c7f 100644 --- a/resources/views/mailboxes/update.blade.php +++ b/resources/views/mailboxes/update.blade.php @@ -148,7 +148,7 @@
- +
@include('partials/field_error', ['field'=>'before_reply']) From bba3f071ee577f48cc6646186c59fc2af94f7ce5 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Wed, 11 Dec 2019 00:37:05 -0800 Subject: [PATCH 06/14] Text Before The Reply option for the mailbox --- public/css/style.css | 13 +++++++------ public/js/main.js | 13 +++++++++++++ .../emails/customer/reply_fancy_text.blade.php | 4 +--- resources/views/mailboxes/update.blade.php | 13 +++++++++---- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 1a97d1838..1f8355690 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -393,6 +393,9 @@ a.navbar-brand:hover img { padding: 1px 11px 4px; width: 250px; } +.form-nav-search .input-group { + padding-top: 3px; +} /*.navbar-nav > li > .dropdown-menu { margin-top: -10px; border-radius: 3px; @@ -422,6 +425,10 @@ a.navbar-brand:hover img { /** * Forms */ +.input-group-addon { + line-height: 11px; + background-color: transparent; +} select.placeholdered { color: #B4C0D4; } @@ -475,9 +482,6 @@ select.form-control { padding-right: 7px; position: relative; } -.input-group { - padding-top: 3px; -} .input-group-btn .btn { height: 28px; } @@ -3427,9 +3431,6 @@ ul.prev-convs { .section-search { line-height: inherit; } -.section-search .input-group { - padding-top: 0; -} .flexy { display: flex; } diff --git a/public/js/main.js b/public/js/main.js index f28cf7967..bde6887f8 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -299,6 +299,19 @@ function mailboxUpdateInit(from_name_custom) $('#from_name_custom_container').addClass('hidden'); } }); + + $('#before-reply-toggle').change(function(event) { + if ($(this).is(':checked')) { + $('#before_reply').removeAttr('readonly').val($('#before_reply').attr('data-default')); + } else { + $('#before_reply').attr('readonly', 'readonly'); + var val = $('#before_reply').val(); + if (val) { + $('#before_reply').attr('data-default', val).attr('placeholder', val); + $('#before_reply').val(''); + } + } + }); }); } diff --git a/resources/views/emails/customer/reply_fancy_text.blade.php b/resources/views/emails/customer/reply_fancy_text.blade.php index 99f817f09..46476c7cf 100644 --- a/resources/views/emails/customer/reply_fancy_text.blade.php +++ b/resources/views/emails/customer/reply_fancy_text.blade.php @@ -2,9 +2,7 @@ @foreach ($threads as $thread) ----------------------------------------------------------- @if (!$loop->first)## {{--@if ($loop->last){{ __(':person sent a message', ['person' => $thread->getFromName($mailbox)]) }}@else {{ __(':person replied', ['person' => $thread->getFromName($mailbox)]) }}@endif--}}{{ $thread->getFromName($mailbox) }}, {{ __('on :date', ['date' => App\Customer::dateFormat($thread->created_at, 'M j @ H:i')]) }} ({{ \Config::get('app.timezone') }}):@endif -{{-- Html2Text\Html2Text::convert($thread->body) - this was causing "AttValue: " expected in Entity" error sometimes --}}@if ($thread->source_via == App\Thread::PERSON_USER && $mailbox->before_reply){{ (new Html2Text\Html2Text($mailbox->before_reply))->getText() }} - -@endif{{ (new Html2Text\Html2Text($thread->body))->getText() }} +{{-- Html2Text\Html2Text::convert($thread->body) - this was causing "AttValue: " expected in Entity" error sometimes --}}{{ (new Html2Text\Html2Text($thread->body))->getText() }} @if ($thread->source_via == App\Thread::PERSON_USER) {{-- Html2Text\Html2Text::convert($conversation->mailbox->signature) --}}{{ (new Html2Text\Html2Text($conversation->getSignatureProcessed(['thread' => $thread])))->getText() }} diff --git a/resources/views/mailboxes/update.blade.php b/resources/views/mailboxes/update.blade.php index 68c5b4c7f..96e926908 100644 --- a/resources/views/mailboxes/update.blade.php +++ b/resources/views/mailboxes/update.blade.php @@ -142,13 +142,18 @@
- +
- - - +
+ + before_reply) checked="checked"@endif id="before-reply-toggle"> + + before_reply) readonly @endif name="before_reply" value="{{ old('before_reply', $mailbox->before_reply) }}" data-default="-- {{ __('Please reply above this line') }} --" placeholder="-- {{ __('Please reply above this line') }} --"> +
+ +
@include('partials/field_error', ['field'=>'before_reply']) From c3cbeebf910601ee8794c057a5ec2dd04847338b Mon Sep 17 00:00:00 2001 From: FreeScout Date: Fri, 13 Dec 2019 21:52:23 -0800 Subject: [PATCH 07/14] Add identifier to queue:work command to void conflicts with other FreeScout instances on the same server - closes #387 --- app/Console/Kernel.php | 8 ++++++-- app/Http/Controllers/SystemController.php | 2 +- app/Misc/Helper.php | 13 ++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 5e6633e1a..18c574c74 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -138,7 +138,11 @@ protected function schedule(Schedule $schedule) } } - $schedule->command('queue:work', Config('app.queue_work_params')) + $queue_work_params = Config('app.queue_work_params'); + // Add identifier to avoid conflicts with other FreeScout instances on the same server. + $queue_work_params['--queue'] .= ','.\Helper::getWorkerIdentifier(); + + $schedule->command('queue:work', $queue_work_params) ->everyMinute() ->withoutOverlapping() ->sendOutputTo(storage_path().'/logs/queue-jobs.log'); @@ -154,7 +158,7 @@ protected function getRunningQueueProcesses() $pids = []; try { - $processes = preg_split("/[\r\n]/", shell_exec("ps aux | grep '".\Helper::WORKER_IDENTIFIER."'")); + $processes = preg_split("/[\r\n]/", shell_exec("ps aux | grep '".\Helper::getWorkerIdentifier()."'")); foreach ($processes as $process) { preg_match("/^[\S]+\s+([\d]+)\s+/", $process, $m); if (!preg_match("/(sh \-c|grep )/", $process) && !empty($m[1])) { diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 4a2d8bc05..7a787b776 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -78,7 +78,7 @@ public function status(Request $request) // Commands $commands_list = [ 'freescout:fetch-emails' => 'freescout:fetch-emails', - \Helper::WORKER_IDENTIFIER => 'queue:work' + \Helper::getWorkerIdentifier() => 'queue:work' ]; foreach ($commands_list as $command_identifier => $command_name) { $status_texts = []; diff --git a/app/Misc/Helper.php b/app/Misc/Helper.php index 105a3d567..0a6580221 100644 --- a/app/Misc/Helper.php +++ b/app/Misc/Helper.php @@ -25,11 +25,6 @@ class Helper */ const QUEUE_DEFAULT = 'default'; - /** - * Background worker identifier. - */ - const WORKER_IDENTIFIER = 'emails,default'; - /** * Menu structure used to display active menu item. * Array are mnemonic names, strings - route names. @@ -1263,4 +1258,12 @@ public static function isInApp() { return (int)app('request')->cookie('in_app'); } + + /** + * Get identifier for queue:work + */ + public static function getWorkerIdentifier() + { + return md5(config('app.key')); + } } From bd1f4b06bc08068959916a8794e95616d2d1235b Mon Sep 17 00:00:00 2001 From: FreeScout Date: Fri, 13 Dec 2019 21:52:40 -0800 Subject: [PATCH 08/14] Label styles --- public/css/style.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 1f8355690..205ba1f9b 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -3343,6 +3343,11 @@ ul.prev-convs { /** * Misc */ +.label { + font-size: 13.4px; + font-weight: normal; + padding-top: 2px; +} .banner { text-align: center; margin-top: 30px; @@ -3612,13 +3617,13 @@ a.help-icon:hover { position: relative; border-top-color: #a5b2bd; } -.accordion .panel-title > a .label { +/*.accordion .panel-title > a .label { padding-bottom: 1px; position: relative; padding-left: 5px; top: -2px; font-style: normal; -} +}*/ .accordion > .panel-default > .panel-heading { background-color: #fff; padding: 0; From a24c56b527bad9fa4bc379c7b5f6f1fc33028711 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 16 Dec 2019 00:43:11 -0800 Subject: [PATCH 09/14] Fix customers ajax search pagination --- public/js/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index bde6887f8..49d949b0b 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -2084,7 +2084,8 @@ function changeCustomerInit() return { q: params.term, exclude_email: input.attr('data-customer_email'), - search_by: 'all' + search_by: 'all', + page: params.page //use_id: true }; } @@ -2269,7 +2270,8 @@ function initCustomerSelector(input, custom_options) use_id: use_id, search_by: search_by, show_fields: show_fields, - allow_non_emails: allow_non_emails + allow_non_emails: allow_non_emails, + page: params.page }; }/*, beforeSend: function(){ From b00b830f21d05399b9453e54a6f8a56bbf44d8eb Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 16 Dec 2019 00:44:12 -0800 Subject: [PATCH 10/14] mailboxes.menu_current_route filter --- public/css/style.css | 14 +++++++++++++- resources/views/mailboxes/sidebar_menu.blade.php | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 205ba1f9b..bdc509f61 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -3314,7 +3314,7 @@ ul.prev-convs { } /** - * Sortable panel + * Panel */ .panel-sortable .handle { cursor: move; @@ -3339,6 +3339,10 @@ ul.prev-convs { margin-bottom: 5px; height: 41px; } +.panel-grey { + background-color: #f8f9f9; + border-color: #dde2e6; +} /** * Misc @@ -3890,6 +3894,14 @@ a.disabled:focus { margin-bottom: 4px; } +/** + * Mobile + */ +@media (max-width:767px) { + .descr-block { + margin: 20px 0; + } +} /** * Only main content is visible */ diff --git a/resources/views/mailboxes/sidebar_menu.blade.php b/resources/views/mailboxes/sidebar_menu.blade.php index 7fad79e07..51caf9d25 100644 --- a/resources/views/mailboxes/sidebar_menu.blade.php +++ b/resources/views/mailboxes/sidebar_menu.blade.php @@ -8,7 +8,7 @@ @if (count($menu_mailboxes)) @endif From c0b48208e65e7a43427e879e1453f2edc27dc1ca Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 16 Dec 2019 10:05:48 -0800 Subject: [PATCH 11/14] conversation.create_form.after_subject hook --- resources/views/conversations/create.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/conversations/create.blade.php b/resources/views/conversations/create.blade.php index 4775bf8b3..7a2b24da7 100644 --- a/resources/views/conversations/create.blade.php +++ b/resources/views/conversations/create.blade.php @@ -194,6 +194,7 @@ @include('partials/field_error', ['field'=>'subject'])
+ @action('conversation.create_form.after_subject', $conversation, $mailbox, $thread)
    From babb1f3956037c85dfe2e0c1391b397054c9d5ac Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 16 Dec 2019 10:06:20 -0800 Subject: [PATCH 12/14] isNewConversation js function --- public/js/main.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 49d949b0b..7e664300c 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1623,9 +1623,6 @@ function initReplyForm(load_attachments, init_customer_selector) return; } - if (!fsApplyFilter('conversation.can_submit', true)) { - return; - } fs_processing_send_reply = true; var button = $(this); @@ -1638,6 +1635,11 @@ function initReplyForm(load_attachments, init_customer_selector) return; } + if (!fsApplyFilter('conversation.can_submit', true)) { + fs_processing_send_reply = false; + return; + } + button.button('loading'); // If draft is being sent, we need to wait and send reply after draft has been saved. @@ -3094,6 +3096,15 @@ function maybeShowConnectionRestored() fs_connection_errors = 0; } +function isNewConversation() +{ + if ($('#conv-layout-main .thread:first').length == 0) { + return true; + } else { + return false; + } +} + /** * Save draft automatically, on reply change or on click. * Validation is not needed. @@ -3118,17 +3129,13 @@ function saveDraft(reload_page, no_loader) } var button = form.children().find('.note-actions .note-btn:first'); - var new_conversation = false; + // Are we saving a draft of a new conversation + var new_conversation = isNewConversation(); if (typeof(no_loader) == "undefined") { no_loader = false; } - // Are we sasving a draft of a new conversation - if ($('#conv-layout-main .thread:first').length == 0) { - new_conversation = true; - } - // Do not save unchanged draft // When replying click on Save draft always reloads conversation if ((new_conversation || !reload_page) && !fs_reply_changed) { From 33c5f74bf30e90dc5d6efe97cc4ed8fb237d468a Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 16 Dec 2019 23:40:30 -0800 Subject: [PATCH 13/14] Do not allow to send empty reply --- public/js/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/main.js b/public/js/main.js index 7e664300c..82a634f9d 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -17,6 +17,7 @@ var fs_conv_editor_toolbar = [ var fs_in_app_data = {}; var fs_actions = {}; var fs_filters = {}; +var fs_body_default = '

    '; // Ajax based notifications; var poly; @@ -3513,8 +3514,11 @@ function getReplyBody(text) function setReplyBody(text) { - $(".conv-reply-block :input[name='body']:first").val(text); $('#body').summernote("code", text); + if (text == fs_body_default) { + text = ''; + } + $(".conv-reply-block :input[name='body']:first").val(text); } // Set text in summernote editor From f3ea9bcb47d715c888f00ea11cb123bde34f1640 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 16 Dec 2019 23:43:04 -0800 Subject: [PATCH 14/14] v1.3.15 --- config/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/app.php b/config/app.php index d08f1403f..79c5fdcca 100644 --- a/config/app.php +++ b/config/app.php @@ -12,7 +12,7 @@ | or any other location as required by the application or its packages. */ - 'version' => '1.3.14', + 'version' => '1.3.15', /* |--------------------------------------------------------------------------