From 6db172956bedb8eca403c08a48da8cbccb9c3d48 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 9 Jan 2016 19:46:27 +0100 Subject: [PATCH] Templating --- Admin/Install/Navigation.install.json | 34 +++- Controller.php | 28 ++- Theme/backend/Lang/Navigation.en.lang.php | 2 + Theme/backend/Lang/en.lang.php | 47 +++-- Theme/backend/costcenter-create.tpl.php | 33 ---- Theme/backend/costcenter-profile.tpl.php | 16 -- Theme/backend/costobject-create.tpl.php | 33 ---- Theme/backend/costobject-list.tpl.php | 52 ------ Theme/backend/costobject-profile.tpl.php | 16 -- Theme/backend/entries.tpl.php | 165 +++++++++++++++++- ....tpl.php => stack-predefined-list.tpl.php} | 5 +- 11 files changed, 259 insertions(+), 172 deletions(-) delete mode 100644 Theme/backend/costcenter-create.tpl.php delete mode 100644 Theme/backend/costcenter-profile.tpl.php delete mode 100644 Theme/backend/costobject-create.tpl.php delete mode 100644 Theme/backend/costobject-list.tpl.php delete mode 100644 Theme/backend/costobject-profile.tpl.php rename Theme/backend/{costcenter-list.tpl.php => stack-predefined-list.tpl.php} (84%) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 1edfd17..dd86ce2 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -68,7 +68,7 @@ "uri": "/{/lang}/backend/accounting/stack/list", "target": "self", "icon": null, - "order": 20, + "order": 10, "from": 1002600000, "permission": null, "parent": 1002601001, @@ -108,6 +108,21 @@ "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", "type": 3, "subtype": 1, + "name": "Predefined", + "uri": "/{/lang}/backend/accounting/stack/predefined/list", + "target": "self", + "icon": null, + "order": 10, + "from": 1002600000, + "permission": null, + "parent": 1002605001, + "children": [] + }, + { + "id": 1002605401, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 3, + "subtype": 1, "name": "Create", "uri": "/{/lang}/backend/accounting/stack/create", "target": "self", @@ -119,6 +134,23 @@ "children": [] } ] + }, + { + "id": 1002606001, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 1, + "name": "Entries", + "uri": "/{/lang}/backend/accounting/entries/dashboard", + "target": "self", + "icon": null, + "order": 1, + "from": 1002600000, + "permission": null, + "parent": 1002601001, + "children": [ + + ] } ] } diff --git a/Controller.php b/Controller.php index 0b4de48..937b8ff 100644 --- a/Controller.php +++ b/Controller.php @@ -87,10 +87,11 @@ class Controller extends ModuleAbstract implements WebInterface '^.*/backend/accounting/impersonal/journal/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewJournalList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], - '^.*/backend/accounting/stack/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], - '^.*/backend/accounting/stack/entries.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackEntries', 'method' => 'GET', 'type' => ViewLayout::MAIN],], - '^.*/backend/accounting/stack/archive/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackArchiveList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], - '^.*/backend/accounting/stack/create.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/accounting/stack/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/accounting/stack/entries.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackEntries', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/accounting/stack/archive/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackArchiveList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/accounting/stack/create.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/accounting/stack/predefined/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewStackPredefinedList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], '^.*/backend/accounting/gl/list.*$' => [['dest' => '\Modules\Accounting\Controller:viewGLList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], '^.*/backend/accounting/gl/create.*$' => [['dest' => '\Modules\Accounting\Controller:viewGLCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],], @@ -177,6 +178,25 @@ class Controller extends ModuleAbstract implements WebInterface return $view; } + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewStackPredefinedList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Accounting/Theme/Backend/stack-predefined-list'); + $view->addData('nav', $this->createNavigation(1002605001, $request, $response)); + + return $view; + } + /** * @param RequestAbstract $request Request * @param ResponseAbstract $response Response diff --git a/Theme/backend/Lang/Navigation.en.lang.php b/Theme/backend/Lang/Navigation.en.lang.php index 8d0e9ce..6610932 100644 --- a/Theme/backend/Lang/Navigation.en.lang.php +++ b/Theme/backend/Lang/Navigation.en.lang.php @@ -22,5 +22,7 @@ $MODLANG['Navigation'] = [ 'CostObjects' => 'Cost Objects', 'Creditors' => 'Creditors', 'Debitors' => 'Debitors', + 'Entries' => 'Entries', 'Postings' => 'Postings', + 'Predefined' => 'Predefined', ]; diff --git a/Theme/backend/Lang/en.lang.php b/Theme/backend/Lang/en.lang.php index bf7a70b..021d988 100644 --- a/Theme/backend/Lang/en.lang.php +++ b/Theme/backend/Lang/en.lang.php @@ -14,19 +14,36 @@ * @link http://orange-management.com */ $MODLANG['Accounting'] = [ - 'BatchPostings' => 'Batch Postings', - 'CostCenter' => 'Cost Center', - 'CostCenters' => 'Cost Centers', - 'CostObject' => 'Cost Object', - 'CostObjects' => 'Cost Objects', - 'Created' => 'Created', - 'Creator' => 'Creator', - 'Incoming' => 'Incoming', - 'GL' => 'GL', - 'Name' => 'Name', - 'Outgoing' => 'Outgoing', - 'Parent' => 'Parent', - 'Stack' => 'Stack', - 'TAccount' => 'T-Account', - 'Type' => 'Type', + 'Account' => 'Account', + 'Accounts' => 'Accounts', + 'BatchPostings' => 'Batch Postings', + 'Charts' => 'Charts', + 'ContraAccount' => 'Contra Account', + 'CostCenter' => 'Cost Center', + 'CostCenters' => 'Cost Centers', + 'CostObject' => 'Cost Object', + 'CostObjects' => 'Cost Objects', + 'Created' => 'Created', + 'Creator' => 'Creator', + 'Credit' => 'Credit', + 'Debit' => 'Debit', + 'Due' => 'Due', + 'Entries' => 'Entries', + 'EntryDate' => 'Entry Date', + 'Evaluation' => 'Evaluation', + 'ExternalVoucher' => 'External Voucher', + 'Incoming' => 'Incoming', + 'GL' => 'GL', + 'List' => 'List', + 'Name' => 'Name', + 'Outgoing' => 'Outgoing', + 'Parent' => 'Parent', + 'Receipt' => 'Receipt', + 'ReceiptDate' => 'Receipt Date', + 'Stack' => 'Stack', + 'TAccount' => 'T-Account', + 'Text' => 'Text', + 'To' => 'To', + 'Total' => 'Total', + 'Type' => 'Type', ]; diff --git a/Theme/backend/costcenter-create.tpl.php b/Theme/backend/costcenter-create.tpl.php deleted file mode 100644 index 7a3517b..0000000 --- a/Theme/backend/costcenter-create.tpl.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright 2013 Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -echo $this->getData('nav')->render(); ?> - -
-

l11n->lang['Accounting']['CostCenter']; ?>

-
-
- -
-
-
-
-
-
-
-
-
-
-
diff --git a/Theme/backend/costcenter-profile.tpl.php b/Theme/backend/costcenter-profile.tpl.php deleted file mode 100644 index ac22ab8..0000000 --- a/Theme/backend/costcenter-profile.tpl.php +++ /dev/null @@ -1,16 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright 2013 Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -echo $this->getData('nav')->render(); ?> diff --git a/Theme/backend/costobject-create.tpl.php b/Theme/backend/costobject-create.tpl.php deleted file mode 100644 index 9481eee..0000000 --- a/Theme/backend/costobject-create.tpl.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright 2013 Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -echo $this->getData('nav')->render(); ?> - -
-

l11n->lang['Accounting']['CostObject']; ?>

-
-
- -
-
-
-
-
-
-
-
-
-
-
diff --git a/Theme/backend/costobject-list.tpl.php b/Theme/backend/costobject-list.tpl.php deleted file mode 100644 index 65c428c..0000000 --- a/Theme/backend/costobject-list.tpl.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright 2013 Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -/** - * @var \phpOMS\Views\View $this - */ - -$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response); -$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); - -$footerView->setPages(1 / 25); -$footerView->setPage(1); -$footerView->setResults(1); - -echo $this->getData('nav')->render(); ?> - -
- - - - - - - $value) : $c++; - $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?id=' . $value->getId()); ?> - -
l11n->lang['Accounting']['CostObjects']; ?>
l11n->lang[0]['ID']; ?> - l11n->lang['Accounting']['Name']; ?> -
render(); ?> -
getId(); ?> - getName(); ?> - - - - - -
l11n->lang[0]['Empty']; ?> - -
-
diff --git a/Theme/backend/costobject-profile.tpl.php b/Theme/backend/costobject-profile.tpl.php deleted file mode 100644 index ac22ab8..0000000 --- a/Theme/backend/costobject-profile.tpl.php +++ /dev/null @@ -1,16 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright 2013 Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -echo $this->getData('nav')->render(); ?> diff --git a/Theme/backend/entries.tpl.php b/Theme/backend/entries.tpl.php index ac22ab8..98c2303 100644 --- a/Theme/backend/entries.tpl.php +++ b/Theme/backend/entries.tpl.php @@ -13,4 +13,167 @@ * @version 1.0.0 * @link http://orange-management.com */ -echo $this->getData('nav')->render(); ?> +//echo $this->getData('nav')->render(); + +$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response); +$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); + +$footerView->setPages(1 / 25); +$footerView->setPage(1); +$footerView->setResults(1); +?> + +
+
+
+ + + + + + +
+
+ + + +
+
+ + + +
+
+
+
+
+ +
+
+ +
+ +
+
+ + + + + + + + $value) : $count++; ?> + + + +
l11n->lang['Accounting']['Entries'] ?>
l11n->lang['Accounting']['EntryDate']; ?> + l11n->lang['Accounting']['Receipt']; ?> + l11n->lang['Accounting']['Debit']; ?> + l11n->lang['Accounting']['Credit']; ?> + l11n->lang['Accounting']['Text']; ?> + l11n->lang['Accounting']['Account']; ?> + l11n->lang['Accounting']['ContraAccount']; ?> + l11n->lang['Accounting']['CostCenter']; ?> + l11n->lang['Accounting']['CostObject']; ?> + l11n->lang['Accounting']['ReceiptDate']; ?> + l11n->lang['Accounting']['ExternalVoucher']; ?> + l11n->lang['Accounting']['Creator']; ?> + l11n->lang['Accounting']['Created']; ?> +
render(); ?> +
l11n->lang[0]['Empty']; ?> + +
+
+
+ +
+
+ + + + + + $value) : $count++; ?> + + + +
l11n->lang['Accounting']['Accounts'] ?>
l11n->lang['Accounting']['Account']; ?> + l11n->lang['Accounting']['Name']; ?> + l11n->lang['Accounting']['Total']; ?> +
l11n->lang[0]['Empty']; ?> + +
+
+
+ + + + + + $value) : $count++; ?> + + + +
l11n->lang['Accounting']['CostCenter'] ?>
l11n->lang['Accounting']['CostCenter']; ?> + l11n->lang['Accounting']['Name']; ?> + l11n->lang['Accounting']['Total']; ?> +
l11n->lang[0]['Empty']; ?> + +
+
+
+ + + + + + $value) : $count++; ?> + + + +
l11n->lang['Accounting']['CostObject'] ?>
l11n->lang['Accounting']['Account']; ?> + l11n->lang['Accounting']['Name']; ?> + l11n->lang['Accounting']['Total']; ?> +
l11n->lang[0]['Empty']; ?> + +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Theme/backend/costcenter-list.tpl.php b/Theme/backend/stack-predefined-list.tpl.php similarity index 84% rename from Theme/backend/costcenter-list.tpl.php rename to Theme/backend/stack-predefined-list.tpl.php index 3d0628c..911b0d1 100644 --- a/Theme/backend/costcenter-list.tpl.php +++ b/Theme/backend/stack-predefined-list.tpl.php @@ -28,11 +28,14 @@ echo $this->getData('nav')->render(); ?>
- +
l11n->lang['Accounting']['CostCenters']; ?>l11n->lang['Accounting']['BatchPostings']; ?>
l11n->lang[0]['ID']; ?> + l11n->lang['Accounting']['Due']; ?> l11n->lang['Accounting']['Name']; ?> + l11n->lang['Accounting']['Creator']; ?> + l11n->lang['Accounting']['Created']; ?>
render(); ?>