diff --git a/Controller/ApiController.php b/Controller/ApiController.php index c36f9d2..3bc663e 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -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 * diff --git a/Models/ModuleStatusUpdateType.php b/Models/ModuleStatusUpdateType.php index b7174dc..e33e284 100755 --- a/Models/ModuleStatusUpdateType.php +++ b/Models/ModuleStatusUpdateType.php @@ -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; } diff --git a/Models/PermissionState.php b/Models/PermissionState.php index 9292e01..11c70b7 100755 --- a/Models/PermissionState.php +++ b/Models/PermissionState.php @@ -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; } diff --git a/Theme/Backend/Components/GroupTagSelector/group-selector-popup.tpl.php b/Theme/Backend/Components/GroupTagSelector/group-selector-popup.tpl.php index 2991eef..36863eb 100755 --- a/Theme/Backend/Components/GroupTagSelector/group-selector-popup.tpl.php +++ b/Theme/Backend/Components/GroupTagSelector/group-selector-popup.tpl.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/Theme/Backend/accounts-list.tpl.php b/Theme/Backend/accounts-list.tpl.php index 91ffa08..8456d34 100755 --- a/Theme/Backend/accounts-list.tpl.php +++ b/Theme/Backend/accounts-list.tpl.php @@ -29,15 +29,15 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Accounts') ?>
+
getHtml('Accounts'); ?>
$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'; } ?> -
getHtml('ID', '0', '0'); ?> - getHtml('Status') ?> - getHtml('Name') ?> - getHtml('Activity') ?> - getHtml('Created') ?> + getHtml('Status'); ?> + getHtml('Name'); ?> + getHtml('Activity'); ?> + getHtml('Created'); ?>
printHtml($value->getId()); ?> - getHtml('Status'. $value->getStatus()); ?> - printHtml( + printHtml($value->getId()); ?> + getHtml('Status'. $value->getStatus()); ?> + printHtml( \sprintf('%3$s %2$s %1$s', $value->getName1(), $value->getName2(), $value->getName3()) ); ?> - printHtml($value->getLastActive()->format('Y-m-d H:i:s')); ?> - printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?> + printHtml($value->getLastActive()->format('Y-m-d H:i:s')); ?> + printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?>
getHtml('Empty', '0', '0'); ?> diff --git a/Theme/Backend/accounts-single.tpl.php b/Theme/Backend/accounts-single.tpl.php index 2132ae0..b7ee0d2 100755 --- a/Theme/Backend/accounts-single.tpl.php +++ b/Theme/Backend/accounts-single.tpl.php @@ -54,7 +54,7 @@ echo $this->getData('nav')->render(); ?>
- request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
@@ -140,13 +140,13 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Groups') ?>
+
getHtml('Groups'); ?>
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(); ?>
-
getHtml('Permissions') ?>
+
getHtml('Permissions'); ?>
getHtml('ID', '0', '0'); ?> - getHtml('Name') ?> + getHtml('Name'); ?>
@@ -243,30 +243,30 @@ echo $this->getData('nav')->render(); ?>
- - + + - - + + - - + + - - + + - - + +
- +
@@ -275,12 +275,12 @@ echo $this->getData('nav')->render(); ?>
- request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
-
getHtml('Audits', 'Auditor') ?>
+
getHtml('Audits', 'Auditor'); ?>
@@ -297,15 +297,15 @@ echo $this->getData('nav')->render(); ?> $audit) : ++$count; $url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?> diff --git a/Theme/Backend/groups-list.tpl.php b/Theme/Backend/groups-list.tpl.php index fe417be..6dc5595 100755 --- a/Theme/Backend/groups-list.tpl.php +++ b/Theme/Backend/groups-list.tpl.php @@ -28,14 +28,14 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Groups') ?>
+
getHtml('Groups'); ?>
getHtml('ID', '0', '0'); ?> - getHtml('Module', 'Auditor') ?> - getHtml('Type', 'Auditor') ?> - getHtml('Subtype', 'Auditor') ?> - getHtml('Old', 'Auditor') ?> - getHtml('New', 'Auditor') ?> - getHtml('Content', 'Auditor') ?> - getHtml('By', 'Auditor') ?> - getHtml('Ref', 'Auditor') ?> - getHtml('Date', 'Auditor') ?> + getHtml('Module', 'Auditor'); ?> + getHtml('Type', 'Auditor'); ?> + getHtml('Subtype', 'Auditor'); ?> + getHtml('Old', 'Auditor'); ?> + getHtml('New', 'Auditor'); ?> + getHtml('Content', 'Auditor'); ?> + getHtml('By', 'Auditor'); ?> + getHtml('Ref', 'Auditor'); ?> + getHtml('Date', 'Auditor'); ?>
$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'; } ?> -
getHtml('ID', '0', '0'); ?> - getHtml('Status') ?> - getHtml('Name') ?> - getHtml('Members') ?> + getHtml('Status'); ?> + getHtml('Name'); ?> + getHtml('Members'); ?>
printHtml($value->getId()); ?> - getHtml('Status'. $value->getStatus()); ?> - printHtml($value->getName()); ?> - + printHtml($value->getId()); ?> + getHtml('Status'. $value->getStatus()); ?> + printHtml($value->getName()); ?> +
getHtml('Empty', '0', '0'); ?> diff --git a/Theme/Backend/groups-single.tpl.php b/Theme/Backend/groups-single.tpl.php index 65202e0..23ba431 100755 --- a/Theme/Backend/groups-single.tpl.php +++ b/Theme/Backend/groups-single.tpl.php @@ -65,7 +65,7 @@ echo $this->getData('nav')->render(); ?>
- request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
@@ -101,7 +101,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Accounts') ?>
+
getHtml('Accounts'); ?>
@@ -136,7 +136,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Permissions') ?>
+
getHtml('Permissions'); ?>
@@ -219,30 +219,30 @@ echo $this->getData('nav')->render(); ?>
- - + + - - + + - - + + - - + + - - + +
- +
@@ -251,12 +251,12 @@ echo $this->getData('nav')->render(); ?>
- request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
-
getHtml('Audits', 'Auditor') ?>
+
getHtml('Audits', 'Auditor'); ?>
@@ -273,15 +273,15 @@ echo $this->getData('nav')->render(); ?> $audit) : ++$count; $url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?> diff --git a/Theme/Backend/modules-list.tpl.php b/Theme/Backend/modules-list.tpl.php index 433c382..c9bdcc6 100755 --- a/Theme/Backend/modules-list.tpl.php +++ b/Theme/Backend/modules-list.tpl.php @@ -26,14 +26,14 @@ $isntalled = $this->getData('isntalled') ?? [];
-
getHtml('Modules') ?>
+
getHtml('Modules'); ?>
getHtml('ID', '0', '0'); ?> - getHtml('Module', 'Auditor') ?> - getHtml('Type', 'Auditor') ?> - getHtml('Subtype', 'Auditor') ?> - getHtml('Old', 'Auditor') ?> - getHtml('New', 'Auditor') ?> - getHtml('Content', 'Auditor') ?> - getHtml('By', 'Auditor') ?> - getHtml('Ref', 'Auditor') ?> - getHtml('Date', 'Auditor') ?> + getHtml('Module', 'Auditor'); ?> + getHtml('Type', 'Auditor'); ?> + getHtml('Subtype', 'Auditor'); ?> + getHtml('Old', 'Auditor'); ?> + getHtml('New', 'Auditor'); ?> + getHtml('Content', 'Auditor'); ?> + getHtml('By', 'Auditor'); ?> + getHtml('Ref', 'Auditor'); ?> + getHtml('Date', 'Auditor'); ?>
$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; } ?> -
getHtml('ID', '0', '0'); ?> - getHtml('Name') ?> - getHtml('Version') ?> - getHtml('Status') ?> + getHtml('Name'); ?> + getHtml('Version'); ?> + getHtml('Status'); ?>
printHtml($module['name']['id']); ?> - printHtml($module['name']['external']); ?> - printHtml($module['version']); ?> - + printHtml($module['name']['id']); ?> + printHtml($module['name']['external']); ?> + printHtml($module['version']); ?> + - request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
@@ -72,18 +72,18 @@ if ($nav !== null) {
- +
- +
- +
@@ -91,12 +91,12 @@ if ($nav !== null) {
- +
- +
@@ -118,7 +118,7 @@ if ($nav !== null) {
- +
getHtml('Permissions') ?>getHtml('Permissions'); ?>
getHtml('ID', '0', '0'); ?> @@ -142,12 +142,12 @@ if ($nav !== null) { - request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
-
getHtml('Audits', 'Auditor') ?>
+
getHtml('Audits', 'Auditor'); ?>
@@ -164,15 +164,15 @@ if ($nav !== null) { $audit) : ++$count; $url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?> diff --git a/Theme/Backend/settings-general.tpl.php b/Theme/Backend/settings-general.tpl.php index 5ef83a4..f0744a4 100755 --- a/Theme/Backend/settings-general.tpl.php +++ b/Theme/Backend/settings-general.tpl.php @@ -47,7 +47,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
- request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
@@ -79,23 +79,23 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
getHtml('ID', '0', '0'); ?> - getHtml('Module', 'Auditor') ?> - getHtml('Type', 'Auditor') ?> - getHtml('Subtype', 'Auditor') ?> - getHtml('Old', 'Auditor') ?> - getHtml('New', 'Auditor') ?> - getHtml('Content', 'Auditor') ?> - getHtml('By', 'Auditor') ?> - getHtml('Ref', 'Auditor') ?> - getHtml('Date', 'Auditor') ?> + getHtml('Module', 'Auditor'); ?> + getHtml('Type', 'Auditor'); ?> + getHtml('Subtype', 'Auditor'); ?> + getHtml('Old', 'Auditor'); ?> + getHtml('New', 'Auditor'); ?> + getHtml('Content', 'Auditor'); ?> + getHtml('By', 'Auditor'); ?> + getHtml('Ref', 'Auditor'); ?> + getHtml('Date', 'Auditor'); ?>
- +
- +
- +
- +
- +
@@ -127,7 +127,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
- request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
@@ -147,7 +147,7 @@ $l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
-
+
diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index a57605e..51a3506 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -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; diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 9c93421..2a090ec 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -43,6 +43,7 @@ use phpOMS\Utils\TestUtils; class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; + protected ModuleAbstract $module; protected function setUp() : void