mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-14 19:48:41 +00:00
bug fixes
This commit is contained in:
parent
baaf2422b1
commit
4358d855ef
|
|
@ -90,7 +90,7 @@ final class Installer extends InstallerAbstract
|
||||||
(OperatingSystem::getSystem() === SystemType::WIN
|
(OperatingSystem::getSystem() === SystemType::WIN
|
||||||
? 'php.exe'
|
? 'php.exe'
|
||||||
: 'php'
|
: 'php'
|
||||||
) . ' ' . __DIR__ . '/../../../../cli.php -v'
|
) . ' ' . __DIR__ . '/../../../cli.php -v'
|
||||||
);
|
);
|
||||||
$cmdResult = $cmdResult === null || $cmdResult === false ? '' : $cmdResult;
|
$cmdResult = $cmdResult === null || $cmdResult === false ? '' : $cmdResult;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/admin/find/accgrp(\?.*$|$)' => [
|
'^.*/admin/accgrp/find(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Admin\Controller\ApiController:apiAccountGroupFind',
|
'dest' => '\Modules\Admin\Controller\ApiController:apiAccountGroupFind',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -290,6 +290,17 @@ return [
|
||||||
'state' => PermissionCategory::MODULE,
|
'state' => PermissionCategory::MODULE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\Admin\Controller\ApiController:apiDeleteAccountFromGroup',
|
||||||
|
'verb' => RouteVerb::DELETE,
|
||||||
|
'csrf' => true,
|
||||||
|
'active' => true,
|
||||||
|
'permission' => [
|
||||||
|
'module' => ApiController::NAME,
|
||||||
|
'type' => PermissionType::MODIFY,
|
||||||
|
'state' => PermissionCategory::MODULE,
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'^.*/admin/account/group(\?.*$|$)' => [
|
'^.*/admin/account/group(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
|
|
@ -303,6 +314,17 @@ return [
|
||||||
'state' => PermissionCategory::MODULE,
|
'state' => PermissionCategory::MODULE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\Admin\Controller\ApiController:apiDeleteGroupFromAccount',
|
||||||
|
'verb' => RouteVerb::DELETE,
|
||||||
|
'csrf' => true,
|
||||||
|
'active' => true,
|
||||||
|
'permission' => [
|
||||||
|
'module' => ApiController::NAME,
|
||||||
|
'type' => PermissionType::MODIFY,
|
||||||
|
'state' => PermissionCategory::MODULE,
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'^.*/admin/group/permission(\?.*$|$)' => [
|
'^.*/admin/group/permission(\?.*$|$)' => [
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ final class ApiController extends Controller
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($login > LoginReturnType::OK) {
|
if ($login > LoginReturnType::OK) {
|
||||||
|
$this->app->sessionManager->sessionStart();
|
||||||
$this->app->sessionManager->set('UID', $login, true);
|
$this->app->sessionManager->set('UID', $login, true);
|
||||||
$response->set($request->uri->__toString(), new \phpOMS\Model\Message\Redirect());
|
$response->set($request->uri->__toString(), new \phpOMS\Model\Message\Redirect());
|
||||||
} elseif ($login === LoginReturnType::NOT_ACTIVATED) {
|
} elseif ($login === LoginReturnType::NOT_ACTIVATED) {
|
||||||
|
|
@ -187,6 +188,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
|
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
|
||||||
|
|
||||||
|
$this->app->sessionManager->sessionStart();
|
||||||
$this->app->sessionManager->remove('UID');
|
$this->app->sessionManager->remove('UID');
|
||||||
$this->app->sessionManager->save();
|
$this->app->sessionManager->save();
|
||||||
|
|
||||||
|
|
@ -839,7 +841,7 @@ final class ApiController extends Controller
|
||||||
|
|
||||||
// request account is valid
|
// request account is valid
|
||||||
if ($requestAccount <= 0) {
|
if ($requestAccount <= 0) {
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::HIDDEN, '', '', []);
|
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, '', 'Invalid account', []);
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -854,7 +856,7 @@ final class ApiController extends Controller
|
||||||
if ($account->login === null
|
if ($account->login === null
|
||||||
|| AccountMapper::login($account->login, (string) $request->getData('oldpass')) !== $requestAccount
|
|| AccountMapper::login($account->login, (string) $request->getData('oldpass')) !== $requestAccount
|
||||||
) {
|
) {
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::HIDDEN, '', '', []);
|
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, '', 'Invalid old password', []);
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -862,7 +864,7 @@ final class ApiController extends Controller
|
||||||
|
|
||||||
// test password repetition
|
// test password repetition
|
||||||
if (((string) $request->getData('newpass')) !== ((string) $request->getData('reppass'))) {
|
if (((string) $request->getData('newpass')) !== ((string) $request->getData('reppass'))) {
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::HIDDEN, '', '', []);
|
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, '', 'Invalid password repetition', []);
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -872,7 +874,7 @@ final class ApiController extends Controller
|
||||||
/** @var \Model\Setting $complexity */
|
/** @var \Model\Setting $complexity */
|
||||||
$complexity = $this->app->appSettings->get(names: SettingsEnum::PASSWORD_PATTERN, module: 'Admin');
|
$complexity = $this->app->appSettings->get(names: SettingsEnum::PASSWORD_PATTERN, module: 'Admin');
|
||||||
if (\preg_match($complexity->content, (string) $request->getData('newpass')) !== 1) {
|
if (\preg_match($complexity->content, (string) $request->getData('newpass')) !== 1) {
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::HIDDEN, '', '', []);
|
$this->fillJsonResponse($request, $response, NotificationLevel::ERROR, '', 'Invalid password complexity', []);
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -1522,7 +1524,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
/** @var \Modules\Admin\Models\Group[] $groups */
|
/** @var \Modules\Admin\Models\Group[] $groups */
|
||||||
$groups = GroupMapper::getAll()
|
$groups = GroupMapper::getAll()
|
||||||
->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
->where('name', '%' . ($request->getDataString('group') ?? '') . '%', 'LIKE')
|
||||||
->limit($request->getDataInt('limit') ?? 50)
|
->limit($request->getDataInt('limit') ?? 50)
|
||||||
->executeGetArray();
|
->executeGetArray();
|
||||||
|
|
||||||
|
|
@ -1534,7 +1536,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Api method to get an accoung
|
* Api method to get an account
|
||||||
*
|
*
|
||||||
* @param RequestAbstract $request Request
|
* @param RequestAbstract $request Request
|
||||||
* @param ResponseAbstract $response Response
|
* @param ResponseAbstract $response Response
|
||||||
|
|
@ -2757,17 +2759,16 @@ final class ApiController extends Controller
|
||||||
public function apiAddAccountPermission(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
|
public function apiAddAccountPermission(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validatePermissionCreate($request))) {
|
if (!empty($val = $this->validatePermissionCreate($request))) {
|
||||||
$response->header->status = RequestStatusCode::R_400;
|
|
||||||
$this->createInvalidCreateResponse($request, $response, $val);
|
$this->createInvalidCreateResponse($request, $response, $val);
|
||||||
|
$response->header->status = RequestStatusCode::R_400;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permission = $this->createPermissionFromRequest($request);
|
$permission = $this->createPermissionFromRequest($request);
|
||||||
|
|
||||||
if (!($permission instanceof AccountPermission)) {
|
if (!($permission instanceof AccountPermission)) {
|
||||||
$response->data['permission_create'] = new FormValidation($val);
|
// @todo Create a response text
|
||||||
$response->header->status = RequestStatusCode::R_400;
|
$response->header->status = RequestStatusCode::R_400;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2969,7 +2970,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$account = (int) $request->getData('account');
|
$account = (int) $request->getData('account');
|
||||||
$groups = [$request->getDataInt('account-list') ?? 0];
|
$groups = [$request->getDataInt('group') ?? 0];
|
||||||
|
|
||||||
// @todo Check if already in group
|
// @todo Check if already in group
|
||||||
|
|
||||||
|
|
@ -2990,7 +2991,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['account'] = !$request->hasData('account'))
|
if (($val['account'] = !$request->hasData('account'))
|
||||||
|| ($val['accountlist'] = !$request->hasData('account-list'))
|
|| ($val['group'] = !$request->hasData('group'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -3965,8 +3966,7 @@ final class ApiController extends Controller
|
||||||
$hasLocationChange = ($request->getDataString('address') ?? $address->address) !== $address->address
|
$hasLocationChange = ($request->getDataString('address') ?? $address->address) !== $address->address
|
||||||
|| ($request->getDataString('postal') ?? $address->postal) !== $address->postal
|
|| ($request->getDataString('postal') ?? $address->postal) !== $address->postal
|
||||||
|| ($request->getDataString('city') ?? $address->city) !== $address->city
|
|| ($request->getDataString('city') ?? $address->city) !== $address->city
|
||||||
|| ($request->getDataString('state') ?? $address->state) !== $address->state
|
|| ($request->getDataString('state') ?? $address->state) !== $address->state;
|
||||||
|| ($request->getDataString('country') ?? $address->country) !== $address->country;
|
|
||||||
|
|
||||||
$address->name = $request->getDataString('name') ?? $address->name;
|
$address->name = $request->getDataString('name') ?? $address->name;
|
||||||
$address->fao = $request->getDataString('fao') ?? $address->fao;
|
$address->fao = $request->getDataString('fao') ?? $address->fao;
|
||||||
|
|
@ -3975,7 +3975,10 @@ final class ApiController extends Controller
|
||||||
$address->postal = $request->getDataString('postal') ?? $address->postal;
|
$address->postal = $request->getDataString('postal') ?? $address->postal;
|
||||||
$address->city = $request->getDataString('city') ?? $address->city;
|
$address->city = $request->getDataString('city') ?? $address->city;
|
||||||
$address->state = $request->getDataString('state') ?? $address->state;
|
$address->state = $request->getDataString('state') ?? $address->state;
|
||||||
$address->setCountry($request->getDataString('country') ?? $address->country);
|
|
||||||
|
if (ISO3166TwoEnum::isValidValue($request->getDataString('country') ?? ISO3166TwoEnum::_XXX)) {
|
||||||
|
$address->setCountry($request->getDataString('country') ?? $address->country);
|
||||||
|
}
|
||||||
|
|
||||||
if ($hasLocationChange) {
|
if ($hasLocationChange) {
|
||||||
$geocoding = Nominatim::geocoding($address->country, $address->city, $address->address);
|
$geocoding = Nominatim::geocoding($address->country, $address->city, $address->address);
|
||||||
|
|
@ -4067,7 +4070,10 @@ final class ApiController extends Controller
|
||||||
$address->postal = $request->getDataString('postal') ?? '';
|
$address->postal = $request->getDataString('postal') ?? '';
|
||||||
$address->city = $request->getDataString('city') ?? '';
|
$address->city = $request->getDataString('city') ?? '';
|
||||||
$address->state = $request->getDataString('state') ?? '';
|
$address->state = $request->getDataString('state') ?? '';
|
||||||
$address->setCountry($request->getDataString('country') ?? ISO3166TwoEnum::_XXX);
|
|
||||||
|
if (ISO3166TwoEnum::isValidValue($request->getDataString('country') ?? ISO3166TwoEnum::_XXX)) {
|
||||||
|
$address->setCountry($request->getDataString('country') ?? ISO3166TwoEnum::_XXX);
|
||||||
|
}
|
||||||
|
|
||||||
$geocoding = Nominatim::geocoding($address->country, $address->city, $address->address);
|
$geocoding = Nominatim::geocoding($address->country, $address->city, $address->address);
|
||||||
if ($geocoding === ['lat' => 0.0, 'lon' => 0.0]) {
|
if ($geocoding === ['lat' => 0.0, 'lon' => 0.0]) {
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,9 @@ final class BackendController extends Controller
|
||||||
$pageLimit = 25;
|
$pageLimit = 25;
|
||||||
$view->data['pageLimit'] = $pageLimit;
|
$view->data['pageLimit'] = $pageLimit;
|
||||||
|
|
||||||
$mapper = AuditMapper::getAll()->with('createdBy');
|
$mapper = AuditMapper::getAll()
|
||||||
|
->with('createdBy')
|
||||||
|
->where('createdBy', $request->getDataInt('id'));
|
||||||
|
|
||||||
/** @var \Modules\Auditor\Models\Audit[] $list */
|
/** @var \Modules\Auditor\Models\Audit[] $list */
|
||||||
$list = AuditMapper::find(
|
$list = AuditMapper::find(
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class AddressView extends View
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public string $name = '';
|
public string $refName = 'account';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Uri for attribute actions
|
* API Uri for attribute actions
|
||||||
|
|
@ -68,7 +68,7 @@ class AddressView extends View
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public string $apiUri = '';
|
public string $endpoint = '{/api}account/address?csrf={$CSRF}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reference id
|
* Reference id
|
||||||
|
|
@ -96,6 +96,9 @@ class AddressView extends View
|
||||||
$this->form = $data[0];
|
$this->form = $data[0];
|
||||||
$this->virtualPath = $data[1] ?? $this->virtualPath;
|
$this->virtualPath = $data[1] ?? $this->virtualPath;
|
||||||
$this->addresses = $data[2] ?? $this->addresses;
|
$this->addresses = $data[2] ?? $this->addresses;
|
||||||
|
$this->refName = $data[3] ?? $this->refName;
|
||||||
|
$this->refId = $data[4] ?? $this->refId;
|
||||||
|
$this->endpoint = $data[5] ?? $this->endpoint;
|
||||||
|
|
||||||
return parent::render();
|
return parent::render();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,13 @@ $types = AddressType::getConstants();
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
<section class="portlet">
|
<section class="portlet">
|
||||||
<form id="addressForm" action="<?= UriFactory::build('{api}account/address?csrf={$CSRF}'); ?>" method="post"
|
<form id="addressForm" action="<?= UriFactory::build($this->endpoint); ?>" method="post"
|
||||||
data-ui-container="#addressTable tbody"
|
data-ui-container="#addressTable tbody"
|
||||||
data-add-form="addressForm"
|
data-add-form="addressForm"
|
||||||
data-add-tpl="#addressTable tbody .oms-add-tpl-address">
|
data-add-tpl="#addressTable tbody .oms-add-tpl-address">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Address', 'Admin', 'Backend'); ?></div>
|
<div class="portlet-head"><?= $this->getHtml('Address', 'Admin', 'Backend'); ?></div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<input type="hidden" id="iAddressRef" name="account" value="<?= $this->refId; ?>" disabled>
|
<input type="hidden" id="iAddressRef" name="<?= $this->refName; ?>" value="<?= $this->refId; ?>" disabled>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iAddressId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
<label for="iAddressId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class ContactView extends View
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public string $name = '';
|
public string $refName = 'account';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Uri for attribute actions
|
* API Uri for attribute actions
|
||||||
|
|
@ -68,7 +68,7 @@ class ContactView extends View
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public string $apiUri = '';
|
public string $endpoint = '{/api}account/contact?csrf={$CSRF}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reference id
|
* Reference id
|
||||||
|
|
@ -96,6 +96,9 @@ class ContactView extends View
|
||||||
$this->form = $data[0];
|
$this->form = $data[0];
|
||||||
$this->virtualPath = $data[1] ?? $this->virtualPath;
|
$this->virtualPath = $data[1] ?? $this->virtualPath;
|
||||||
$this->contacts = $data[2] ?? $this->contacts;
|
$this->contacts = $data[2] ?? $this->contacts;
|
||||||
|
$this->refName = $data[3] ?? $this->refName;
|
||||||
|
$this->refId = $data[4] ?? $this->refId;
|
||||||
|
$this->endpoint = $data[5] ?? $this->endpoint;
|
||||||
|
|
||||||
return parent::render();
|
return parent::render();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,13 @@ $subtypes = AddressType::getConstants();
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
<section class="portlet">
|
<section class="portlet">
|
||||||
<form id="contactForm" action="<?= UriFactory::build('{api}account/contact?csrf={$CSRF}'); ?>" method="post"
|
<form id="contactForm" action="<?= UriFactory::build($this->endpoint); ?>" method="post"
|
||||||
data-ui-container="#contactTable tbody"
|
data-ui-container="#contactTable tbody"
|
||||||
data-add-form="contactForm"
|
data-add-form="contactForm"
|
||||||
data-add-tpl="#contactTable tbody .oms-add-tpl-contact">
|
data-add-tpl="#contactTable tbody .oms-add-tpl-contact">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Contact', 'Admin', 'Backend'); ?></div>
|
<div class="portlet-head"><?= $this->getHtml('Contact', 'Admin', 'Backend'); ?></div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<input type="hidden" id="iContactRef" name="account" value="<?= $this->refId; ?>" disabled>
|
<input type="hidden" id="iContactRef" name="<?= $this->refName; ?>" value="<?= $this->refId; ?>" disabled>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iContactId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
<label for="iContactId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,11 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
<section class="portlet">
|
<section class="portlet">
|
||||||
<form id="iAddGroupToAccount" action="<?= UriFactory::build('{/api}admin/account/group?csrf={$CSRF}'); ?>" method="put">
|
<form id="iAddGroupToAccount"
|
||||||
|
action="<?= UriFactory::build('{/api}admin/account/group?csrf={$CSRF}'); ?>"
|
||||||
|
method="put"
|
||||||
|
data-redirect="<?= UriFactory::build('{%}'); ?>"
|
||||||
|
>
|
||||||
<div class="portlet-head"><?= $this->getHtml('Groups'); ?></div>
|
<div class="portlet-head"><?= $this->getHtml('Groups'); ?></div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
@ -171,7 +175,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div id="iGroupSelector" class="smart-input-wrapper" data-src="<?= UriFactory::build('{/api}admin/group/find?csrf={$CSRF}'); ?>">
|
<div id="iGroupSelector" class="smart-input-wrapper" data-src="<?= UriFactory::build('{/api}admin/group/find?csrf={$CSRF}'); ?>">
|
||||||
<div
|
<div
|
||||||
data-value=""
|
data-value=""
|
||||||
data-name="search"
|
data-name="group"
|
||||||
data-limit="10"
|
data-limit="10"
|
||||||
data-container=""
|
data-container=""
|
||||||
class="input-div"
|
class="input-div"
|
||||||
|
|
@ -195,13 +199,31 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<section class="portlet">
|
<section class="portlet">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Groups'); ?><i class="g-icon download btn end-xs">download</i></div>
|
<div class="portlet-head"><?= $this->getHtml('Groups'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||||
<table id="groupTable" class="default sticky">
|
<table id="groupTable" class="default sticky"
|
||||||
|
data-tag="form"
|
||||||
|
data-ui-element="tr"
|
||||||
|
data-add-tpl=".oms-add-tpl-group"
|
||||||
|
data-delete-form="iAddGroupToAccount">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||||
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<template class="oms-add-tpl-group">
|
||||||
|
<tr data-id="" draggable="false">
|
||||||
|
<td>
|
||||||
|
<i class="g-icon btn remove-form">close</i>
|
||||||
|
<input id="groupTable-remove-0" type="checkbox" class="vh">
|
||||||
|
<label for="groupTable-remove-0" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||||
|
<span class="checked-visibility">
|
||||||
|
<label for="groupTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||||
|
<label for="groupTable-remove-0" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||||
|
</span>
|
||||||
|
<td data-tpl-text="/id" data-tpl-value="/id"></td>
|
||||||
|
<td data-tpl-text="/name/0" data-tpl-value="/name/0"></td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
<?php
|
<?php
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$groups = $account->getGroups();
|
$groups = $account->getGroups();
|
||||||
|
|
@ -209,7 +231,12 @@ echo $this->data['nav']->render(); ?>
|
||||||
$url = UriFactory::build('{/base}/admin/group/view?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/admin/group/view?{?}&id=' . $value->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="#"><i class="g-icon">close</i></a>
|
<td><input id="groupTable-remove-<?= $value->id; ?>" type="checkbox" class="vh">
|
||||||
|
<label for="groupTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||||
|
<span class="checked-visibility">
|
||||||
|
<label for="groupTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||||
|
<label for="groupTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||||
|
</span>
|
||||||
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
@ -237,7 +264,8 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iPermissionId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
<label for="iPermissionId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||||
<input id="iPermissionId" name="permissionref" type="text" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
<input id="iPermissionId" name="id" type="text" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
||||||
|
<input id="iPermissionRef" name="permissionref" type="hidden" value="<?= $account->id; ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
@ -332,7 +360,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-foot">
|
<div class="portlet-foot">
|
||||||
<input type="hidden" name="permissionowner" value="<?= PermissionOwner::GROUP; ?>">
|
<input type="hidden" name="permissionowner" value="<?= PermissionOwner::ACCOUNT; ?>">
|
||||||
|
|
||||||
<input id="bPermissionAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
|
<input id="bPermissionAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
|
||||||
<input id="bPermissionSave" formmethod="post" type="submit" class="save-form vh button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
|
<input id="bPermissionSave" formmethod="post" type="submit" class="save-form vh button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
|
||||||
|
|
@ -350,7 +378,8 @@ echo $this->data['nav']->render(); ?>
|
||||||
data-tag="form"
|
data-tag="form"
|
||||||
data-ui-element="tr"
|
data-ui-element="tr"
|
||||||
data-add-tpl=".oms-add-tpl-permission"
|
data-add-tpl=".oms-add-tpl-permission"
|
||||||
data-update-form="permissionForm">
|
data-update-form="permissionForm"
|
||||||
|
data-delete-form="permissionForm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<form id="fGroupCreate"
|
<form id="fGroupCreate"
|
||||||
action="<?= UriFactory::build('{/api}admin/group?csrf={$CSRF}'); ?>"
|
action="<?= UriFactory::build('{/api}admin/group?csrf={$CSRF}'); ?>"
|
||||||
method="put"
|
method="put"
|
||||||
|
data-redirect="<?= UriFactory::build('{/base}/admin/group/view'); ?>?id={/0/response/id}"
|
||||||
autocomplete="off">
|
autocomplete="off">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Group'); ?></div>
|
<div class="portlet-head"><?= $this->getHtml('Group'); ?></div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
data-tag="form"
|
data-tag="form"
|
||||||
data-ui-element="tr"
|
data-ui-element="tr"
|
||||||
data-add-tpl=".oms-add-tpl-account"
|
data-add-tpl=".oms-add-tpl-account"
|
||||||
data-delete-form="accountForm">
|
data-delete-form="iAddAccountToGroup">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
@ -184,7 +184,8 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iPermissionId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
<label for="iPermissionId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||||
<input id="iPermissionId" name="permissionref" type="text" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
<input id="iPermissionId" name="id" type="text" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
||||||
|
<input id="iPermissionRef" name="permissionref" type="hidden" value="<?= $group->id; ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iPermissionUnit"><?= $this->getHtml('Unit'); ?></label>
|
<label for="iPermissionUnit"><?= $this->getHtml('Unit'); ?></label>
|
||||||
|
|
@ -290,7 +291,8 @@ echo $this->data['nav']->render(); ?>
|
||||||
data-tag="form"
|
data-tag="form"
|
||||||
data-ui-element="tr"
|
data-ui-element="tr"
|
||||||
data-add-tpl=".oms-add-tpl-permission"
|
data-add-tpl=".oms-add-tpl-permission"
|
||||||
data-update-form="permissionForm">
|
data-update-form="permissionForm"
|
||||||
|
data-delete-form="permissionForm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
|
|
@ -57,18 +57,21 @@ if (isset($installed[$id])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-foot">
|
<div class="portlet-foot">
|
||||||
<?php if (isset($active[$id])) : ?>
|
<?php if (isset($active[$id])) : ?>
|
||||||
<form id="fModuleDeactivate" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST">
|
<form id="fModuleDeactivate" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST"
|
||||||
|
data-redirect="<?= UriFactory::build('{%}'); ?>">
|
||||||
<button id="fModuleDeactivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DEACTIVATE; ?>"><?= $this->getHtml('Deactivate'); ?></button>
|
<button id="fModuleDeactivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DEACTIVATE; ?>"><?= $this->getHtml('Deactivate'); ?></button>
|
||||||
</form>
|
</form>
|
||||||
<?php elseif (isset($installed[$id])) : ?>
|
<?php elseif (isset($installed[$id])) : ?>
|
||||||
<div class="ipt-wrap">
|
<div class="ipt-wrap">
|
||||||
<div class="ipt-first">
|
<div class="ipt-first">
|
||||||
<form id="fModuleUninstall" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST">
|
<form id="fModuleUninstall" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST"
|
||||||
|
data-redirect="<?= UriFactory::build('{%}'); ?>">
|
||||||
<button id="fModuleUninstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::UNINSTALL; ?>"><?= $this->getHtml('Uninstall'); ?></button>
|
<button id="fModuleUninstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::UNINSTALL; ?>"><?= $this->getHtml('Uninstall'); ?></button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="ipt-second">
|
<div class="ipt-second">
|
||||||
<form id="fModuleActivate" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST">
|
<form id="fModuleActivate" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST"
|
||||||
|
data-redirect="<?= UriFactory::build('{%}'); ?>">
|
||||||
<button id="fModuleActivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::ACTIVATE; ?>"><?= $this->getHtml('Activate'); ?></button>
|
<button id="fModuleActivateButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::ACTIVATE; ?>"><?= $this->getHtml('Activate'); ?></button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -76,12 +79,17 @@ if (isset($installed[$id])) {
|
||||||
<?php elseif (isset($module)) : ?>
|
<?php elseif (isset($module)) : ?>
|
||||||
<div class="ipt-wrap">
|
<div class="ipt-wrap">
|
||||||
<div class="ipt-first">
|
<div class="ipt-first">
|
||||||
<form id="fModuleInstall" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST">
|
<form id="fModuleInstall" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>"
|
||||||
<button id="fModuleInstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::INSTALL; ?>"><?= $this->getHtml('Install'); ?></button>
|
method="POST"
|
||||||
|
data-redirect="<?= UriFactory::build('{%}'); ?>">
|
||||||
|
<button id="fModuleInstallButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::INSTALL; ?>">
|
||||||
|
<?= $this->getHtml('Install'); ?>
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="ipt-second">
|
<div class="ipt-second">
|
||||||
<form id="fModuleDelete" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST">
|
<form id="fModuleDelete" action="<?= UriFactory::build('{/api}admin/module/status?module=' . $id . '&csrf={$CSRF}'); ?>" method="POST"
|
||||||
|
data-redirect="<?= UriFactory::build('{%}'); ?>">
|
||||||
<button id="fModuleDeleteButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DELETE; ?>"><?= $this->getHtml('Delete'); ?></button>
|
<button id="fModuleDeleteButton" name="status" type="submit" value="<?= ModuleStatusUpdateType::DELETE; ?>"><?= $this->getHtml('Delete'); ?></button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user