From 14bb7e8d1c35e0f5d3f79be8cb9bf8cf2a2c6323 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 15 Feb 2018 17:57:57 +0100 Subject: [PATCH] Implement group/account create+edit --- Controller.php | 6 +-- Theme/Backend/accounts-create.tpl.php | 38 ++++++++++++++--- Theme/Backend/accounts-single.tpl.php | 4 +- Theme/Backend/groups-create.tpl.php | 59 ++++++++++++++++++++++++--- Theme/Backend/groups-single.tpl.php | 10 ++--- 5 files changed, 96 insertions(+), 21 deletions(-) diff --git a/Controller.php b/Controller.php index e49871f..2f01565 100644 --- a/Controller.php +++ b/Controller.php @@ -496,7 +496,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiGroupSet(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiGroupUpdate(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::GROUP) @@ -507,9 +507,9 @@ class Controller extends ModuleAbstract implements WebInterface } $group = GroupMapper::get((int) $request->getData('id')); - $group->setName((string) ($request->getData('name') ?? $group->getName())); - $group->setDescription(Markdown::parse((string) ($request->getData('description') ?? $group->getDescription()))); + $group->setStatus((int) ($request->getData('status') ?? $group->getStatus())); + $group->setDescription(Markdown::parse((string) ($request->getData('description') ?? $group->getDescriptionRaw()))); $group->setDescriptionRaw((string) ($request->getData('description') ?? $group->getDescriptionRaw())); GroupMapper::update($group); diff --git a/Theme/Backend/accounts-create.tpl.php b/Theme/Backend/accounts-create.tpl.php index 332f0c8..defb92b 100644 --- a/Theme/Backend/accounts-create.tpl.php +++ b/Theme/Backend/accounts-create.tpl.php @@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Account'); ?>

-
+
@@ -37,7 +37,7 @@ echo $this->getData('nav')->render(); ?>
-
+
@@ -48,7 +48,7 @@ echo $this->getData('nav')->render(); ?>
-
+
@@ -56,6 +56,16 @@ echo $this->getData('nav')->render(); ?>
+ + + + + +
getHtml('Groups') ?>
getHtml('ID', 0, 0); ?> + getHtml('Name') ?> +
getHtml('Empty', 0, 0); ?> +
+

getHtml('Groups'); ?>

@@ -63,7 +73,7 @@ echo $this->getData('nav')->render(); ?>
-
+
@@ -72,14 +82,30 @@ echo $this->getData('nav')->render(); ?>
+ + + + + +
getHtml('Permissions') ?>
getHtml('ID', 0, 0); ?> + Unit + App + Module + Type + Ele. + Comp. + Perm. +
getHtml('Empty', 0, 0); ?> +
+

getHtml('Permissions'); ?>

-
-
+
+
diff --git a/Theme/Backend/accounts-single.tpl.php b/Theme/Backend/accounts-single.tpl.php index 469cdee..fdb768a 100644 --- a/Theme/Backend/accounts-single.tpl.php +++ b/Theme/Backend/accounts-single.tpl.php @@ -24,7 +24,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Account'); ?>

-
+
@@ -53,7 +53,7 @@ echo $this->getData('nav')->render(); ?>
-
+
diff --git a/Theme/Backend/groups-create.tpl.php b/Theme/Backend/groups-create.tpl.php index afd2775..ab48d98 100644 --- a/Theme/Backend/groups-create.tpl.php +++ b/Theme/Backend/groups-create.tpl.php @@ -17,7 +17,7 @@ echo $this->getData('nav')->render(); ?>
-
+

getHtml('Group'); ?>

@@ -41,7 +41,24 @@ echo $this->getData('nav')->render(); ?>
-
+
+ + + + + + $value) : $c++; ?> + +
getHtml('Parents') ?>
getHtml('ID', 0, 0); ?> + Name +
+ + + +
getHtml('Empty', 0, 0); ?> + +
+

getHtml('Parent'); ?>

@@ -49,7 +66,7 @@ echo $this->getData('nav')->render(); ?>
-
+
@@ -57,7 +74,23 @@ echo $this->getData('nav')->render(); ?>
-
+
+ + + + + +
getHtml('Permissions') ?>
getHtml('ID', 0, 0); ?> + Unit + App + Module + Type + Ele. + Comp. + Perm. +
getHtml('Empty', 0, 0); ?> +
+

getHtml('Permissions'); ?>

@@ -65,7 +98,23 @@ echo $this->getData('nav')->render(); ?>
-
+
+
+
+ +
+
+
+ +
+
+

getHtml('Accounts'); ?>

+
+
+ + +
+
diff --git a/Theme/Backend/groups-single.tpl.php b/Theme/Backend/groups-single.tpl.php index 9d9e499..9f2d28e 100644 --- a/Theme/Backend/groups-single.tpl.php +++ b/Theme/Backend/groups-single.tpl.php @@ -25,22 +25,22 @@ echo $this->getData('nav')->render(); ?>

getHtml('Group'); ?>

-
+
-
+
-
+
-
-
+