From 152e5db02b2970a7ab54d1e82ac868e9f87b62e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 13 Jan 2021 00:09:29 +0300 Subject: [PATCH] Select remote fixed searching value.. --- config/search-string.php | 4 ++-- .../js/components/AkauntingSelectRemote.vue | 16 ++++++++-------- resources/views/common/items/create.blade.php | 2 +- resources/views/common/items/edit.blade.php | 2 +- .../components/documents/form/advanced.blade.php | 2 +- .../views/purchases/payments/create.blade.php | 2 +- .../views/purchases/payments/edit.blade.php | 2 +- resources/views/sales/revenues/create.blade.php | 2 +- resources/views/sales/revenues/edit.blade.php | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config/search-string.php b/config/search-string.php index ad9048e41..42a65d852 100644 --- a/config/search-string.php +++ b/config/search-string.php @@ -206,7 +206,7 @@ return [ 'contact_phone' => ['searchable' => true], 'contact_address' => ['searchable' => true], 'category_id' => [ - 'route' => 'categories.index' + 'route' => ['categories.index', 'search=type:expense'] ], 'parent_id', ], @@ -252,7 +252,7 @@ return [ 'contact_phone' => ['searchable' => true], 'contact_address' => ['searchable' => true], 'category_id' => [ - 'route' => 'categories.index' + 'route' => ['categories.index', 'search=type:income'] ], 'parent_id', ], diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index dfdf2a101..7349121a5 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -621,19 +621,19 @@ export default { let path = this.remoteAction; - if (!path) { + if (!path) { path = url + '/common/items/autocomplete'; - } + } - if (path.indexOf('?') === -1) { + if (path.indexOf('?search') === -1) { path += '?search="' + query + '"'; - } else { - path += '&search="' + query + '"'; - } + } else { + path += ' "' + query + '"'; + } - path += '¤cy_code=' + this.currencyCode; + path += ' limit:10'; - path += '&limit:10'; + path += '¤cy_code=' + this.currencyCode; window.axios({ method: 'GET', diff --git a/resources/views/common/items/create.blade.php b/resources/views/common/items/create.blade.php index 9ed5387ce..924561481 100644 --- a/resources/views/common/items/create.blade.php +++ b/resources/views/common/items/create.blade.php @@ -27,7 +27,7 @@ {{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }} - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?type=item']) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item']) }} {{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus', ['dropzone-class' => 'form-file']) }} diff --git a/resources/views/common/items/edit.blade.php b/resources/views/common/items/edit.blade.php index bd35a2140..a4ba4ee02 100644 --- a/resources/views/common/items/edit.blade.php +++ b/resources/views/common/items/edit.blade.php @@ -28,7 +28,7 @@ {{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }} - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?type=item']) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item']) }} {{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file']) }} diff --git a/resources/views/components/documents/form/advanced.blade.php b/resources/views/components/documents/form/advanced.blade.php index e9b1fc725..0bd883197 100644 --- a/resources/views/components/documents/form/advanced.blade.php +++ b/resources/views/components/documents/form/advanced.blade.php @@ -19,7 +19,7 @@ @if (!$hideCategory || !$hideAttachment)
@if (!$hideCategory) - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $document->category_id ?? setting('default.' . $categoryType . '_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=' . $categoryType, 'remote_action' => route('categories.index'). '?type=' . $categoryType], $more_form_class) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $document->category_id ?? setting('default.' . $categoryType . '_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=' . $categoryType, 'remote_action' => route('categories.index'). '?search=type:' . $categoryType], $more_form_class) }} @endif @if (!$hideAttachment) diff --git a/resources/views/purchases/payments/create.blade.php b/resources/views/purchases/payments/create.blade.php index 5536d82c2..7744147f4 100644 --- a/resources/views/purchases/payments/create.blade.php +++ b/resources/views/purchases/payments/create.blade.php @@ -30,7 +30,7 @@ {{ Form::textareaGroup('description', trans('general.description')) }} - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.expense_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?type=expense']) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.expense_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?search=type:expense', 'remote_action' => route('categories.index'). '?type=expense']) }} {{ Form::recurring('create') }} diff --git a/resources/views/purchases/payments/edit.blade.php b/resources/views/purchases/payments/edit.blade.php index 6e4dd5faa..b4b3fca8e 100644 --- a/resources/views/purchases/payments/edit.blade.php +++ b/resources/views/purchases/payments/edit.blade.php @@ -49,7 +49,7 @@ {{ Form::textareaGroup('description', trans('general.description')) }} - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?type=expense']) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense']) }} {{ Form::recurring('edit', $payment) }} diff --git a/resources/views/sales/revenues/create.blade.php b/resources/views/sales/revenues/create.blade.php index 3f0c6477d..59c839319 100644 --- a/resources/views/sales/revenues/create.blade.php +++ b/resources/views/sales/revenues/create.blade.php @@ -30,7 +30,7 @@ {{ Form::textareaGroup('description', trans('general.description')) }} - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.income_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?type=income']) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.income_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?search=type:income']) }} {{ Form::recurring('create') }} diff --git a/resources/views/sales/revenues/edit.blade.php b/resources/views/sales/revenues/edit.blade.php index 7f20d91be..02f5c2ec9 100644 --- a/resources/views/sales/revenues/edit.blade.php +++ b/resources/views/sales/revenues/edit.blade.php @@ -49,7 +49,7 @@ {{ Form::textareaGroup('description', trans('general.description')) }} - {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?type=income']) }} + {{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?search=type:income']) }} {{ Form::recurring('edit', $revenue) }}