autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:10 +02:00
parent 22a7cf0510
commit fb920cbb3f
13 changed files with 121 additions and 105 deletions

View File

@ -1366,6 +1366,7 @@ final class ApiController extends Controller
/**
* This update logic below is only temp. And will be replaced once the package management is implemented (not part of this application but part of the service provided by the organization website)
*/
/**
* Api check for updates
*

View File

@ -27,9 +27,14 @@ use phpOMS\Stdlib\Base\Enum;
abstract class ModuleStatusUpdateType extends Enum
{
public const ACTIVATE = 1;
public const DEACTIVATE = 2;
public const INSTALL = 3;
public const UNINSTALL = 4;
public const DELETE = 5;
public const UPDATE = 6;
}

View File

@ -27,12 +27,20 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum
{
public const SETTINGS = 1;
public const ACCOUNT = 2;
public const GROUP = 3;
public const MODULE = 4;
public const LOG = 5;
public const ROUTE = 6;
public const APP = 7;
public const ACCOUNT_SETTINGS = 8;
public const SEARCH = 9;
}

View File

@ -1,6 +1,6 @@
<template id="group-selector-tpl">
<section id="group-selector" class="box w-50" style="z-index: 9; position: absolute; margin: 0 auto; left: 50%; top: 50%; transform: translate(-50%, -50%);">
<header><h1><?= $this->getHtml('Group', 'Admin') ?></h1></header>
<header><h1><?= $this->getHtml('Group', 'Admin'); ?></h1></header>
<div class="inner">
<label for="iSearchGroup">Search</label>
@ -41,7 +41,7 @@
{"key": 1, "type": "dom.remove", "selector": "#group-selector", "aniOut": "fadeOut"}
]
}
]'><?= $this->getHtml('Close', 'Admin') ?></button>
]'><?= $this->getHtml('Close', 'Admin'); ?></button>
</div>
</section>
</template>

View File

@ -29,15 +29,15 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Accounts'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="accountList" 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('Activity') ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Created') ?><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('Activity'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Created'); ?><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;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/account/settings?{?}&id=' . $value->getId());
@ -47,13 +47,13 @@ echo $this->getData('nav')->render(); ?>
elseif ($value->getStatus() === AccountStatus::TIMEOUT) { $color = 'purple'; }
elseif ($value->getStatus() === AccountStatus::BANNED) { $color = 'red'; } ?>
<tr tabindex="0" 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(
<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(
\sprintf('%3$s %2$s %1$s', $value->getName1(), $value->getName2(), $value->getName3())
); ?></a>
<td data-label="<?= $this->getHtml('Activity') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getLastActive()->format('Y-m-d H:i:s')); ?></a>
<td data-label="<?= $this->getHtml('Created') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
<td data-label="<?= $this->getHtml('Activity'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getLastActive()->format('Y-m-d H:i:s')); ?></a>
<td data-label="<?= $this->getHtml('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -54,7 +54,7 @@ echo $this->getData('nav')->render(); ?>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
@ -140,13 +140,13 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></div>
<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>
<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()); ?>
@ -181,7 +181,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Permissions'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div style="overflow-x:auto;">
<table id="accountPermissions" class="default">
<thead>
@ -243,30 +243,30 @@ echo $this->getData('nav')->render(); ?>
<tr><td><label><?= $this->getHtml('Permission'); ?></label>
<tr><td>
<span class="checkbox">
<input id="iPermissionCreate" name="permissioncreate" type="checkbox" value="<?= PermissionType::CREATE ?>">
<label for="iPermissionCreate"><?= $this->getHtml('Create') ?></label>
<input id="iPermissionCreate" name="permissioncreate" type="checkbox" value="<?= PermissionType::CREATE; ?>">
<label for="iPermissionCreate"><?= $this->getHtml('Create'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionRead" name="permissionread" type="checkbox" value="<?= PermissionType::READ ?>">
<label for="iPermissionRead"><?= $this->getHtml('Read') ?></label>
<input id="iPermissionRead" name="permissionread" type="checkbox" value="<?= PermissionType::READ; ?>">
<label for="iPermissionRead"><?= $this->getHtml('Read'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionUpdate" name="permissionupdate" type="checkbox" value="<?= PermissionType::MODIFY ?>">
<label for="iPermissionUpdate"><?= $this->getHtml('Update') ?></label>
<input id="iPermissionUpdate" name="permissionupdate" type="checkbox" value="<?= PermissionType::MODIFY; ?>">
<label for="iPermissionUpdate"><?= $this->getHtml('Update'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionDelete" name="permissiondelete" type="checkbox" value="<?= PermissionType::DELETE ?>">
<label for="iPermissionDelete"><?= $this->getHtml('Delete') ?></label>
<input id="iPermissionDelete" name="permissiondelete" type="checkbox" value="<?= PermissionType::DELETE; ?>">
<label for="iPermissionDelete"><?= $this->getHtml('Delete'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionPermission" name="permissionpermission" type="checkbox" value="<?= PermissionType::PERMISSION ?>">
<label for="iPermissionPermission"><?= $this->getHtml('Permission') ?></label>
<input id="iPermissionPermission" name="permissionpermission" type="checkbox" value="<?= PermissionType::PERMISSION; ?>">
<label for="iPermissionPermission"><?= $this->getHtml('Permission'); ?></label>
</span>
</table>
</div>
<div class="portlet-foot">
<input type="hidden" name="permissionref" value="<?= $this->printHtml($account->getId()); ?>">
<input type="hidden" name="permissionowner" value="<?= PermissionOwner::ACCOUNT ?>">
<input type="hidden" name="permissionowner" value="<?= PermissionOwner::ACCOUNT; ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
@ -275,12 +275,12 @@ echo $this->getData('nav')->render(); ?>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default fixed">
<colgroup>
<col style="width: 75px">
@ -297,15 +297,15 @@ echo $this->getData('nav')->render(); ?>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td ><?= $this->getHtml('Module', 'Auditor') ?>
<td ><?= $this->getHtml('Type', 'Auditor') ?>
<td ><?= $this->getHtml('Subtype', 'Auditor') ?>
<td ><?= $this->getHtml('Old', 'Auditor') ?>
<td ><?= $this->getHtml('New', 'Auditor') ?>
<td ><?= $this->getHtml('Content', 'Auditor') ?>
<td ><?= $this->getHtml('By', 'Auditor') ?>
<td ><?= $this->getHtml('Ref', 'Auditor') ?>
<td ><?= $this->getHtml('Date', 'Auditor') ?>
<td ><?= $this->getHtml('Module', 'Auditor'); ?>
<td ><?= $this->getHtml('Type', 'Auditor'); ?>
<td ><?= $this->getHtml('Subtype', 'Auditor'); ?>
<td ><?= $this->getHtml('Old', 'Auditor'); ?>
<td ><?= $this->getHtml('New', 'Auditor'); ?>
<td ><?= $this->getHtml('Content', 'Auditor'); ?>
<td ><?= $this->getHtml('By', 'Auditor'); ?>
<td ><?= $this->getHtml('Ref', 'Auditor'); ?>
<td ><?= $this->getHtml('Date', 'Auditor'); ?>
<tbody>
<?php $count = 0; foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?>

View File

@ -28,14 +28,14 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Groups') ?><i class="fa fa-download floatRight download btn"></i></div>
<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>
<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 ($groups as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId());
@ -44,10 +44,10 @@ echo $this->getData('nav')->render(); ?>
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::INACTIVE) { $color = 'darkblue'; }
elseif ($value->getStatus() === \phpOMS\Account\GroupStatus::HIDDEN) { $color = 'purple'; } ?>
<tr tabindex="0" 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') ?>">
<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'); ?>

View File

@ -65,7 +65,7 @@ echo $this->getData('nav')->render(); ?>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
@ -101,7 +101,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Accounts'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default">
<thead>
<tr>
@ -136,7 +136,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Permissions'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div style="overflow-x:auto;">
<table id="groupPermissions" class="default" data-table-form="fGroupAddPermission">
<thead>
@ -219,30 +219,30 @@ echo $this->getData('nav')->render(); ?>
<tr><td><label><?= $this->getHtml('Permission'); ?></label>
<tr><td>
<span class="checkbox">
<input id="iPermissionCreate" name="permissioncreate" type="checkbox" value="<?= PermissionType::CREATE ?>" data-tpl-text="/perm/c" data-tpl-value="/perm/c">
<label for="iPermissionCreate"><?= $this->getHtml('Create') ?></label>
<input id="iPermissionCreate" name="permissioncreate" type="checkbox" value="<?= PermissionType::CREATE; ?>" data-tpl-text="/perm/c" data-tpl-value="/perm/c">
<label for="iPermissionCreate"><?= $this->getHtml('Create'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionRead" name="permissionread" type="checkbox" value="<?= PermissionType::READ ?>" data-tpl-text="/perm/r" data-tpl-value="/perm/r">
<label for="iPermissionRead"><?= $this->getHtml('Read') ?></label>
<input id="iPermissionRead" name="permissionread" type="checkbox" value="<?= PermissionType::READ; ?>" data-tpl-text="/perm/r" data-tpl-value="/perm/r">
<label for="iPermissionRead"><?= $this->getHtml('Read'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionUpdate" name="permissionupdate" type="checkbox" value="<?= PermissionType::MODIFY ?>" data-tpl-text="/perm/u" data-tpl-value="/perm/u">
<label for="iPermissionUpdate"><?= $this->getHtml('Update') ?></label>
<input id="iPermissionUpdate" name="permissionupdate" type="checkbox" value="<?= PermissionType::MODIFY; ?>" data-tpl-text="/perm/u" data-tpl-value="/perm/u">
<label for="iPermissionUpdate"><?= $this->getHtml('Update'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionDelete" name="permissiondelete" type="checkbox" value="<?= PermissionType::DELETE ?>" data-tpl-text="/perm/d" data-tpl-value="/perm/d">
<label for="iPermissionDelete"><?= $this->getHtml('Delete') ?></label>
<input id="iPermissionDelete" name="permissiondelete" type="checkbox" value="<?= PermissionType::DELETE; ?>" data-tpl-text="/perm/d" data-tpl-value="/perm/d">
<label for="iPermissionDelete"><?= $this->getHtml('Delete'); ?></label>
</span>
<span class="checkbox">
<input id="iPermissionPermission" name="permissionpermission" type="checkbox" value="<?= PermissionType::PERMISSION ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
<label for="iPermissionPermission"><?= $this->getHtml('Permission') ?></label>
<input id="iPermissionPermission" name="permissionpermission" type="checkbox" value="<?= PermissionType::PERMISSION; ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
<label for="iPermissionPermission"><?= $this->getHtml('Permission'); ?></label>
</span>
</table>
</div>
<div class="portlet-foot">
<input type="hidden" name="permissionref" value="<?= $this->printHtml($group->getId()); ?>">
<input type="hidden" name="permissionowner" value="<?= PermissionOwner::GROUP ?>">
<input type="hidden" name="permissionowner" value="<?= PermissionOwner::GROUP; ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
@ -251,12 +251,12 @@ echo $this->getData('nav')->render(); ?>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default fixed">
<colgroup>
<col style="width: 75px">
@ -273,15 +273,15 @@ echo $this->getData('nav')->render(); ?>
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td ><?= $this->getHtml('Module', 'Auditor') ?>
<td ><?= $this->getHtml('Type', 'Auditor') ?>
<td ><?= $this->getHtml('Subtype', 'Auditor') ?>
<td ><?= $this->getHtml('Old', 'Auditor') ?>
<td ><?= $this->getHtml('New', 'Auditor') ?>
<td ><?= $this->getHtml('Content', 'Auditor') ?>
<td ><?= $this->getHtml('By', 'Auditor') ?>
<td ><?= $this->getHtml('Ref', 'Auditor') ?>
<td ><?= $this->getHtml('Date', 'Auditor') ?>
<td ><?= $this->getHtml('Module', 'Auditor'); ?>
<td ><?= $this->getHtml('Type', 'Auditor'); ?>
<td ><?= $this->getHtml('Subtype', 'Auditor'); ?>
<td ><?= $this->getHtml('Old', 'Auditor'); ?>
<td ><?= $this->getHtml('New', 'Auditor'); ?>
<td ><?= $this->getHtml('Content', 'Auditor'); ?>
<td ><?= $this->getHtml('By', 'Auditor'); ?>
<td ><?= $this->getHtml('Ref', 'Auditor'); ?>
<td ><?= $this->getHtml('Date', 'Auditor'); ?>
<tbody>
<?php $count = 0; foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?>

View File

@ -26,14 +26,14 @@ $isntalled = $this->getData('isntalled') ?? [];
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Modules') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Modules'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="moduleList" 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>
<td><?= $this->getHtml('Version') ?>
<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('Version'); ?>
<td><?= $this->getHtml('Status'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $count = 0; foreach ($modules as $key => $module) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/module/settings?{?}&id=' . $module['name']['internal']);
@ -42,10 +42,10 @@ $isntalled = $this->getData('isntalled') ?? [];
else { $status = ModuleStatus::AVAILABLE; }
?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['id']); ?></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['external']); ?></a>
<td data-label="<?= $this->getHtml('Version') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['version']); ?></a>
<td data-label="<?= $this->getHtml('Status') ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['id']); ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['external']); ?></a>
<td data-label="<?= $this->getHtml('Version'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['version']); ?></a>
<td data-label="<?= $this->getHtml('Status'); ?>">
<span class="tag <?php
if ($status === ModuleStatus::ACTIVE)
echo 'green';

View File

@ -42,7 +42,7 @@ if ($nav !== null) {
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-4">
@ -72,18 +72,18 @@ if ($nav !== null) {
<div class="portlet-foot">
<?php if (isset($active[$id])) : ?>
<form id="fModuleDeactivate" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleDeactivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DEACTIVATE ?>"><?= $this->getHtml('Deactivate'); ?></button>
<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="<?= UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleUninstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::UNINSTALL ?>"><?= $this->getHtml('Uninstall'); ?></button>
<button id="fModuleUninstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::UNINSTALL; ?>"><?= $this->getHtml('Uninstall'); ?></button>
</form>
</div>
<div class="ipt-second">
<form id="fModuleActivate" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleActivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::ACTIVATE ?>"><?= $this->getHtml('Activate'); ?></button>
<button id="fModuleActivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::ACTIVATE; ?>"><?= $this->getHtml('Activate'); ?></button>
</form>
</div>
</div>
@ -91,12 +91,12 @@ if ($nav !== null) {
<div class="ipt-wrap">
<div class="ipt-first">
<form id="fModuleInstall" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleInstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::INSTALL ?>"><?= $this->getHtml('Install'); ?></button>
<button id="fModuleInstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::INSTALL; ?>"><?= $this->getHtml('Install'); ?></button>
</form>
</div>
<div class="ipt-second">
<form id="fModuleDelete" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id); ?>" method="POST">
<button id="fModuleDeleteButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DELETE ?>"><?= $this->getHtml('Delete'); ?></button>
<button id="fModuleDeleteButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DELETE; ?>"><?= $this->getHtml('Delete'); ?></button>
</form>
</div>
</div>
@ -118,7 +118,7 @@ if ($nav !== null) {
<div class="col-xs-12 col-md-4">
<div class="portlet">
<table id="iModuleGroupList" class="default">
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
<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>
@ -142,12 +142,12 @@ if ($nav !== null) {
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default fixed">
<colgroup>
<col style="width: 75px">
@ -164,15 +164,15 @@ if ($nav !== null) {
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td ><?= $this->getHtml('Module', 'Auditor') ?>
<td ><?= $this->getHtml('Type', 'Auditor') ?>
<td ><?= $this->getHtml('Subtype', 'Auditor') ?>
<td ><?= $this->getHtml('Old', 'Auditor') ?>
<td ><?= $this->getHtml('New', 'Auditor') ?>
<td ><?= $this->getHtml('Content', 'Auditor') ?>
<td ><?= $this->getHtml('By', 'Auditor') ?>
<td ><?= $this->getHtml('Ref', 'Auditor') ?>
<td ><?= $this->getHtml('Date', 'Auditor') ?>
<td ><?= $this->getHtml('Module', 'Auditor'); ?>
<td ><?= $this->getHtml('Type', 'Auditor'); ?>
<td ><?= $this->getHtml('Subtype', 'Auditor'); ?>
<td ><?= $this->getHtml('Old', 'Auditor'); ?>
<td ><?= $this->getHtml('New', 'Auditor'); ?>
<td ><?= $this->getHtml('Content', 'Auditor'); ?>
<td ><?= $this->getHtml('By', 'Auditor'); ?>
<td ><?= $this->getHtml('Ref', 'Auditor'); ?>
<td ><?= $this->getHtml('Date', 'Auditor'); ?>
<tbody>
<?php $count = 0; foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?>

View File

@ -47,7 +47,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
@ -79,23 +79,23 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
<tbody>
<tr><td>
<label for="iPassword"><?= $this->getHtml('PasswordRegex'); ?></label>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordRegex') ?>"><i class="fa fa-info-circle"></i></i>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordRegex'); ?>"><i class="fa fa-info-circle"></i></i>
<tr><td><input id="iPassword" name="settings_1000000001" type="text" value="<?= $this->printHtml($settings[1000000001]); ?>" placeholder="&#xf023; ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
<tr><td>
<label for="iLoginRetries"><?= $this->getHtml('LoginRetries'); ?></label>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:LoginRetries') ?>"><i class="fa fa-info-circle"></i></i>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:LoginRetries'); ?>"><i class="fa fa-info-circle"></i></i>
<tr><td><input id="iLoginRetries" name="settings_1000000005" type="number" value="<?= $this->printHtml($settings[1000000005]); ?>" min="-1">
<tr><td>
<label for="iTimeoutPeriod"><?= $this->getHtml('TimeoutPeriod'); ?></label>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:TimeoutPeriod') ?>"><i class="fa fa-info-circle"></i></i>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:TimeoutPeriod'); ?>"><i class="fa fa-info-circle"></i></i>
<tr><td><input id="iTimeoutPeriod" name="settings_1000000002" type="number" value="<?= $this->printHtml($settings[1000000002]); ?>">
<tr><td>
<label for="iPasswordChangeInterval"><?= $this->getHtml('PasswordChangeInterval'); ?></label>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordChangeInterval') ?>"><i class="fa fa-info-circle"></i></i>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordChangeInterval'); ?>"><i class="fa fa-info-circle"></i></i>
<tr><td><input id="iPasswordChangeInterval" name="settings_1000000003" type="number" value="<?= $this->printHtml($settings[1000000003]); ?>">
<tr><td>
<label for="iPasswordHistory"><?= $this->getHtml('PasswordHistory'); ?></label>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordHistory') ?>"><i class="fa fa-info-circle"></i></i>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordHistory'); ?>"><i class="fa fa-info-circle"></i></i>
<tr><td><input id="iPasswordHistory" name="settings_1000000004" type="number" value="<?= $this->printHtml($settings[1000000004]); ?>">
</table>
</div>
@ -127,7 +127,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-4">
@ -147,7 +147,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
<?php endforeach; ?>
</select>
</div>
<div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?load=1'); ?>" value="<?= $this->getHtml('Load') ?>"></div>
<div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?load=1'); ?>" value="<?= $this->getHtml('Load'); ?>"></div>
</div>
<tr><td colspan="2"><label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<tr><td colspan="2">

View File

@ -20,6 +20,7 @@ namespace Modules\Admin\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase
{
protected const MODULE_NAME = 'Admin';
protected const URI_LOAD = 'http://127.0.0.1/en/backend/admin';
use \Modules\tests\ModuleTestTrait;

View File

@ -43,6 +43,7 @@ use phpOMS\Utils\TestUtils;
class ApiControllerTest extends \PHPUnit\Framework\TestCase
{
protected ApplicationAbstract $app;
protected ModuleAbstract $module;
protected function setUp() : void