Skip to content

Commit

Permalink
SordersController::index, fix switching between with/without lines view
Browse files Browse the repository at this point in the history
Maintain search criteria when swtiching between with/without/lines.
  • Loading branch information
steveblamey committed Jan 5, 2022
1 parent d8cdd28 commit 698bdf8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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);
Expand Down Expand Up @@ -678,7 +680,7 @@ public function view()
'controller' => $this->name,
'action' => 'index',
'slmaster_id' => $order->slmaster_id,
'status' => ''
'status' => 'all'
),
'tag' => 'view quotes/orders'
);
Expand Down

0 comments on commit 698bdf8

Please sign in to comment.