september update 1

This commit is contained in:
Dennis Eichhorn 2021-09-19 19:50:14 +02:00
parent eb8ec9d727
commit aa82719d67
18 changed files with 1532 additions and 400 deletions

View File

@ -13,21 +13,6 @@
"permission": { "permission": 2, "type": null, "element": null },
"parent": 0,
"children": [
{
"id": 1000102001,
"pid": "/",
"type": 2,
"subtype": 1,
"name": "Settings",
"uri": "{/prefix}admin/settings/general?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "Admin",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000101001,
"children": []
},
{
"id": 1000103001,
"pid": "/",
@ -83,7 +68,7 @@
"uri": "{/prefix}admin/account/list",
"target": "self",
"icon": null,
"order": 3,
"order": 4,
"from": "Admin",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000101001,
@ -129,7 +114,7 @@
"uri": "{/prefix}admin/module/list",
"target": "self",
"icon": null,
"order": 4,
"order": 5,
"from": "Admin",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000101001,
@ -143,7 +128,7 @@
"uri": "{/prefix}admin/module/info?{?}",
"target": "self",
"icon": null,
"order": 4,
"order": 1,
"from": "Admin",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000105001,
@ -158,7 +143,7 @@
"uri": "{/prefix}admin/module/settings?{?}",
"target": "self",
"icon": null,
"order": 4,
"order": 5,
"from": "Admin",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000105001,
@ -173,7 +158,7 @@
"uri": "{/prefix}admin/module/log?{?}",
"target": "self",
"icon": null,
"order": 4,
"order": 10,
"from": "Admin",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000105001,

View File

@ -507,6 +507,33 @@
}
}
},
"app": {
"name": "app",
"fields": {
"app_id": {
"name": "app_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"app_name": {
"name": "app_name",
"type": "VARCHAR(50)",
"null": false
},
"app_theme": {
"name": "app_theme",
"type": "VARCHAR(255)",
"null": false
},
"app_status": {
"name": "app_status",
"type": "TINYINT",
"null": false
}
}
},
"group": {
"name": "group",
"fields": {
@ -858,6 +885,19 @@
"type": "VARCHAR(255)",
"null": true
},
"settings_pattern": {
"name": "settings_pattern",
"type": "TEXT",
"null": true
},
"settings_app": {
"name": "settings_app",
"type": "INT",
"default": null,
"null": true,
"foreignTable": "app",
"foreignKey": "app_id"
},
"settings_module": {
"name": "settings_module",
"type": "VARCHAR(190)",

View File

@ -156,4 +156,21 @@ final class Installer extends InstallerAbstract
$query->execute();
}
/**
* Install data from providing modules.
*
* @param ApplicationAbstract $app Application
* @param array $data Additional data
*
* @return array
*
* @throws PathException
* @throws \Exception
*
* @since 1.0.0
*/
public static function installExternal(ApplicationAbstract $app, array $data) : array
{
}
}

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1);
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use Modules\Admin\Controller\ApiController;
use Modules\Admin\Models\PermissionState;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1);
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use Modules\Admin\Controller\BackendController;
use Modules\Admin\Models\PermissionState;
@ -15,17 +27,18 @@ return [
],
],
'^.*/admin/settings/general.*$' => [
'^.*/admin/module/settings\?id=Admin.*$' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewSettingsGeneral',
'dest' => '\Modules\Admin\Controller\BackendController:viewModuleSettings',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::SETTINGS,
'state' => \Modules\Admin\Models\PermissionState::MODULE,
],
],
],
'^.*/admin/account/list.*$' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewAccountList',
@ -114,17 +127,6 @@ return [
],
],
],
'^.*/admin/module/settings\?.*$' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewModuleSettings',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::MODULE,
],
],
],
'^.*/admin/module/log\?.*$' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewModuleLog',

View File

@ -0,0 +1,783 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use Modules\Organization\Models\UnitMapper;
use phpOMS\Localization\NullLocalization;
use phpOMS\Uri\UriFactory;
$generalSettings = $this->getData('generalSettings') ?? [];
$settings = $this->getData('settings') ?? [];
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
$timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants();
$timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants();
$languages = \phpOMS\Localization\ISO639Enum::getConstants();
$currencies = \phpOMS\Localization\ISO4217Enum::getConstants();
$l11nDefinitions = \phpOMS\System\File\Local\Directory::list(__DIR__ . '/../../../../phpOMS/Localization/Defaults/Definitions');
$weights = \phpOMS\Utils\Converter\WeightType::getConstants();
$speeds = \phpOMS\Utils\Converter\SpeedType::getConstants();
$areas = \phpOMS\Utils\Converter\AreaType::getConstants();
$lengths = \phpOMS\Utils\Converter\LengthType::getConstants();
$volumes = \phpOMS\Utils\Converter\VolumeType::getConstants();
$temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants();
$l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
echo $this->getData('nav')->render();
?>
<div id="iSettings" class="tabview tab-2 url-rewrite">
<div class="box wf-100 col-xs-12">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('Localization'); ?></label></li>
<li><label for="c-tab-3"><?= $this->getHtml('Design'); ?></label></li>
<li><label for="c-tab-5"><?= $this->getHtml('Settings'); ?></label></li>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iGeneralSettings" action="<?= UriFactory::build('{/api}admin/settings/general'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iOname"><?= $this->getHtml('OrganizationName'); ?></label>
<select id="iOname" name="settings_1000000009">
<?php $unit = UnitMapper::get((int) $generalSettings[1000000009]); ?>
<option value="<?= $unit->getId(); ?>"><?= $this->printHtml($unit->name); ?>
</select>
</div>
</div>
<div class="portlet-foot"><input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>"></div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iSecuritySettings" action="<?= UriFactory::build('{/api}admin/settings/general'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Security'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iPassword">
<?= $this->getHtml('PasswordRegex'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordRegex'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iPassword" name="settings_1000000001" type="text" value="<?= $this->printHtml($generalSettings['1000000001']['content']); ?>" placeholder="&#xf023; ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
</div>
<div class="form-group">
<label for="iLoginRetries">
<?= $this->getHtml('LoginRetries'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:LoginRetries'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iLoginRetries" name="settings_1000000005" type="number" value="<?= $this->printHtml($generalSettings['1000000005']['content']); ?>" min="-1">
</div>
<div class="form-group">
<label for="iTimeoutPeriod">
<?= $this->getHtml('TimeoutPeriod'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:TimeoutPeriod'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iTimeoutPeriod" name="settings_1000000002" type="number" value="<?= $this->printHtml($generalSettings['1000000002']['content']); ?>">
</div>
<div class="form-group">
<label for="iPasswordChangeInterval">
<?= $this->getHtml('PasswordChangeInterval'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordChangeInterval'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iPasswordChangeInterval" name="settings_1000000003" type="number" value="<?= $this->printHtml($generalSettings['1000000003']['content']); ?>">
</div>
<div class="form-group">
<label for="iPasswordHistory">
<?= $this->getHtml('PasswordHistory'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordHistory'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iPasswordHistory" name="settings_1000000004" type="number" value="<?= $this->printHtml($generalSettings['1000000004']['content']); ?>">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iLoggingSettings"
action="<?= UriFactory::build('{/api}admin/settings/general'); ?>"
method="post">
<div class="portlet-head"><?= $this->getHtml('Logging'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label class="checkbox" for="iLog">
<input id="iLog" type="checkbox" name="settings_1000000006" value="1">
<span class="checkmark"></span>
<?= $this->getHtml('Log'); ?>
</label>
</div>
<div class="form-group">
<label for="iLogPath"><?= $this->getHtml('LogPath'); ?></label>
<input id="iLogPath" name="settings_1000000007" type="text" value="<?= $this->printHtml($generalSettings['1000000007']['content']); ?>" placeholder="&#xf040; /Logs">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-4">
<div class="portlet">
<form id="fLocalization"
name="fLocalization"
action="<?= UriFactory::build('{/api}profile/settings/localization'); ?>"
method="post">
<div class="portlet-head"><?= $this->getHtml('Localization'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iDefaultLocalizations"><?= $this->getHtml('Defaults'); ?></label>
<div class="ipt-wrap wf-100">
<div class="ipt-first"><select id="iDefaultLocalizations" name="localization_load">
<option selected disabled><?= $this->getHtml('Customized'); ?>
<?php foreach ($l11nDefinitions as $def) : ?>
<option value="<?= $this->printHtml(\explode('.', $def)[0]); ?>"><?= $this->printHtml(\explode('.', $def)[0]); ?>
<?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>
</div>
<div class="form-group">
<label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<select id="iCountries" name="settings_country">
<?php foreach ($countryCodes as $code3 => $code2) : ?>
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $l11n->getCountry() ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLanguages"><?= $this->getHtml('Language'); ?></label>
<select id="iLanguages" name="settings_language">
<?php foreach ($languages as $code => $language) : $code = \strtolower(\substr($code, 1)); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iTemperature"><?= $this->getHtml('Temperature'); ?></label>
<select id="iTemperature" name="settings_temperature">
<?php foreach ($temperatures as $temperature) : ?>
<option value="<?= $this->printHtml($temperature); ?>"<?= $this->printHtml($temperature === $l11n->getTemperature() ? ' selected' : ''); ?>><?= $this->printHtml($temperature); ?>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitLocalization" name="submitLocalization" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-time" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Time'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iTimezones"><?= $this->getHtml('Timezone'); ?></label>
<select form="fLocalization" id="iTimezones" name="settings_timezone">
<?php foreach ($timezones as $timezone) : ?>
<option value="<?= $this->printHtml($timezone); ?>"<?= $this->printHtml($timezone === $l11n->getTimezone() ? ' selected' : ''); ?>><?= $this->printHtml($timezone); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iTimeformatVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<input form="fLocalization" id="iTimeformatVeryShort" name="settings_timeformat_vs" type="text" value="<?= $this->printHtml($l11n->getDatetime()['very_short']); ?>" placeholder="Y" required>
</div>
<h2><?= $this->getHtml('Timeformat'); ?></h2>
<div class="form-group">
<label for="iTimeformatShort"><?= $this->getHtml('Short'); ?></label>
<input form="fLocalization" id="iTimeformatShort" name="settings_timeformat_s" type="text" value="<?= $this->printHtml($l11n->getDatetime()['short']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatMedium"><?= $this->getHtml('Medium'); ?></label>
<input form="fLocalization" id="iTimeformatMedium" name="settings_timeformat_m" type="text" value="<?= $this->printHtml($l11n->getDatetime()['medium']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatLong"><?= $this->getHtml('Long'); ?></label>
<input form="fLocalization" id="iTimeformatLong" name="settings_timeformat_l" type="text" value="<?= $this->printHtml($l11n->getDatetime()['long']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<input form="fLocalization" id="iTimeformatVeryLong" name="settings_timeformat_vl" type="text" value="<?= $this->printHtml($l11n->getDatetime()['very_long']); ?>" placeholder="Y" required>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-numeric" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Numeric'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iCurrencies"><?= $this->getHtml('Currency'); ?></label>
<select form="fLocalization" id="iCurrencies" name="settings_currency">
<?php foreach ($currencies as $code => $currency) : $code = \substr($code, 1); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $l11n->getCurrency() ? ' selected' : ''); ?>><?= $this->printHtml($currency); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label><?= $this->getHtml('Currencyformat'); ?></label>
<select form="fLocalization" name="settings_currencyformat">
<option value="0"<?= $this->printHtml('0' === $l11n->getCurrencyFormat() ? ' selected' : ''); ?>><?= $this->getHtml('Amount') , ' ' , $this->printHtml($l11n->getCurrency()); ?>
<option value="1"<?= $this->printHtml('1' === $l11n->getCurrencyFormat() ? ' selected' : ''); ?>><?= $this->printHtml($l11n->getCurrency()) , ' ' , $this->getHtml('Amount'); ?>
</select>
</div>
<h2><?= $this->getHtml('Numberformat'); ?></h2>
<div class="form-group">
<div class="input-control">
<label for="iDecimalPoint"><?= $this->getHtml('DecimalPoint'); ?></label>
<input form="fLocalization" id="iDecimalPoint" name="settings_decimal" type="text" value="<?= $this->printHtml($l11n->getDecimal()); ?>" placeholder="." required>
</div>
<div class="input-control">
<label for="iThousandSep"><?= $this->getHtml('ThousandsSeparator'); ?></label>
<input form="fLocalization" id="iThousandSep" name="settings_thousands" type="text" value="<?= $this->printHtml($l11n->getThousands()); ?>" placeholder="," required>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-precision" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Precision'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iPrecisionVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<input form="fLocalization" id="iPrecisionVeryShort" name="settings_precision_vs" value="<?= $l11n->getPrecision()['very_short']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionShort"><?= $this->getHtml('Short'); ?></label>
<input form="fLocalization" id="iPrecisionLight" name="settings_precision_s" value="<?= $l11n->getPrecision()['short']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionMedium"><?= $this->getHtml('Medium'); ?></label>
<input form="fLocalization" id="iPrecisionMedium" name="settings_precision_m" value="<?= $l11n->getPrecision()['medium']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionLong"><?= $this->getHtml('Long'); ?></label>
<input form="fLocalization" id="iPrecisionLong" name="settings_precision_l" value="<?= $l11n->getPrecision()['long']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<input form="fLocalization" id="iPrecisionVeryLong" name="settings_precision_vl" value="<?= $l11n->getPrecision()['very_long']; ?>" type="number">
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-weight" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Weight'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iWeightVeryLight"><?= $this->getHtml('VeryLight'); ?></label>
<select form="fLocalization" id="iWeightVeryLight" name="settings_weight_vl">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['very_light'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightLight"><?= $this->getHtml('Light'); ?></label>
<select form="fLocalization" id="iWeightLight" name="settings_weight_l">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['light'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iWeightMedium" name="settings_weight_m">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightHeavy"><?= $this->getHtml('Heavy'); ?></label>
<select form="fLocalization" id="iWeightHeavy" name="settings_weight_h">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['heavy'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightVeryHeavy"><?= $this->getHtml('VeryHeavy'); ?></label>
<select form="fLocalization" id="iWeightVeryHeavy" name="settings_weight_vh">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['very_heavy'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-speed" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Speed'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iSpeedVerySlow"><?= $this->getHtml('VerySlow'); ?></label>
<select form="fLocalization" id="iSpeedVerySlow" name="settings_speed_vs">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['very_slow'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedSlow"><?= $this->getHtml('Slow'); ?></label>
<select form="fLocalization" id="iSpeedSlow" name="settings_speed_s">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['slow'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iSpeedMedium" name="settings_speed_m">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedFast"><?= $this->getHtml('Fast'); ?></label>
<select form="fLocalization" id="iSpeedFast" name="settings_speed_f">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['fast'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedVeryFast"><?= $this->getHtml('VeryFast'); ?></label>
<select form="fLocalization" id="iSpeedVeryFast" name="settings_speed_vf">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['very_fast'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedSea"><?= $this->getHtml('Sea'); ?></label>
<select form="fLocalization" id="iSpeedSea" name="settings_speed_sea">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['sea'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-length" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Length'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iLengthVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<select form="fLocalization" id="iLengthVeryShort" name="settings_length_vs">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['very_short'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthShort"><?= $this->getHtml('Short'); ?></label>
<select form="fLocalization" id="iLengthShort" name="settings_length_s">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['short'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iLengthMedium" name="settings_length_m">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthLong"><?= $this->getHtml('Long'); ?></label>
<select form="fLocalization" id="iLengthLong" name="settings_length_l">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['long'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<select form="fLocalization" id="iLengthVeryLong" name="settings_length_vl">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['very_long'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthSea"><?= $this->getHtml('Sea'); ?></label>
<select form="fLocalization" id="iLengthSea" name="settings_length_sea">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['sea'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-area" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Area'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iAreaVerySmall"><?= $this->getHtml('VerySmall'); ?></label>
<select form="fLocalization" id="iAreaVerySmall" name="settings_area_vs">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['very_small'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaSmall"><?= $this->getHtml('Small'); ?></label>
<select form="fLocalization" id="iAreaSmall" name="settings_area_s">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['small'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iAreaMedium" name="settings_area_m">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaLarge"><?= $this->getHtml('Large'); ?></label>
<select form="fLocalization" id="iAreaLarge" name="settings_area_l">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['large'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaVeryLarge"><?= $this->getHtml('VeryLarge'); ?></label>
<select form="fLocalization" id="iAreaVeryLarge" name="settings_area_vl">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['very_large'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-volume" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Volume'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iVolumeVerySmall"><?= $this->getHtml('VerySmall'); ?></label>
<select form="fLocalization" id="iVolumeVerySmall" name="settings_volume_vs">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['very_small'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeSmall"><?= $this->getHtml('Small'); ?></label>
<select form="fLocalization" id="iVolumeSmall" name="settings_volume_s">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['small'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iVolumeMedium" name="settings_volume_m">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeLarge"><?= $this->getHtml('Large'); ?></label>
<select form="fLocalization" id="iVolumeLarge" name="settings_volume_l">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['large'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeVeryLarge"><?= $this->getHtml('VeryLarge'); ?></label>
<select form="fLocalization" id="iVolumeVeryLarge" name="settings_volume_vl">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['very_large'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeTeaspoon"><?= $this->getHtml('Teaspoon'); ?></label>
<select form="fLocalization" id="iVolumeTeaspoon" name="settings_volume_teaspoon">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['teaspoon'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeTablespoon"><?= $this->getHtml('Tablespoon'); ?></label>
<select form="fLocalization" id="iVolumeTablespoon" name="settings_volume_tablespoon">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['tablespoon'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeGlass"><?= $this->getHtml('Glass'); ?></label>
<select form="fLocalization" id="iVolumeGlass" name="settings_volume_glass">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['glass'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-3"
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Images'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iLoginImage"><?= $this->getHtml('LoginImage'); ?></label>
<div>
<img id="preview-loginImage"
alt="<?= $this->getHtml('LoginImage'); ?>"
itemprop="logo" loading="lazy"
src="<?= UriFactory::build('Web/Backend/img/logo.png'); ?>"
width="50px">
<div>
<a id="iLoginImageUploadButton" href="#upload" data-action='[
{"listener": "click", "key": 1, "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "dom.click", "selector": "#iLoginImageUpload"}
]}]'><?= $this->getHtml('Change'); ?></a>
<form id="iLoginImageUploadForm" action="<?= UriFactory::build('{/api}admin/settings/design'); ?>" method="post">
<input class="preview" data-action='[
{"listener": "change", "key": 1, "action": [
{"key": 1, "type": "form.submit", "selector": "#iLoginImageUploadForm"}
]}]' id="iLoginImageUpload" name="loginImage" type="file" accept="image/png" style="display: none;">
</form>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-5"
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="slider">
<table id="settingsList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Module'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<tbody>
<?php $count = 0;
$previousSettings = empty($settings) ? '{/prefix}admin/settings/general' : '{/prefix}admin/settings/general?{?}&sid=' . \reset($settings)->getId() . '&ptype=p';
$nextSettings = empty($settings) ? '{/prefix}admin/settings/general' : '{/prefix}admin/settings/general?{?}&sid=' . \end($settings)->getId() . '&ptype=n';
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0">
<td><i class="fa fa-cogs"></i>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->getId(); ?>
<td data-label="<?= $this->getHtml('Name'); ?>"><?= $this->printHtml($setting->name); ?>
<td data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml($setting->content); ?>
<td data-label="<?= $this->getHtml('Module'); ?>"><?= $this->printHtml($setting->module); ?>
<td data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml($setting->group); ?>
<td data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml($setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="7" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previousSettings); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($nextSettings); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
asdf
// login status (normal, read_only, disabled)
// default email settings for server (e.g. for forgot password)
// some default pages (e.g. legal pages)
// other settings defined during the installation (e.g. default unit ...)
// maybe combine page Admin/Settings and the module settings into one page. Maybe make them reference each other or maybe completely remove the Admin/Settings page because it is available in the module settings!

View File

@ -16,10 +16,13 @@ declare(strict_types=1);
namespace Modules\Admin\Controller;
use Model\App;
use Model\AppMapper;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\AccountMapper;
use Modules\Admin\Models\AccountPermission;
use Modules\Admin\Models\AccountPermissionMapper;
use Modules\Admin\Models\ModuleMapper;
use Modules\Admin\Models\Group;
use Modules\Admin\Models\GroupMapper;
use Modules\Admin\Models\GroupPermission;
@ -62,6 +65,7 @@ use phpOMS\Uri\UriFactory;
use phpOMS\Utils\Parser\Markdown\Markdown;
use phpOMS\Validation\Network\Email as EmailValidator;
use phpOMS\Version\Version;
use phpOMS\Utils\StringUtils;
/**
* Admin controller class.
@ -153,11 +157,9 @@ final class ApiController extends Controller
$account = AccountMapper::getBy((string) $request->getData('login'), 'login');
$forgotten = $this->app->appSettings->get(
null,
['forgott_date', 'forgrott_count'],
self::MODULE_NAME,
null,
$account->getId()
names: ['forgott_date', 'forgrott_count'],
module: self::MODULE_NAME,
account: $account->getId()
);
if ((int) $forgotten['forgrotten_count'] > 3) {
@ -235,6 +237,7 @@ final class ApiController extends Controller
[
'response' => $this->app->appSettings->get(
$id !== null ? (int) $id : $id,
$request->getData('app') ?? null,
$request->getData('name') ?? '',
$request->getData('module') ?? null,
$group !== null ? (int) $group : $group,
@ -265,20 +268,22 @@ final class ApiController extends Controller
$id = isset($data['id']) ? (int) $data['id'] : null;
$name = $data['name'] ?? null;
$content = $data['content'] ?? null;
$app = $data['app'] ?? null;
$module = $data['module'] ?? null;
$group = isset($data['group']) ? (int) $data['group'] : null;
$account = isset($data['account']) ? (int) $data['account'] : null;
$this->updateModel(
$request->header->account,
$this->app->appSettings->get($id, $name, $module, $group, $account),
$this->app->appSettings->get($id, $name, $app, $module, $group, $account),
$data,
function () use ($id, $name, $content, $module, $group, $account) : void {
function () use ($id, $name, $content, $app, $module, $group, $account) : void {
$this->app->appSettings->set([
[
'id' => $id,
'name' => $name,
'content' => $content,
'app' => $app,
'module' => $module,
'group' => $group,
'account' => $account,
@ -477,7 +482,7 @@ final class ApiController extends Controller
*/
public function apiInstallApplication(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
$appManager = new ApplicationManager($this->app->moduleManager);
$appManager = new ApplicationManager();
$app = $request->getData('appSrc');
if (!\is_dir(__DIR__ . '/../../../' . $app)) {
@ -485,12 +490,42 @@ final class ApiController extends Controller
return;
}
$appManager->install(
$info = new ApplicationInfo(__DIR__ . '/../../../' . $app);
$info->load();
// handle dependencies
$dependencies = $info->getDependencies();
$installed = $this->app->moduleManager->getInstalledModules();
foreach ($dependencies as $key => $version) {
if (!isset($installed[$key])) {
$this->app->moduleManager->install($key);
}
}
// handle app installation
$result = $appManager->install(
__DIR__ . '/../../../' . $app,
__DIR__ . '/../../../' . $request->getData('appDest') ?? '',
$request->getData('theme') ?? 'Default'
);
// handle providing
if ($result) {
$providing = $info->getProviding();
foreach ($providing as $key => $version) {
if (isset($installed[$key])) {
$this->app->moduleManager->installProviding($app, $key);
}
}
}
$app = new App();
$app->name = $request->getData('appName') ?? '';
$app->theme = $request->getData('theme') ?? '';
AppMapper::create($app);
$this->apiActivateTheme($request, $response);
}
@ -667,6 +702,13 @@ final class ApiController extends Controller
*/
public function apiGroupDelete(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
if (((int) $request->getId('id')) === 3) {
// admin group cannot be deleted
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Group', 'Admin group cannot be deleted', []);
return;
}
$group = GroupMapper::get((int) $request->getData('id'));
$this->deleteModel($request->header->account, $group, GroupMapper::class, 'group', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Group', 'Group successfully deleted', $group);
@ -1035,7 +1077,15 @@ final class ApiController extends Controller
return;
}
$this->app->eventManager->trigger('PRE:Module:Admin-module-status', '', ['status' => $status, 'module' => $module]);
$old = ModuleMapper::get($module);
$this->app->eventManager->triggerSimilar(
'PRE:Module:Admin-module-status-update', '',
[
$request->header->account,
['status' => $status, 'module' => $module]
]
);
switch ($status) {
case ModuleStatusUpdateType::ACTIVATE:
$done = $module === 'Admin' ? false : $this->app->moduleManager->activate($module);
@ -1062,7 +1112,20 @@ final class ApiController extends Controller
$msg = 'Unknown module status change request.';
$response->header->status = RequestStatusCode::R_400;
}
$this->app->eventManager->trigger('POST:Module:Admin-module-status', '', ['status' => $status, 'module' => $module]);
ModuleMapper::clearCache();
$new = ModuleMapper::get($module);
$this->app->eventManager->triggerSimilar(
'POST:Module:Admin-module-status-update', '',
[
$request->header->account,
$old, $new,
StringUtils::intHash(ModuleMapper::class), 'module-status',
$module,
self::MODULE_NAME,
$request->getOrigin()
]
);
if (!$done) {
$response->header->status = RequestStatusCode::R_400;
@ -1132,6 +1195,14 @@ final class ApiController extends Controller
{
/** @var GroupPermission $permission */
$permission = GroupPermissionMapper::get((int) $request->getData('id'));
if ($permission->getGroup() === 3) {
// admin group cannot be deleted
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Group', 'Admin group permissions cannot be deleted', []);
return;
}
$this->deleteModel($request->header->account, $permission, GroupPermissionMapper::class, 'group-permission', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Permission', 'Permission successfully deleted', $permission);
}
@ -1157,27 +1228,6 @@ final class ApiController extends Controller
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Permission', 'Permission successfully deleted', $permission);
}
/**
* Api method to delete a user permission
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return void
*
* @api
*
* @since 1.0.0
*/
public function apiUserPermissionDelete(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
/** @var AccountPermission $permission */
$permission = AccountPermissionMapper::get((int) $request->getData('id'));
$this->deleteModel($request->header->account, $permission, AccountPermissionMapper::class, 'user-permission', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Permission', 'Permission successfully deleted', $permission);
}
/**
* Api method to add a permission to a group
*
@ -1193,6 +1243,13 @@ final class ApiController extends Controller
*/
public function apiAddGroupPermission(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
if (((int) $request->getId('permissionref')) === 3) {
// admin group cannot be deleted
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Group', 'Admin group permissions cannot get modified', []);
return;
}
if (!empty($val = $this->validatePermissionCreate($request))) {
$response->set('permission_create', new FormValidation($val));
$response->header->status = RequestStatusCode::R_400;
@ -1360,6 +1417,13 @@ final class ApiController extends Controller
/** @var GroupPermission $old */
$old = clone GroupPermissionMapper::get((int) $request->getData('id'));
if ($old->getGroup() === 3) {
// admin group cannot be deleted
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Group', 'Admin group permissions cannot get modified', []);
return;
}
/** @var GroupPermission $new */
$new = $this->updatePermissionFromRequest(GroupPermissionMapper::get((int) $request->getData('id')), $request);
@ -1438,6 +1502,64 @@ final class ApiController extends Controller
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Group', 'Relation added', []);
}
/**
* Api method to add a group to an account
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return void
*
* @api
*
* @since 1.0.0
*/
public function apiDeleteGroupFromAccount(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
$account = (int) $request->getData('account');
$groups = \array_map('intval', $request->getDataList('igroup-idlist'));
if (\in_array(3, $groups) && $account === $request->header->account) {
// admin group cannot be deleted
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Account', 'Admin group cannot be removed from yourself', []);
return;
}
$this->deleteModelRelation($request->header->account, $account, $groups, AccountMapper::class, 'groups', 'account-group', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Account', 'Relation deleted', []);
}
/**
* Api method to add an account to a group
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return void
*
* @api
*
* @since 1.0.0
*/
public function apiDeleteAccountFromGroup(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
$group = (int) $request->getData('group');
$accounts = \array_map('intval', $request->getDataList('iaccount-idlist'));
if (\in_array($request->header->account, $accounts) && $group === 3) {
// admin group cannot be deleted
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, 'Group', 'Admin group cannot be removed from yourself', []);
return;
}
$this->deleteModelRelation($request->header->account, $group, $accounts, GroupMapper::class, 'accounts', 'group-account', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Group', 'Relation deleted', []);
}
/**
* Api re-init routes
*

View File

@ -32,6 +32,7 @@ use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Utils\StringUtils;
use phpOMS\Views\View;
use phpOMS\Utils\Parser\Markdown\Markdown;
/**
* Admin controller class.
@ -62,37 +63,6 @@ final class BackendController extends Controller
return new View();
}
/**
* Method which generates the general settings view.
*
* In this view general settings for the entire application can be seen and adjusted. Settings which can be modified
* here are localization, password, database, etc.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Response can be rendered
*
* @since 1.0.0
*/
public function viewSettingsGeneral(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$generalSettings = $this->app->appSettings->get(null, [
SettingsEnum::PASSWORD_PATTERN, SettingsEnum::LOGIN_TIMEOUT, SettingsEnum::PASSWORD_INTERVAL, SettingsEnum::PASSWORD_HISTORY, SettingsEnum::LOGIN_TRIES, SettingsEnum::LOGGING_STATUS, SettingsEnum::LOGGING_PATH, SettingsEnum::DEFAULT_ORGANIZATION,
SettingsEnum::LOGIN_STATUS, SettingsEnum::DEFAULT_LOCALIZATION, SettingsEnum::ADMIN_MAIL,
]);
$view->setTemplate('/Modules/Admin/Theme/Backend/settings-general');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response));
$view->setData('generalSettings', $generalSettings);
$view->setData('defaultlocalization', LocalizationMapper::get((int) $generalSettings[SettingsEnum::DEFAULT_LOCALIZATION]));
$view->setData('settings', SettingMapper::getAll());
return $view;
}
/**
* Method which generates the general settings view.
*
@ -373,36 +343,30 @@ final class BackendController extends Controller
$view->setData('installed', $installed = $this->app->moduleManager->getInstalledModules());
$view->setData('id', $id);
$groupPermission = GroupMapper::getPermissionForModule($id);
$view->setData('groupPermissions', $groupPermission);
$type = 'Help';
$page = 'introduction';
$basePath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $request->getLanguage();
$path = \realpath($basePath . '/' . $page . '.md');
return $view;
}
/**
* Method which generates the module profile view.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Response can be rendered
*
* @since 1.0.0
*/
public function viewModuleSettings(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-settings');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$id = $request->getData('id') ?? '';
$settings = SettingMapper::getFor($id, 'module');
if (!($settings instanceof NullSetting)) {
$view->setData('settings', !\is_array($settings) ? [$settings] : $settings);
if ($path === false) {
$basePath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $this->app->l11nServer->getLanguage();
$path = \realpath($basePath . '/' . $page . '.md');
}
if ($path === false) {
$basePath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/en';
$path = \realpath($basePath . '/' . $page . '.md');
}
if ($path === false) {
$path = \realpath($basePath . '/introduction.md');
}
$toParse = $path === false ? '' : \file_get_contents($path);
$content = Markdown::parse($toParse === false ? '' : $toParse);
$view->setData('introduction', $content);
return $view;
}
@ -423,17 +387,58 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-log');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$id = $request->getData('id') ?? '';
$id = (string) ($request->getData('id') ?? '');
// audit log
if ($request->getData('ptype') === 'p') {
$view->setData('auditlogs', AuditMapper::with('module', (string) $request->getData('id'), [Audit::class])::getBeforePivot((int) $request->getData('audit'), null, 25));
$view->setData('auditlogs', AuditMapper::with('module', $id, [Audit::class])::getBeforePivot((int) $request->getData('audit'), null, 25));
} elseif ($request->getData('ptype') === 'n') {
$view->setData('auditlogs', AuditMapper::with('module', (string) $request->getData('id'), [Audit::class])::getAfterPivot((int) $request->getData('audit'), null, 25));
$view->setData('auditlogs', AuditMapper::with('module', $id, [Audit::class])::getAfterPivot((int) $request->getData('audit'), null, 25));
} else {
$view->setData('auditlogs', AuditMapper::with('module', (string) $request->getData('id'), [Audit::class])::getAfterPivot(0, null, 25));
$view->setData('auditlogs', AuditMapper::with('module', $id, [Audit::class])::getAfterPivot(0, null, 25));
}
return $view;
}
/**
* Method which generates the module profile view.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Response can be rendered
*
* @since 1.0.0
*/
public function viewModuleSettings(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$id = $request->getData('id') ?? '';
$settings = SettingMapper::getFor($id, 'module');
if (!($settings instanceof NullSetting)) {
$view->setData('settings', !\is_array($settings) ? [$settings] : $settings);
}
if (\is_file(__DIR__ . '/../Admin/Settings/Theme/Backend/settings.tpl.php')) {
$view->setTemplate('/Modules/' . static::MODULE_NAME . '/Admin/Settings/Theme/Backend/settings');
} else {
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-settings');
}
$generalSettings = $this->app->appSettings->get(null, [
SettingsEnum::PASSWORD_PATTERN, SettingsEnum::LOGIN_TIMEOUT, SettingsEnum::PASSWORD_INTERVAL, SettingsEnum::PASSWORD_HISTORY, SettingsEnum::LOGIN_TRIES, SettingsEnum::LOGGING_STATUS, SettingsEnum::LOGGING_PATH, SettingsEnum::DEFAULT_ORGANIZATION,
SettingsEnum::LOGIN_STATUS, SettingsEnum::DEFAULT_LOCALIZATION, SettingsEnum::ADMIN_MAIL,
]);
$view->setData('generalSettings', $generalSettings);
$view->setData('defaultlocalization', LocalizationMapper::get((int) $generalSettings[SettingsEnum::DEFAULT_LOCALIZATION]));
$view->setData('settings', SettingMapper::getAll());
return $view;
}
}

View File

@ -30,10 +30,10 @@ class Module
/**
* Module id.
*
* @var int
* @var string
* @since 1.0.0
*/
protected int $id = 0;
protected string $id = '';
/**
* Module name.
@ -80,11 +80,11 @@ class Module
/**
* Get module id.
*
* @return int
* @return string
*
* @since 1.0.0
*/
public function getId() : int
public function getId() : string
{
return $this->id;
}
@ -147,6 +147,7 @@ class Module
return [
'id' => $this->id,
'name' => $this->name,
'status' => $this->status,
'description' => $this->description,
'createdAt' => $this->createdAt,
];

39
Models/NullModule.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Admin\Models;
/**
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class NullModule extends Module
{
/**
* Constructor
*
* @param string $id Model id
*
* @since 1.0.0
*/
public function __construct(string $id = '')
{
parent::__construct();
$this->id = $id;
}
}

View File

@ -43,4 +43,6 @@ abstract class PermissionState extends Enum
public const ACCOUNT_SETTINGS = 8;
public const SEARCH = 9;
public const API = 9;
}

View File

@ -26,6 +26,10 @@ return [
'Log' => 'Log',
'Info' => 'Info',
'Account' => 'Account',
'Pages' => 'Pages',
'Permissions' => 'Permissions',
'Navigation' => 'Navigation',
'Routes' => 'Routes',
'Accounts' => 'Accounts',
],
];

View File

@ -53,8 +53,10 @@ echo $this->getData('nav')->render(); ?>
<div class="box wf-100 col-xs-12">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('Localization'); ?></label></li>
<li><label for="c-tab-3"><?= $this->getHtml('AuditLog'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('Groups'); ?></label></li>
<li><label for="c-tab-3"><?= $this->getHtml('Permissions'); ?></label></li>
<li><label for="c-tab-4"><?= $this->getHtml('Localization'); ?></label></li>
<li><label for="c-tab-5"><?= $this->getHtml('AuditLog'); ?></label></li>
</ul>
</div>
<div class="tab-content">
@ -150,8 +152,31 @@ echo $this->getData('nav')->render(); ?>
</form>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<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">
<div class="form-group">
<label for="iGroup"><?= $this->getHtml('Name'); ?></label>
<?= $this->getData('grpSelector')->render('iGroup', true); ?>
</div>
</div>
<div class="portlet-foot">
<input name="account" type="hidden" value="<?= $account->getId(); ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
<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>
<table id="groupTable" class="default">
@ -177,70 +202,14 @@ echo $this->getData('nav')->render(); ?>
<?php endif; ?>
</table>
</div>
<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">
<div class="form-group">
<label for="iGroup"><?= $this->getHtml('Name'); ?></label>
<?= $this->getData('grpSelector')->render('iGroup', true); ?>
</div>
</div>
<div class="portlet-foot">
<input name="account" type="hidden" value="<?= $account->getId(); ?>">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<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 style="overflow-x:auto;">
<table id="accountPermissions" class="default">
<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>
<?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>
</div>
<div class="portlet">
<form id="fAccountAddPermission" action="<?= UriFactory::build('{/api}admin/account/permission'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Permissions'); ?></div>
@ -320,6 +289,53 @@ echo $this->getData('nav')->render(); ?>
</form>
</div>
</div>
<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 style="overflow-x:auto;">
<table id="accountPermissions" class="default">
<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>
<?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>
</div>
</div>
</div>
</div>
@ -339,7 +355,7 @@ echo $this->getData('nav')->render(); ?>
$volumes = VolumeType::getConstants();
$temperatures = TemperatureType::getConstants();
?>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-4">
@ -790,7 +806,7 @@ echo $this->getData('nav')->render(); ?>
</div>
</div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">

View File

@ -39,7 +39,9 @@ echo $this->getData('nav')->render(); ?>
<div class="box wf-100 col-xs-12">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('AuditLog'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('Accounts'); ?></label></li>
<li><label for="c-tab-3"><?= $this->getHtml('Permissions'); ?></label></li>
<li><label for="c-tab-4"><?= $this->getHtml('AuditLog'); ?></label></li>
</ul>
</div>
<div class="tab-content">
@ -82,8 +84,32 @@ echo $this->getData('nav')->render(); ?>
</form>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<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">
<div class="form-group">
<label for="iAccount"><?= $this->getHtml('Name'); ?></label>
<?= $this->getData('accGrpSelector')->render('iAccount', 'group', true); ?>
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>
<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>
<table class="default">
@ -103,88 +129,15 @@ echo $this->getData('nav')->render(); ?>
</table>
<div class="portlet-foot"></div>
</div>
<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">
<div class="form-group">
<label for="iAccount"><?= $this->getHtml('Name'); ?></label>
<?= $this->getData('accGrpSelector')->render('iAccount', 'group', true); ?>
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<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 style="overflow-x:auto;">
<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><?= $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>
</div>
<div class="portlet">
<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">
@ -263,10 +216,74 @@ echo $this->getData('nav')->render(); ?>
</form>
</div>
</div>
<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 style="overflow-x:auto;">
<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><?= $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>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">

View File

@ -23,7 +23,9 @@ $active = $this->getData('active');
$installed = $this->getData('installed');
$id = $this->getData('id');
echo $this->getData('nav')->render();
if (isset($installed[$id])) {
echo $this->getData('nav')->render();
}
?>
<div class="row">
@ -87,38 +89,13 @@ echo $this->getData('nav')->render();
</div>
</div>
<div class="col-xs-12 col-md-4">
<?php if (!empty($this->getData('introduction'))) : ?>
<div class="col-xs-12 col-md-8">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?></div>
<div class="portlet-body">
<article><?= $this->getData('introduction'); ?></article>
</div>
</div>
</div>
<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>
<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 = 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->name; ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
<?php endif; ?>
</div>

View File

@ -72,7 +72,7 @@ $isntalled = $this->getData('isntalled') ?? [];
<tbody>
<?php $count = 0;
foreach ($modules as $key => $module) : ++$count;
$url = UriFactory::build('{/prefix}admin/module/settings?{?}&id=' . $module->getInternalName());
$url = UriFactory::build('{/prefix}admin/module/info?{?}&id=' . $module->getInternalName());
if (isset($active[$module->getInternalName()])) {
$status = ModuleStatus::ACTIVE;

View File

@ -18,96 +18,88 @@ declare(strict_types=1);
$settings = $this->getData('settings') ?? [];
echo $this->getData('nav')->render();
?>
<div class="tabview tab-2">
<div class="box wf-100 col-xs-12">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('Settings'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('List'); ?></label></li>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="slider">
<table id="settingsList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<tbody>
<?php $count = 0;
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0">
<td><i class="fa fa-cogs"></i>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->getId(); ?>
<td data-label="<?= $this->getHtml('Name'); ?>"><?= $this->printHtml($setting->name); ?>
<td data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml($setting->content); ?>
<td data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml($setting->group); ?>
<td data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml($setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>
if ($this->hasData('settingsTpl')
&& \is_file($this->getData('settingsTpl'))
) :
include $this->getData('settingsTpl');
else : ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="slider">
<table id="settingsList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<tbody>
<?php $count = 0;
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0">
<td><i class="fa fa-cogs"></i>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->getId(); ?>
<td data-label="<?= $this->getHtml('Name'); ?>"><?= $this->printHtml($setting->name); ?>
<td data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml($setting->content); ?>
<td data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml($setting->group); ?>
<td data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml($setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1,118 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Admin\Models\Page[] $pages
*/
$pages = $this->getData('pages') ?? [];
$previous = empty($pages) ? '{/prefix}admin/page/list' : '{/prefix}admin/page/list?{?}&id=' . \reset($pages)->getId() . '&ptype=p';
$next = empty($pages) ? '{/prefix}admin/page/list' : '{/prefix}admin/page/list?{?}&id=' . \end($pages)->getId() . '&ptype=n';
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $this->getHtml('PAges'); ?>
</div>
<div class="slider">
<table id="accountList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="accountList-r1-asc">
<input id="accountList-r1-asc" name="accountList-sort" type="radio">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="accountList-r1-desc">
<input id="accountList-r1-desc" name="accountList-sort" type="radio">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<td><?= $this->getHtml('Status'); ?>
<label for="accountList-r2-asc">
<input id="accountList-r2-asc" name="accountList-sort" type="radio">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="accountList-r2-desc">
<input id="accountList-r2-desc" name="accountList-sort" type="radio">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<label for="accountList-r3-asc">
<input id="accountList-r3-asc" name="accountList-sort" type="radio">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="accountList-r3-desc">
<input id="accountList-r3-desc" name="accountList-sort" type="radio">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-filter-table.tpl.php'; ?>
<td><?= $this->getHtml('Activity'); ?>
<label for="accountList-r4-asc">
<input id="accountList-r4-asc" name="accountList-sort" type="radio">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="accountList-r4-desc">
<input id="accountList-r4-desc" name="accountList-sort" type="radio">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Created'); ?>
<label for="accountList-r5-asc">
<input id="accountList-r5-asc" name="accountList-sort" type="radio">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="accountList-r5-desc">
<input id="accountList-r5-desc" name="accountList-sort" type="radio">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<tbody>
<?php $c = 0; foreach ($accounts as $key => $value) : ++$c;
$url = UriFactory::build('{/prefix}admin/account/settings?{?}&id=' . $value->getId());
$color = 'darkred';
if ($value->getStatus() === AccountStatus::ACTIVE) { $color = 'green'; }
elseif ($value->getStatus() === AccountStatus::INACTIVE) { $color = 'darkblue'; }
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; ?>"><?= $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->name1, $value->name2, $value->name3)
); ?></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->createdAt->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'); ?>
<?php endif; ?>
</table>
</div>
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
</div>
</div>
</div>