From 698bdf8978f0ce47beb209c222a7e562b27af0ac Mon Sep 17 00:00:00 2001 From: Steve Blamey Date: Wed, 5 Jan 2022 14:05:47 +0000 Subject: [PATCH] SordersController::index, fix switching between with/without lines view Maintain search criteria when swtiching between with/without/lines. --- .../order/sales_order/controllers/SordersController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/public_pages/erp/order/sales_order/controllers/SordersController.php b/modules/public_pages/erp/order/sales_order/controllers/SordersController.php index 4496ad75..d8193065 100755 --- a/modules/public_pages/erp/order/sales_order/controllers/SordersController.php +++ b/modules/public_pages/erp/order/sales_order/controllers/SordersController.php @@ -37,8 +37,10 @@ public function index() $s_data['slmaster_id'] = $this->_data['slmaster_id']; } - if (isset($this->_data['status'])) { + if (isset($this->_data['status']) && $this->_data['status'] !== 'all') { $s_data['status'] = $this->_data['status']; + } elseif (isset($this->_data['status']) && $this->_data['status'] == 'all') { + $s_data['status'] = array_keys($this->_templateobject->getEnumOptions('status')); } else { $s_data['status'] = [ $this->_templateobject->newStatus(), @@ -53,7 +55,7 @@ public function index() } - if (!empty($s_data)) { + if (isset($this->_data['slmaster_id']) && isset($this->_data['status']) && $this->_data['status'] == 'all') { $this->setSearch('sordersSearch', 'useDefault', $s_data, null ); } else { $this->setSearch('sordersSearch', 'useDefault', $s_data, null, true); @@ -678,7 +680,7 @@ public function view() 'controller' => $this->name, 'action' => 'index', 'slmaster_id' => $order->slmaster_id, - 'status' => '' + 'status' => 'all' ), 'tag' => 'view quotes/orders' );