draft tags and portlets

This commit is contained in:
Dennis Eichhorn 2020-03-01 15:00:33 +01:00
parent cdf1357c5c
commit 4a11ffe120
9 changed files with 359 additions and 319 deletions

View File

@ -273,6 +273,10 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-list');
$view->setData('modules', $this->app->moduleManager->getAllModules());
$view->setData('active', $this->app->moduleManager->getActiveModules());
$view->setData('installed', $this->app->moduleManager->getInstalledModules());
return $view;
}

View File

@ -12,18 +12,19 @@
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Account'); ?></h1></header>
<div class="inner">
<form id="fAccount" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/account'); ?>" method="put">
<div class="portlet">
<form id="fAccount" action="<?= UriFactory::build('{/api}admin/account'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Account'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iType"><?= $this->getHtml('Type'); ?></label>
@ -50,10 +51,12 @@ echo $this->getData('nav')->render(); ?>
<tr><td><input id="iEmail" name="email" type="email" placeholder="&#xf0e0; d.duck@duckburg.com">
<tr><td><label for="iPassword"><?= $this->getHtml('Name3'); ?></label>
<tr><td><input id="iPassword" name="password" type="password" placeholder="&#xf023; Pa55ssw0rd?">
<tr><td><input id="account-create-submit" name="createSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table>
</form>
</div>
</section>
</div>
<div class="portlet-foot">
<input id="account-create-submit" name="createSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>

View File

@ -22,9 +22,9 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts') ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="accountList" class="default">
<caption><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
@ -55,6 +55,7 @@ echo $this->getData('nav')->render(); ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
</div>
</div>

View File

@ -15,6 +15,7 @@ declare(strict_types=1);
use phpOMS\Account\AccountStatus;
use phpOMS\Account\AccountType;
use phpOMS\Account\PermissionType;
use phpOMS\Uri\UriFactory;
/**
* @todo Orange-Management/Modules#122
@ -41,10 +42,10 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Account'); ?></h1></header>
<div class="inner">
<form id="account-edit" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/account'); ?>" method="post">
<div class="portlet">
<form id="account-edit" action="<?= UriFactory::build('{/api}admin/account'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Account'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
@ -102,105 +103,111 @@ echo $this->getData('nav')->render(); ?>
</div>
<div class="ipt-second"> or <button><?= $this->getHtml('Reset'); ?></button></div>
</div>
<tr><td>
<input id="account-edit-submit" name="editSubmit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
<button id="account-profile-create" data-action='[
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "dom.getvalue", "base": "", "selector": "#iId"},
{"key": 3, "type": "message.request", "uri": "{/base}/{/lang}/api/profile", "method": "PUT", "request_type": "json"},
{"key": 4, "type": "message.log"}
]
}
]'><?= $this->getHtml('CreateProfile'); ?></button>
</table>
</form>
</div>
</section>
</div>
<div class="portlet-foot">
<input id="account-edit-submit" name="editSubmit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
<button id="account-profile-create" data-action='[
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "dom.getvalue", "base": "", "selector": "#iId"},
{"key": 3, "type": "message.request", "uri": "{/base}/{/lang}/api/profile", "method": "PUT", "request_type": "json"},
{"key": 4, "type": "message.log"}
]
}
]'><?= $this->getHtml('CreateProfile'); ?></button>
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-6">
<table id="groupTable" class="box table default">
<caption><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; $groups = $account->getGroups(); foreach ($groups as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="groupTable" class="default">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; $groups = $account->getGroups(); foreach ($groups as $key => $value) : ++$c;
$url = UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Groups'); ?></h1></header>
<div class="inner">
<form id="iAddGroupToAccount" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/account/group'); ?>" method="put">
<div class="portlet">
<form id="iAddGroupToAccount" action="<?= UriFactory::build('{/api}admin/account/group'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Groups'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iGroup"><?= $this->getHtml('Name'); ?></label>
<tr><td><?= $this->getData('grpSelector')->render('iGroup', true); ?>
<tr><td>
<input name="account" type="hidden" value="<?= $this->printHtml($account->getId()); ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</table>
</form>
</div>
</section>
</div>
<div class="portlet-foot">
<input name="account" type="hidden" value="<?= $this->printHtml($account->getId()); ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-6">
<table class="box table default">
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td><?= $this->getHtml('Unit'); ?>
<td><?= $this->getHtml('App'); ?>
<td><?= $this->getHtml('Module'); ?>
<td><?= $this->getHtml('Type'); ?>
<td><?= $this->getHtml('Ele'); ?>
<td><?= $this->getHtml('Comp'); ?>
<td class="wf-100"><?= $this->getHtml('Perm'); ?>
<tbody>
<?php $c = 0; foreach ($permissions as $key => $value) : ++$c; $permission = $value->getPermission(); ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="#"><i class="fa fa-cogs"></i></a>
<td><?= $value->getId(); ?>
<td><?= $value->getUnit(); ?>
<td><?= $value->getApp(); ?>
<td><?= $value->getModule(); ?>
<td><?= $value->getType(); ?>
<td><?= $value->getElement(); ?>
<td><?= $value->getComponent(); ?>
<td>
<?= (PermissionType::CREATE | $permission) === $permission ? 'C' : ''; ?>
<?= (PermissionType::READ | $permission) === $permission ? 'R' : ''; ?>
<?= (PermissionType::MODIFY | $permission) === $permission ? 'U' : ''; ?>
<?= (PermissionType::DELETE | $permission) === $permission ? 'D' : ''; ?>
<?= (PermissionType::PERMISSION | $permission) === $permission ? 'P' : ''; ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default">
<thead>
<tr>
<td>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td><?= $this->getHtml('Unit'); ?>
<td><?= $this->getHtml('App'); ?>
<td><?= $this->getHtml('Module'); ?>
<td><?= $this->getHtml('Type'); ?>
<td><?= $this->getHtml('Ele'); ?>
<td><?= $this->getHtml('Comp'); ?>
<td class="wf-100"><?= $this->getHtml('Perm'); ?>
<tbody>
<?php $c = 0; foreach ($permissions as $key => $value) : ++$c; $permission = $value->getPermission(); ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="#"><i class="fa fa-cogs"></i></a>
<td><?= $value->getId(); ?>
<td><?= $value->getUnit(); ?>
<td><?= $value->getApp(); ?>
<td><?= $value->getModule(); ?>
<td><?= $value->getType(); ?>
<td><?= $value->getElement(); ?>
<td><?= $value->getComponent(); ?>
<td>
<?= (PermissionType::CREATE | $permission) === $permission ? 'C' : ''; ?>
<?= (PermissionType::READ | $permission) === $permission ? 'R' : ''; ?>
<?= (PermissionType::MODIFY | $permission) === $permission ? 'U' : ''; ?>
<?= (PermissionType::DELETE | $permission) === $permission ? 'D' : ''; ?>
<?= (PermissionType::PERMISSION | $permission) === $permission ? 'P' : ''; ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Permissions'); ?></h1></header>
<div class="inner">
<form id="fAccountAddPermission" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/account/permission'); ?>" method="put">
<div class="portlet">
<form id="fAccountAddPermission" action="<?= UriFactory::build('{/api}admin/account/permission'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Permissions'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iPermissionUnit"><?= $this->getHtml('Unit'); ?></label>
@ -237,13 +244,14 @@ echo $this->getData('nav')->render(); ?>
<input id="iPermissionPermission" name="permissionpermission" type="checkbox" value="<?= PermissionType::PERMISSION ?>">
<label for="iPermissionPermission"><?= $this->getHtml('Permission') ?></label>
</span>
<tr><td>
<input type="hidden" name="permissionref" value="<?= $this->printHtml($account->getId()); ?>">
<input type="hidden" name="permissionowner" value="<?= \phpOMS\Account\PermissionOwner::ACCOUNT ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</table>
</form>
</div>
</section>
</div>
<div class="portlet-foot">
<input type="hidden" name="permissionref" value="<?= $this->printHtml($account->getId()); ?>">
<input type="hidden" name="permissionowner" value="<?= \phpOMS\Account\PermissionOwner::ACCOUNT ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>

View File

@ -12,6 +12,7 @@
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
@ -20,10 +21,10 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Group'); ?></h1></header>
<div class="inner">
<form id="fGroupCreate" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/group'); ?>" method="put">
<div class="portlet">
<form id="fGroupCreate" action="<?= UriFactory::build('{/api}admin/group'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Group'); ?></div>
<div class="portlet-body">
<table class="layout wf-100" style="table-layout: fixed">
<tbody>
<tr><td><label for="iStatus"><?= $this->getHtml('Status'); ?></label>
@ -36,10 +37,12 @@ echo $this->getData('nav')->render(); ?>
<tr><td><input id="iGname" name="name" type="text" placeholder="&#xf0c0; Guest" required>
<tr><td><?= $this->getData('editor')->render('group-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('group-editor', 'description', 'fGroupCreate'); ?>
<tr><td><input type="submit" id="iCreate" name="create" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table>
</form>
</div>
</section>
</div>
<div class="portlet-foot">
<input type="submit" id="iCreate" name="create" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>

View File

@ -20,32 +20,33 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<table id="groupList" class="box table default">
<caption><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Status') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Members') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tfoot>
<tr><td colspan="5">
<tbody>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId());
$color = 'darkred';
if ($value->getStatus() === \phpOMS\Account\GroupStatus::ACTIVE) { $color = 'green'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::INACTIVE) { $color = 'darkblue'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::HIDDEN) { $color = 'purple'; } ?>
<tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td data-label="<?= $this->getHtml('Status') ?>"><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getHtml('Status'. $value->getStatus()); ?></span></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td data-label="<?= $this->getHtml('Members') ?>">
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="groupList" class="default">
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Status') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Members') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId());
$color = 'darkred';
if ($value->getStatus() === \phpOMS\Account\GroupStatus::ACTIVE) { $color = 'green'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::INACTIVE) { $color = 'darkblue'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::HIDDEN) { $color = 'purple'; } ?>
<tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td data-label="<?= $this->getHtml('Status') ?>"><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getHtml('Status'. $value->getStatus()); ?></span></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td data-label="<?= $this->getHtml('Members') ?>">
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
</div>
</div>

View File

@ -12,6 +12,8 @@
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @todo Orange-Management/Modules#122
* Add group account removal
@ -59,10 +61,10 @@ echo $this->getData('nav')->render(); ?>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Group'); ?></h1></header>
<div class="inner">
<form id="fGroupEdit" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/group'); ?>" method="post">
<div class="portlet">
<form id="fGroupEdit" action="<?= UriFactory::build('{/api}admin/group'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Group'); ?></div>
<div class="portlet-body">
<label for="iGid"><?= $this->getHtml('ID', '0', '0'); ?></label>
<input id="iGid" name="id" type="text" value="<?= $this->printHtml($group->getId()); ?>" disabled>
<label for="iGname"><?= $this->getHtml('Name'); ?></label>
@ -81,105 +83,116 @@ echo $this->getData('nav')->render(); ?>
$group->getDescriptionRaw(),
$group->getDescription()
); ?>
</div>
<div class="portlet-foot">
<input id="groupSubmit" name="groupsubmit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</form>
</div>
</section>
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-6">
<table class="box table default wf-100">
<caption><?= $this->getHtml('Accounts') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; foreach ($accounts as $key => $value) : ++$c; ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= \phpOMS\Uri\UriFactory::build('{/prefix}admin/account/settings?{?}&id=' . $value->getId()) ?>"><?= $value->getName1(); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts') ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default">
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; foreach ($accounts as $key => $value) : ++$c; ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="<?= UriFactory::build('{/prefix}admin/account/settings?{?}&id=' . $value->getId()) ?>"><?= $value->getName1(); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Accounts'); ?></h1></header>
<div class="inner">
<form id="iAddAccountToGroup" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/group/account'); ?>" method="put">
<div class="portlet">
<form id="iAddAccountToGroup" action="<?= UriFactory::build('{/api}admin/group/account'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Accounts'); ?></div>
<div class="portlet-body">
<label for="iAccount"><?= $this->getHtml('Name'); ?></label>
<?= $this->getData('accGrpSelector')->render('iAccount', 'group', true); ?>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</form>
</div>
</section>
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-6">
<table id="groupPermissions" class="box table default wf-100" data-table-form="fGroupAddPermission">
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Unit'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('App'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Module'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Type'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Ele'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Comp'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Perm'); ?>
<tbody>
<template>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="groupPermissions" class="default" data-table-form="fGroupAddPermission">
<thead>
<tr>
<td>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Unit'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('App'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Module'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Type'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Ele'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Comp'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Perm'); ?>
<tbody>
<template>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="#"><i class="fa fa-cogs"></i></a>
<td></td>
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value=""></td>
<td data-tpl-text="/app" data-tpl-value="/app" data-value=""></td>
<td data-tpl-text="/module" data-tpl-value="/module" data-value=""></td>
<td data-tpl-text="/type" data-tpl-value="/type" data-value=""></td>
<td data-tpl-text="/ele" data-tpl-value="/ele" data-value=""></td>
<td data-tpl-text="/comp" data-tpl-value="/comp" data-value=""></td>
<td>
<span data-tpl-text="/perm/c" data-tpl-value="/perm/c" data-value=""><span>
<span data-tpl-text="/perm/r" data-tpl-value="/perm/r" data-value=""><span>
<span data-tpl-text="/perm/u" data-tpl-value="/perm/u" data-value=""><span>
<span data-tpl-text="/perm/d" data-tpl-value="/perm/d" data-value=""><span>
<span data-tpl-text="/perm/p" data-tpl-value="/perm/p" data-value=""><span>
</td>
</tr>
</template>
<?php $c = 0; foreach ($permissions as $key => $value) : ++$c; $permission = $value->getPermission(); ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="#"><i class="fa fa-cogs"></i></a>
<td></td>
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value=""></td>
<td data-tpl-text="/app" data-tpl-value="/app" data-value=""></td>
<td data-tpl-text="/module" data-tpl-value="/module" data-value=""></td>
<td data-tpl-text="/type" data-tpl-value="/type" data-value=""></td>
<td data-tpl-text="/ele" data-tpl-value="/ele" data-value=""></td>
<td data-tpl-text="/comp" data-tpl-value="/comp" data-value=""></td>
<td><?= $value->getId(); ?>
<td><?= $value->getUnit(); ?>
<td><?= $value->getApp(); ?>
<td><?= $value->getModule(); ?>
<td><?= $value->getType(); ?>
<td><?= $value->getElement(); ?>
<td><?= $value->getComponent(); ?>
<td>
<span data-tpl-text="/perm/c" data-tpl-value="/perm/c" data-value=""><span>
<span data-tpl-text="/perm/r" data-tpl-value="/perm/r" data-value=""><span>
<span data-tpl-text="/perm/u" data-tpl-value="/perm/u" data-value=""><span>
<span data-tpl-text="/perm/d" data-tpl-value="/perm/d" data-value=""><span>
<span data-tpl-text="/perm/p" data-tpl-value="/perm/p" data-value=""><span>
</td>
</tr>
</template>
<?php $c = 0; foreach ($permissions as $key => $value) : ++$c; $permission = $value->getPermission(); ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="#"><i class="fa fa-cogs"></i></a>
<td><?= $value->getId(); ?>
<td><?= $value->getUnit(); ?>
<td><?= $value->getApp(); ?>
<td><?= $value->getModule(); ?>
<td><?= $value->getType(); ?>
<td><?= $value->getElement(); ?>
<td><?= $value->getComponent(); ?>
<td>
<?= (\phpOMS\Account\PermissionType::CREATE | $permission) === $permission ? 'C' : ''; ?>
<?= (\phpOMS\Account\PermissionType::READ | $permission) === $permission ? 'R' : ''; ?>
<?= (\phpOMS\Account\PermissionType::MODIFY | $permission) === $permission ? 'U' : ''; ?>
<?= (\phpOMS\Account\PermissionType::DELETE | $permission) === $permission ? 'D' : ''; ?>
<?= (\phpOMS\Account\PermissionType::PERMISSION | $permission) === $permission ? 'P' : ''; ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<?= (\phpOMS\Account\PermissionType::CREATE | $permission) === $permission ? 'C' : ''; ?>
<?= (\phpOMS\Account\PermissionType::READ | $permission) === $permission ? 'R' : ''; ?>
<?= (\phpOMS\Account\PermissionType::MODIFY | $permission) === $permission ? 'U' : ''; ?>
<?= (\phpOMS\Account\PermissionType::DELETE | $permission) === $permission ? 'D' : ''; ?>
<?= (\phpOMS\Account\PermissionType::PERMISSION | $permission) === $permission ? 'P' : ''; ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Permissions'); ?></h1></header>
<div class="inner">
<form id="fGroupAddPermission" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/group/permission'); ?>" method="put">
<div class="portlet">
<form id="fGroupAddPermission" action="<?= UriFactory::build('{/api}admin/group/permission'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Permissions'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iPermissionUnit"><?= $this->getHtml('Unit'); ?></label>
@ -216,14 +229,15 @@ echo $this->getData('nav')->render(); ?>
<input id="iPermissionPermission" name="permissionpermission" type="checkbox" value="<?= \phpOMS\Account\PermissionType::PERMISSION ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
<label for="iPermissionPermission"><?= $this->getHtml('Permission') ?></label>
</span>
<tr><td>
<input type="hidden" name="permissionref" value="<?= $this->printHtml($group->getId()); ?>">
<input type="hidden" name="permissionowner" value="<?= \phpOMS\Account\PermissionOwner::GROUP ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</table>
</form>
</div>
</section>
</div>
<div class="portlet-foot">
<input type="hidden" name="permissionref" value="<?= $this->printHtml($group->getId()); ?>">
<input type="hidden" name="permissionowner" value="<?= \phpOMS\Account\PermissionOwner::GROUP ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>
</div>
@ -232,23 +246,26 @@ echo $this->getData('nav')->render(); ?>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<table class="box table default wf-100">
<caption><?= $this->getHtml('AuditLog') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td class="wf-100">Name
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : ++$c; ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td>
<td>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('AuditLog') ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default">
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td class="wf-100">Name
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : ++$c; ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td>
<td>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
</div>
</div>
</div>

View File

@ -18,16 +18,16 @@ use phpOMS\Module\ModuleStatus;
* @var \phpOMS\Views\View $this
*/
$modules = $this->app->moduleManager->getAllModules();
$active = $this->app->moduleManager->getActiveModules();
$installed = $this->app->moduleManager->getInstalledModules();
$modules = $this->getData('modules') ?? [];
$active = $this->getData('active') ?? [];
$isntalled = $this->getData('isntalled') ?? [];
?>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Modules') ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="moduleList" class="default">
<caption><?= $this->getHtml('Modules') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
@ -71,6 +71,7 @@ $installed = $this->app->moduleManager->getInstalledModules();
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
</div>
</div>

View File

@ -32,10 +32,10 @@ if ($nav !== null) {
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->printHtml($modules[$id]['name']['external']); ?></h1></header>
<div class="portlet">
<div class="portlet-head"><?= $this->printHtml($modules[$id]['name']['external']); ?></div>
<div class="inner">
<div class="portlet-body">
<table class="list wf-100">
<tbody>
<tr>
@ -53,74 +53,76 @@ if ($nav !== null) {
<tr>
<td><?= $this->getHtml('Description'); ?>
<td><?= $this->printHtml($modules[$id]['description']); ?>
<tr>
<td colspan="2">
<?php if (isset($active[$id])) : ?>
<form id="fModuleDeactivate" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleDeactivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DEACTIVATE ?>"><?= $this->getHtml('Deactivate'); ?></button>
</form>
<?php elseif (isset($installed[$id])) : ?>
<div class="ipt-wrap">
<div class="ipt-first">
<form id="fModuleUninstall" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleUninstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::UNINSTALL ?>"><?= $this->getHtml('Uninstall'); ?></button>
</form>
</div>
<div class="ipt-second">
<form id="fModuleActivate" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleActivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::ACTIVATE ?>"><?= $this->getHtml('Activate'); ?></button>
</form>
</div>
</div>
<?php elseif (isset($modules[$id])) : ?>
<div class="ipt-wrap">
<div class="ipt-first">
<form id="fModuleInstall" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleInstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::INSTALL ?>"><?= $this->getHtml('Install'); ?></button>
</form>
</div>
<div class="ipt-second">
<form id="fModuleDelete" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleDeleteButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DELETE ?>"><?= $this->getHtml('Delete'); ?></button>
</form>
</div>
</div>
<?php endif; ?>
</table>
</div>
</section>
<div class="portlet-foot">
<?php if (isset($active[$id])) : ?>
<form id="fModuleDeactivate" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleDeactivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DEACTIVATE ?>"><?= $this->getHtml('Deactivate'); ?></button>
</form>
<?php elseif (isset($installed[$id])) : ?>
<div class="ipt-wrap">
<div class="ipt-first">
<form id="fModuleUninstall" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleUninstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::UNINSTALL ?>"><?= $this->getHtml('Uninstall'); ?></button>
</form>
</div>
<div class="ipt-second">
<form id="fModuleActivate" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleActivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::ACTIVATE ?>"><?= $this->getHtml('Activate'); ?></button>
</form>
</div>
</div>
<?php elseif (isset($modules[$id])) : ?>
<div class="ipt-wrap">
<div class="ipt-first">
<form id="fModuleInstall" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleInstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::INSTALL ?>"><?= $this->getHtml('Install'); ?></button>
</form>
</div>
<div class="ipt-second">
<form id="fModuleDelete" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleDeleteButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DELETE ?>"><?= $this->getHtml('Delete'); ?></button>
</form>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Settings'); ?></h1></header>
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?></div>
<div class="inner">
<div class="portlet-body">
</div>
</section>
</div>
</div>
<div class="col-xs-12 col-md-4">
<table id="iModuleGroupList" class="box table default wf-100">
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td>Type<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; $groupPermissions = $this->getData('groupPermissions');
foreach ($groupPermissions as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>">Group</a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet">
<table id="iModuleGroupList" class="default">
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td>Type<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $c = 0; $groupPermissions = $this->getData('groupPermissions');
foreach ($groupPermissions as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><i class="fa fa-times"></i></a>
<td><a href="<?= $url; ?>">Group</a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>