From 22e4e678a6b38b2307c01784a50643f665f1d6e8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 17 Apr 2024 17:45:06 +0000 Subject: [PATCH] fix templates --- Admin/Settings/Theme/Backend/settings.tpl.php | 14 +- Controller/ApiController.php | 2 + Controller/BackendController.php | 15 +- .../Components/Localization/l11n-view.tpl.php | 36 ++--- Theme/Backend/accounts-create.tpl.php | 4 +- Theme/Backend/accounts-list.tpl.php | 4 +- Theme/Backend/accounts-view.tpl.php | 141 +++++++++--------- Theme/Backend/groups-create.tpl.php | 4 +- Theme/Backend/groups-list.tpl.php | 4 +- Theme/Backend/groups-view.tpl.php | 24 +-- Theme/Backend/modules-hook-list.tpl.php | 4 +- Theme/Backend/modules-info.tpl.php | 8 +- Theme/Backend/modules-list.tpl.php | 4 +- Theme/Backend/modules-log.tpl.php | 4 +- Theme/Backend/modules-route-list.tpl.php | 8 +- Theme/Backend/modules-settings.tpl.php | 4 +- Theme/Backend/page-list.tpl.php | 4 +- 17 files changed, 145 insertions(+), 139 deletions(-) diff --git a/Admin/Settings/Theme/Backend/settings.tpl.php b/Admin/Settings/Theme/Backend/settings.tpl.php index 07ccc0b..c54ad75 100755 --- a/Admin/Settings/Theme/Backend/settings.tpl.php +++ b/Admin/Settings/Theme/Backend/settings.tpl.php @@ -182,7 +182,7 @@ echo $this->data['nav']->render();
-
+
data['nav']->render();
-
+
@@ -694,10 +694,10 @@ echo $this->data['nav']->render();
request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>> -
-
-
-
getHtml('Settings'); ?>download
+
+
+
+
getHtml('Settings'); ?>download
@@ -827,7 +827,7 @@ echo $this->data['nav']->render(); getHtml('Previous', '0', '0'); ?>getHtml('Next', '0', '0'); ?> - + diff --git a/Controller/ApiController.php b/Controller/ApiController.php index c038f27..ead1724 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -2840,6 +2840,8 @@ final class ApiController extends Controller $account = (int) $request->getData('account'); $groups = [$request->getDataInt('account-list') ?? 0]; + // @todo Check if already in group + $this->createModelRelation($request->header->account, $account, $groups, AccountMapper::class, 'groups', 'account-group', $request->getOrigin()); $this->createStandardAddResponse($request, $response, $groups); } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index b02af0b..0108eae 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -27,6 +27,7 @@ use Modules\Organization\Models\UnitMapper; use phpOMS\Autoloader; use phpOMS\Contract\RenderableInterface; use phpOMS\DataStorage\Database\Query\OrderType; +use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Utils\Parser\Markdown\Markdown; @@ -518,14 +519,14 @@ final class BackendController extends Controller */ public function viewModuleInfo(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { - /* - $head = $response->data['Content']->head; - $nonce = $this->app->appSettings->getOption('script-nonce'); - - $head->addAsset(AssetType::JSLATE, 'Resources/mermaid/mermaid.min.js?v=' . $this->app->version, ['nonce' => $nonce]); - */ - $view = new View($this->app->l11nManager, $request, $response); + if (!$request->hasData('id')) { + $response->header->status = RequestStatusCode::R_404; + $view->setTemplate('/Web/Backend/Error/404'); + + return $view; + } + $view->setTemplate('/Modules/Admin/Theme/Backend/modules-info'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response); diff --git a/Theme/Backend/Components/Localization/l11n-view.tpl.php b/Theme/Backend/Components/Localization/l11n-view.tpl.php index 72ded4a..fd4c67c 100644 --- a/Theme/Backend/Components/Localization/l11n-view.tpl.php +++ b/Theme/Backend/Components/Localization/l11n-view.tpl.php @@ -32,7 +32,7 @@ $temperatures = TemperatureType::getConstants(); ?>
-
+
getHtml('Localization'); ?>
@@ -82,11 +82,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Time'); ?>
@@ -127,11 +127,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Numeric'); ?>
@@ -171,11 +171,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Precision'); ?>
@@ -203,11 +203,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Weight'); ?>
@@ -255,11 +255,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Speed'); ?>
@@ -316,11 +316,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Length'); ?>
@@ -377,11 +377,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Area'); ?>
@@ -429,11 +429,11 @@ $temperatures = TemperatureType::getConstants();
-
+
-
+
getHtml('Volume'); ?>
@@ -508,6 +508,6 @@ $temperatures = TemperatureType::getConstants();
-
+
\ No newline at end of file diff --git a/Theme/Backend/accounts-create.tpl.php b/Theme/Backend/accounts-create.tpl.php index 173c1b0..fe2fa8a 100755 --- a/Theme/Backend/accounts-create.tpl.php +++ b/Theme/Backend/accounts-create.tpl.php @@ -21,7 +21,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Account'); ?>
@@ -95,6 +95,6 @@ echo $this->data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/accounts-list.tpl.php b/Theme/Backend/accounts-list.tpl.php index dd63669..12e88b6 100755 --- a/Theme/Backend/accounts-list.tpl.php +++ b/Theme/Backend/accounts-list.tpl.php @@ -42,7 +42,7 @@ echo $this->data['nav']->render(); ?>
-
+
renderTitle( $this->getHtml('Accounts') @@ -118,6 +118,6 @@ echo $this->data['nav']->render(); ?>
--> -
+
diff --git a/Theme/Backend/accounts-view.tpl.php b/Theme/Backend/accounts-view.tpl.php index b069a3a..caf6358 100644 --- a/Theme/Backend/accounts-view.tpl.php +++ b/Theme/Backend/accounts-view.tpl.php @@ -61,7 +61,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Account'); ?>
@@ -147,7 +147,7 @@ echo $this->data['nav']->render(); ?> ]'>getHtml('CreateProfile'); ?>
-
+
@@ -156,7 +156,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Groups'); ?>
@@ -170,11 +170,11 @@ echo $this->data['nav']->render(); ?>
-
+
-
+
getHtml('Groups'); ?>download
@@ -198,7 +198,7 @@ echo $this->data['nav']->render(); ?>
getHtml('Empty', '0', '0'); ?>
-
+
@@ -207,7 +207,7 @@ echo $this->data['nav']->render(); ?>
-
+
data['nav']->render(); ?>
-
+
-
+
getHtml('Permissions'); ?>download
data['nav']->render(); ?>
-
+
@@ -421,71 +421,70 @@ echo $this->data['nav']->render(); ?> request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
-
-
-
-
renderTitle($this->getHtml('Audits', 'Auditor', 'Backend')); ?>
-
- - - - - $audit) : ++$count; - $url = UriFactory::build('{/base}/admin/audit/view?id=' . $audit->id); ?> - -
renderHeaderElement('id', $this->getHtml('ID', '0', '0'), 'number'); ?> - renderHeaderElement('module', $this->getHtml('Module', 'Auditor', 'Backend'), 'text'); ?> - renderHeaderElement('action', $this->getHtml('Action', 'Auditor', 'Backend'), 'select', - [ - 'create' => $this->getHtml('CREATE', 'Auditor', 'Backend'), - 'modify' => $this->getHtml('UPDATE', 'Auditor', 'Backend'), - 'delete' => $this->getHtml('DELETE', 'Auditor', 'Backend'), - ], - false // don't render sort - ); ?> - renderHeaderElement('type', $this->getHtml('Type', 'Auditor', 'Backend'), 'number'); ?> - renderHeaderElement('trigger', $this->getHtml('Trigger', 'Auditor', 'Backend'), 'text'); ?> - renderHeaderElement('createdBy', $this->getHtml('By', 'Auditor', 'Backend'), 'text'); ?> - renderHeaderElement('ref', $this->getHtml('Ref', 'Auditor', 'Backend'), 'text', [], true, true, false); ?> - renderHeaderElement('createdAt', $this->getHtml('Date', 'Auditor', 'Backend'), 'date'); ?> -
id; ?> - printHtml($audit->module); ?> - old === null) : echo $this->getHtml('CREATE', 'Auditor', 'Backend'); ?> - old !== null && $audit->new !== null) : echo $this->getHtml('UPDATE', 'Auditor', 'Backend'); ?> - new === null) : echo $this->getHtml('DELETE', 'Auditor', 'Backend'); ?> - getHtml('UNKNOWN', 'Auditor', 'Backend'); ?> - - printHtml((string) $audit->type); ?> - printHtml($audit->trigger); ?> - printHtml( - $this->renderUserName('%3$s %2$s %1$s', [$audit->createdBy->name1, $audit->createdBy->name2, $audit->createdBy->name3, $audit->createdBy->login]) - ); ?> - printHtml((string) $audit->ref); ?> - createdAt->format('Y-m-d H:i:s'); ?> - - -
getHtml('Empty', '0', '0'); ?> - -
-
- + +
- -
diff --git a/Theme/Backend/groups-create.tpl.php b/Theme/Backend/groups-create.tpl.php index 1a29a63..d05be63 100755 --- a/Theme/Backend/groups-create.tpl.php +++ b/Theme/Backend/groups-create.tpl.php @@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
-
+
data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/groups-list.tpl.php b/Theme/Backend/groups-list.tpl.php index 1803b3a..0035010 100755 --- a/Theme/Backend/groups-list.tpl.php +++ b/Theme/Backend/groups-list.tpl.php @@ -43,7 +43,7 @@ echo $this->data['nav']->render(); ?>
-
+
renderTitle( $this->getHtml('Groups') @@ -115,6 +115,6 @@ echo $this->data['nav']->render(); ?>
--> -
+
\ No newline at end of file diff --git a/Theme/Backend/groups-view.tpl.php b/Theme/Backend/groups-view.tpl.php index 6745960..cd9afbc 100644 --- a/Theme/Backend/groups-view.tpl.php +++ b/Theme/Backend/groups-view.tpl.php @@ -49,7 +49,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Group'); ?>
@@ -86,7 +86,7 @@ echo $this->data['nav']->render(); ?>
-
+
@@ -95,7 +95,7 @@ echo $this->data['nav']->render(); ?>
-
+
data['nav']->render(); ?>
-
+
-
+
getHtml('Accounts'); ?>download
data['nav']->render(); ?>
getHtml('Empty', '0', '0'); ?>
-
+
@@ -173,7 +173,7 @@ echo $this->data['nav']->render(); ?>
-
+
data['nav']->render(); ?>
-
+
-
+
getHtml('Permissions'); ?>download
data['nav']->render(); ?>
-
+
@@ -377,7 +377,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Audits', 'Auditor'); ?>download
@@ -411,7 +411,7 @@ echo $this->data['nav']->render(); ?> getHtml('Next', '0', '0'); ?> --> - + diff --git a/Theme/Backend/modules-hook-list.tpl.php b/Theme/Backend/modules-hook-list.tpl.php index 70cc98f..53dd52c 100755 --- a/Theme/Backend/modules-hook-list.tpl.php +++ b/Theme/Backend/modules-hook-list.tpl.php @@ -23,7 +23,7 @@ echo $this->data['nav']->render();
-
+
getHtml('Hooks'); ?>download
@@ -92,6 +92,6 @@ echo $this->data['nav']->render(); -
+
diff --git a/Theme/Backend/modules-info.tpl.php b/Theme/Backend/modules-info.tpl.php index f878a05..d62be41 100755 --- a/Theme/Backend/modules-info.tpl.php +++ b/Theme/Backend/modules-info.tpl.php @@ -35,7 +35,7 @@ if (isset($installed[$id])) {
-
+
printHtml($module->getExternalName()); ?>
@@ -88,16 +88,16 @@ if (isset($installed[$id])) {
-
+
getData('introduction'))) : ?>
-
+
data['introduction']; ?>
-
+
diff --git a/Theme/Backend/modules-list.tpl.php b/Theme/Backend/modules-list.tpl.php index 6bd243a..6d805bd 100755 --- a/Theme/Backend/modules-list.tpl.php +++ b/Theme/Backend/modules-list.tpl.php @@ -31,7 +31,7 @@ $tableView->setObjects($modules); ?>
-
+
renderTitle( $this->getHtml('Modules') @@ -105,6 +105,6 @@ $tableView->setObjects($modules);
-
+
diff --git a/Theme/Backend/modules-log.tpl.php b/Theme/Backend/modules-log.tpl.php index b3db41e..89b7eeb 100755 --- a/Theme/Backend/modules-log.tpl.php +++ b/Theme/Backend/modules-log.tpl.php @@ -28,7 +28,7 @@ echo $this->data['nav']->render();
-
+
getHtml('Audits', 'Auditor'); ?>download
@@ -75,6 +75,6 @@ echo $this->data['nav']->render(); getHtml('Next', '0', '0'); ?> --> - + diff --git a/Theme/Backend/modules-route-list.tpl.php b/Theme/Backend/modules-route-list.tpl.php index 229e926..77e03e9 100755 --- a/Theme/Backend/modules-route-list.tpl.php +++ b/Theme/Backend/modules-route-list.tpl.php @@ -25,7 +25,7 @@ echo $this->data['nav']->render();
-
+
getHtml('Routes'); ?>download
@@ -102,7 +102,11 @@ echo $this->data['nav']->render(); + -
+
diff --git a/Theme/Backend/modules-settings.tpl.php b/Theme/Backend/modules-settings.tpl.php index 4dafdd7..618117a 100755 --- a/Theme/Backend/modules-settings.tpl.php +++ b/Theme/Backend/modules-settings.tpl.php @@ -26,7 +26,7 @@ if ($this->hasData('settingsTpl') else : ?>
-
+
getHtml('Settings'); ?>download
@@ -137,7 +137,7 @@ else : ?>
-
+
diff --git a/Theme/Backend/page-list.tpl.php b/Theme/Backend/page-list.tpl.php index 95ab4fd..99ca1f3 100755 --- a/Theme/Backend/page-list.tpl.php +++ b/Theme/Backend/page-list.tpl.php @@ -28,7 +28,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Pages'); ?>
@@ -114,6 +114,6 @@ echo $this->data['nav']->render(); ?> getHtml('Next', '0', '0'); ?>
--> -
+