diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 487de78..ef26205 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -19,7 +19,7 @@ "type": 2, "subtype": 1, "name": "CostCenters", - "uri": "{/base}/accounting/costcenter/list?{?}", + "uri": "{/base}/accounting/costcenter/list", "target": "self", "icon": null, "order": 5, @@ -33,7 +33,7 @@ "type": 3, "subtype": 1, "name": "List", - "uri": "{/base}/accounting/costcenter/list?{?}", + "uri": "{/base}/accounting/costcenter/list", "target": "self", "icon": null, "order": 1, @@ -48,7 +48,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/base}/accounting/costcenter/create?{?}", + "uri": "{/base}/accounting/costcenter/create", "target": "self", "icon": null, "order": 5, @@ -65,7 +65,7 @@ "type": 2, "subtype": 1, "name": "CostObjects", - "uri": "{/base}/accounting/costobject/list?{?}", + "uri": "{/base}/accounting/costobject/list", "target": "self", "icon": null, "order": 5, @@ -79,7 +79,7 @@ "type": 3, "subtype": 1, "name": "List", - "uri": "{/base}/accounting/costobject/list?{?}", + "uri": "{/base}/accounting/costobject/list", "target": "self", "icon": null, "order": 1, @@ -94,7 +94,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/base}/accounting/costobject/create?{?}", + "uri": "{/base}/accounting/costobject/create", "target": "self", "icon": null, "order": 5, @@ -111,7 +111,7 @@ "type": 2, "subtype": 1, "name": "Accounts", - "uri": "{/base}/accounting/coa/list?{?}", + "uri": "{/base}/accounting/coa/list", "target": "self", "icon": null, "order": 5, @@ -125,7 +125,7 @@ "type": 3, "subtype": 1, "name": "List", - "uri": "{/base}/accounting/coa/list?{?}", + "uri": "{/base}/accounting/coa/list", "target": "self", "icon": null, "order": 1, @@ -140,7 +140,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/base}/accounting/coa/create?{?}", + "uri": "{/base}/accounting/coa/create", "target": "self", "icon": null, "order": 5, @@ -157,7 +157,7 @@ "type": 2, "subtype": 1, "name": "BatchPostings", - "uri": "{/base}/accounting/stack/list?{?}", + "uri": "{/base}/accounting/stack/list", "target": "self", "icon": null, "order": 10, @@ -171,7 +171,7 @@ "type": 3, "subtype": 1, "name": "List", - "uri": "{/base}/accounting/stack/list?{?}", + "uri": "{/base}/accounting/stack/list", "target": "self", "icon": null, "order": 5, @@ -186,7 +186,7 @@ "type": 3, "subtype": 1, "name": "Archive", - "uri": "{/base}/accounting/stack/archive/list?{?}", + "uri": "{/base}/accounting/stack/archive/list", "target": "self", "icon": null, "order": 10, @@ -201,7 +201,7 @@ "type": 3, "subtype": 1, "name": "Predefined", - "uri": "{/base}/accounting/stack/predefined/list?{?}", + "uri": "{/base}/accounting/stack/predefined/list", "target": "self", "icon": null, "order": 10, @@ -216,7 +216,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/base}/accounting/stack/create?{?}", + "uri": "{/base}/accounting/stack/create", "target": "self", "icon": null, "order": 15, @@ -233,7 +233,7 @@ "type": 2, "subtype": 1, "name": "Entries", - "uri": "{/base}/accounting/entries/dashboard?{?}", + "uri": "{/base}/accounting/entries/dashboard", "target": "self", "icon": null, "order": 1, @@ -249,7 +249,7 @@ "type": 2, "subtype": 1, "name": "Suppliers", - "uri": "{/base}/accounting/supplier/list?{?}", + "uri": "{/base}/accounting/supplier/list", "target": "self", "icon": null, "order": 1, @@ -265,7 +265,7 @@ "type": 2, "subtype": 1, "name": "Clients", - "uri": "{/base}/accounting/client/list?{?}", + "uri": "{/base}/accounting/client/list", "target": "self", "icon": null, "order": 1, diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 920ef76..2fb7192 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -422,21 +422,15 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Accounting/Theme/Backend/costcenter-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002602001, $request, $response); - $mapper = CostCenterMapper::getAll() + $view->data['costcenter'] = CostCenterMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) - ->limit(25); - - if ($request->getData('ptype') === 'p') { - $view->data['costcenter'] = $mapper->where('id', $request->getDataInt('offset') ?? 0, '<') - ->execute(); - } elseif ($request->getData('ptype') === 'n') { - $view->data['costcenter'] = $mapper->where('id', $request->getDataInt('offset') ?? 0, '>') - ->execute(); - } else { - $view->data['costcenter'] = $mapper->where('id', 0, '>') - ->execute(); - } + ->limit(25) + ->paginate( + 'id', + $request->getDataString('ptype') ?? '', + $request->getDataInt('offset') + )->executeGetArray(); return $view; } @@ -459,21 +453,15 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Accounting/Theme/Backend/costobject-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002603001, $request, $response); - $mapper = CostObjectMapper::getAll() + $view->data['costobject'] = CostObjectMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) - ->limit(25); - - if ($request->getData('ptype') === 'p') { - $view->data['costobject'] = $mapper->where('id', $request->getDataInt('offset') ?? 0, '<') - ->execute(); - } elseif ($request->getData('ptype') === 'n') { - $view->data['costobject'] = $mapper->where('id', $request->getDataInt('offset') ?? 0, '>') - ->execute(); - } else { - $view->data['costobject'] = $mapper->where('id', 0, '>') - ->execute(); - } + ->limit(25) + ->paginate( + 'id', + $request->getDataString('ptype') ?? '', + $request->getDataInt('offset') + )->executeGetArray(); return $view; }