From ce3afdaf8d7831806412ad6c85fb2a29ed7de9c1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 13 Mar 2017 21:27:32 +0200 Subject: [PATCH] When Archiving/Deleting Recurring Invoices, Silently Drops into Invoice Screen #1377 --- app/Http/Controllers/BaseController.php | 4 ++-- app/Http/Controllers/InvoiceController.php | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 90e85c312f78..55ebaeb559db 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -37,7 +37,7 @@ class BaseController extends Controller // when restoring redirect to entity if ($action == 'restore' && count($ids) == 1) { - return redirect("{$entityTypes}/" . $ids[0]); + return redirect("{$entityTypes}/" . $ids[0] . '/edit'); // when viewing from a datatable list } elseif (strpos($referer, '/clients/')) { return redirect($referer); @@ -45,7 +45,7 @@ class BaseController extends Controller return redirect("{$entityTypes}"); // when viewing individual entity } elseif (count($ids)) { - return redirect("{$entityTypes}/" . $ids[0]); + return redirect("{$entityTypes}/" . $ids[0] . '/edit'); } else { return redirect("{$entityTypes}"); } diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 1db9455b661f..51b2a9e9bb71 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -464,7 +464,6 @@ class InvoiceController extends BaseController public function bulk($entityType = ENTITY_INVOICE) { $action = Input::get('bulk_action') ?: Input::get('action'); - ; $ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids')); $count = $this->invoiceService->bulk($ids, $action); @@ -482,6 +481,10 @@ class InvoiceController extends BaseController Session::flash('message', $message); } + if (strpos(\Request::server('HTTP_REFERER'), 'recurring_invoices')) { + $entityType = ENTITY_RECURRING_INVOICE; + } + return $this->returnBulk($entityType, $action, $ids); }