mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-11 13:38:39 +00:00
add css version
This commit is contained in:
parent
5102cb41cc
commit
892ef145f5
|
|
@ -658,7 +658,7 @@ final class ApiController extends Controller
|
|||
{
|
||||
$appManager = new ApplicationManager($this->app);
|
||||
|
||||
$app = $request->getData('appSrc');
|
||||
$app = \rtrim($request->getData('appSrc') ?? '', '/\\ ');
|
||||
if (!\is_dir(__DIR__ . '/../../../' . $app)) {
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
return;
|
||||
|
|
@ -743,8 +743,8 @@ final class ApiController extends Controller
|
|||
public function apiGroupUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var \Modules\Admin\Models\Group $old */
|
||||
$old = clone GroupMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$new = $this->updateGroupFromRequest($request);
|
||||
$old = GroupMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$new = $this->updateGroupFromRequest($request, clone $old);
|
||||
$this->updateModel($request->header->account, $old, $new, GroupMapper::class, 'group', $request->getOrigin());
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Group', 'Group successfully updated', $new);
|
||||
}
|
||||
|
|
@ -758,10 +758,8 @@ final class ApiController extends Controller
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function updateGroupFromRequest(RequestAbstract $request) : Group
|
||||
private function updateGroupFromRequest(RequestAbstract $request, Group $group) : Group
|
||||
{
|
||||
/** @var \Modules\Admin\Models\Group $group */
|
||||
$group = GroupMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$group->name = (string) ($request->getData('name') ?? $group->name);
|
||||
$group->setStatus((int) ($request->getData('status') ?? $group->getStatus()));
|
||||
$group->description = Markdown::parse((string) ($request->getData('description') ?? $group->descriptionRaw));
|
||||
|
|
@ -1181,8 +1179,8 @@ final class ApiController extends Controller
|
|||
public function apiAccountUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var Account $old */
|
||||
$old = clone AccountMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$new = $this->updateAccountFromRequest($request);
|
||||
$old = AccountMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$new = $this->updateAccountFromRequest($request, clone $old);
|
||||
$this->updateModel($request->header->account, $old, $new, AccountMapper::class, 'account', $request->getOrigin());
|
||||
|
||||
if (\Modules\Profile\Models\ProfileMapper::get()->where('account', $new->getId())->execute() instanceof \Modules\Profile\Models\NullProfile) {
|
||||
|
|
@ -1202,10 +1200,8 @@ final class ApiController extends Controller
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function updateAccountFromRequest(RequestAbstract $request, bool $allowPassword = false) : Account
|
||||
private function updateAccountFromRequest(RequestAbstract $request, Account $account, bool $allowPassword = false) : Account
|
||||
{
|
||||
/** @var Account $account */
|
||||
$account = AccountMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$account->login = (string) ($request->getData('login') ?? $account->login);
|
||||
$account->name1 = (string) ($request->getData('name1') ?? $account->name1);
|
||||
$account->name2 = (string) ($request->getData('name2') ?? $account->name2);
|
||||
|
|
@ -1652,10 +1648,10 @@ final class ApiController extends Controller
|
|||
public function apiAccountPermissionUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var AccountPermission $old */
|
||||
$old = clone AccountPermissionMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$old = AccountPermissionMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
|
||||
/** @var AccountPermission $new */
|
||||
$new = $this->updatePermissionFromRequest(AccountPermissionMapper::get()->where('id', (int) $request->getData('id'))->execute(), $request);
|
||||
$new = $this->updatePermissionFromRequest($request, clone $old);
|
||||
|
||||
$this->updateModel($request->header->account, $old, $new, AccountPermissionMapper::class, 'account-permission', $request->getOrigin());
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Permission', 'Permission successfully updated', $new);
|
||||
|
|
@ -1677,7 +1673,7 @@ final class ApiController extends Controller
|
|||
public function apiGroupPermissionUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var GroupPermission $old */
|
||||
$old = clone GroupPermissionMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$old = GroupPermissionMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
|
||||
if ($old->getGroup() === 3) {
|
||||
// admin group cannot be deleted
|
||||
|
|
@ -1687,7 +1683,7 @@ final class ApiController extends Controller
|
|||
}
|
||||
|
||||
/** @var GroupPermission $new */
|
||||
$new = $this->updatePermissionFromRequest(GroupPermissionMapper::get()->where('id', (int) $request->getData('id'))->execute(), $request);
|
||||
$new = $this->updatePermissionFromRequest($request, clone $old);
|
||||
|
||||
$this->updateModel($request->header->account, $old, $new, GroupPermissionMapper::class, 'group-permission', $request->getOrigin());
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Permission', 'Permission successfully updated', $new);
|
||||
|
|
@ -1696,14 +1692,14 @@ final class ApiController extends Controller
|
|||
/**
|
||||
* Method to update a group permission from a request
|
||||
*
|
||||
* @param PermissionAbstract $permission Permission model
|
||||
* @param RequestAbstract $request Request
|
||||
* @param PermissionAbstract $permission Permission model
|
||||
*
|
||||
* @return PermissionAbstract
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function updatePermissionFromRequest(PermissionAbstract $permission, RequestAbstract $request) : PermissionAbstract
|
||||
private function updatePermissionFromRequest(RequestAbstract $request, PermissionAbstract $permission) : PermissionAbstract
|
||||
{
|
||||
$permission->setUnit(empty($request->getData('permissionunit')) ? $permission->getUnit() : (int) $request->getData('permissionunit'));
|
||||
$permission->setApp(empty($request->getData('permissionapp')) ? $permission->getApp() : (string) $request->getData('permissionapp'));
|
||||
|
|
|
|||
|
|
@ -25,13 +25,17 @@ use Modules\Admin\Models\NullAccountPermission;
|
|||
use Modules\Admin\Models\NullGroupPermission;
|
||||
use Modules\Admin\Models\SettingsEnum;
|
||||
use Modules\Auditor\Models\AuditMapper;
|
||||
use Modules\Media\Models\MediaMapper;
|
||||
use phpOMS\Asset\AssetType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\DataStorage\Database\Query\OrderType;
|
||||
use phpOMS\Localization\NullLocalization;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||
use phpOMS\Utils\StringUtils;
|
||||
use phpOMS\Views\View;
|
||||
use Web\Backend\Views\TableView;
|
||||
|
||||
/**
|
||||
* Admin controller class.
|
||||
|
|
@ -101,14 +105,91 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Admin/Theme/Backend/accounts-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response));
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('accounts', AccountMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute());
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('accounts', AccountMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute());
|
||||
} else {
|
||||
$view->setData('accounts', AccountMapper::getAll()->where('id', 0, '>')->limit(25)->execute());
|
||||
$searchFieldData = $request->getLike('.*\-p\-.*');
|
||||
$searchField = [];
|
||||
foreach ($searchFieldData as $key => $data) {
|
||||
if ($data === '1') {
|
||||
$split = \explode('-', $key);
|
||||
$member = \end($split);
|
||||
|
||||
$searchField[] = $member;
|
||||
}
|
||||
}
|
||||
|
||||
$filterFieldData = $request->getLike('.*\-f\-.*?\-t');
|
||||
$filterField = [];
|
||||
foreach ($filterFieldData as $key => $type) {
|
||||
$split = \explode('-', $key);
|
||||
\end($split);
|
||||
|
||||
$member = \prev($split);
|
||||
|
||||
if (!empty($request->getData('accountslist-f-' . $member . '-f1'))) {
|
||||
$filterField[$member] = [
|
||||
'type' => $type,
|
||||
'value1' => $request->getData('accountslist-f-' . $member . '-f1'),
|
||||
'logic1' => $request->getData('accountslist-f-' . $member . '-o1'),
|
||||
'value2' => $request->getData('accountslist-f-' . $member . '-f2'),
|
||||
'logic2' => $request->getData('accountslist-f-' . $member . '-o2'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$pageLimit = 25;
|
||||
$view->addData('pageLimit', $pageLimit);
|
||||
|
||||
$mapper = AccountMapper::getAll()->with('createdBy');
|
||||
$list = AccountMapper::find(
|
||||
search: $request->getData('search'),
|
||||
mapper: $mapper,
|
||||
id: (int) ($request->getData('id') ?? 0),
|
||||
secondaryId: (string) ($request->getData('subid') ?? ''),
|
||||
type: $request->getData('pType'),
|
||||
pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')),
|
||||
sortBy: $request->getData('sort_by') ?? '',
|
||||
sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
|
||||
searchFields: $searchField,
|
||||
filters: $filterField
|
||||
);
|
||||
|
||||
$view->setData('accounts', $list['data']);
|
||||
|
||||
/** @var \Model\Setting[] $exportTemplates */
|
||||
$exportTemplates = $this->app->appSettings->get(
|
||||
names: [
|
||||
SettingsEnum::DEFAULT_PDF_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_EXCEL_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_CSV_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_WORD_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_EMAIL_EXPORT_TEMPLATE,
|
||||
],
|
||||
module: 'Admin'
|
||||
);
|
||||
|
||||
$templateIds = [];
|
||||
foreach ($exportTemplates as $template) {
|
||||
$templateIds[] = (int) $template->content;
|
||||
}
|
||||
|
||||
$mediaTemplates = MediaMapper::getAll()
|
||||
->where('id', $templateIds, 'in')
|
||||
->execute();
|
||||
|
||||
$tableView = new TableView($this->app->l11nManager, $request, $response);
|
||||
$tableView->module = 'Admin';
|
||||
$tableView->theme = 'Backend';
|
||||
$tableView->setTitleTemplate('/Web/Backend/Themes/table-title');
|
||||
$tableView->setExportTemplate('/Web/Backend/Themes/popup-export-data');
|
||||
$tableView->setExportTemplates($mediaTemplates);
|
||||
$tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table');
|
||||
$tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-table');
|
||||
$tableView->setSortTemplate('/Web/Backend/Themes/sort-table');
|
||||
$tableView->setData('hasPrevious', $list['hasPrevious']);
|
||||
$tableView->setData('hasNext', $list['hasNext']);
|
||||
|
||||
$view->addData('tableView', $tableView);
|
||||
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
@ -206,17 +287,93 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Admin/Theme/Backend/groups-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000103001, $request, $response));
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('groups', GroupMapper::getAll()->with('createdBy')->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute());
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('groups', GroupMapper::getAll()->with('createdBy')->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute());
|
||||
} else {
|
||||
$view->setData('groups', GroupMapper::getAll()->where('id', 0, '>')->limit(25)->execute());
|
||||
$searchFieldData = $request->getLike('.*\-p\-.*');
|
||||
$searchField = [];
|
||||
foreach ($searchFieldData as $key => $data) {
|
||||
if ($data === '1') {
|
||||
$split = \explode('-', $key);
|
||||
$member = \end($split);
|
||||
|
||||
$searchField[] = $member;
|
||||
}
|
||||
}
|
||||
|
||||
$filterFieldData = $request->getLike('.*\-f\-.*?\-t');
|
||||
$filterField = [];
|
||||
foreach ($filterFieldData as $key => $type) {
|
||||
$split = \explode('-', $key);
|
||||
\end($split);
|
||||
|
||||
$member = \prev($split);
|
||||
|
||||
if (!empty($request->getData('groupslist-f-' . $member . '-f1'))) {
|
||||
$filterField[$member] = [
|
||||
'type' => $type,
|
||||
'value1' => $request->getData('groupslist-f-' . $member . '-f1'),
|
||||
'logic1' => $request->getData('groupslist-f-' . $member . '-o1'),
|
||||
'value2' => $request->getData('groupslist-f-' . $member . '-f2'),
|
||||
'logic2' => $request->getData('groupslist-f-' . $member . '-o2'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$pageLimit = 25;
|
||||
$view->addData('pageLimit', $pageLimit);
|
||||
|
||||
$mapper = GroupMapper::getAll()->with('createdBy');
|
||||
$list = GroupMapper::find(
|
||||
search: $request->getData('search'),
|
||||
mapper: $mapper,
|
||||
id: (int) ($request->getData('id') ?? 0),
|
||||
secondaryId: (string) ($request->getData('subid') ?? ''),
|
||||
type: $request->getData('pType'),
|
||||
pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')),
|
||||
sortBy: $request->getData('sort_by') ?? '',
|
||||
sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
|
||||
searchFields: $searchField,
|
||||
filters: $filterField
|
||||
);
|
||||
|
||||
$view->setData('groups', $list['data']);
|
||||
|
||||
$memberCount = GroupMapper::countMembers();
|
||||
$view->setData('memberCount', $memberCount);
|
||||
|
||||
/** @var \Model\Setting[] $exportTemplates */
|
||||
$exportTemplates = $this->app->appSettings->get(
|
||||
names: [
|
||||
SettingsEnum::DEFAULT_PDF_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_EXCEL_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_CSV_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_WORD_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_EMAIL_EXPORT_TEMPLATE,
|
||||
],
|
||||
module: 'Admin'
|
||||
);
|
||||
|
||||
$templateIds = [];
|
||||
foreach ($exportTemplates as $template) {
|
||||
$templateIds[] = (int) $template->content;
|
||||
}
|
||||
|
||||
$mediaTemplates = MediaMapper::getAll()
|
||||
->where('id', $templateIds, 'in')
|
||||
->execute();
|
||||
|
||||
$tableView = new TableView($this->app->l11nManager, $request, $response);
|
||||
$tableView->module = 'Admin';
|
||||
$tableView->theme = 'Backend';
|
||||
$tableView->setTitleTemplate('/Web/Backend/Themes/table-title');
|
||||
$tableView->setExportTemplate('/Web/Backend/Themes/popup-export-data');
|
||||
$tableView->setExportTemplates($mediaTemplates);
|
||||
$tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table');
|
||||
$tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-table');
|
||||
$tableView->setSortTemplate('/Web/Backend/Themes/sort-table');
|
||||
$tableView->setData('hasPrevious', $list['hasPrevious']);
|
||||
$tableView->setData('hasNext', $list['hasNext']);
|
||||
|
||||
$view->addData('tableView', $tableView);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
@ -312,6 +469,10 @@ final class BackendController extends Controller
|
|||
*/
|
||||
public function viewModuleList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
/** @var \phpOMS\Model\Html\Head $head */
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head->addAsset(AssetType::CSS, 'Modules/Admin/Theme/Backend/css/styles.css?v=1.0.0');
|
||||
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-list');
|
||||
|
||||
|
|
@ -319,6 +480,39 @@ final class BackendController extends Controller
|
|||
$view->setData('active', $this->app->moduleManager->getActiveModules());
|
||||
$view->setData('installed', $this->app->moduleManager->getInstalledModules());
|
||||
|
||||
/** @var \Model\Setting[] $exportTemplates */
|
||||
$exportTemplates = $this->app->appSettings->get(
|
||||
names: [
|
||||
SettingsEnum::DEFAULT_PDF_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_EXCEL_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_CSV_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_WORD_EXPORT_TEMPLATE,
|
||||
SettingsEnum::DEFAULT_EMAIL_EXPORT_TEMPLATE,
|
||||
],
|
||||
module: 'Admin'
|
||||
);
|
||||
|
||||
$templateIds = [];
|
||||
foreach ($exportTemplates as $template) {
|
||||
$templateIds[] = (int) $template->content;
|
||||
}
|
||||
|
||||
$mediaTemplates = MediaMapper::getAll()
|
||||
->where('id', $templateIds, 'in')
|
||||
->execute();
|
||||
|
||||
$tableView = new TableView($this->app->l11nManager, $request, $response);
|
||||
$tableView->module = 'Admin';
|
||||
$tableView->theme = 'Backend';
|
||||
$tableView->setTitleTemplate('/Web/Backend/Themes/table-title');
|
||||
$tableView->setExportTemplate('/Web/Backend/Themes/popup-export-data');
|
||||
$tableView->setExportTemplates($mediaTemplates);
|
||||
$tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table');
|
||||
$tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-table');
|
||||
$tableView->setSortTemplate('/Web/Backend/Themes/sort-table');
|
||||
|
||||
$view->addData('tableView', $tableView);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,22 @@ use phpOMS\Uri\UriFactory;
|
|||
*/
|
||||
$accounts = $this->getData('accounts') ?? [];
|
||||
|
||||
$previous = empty($accounts) ? '{/prefix}admin/account/list' : '{/prefix}admin/account/list?{?}&id=' . \reset($accounts)->getId() . '&ptype=p';
|
||||
$next = empty($accounts) ? '{/prefix}admin/account/list' : '{/prefix}admin/account/list?{?}&id=' . \end($accounts)->getId() . '&ptype=n';
|
||||
$tableView = $this->getData('tableView');
|
||||
$tableView->id = 'accountsList';
|
||||
$tableView->baseUri = '{/prefix}admin/account/list';
|
||||
$tableView->exportUri = '{/api}admin/account/list/export';
|
||||
$tableView->setObjects($accounts);
|
||||
|
||||
$previous = $tableView->getPreviousLink(
|
||||
$this->request,
|
||||
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
|
||||
);
|
||||
|
||||
$next = $tableView->getNextLink(
|
||||
$this->request,
|
||||
empty($this->objects) ? null : \end($this->objects),
|
||||
$this->getData('hasNext') ?? false
|
||||
);
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
|
|
@ -30,66 +44,44 @@ echo $this->getData('nav')->render(); ?>
|
|||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head">
|
||||
<?= $this->getHtml('Accounts'); ?>
|
||||
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-additional-function.tpl.php'; ?>
|
||||
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
|
||||
<?= $tableView->renderTitle(
|
||||
$this->getHtml('Accounts')
|
||||
); ?>
|
||||
</div>
|
||||
<div class="slider">
|
||||
<table id="accountList" class="default sticky">
|
||||
<table id="<?= $tableView->id; ?>" 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>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'id',
|
||||
$this->getHtml('ID', '0', '0'),
|
||||
'number'
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'action',
|
||||
$this->getHtml('Status'),
|
||||
'select',
|
||||
[
|
||||
'active' => $this->getHtml('Active'),
|
||||
'inactive' => $this->getHtml('Inactive'),
|
||||
],
|
||||
false // don't render sort
|
||||
); ?>
|
||||
<td class="wf-100"><?= $tableView->renderHeaderElement(
|
||||
'module',
|
||||
$this->getHtml('Name'),
|
||||
'text'
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'lastActive',
|
||||
$this->getHtml('Activity'),
|
||||
'date'
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'createdAt',
|
||||
$this->getHtml('Created'),
|
||||
'date'
|
||||
); ?>
|
||||
<tbody>
|
||||
<?php
|
||||
$c = 0;
|
||||
|
|
@ -114,10 +106,16 @@ echo $this->getData('nav')->render(); ?>
|
|||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
|
||||
<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>
|
||||
<?php if ($this->getData('hasPrevious')) : ?>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData('hasNext')) : ?>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
30
Theme/Backend/css/styles.css
Normal file
30
Theme/Backend/css/styles.css
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
.tag.module-status-1,
|
||||
.tag.module-status-2,
|
||||
.tag.module-status-3,
|
||||
.tag.module-status-4,
|
||||
.tag.module-status-5 {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.tag.module-status-5 {
|
||||
background: #ff6250;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tag.module-status-3 {
|
||||
background: #3498db;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tag.module-status-2 {
|
||||
background: #ffd321;
|
||||
}
|
||||
|
||||
.tag.module-status-4 {
|
||||
background: #9b59b6;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tag.module-status-1 {
|
||||
background: #46eb8b;
|
||||
}
|
||||
|
|
@ -21,7 +21,10 @@ echo $this->getData('nav')->render(); ?>
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
<form id="fGroupCreate" action="<?= UriFactory::build('{/api}admin/group'); ?>" method="put">
|
||||
<form id="fGroupCreate"
|
||||
action="<?= UriFactory::build('{/api}admin/group'); ?>"
|
||||
method="put"
|
||||
autocomplete="off">
|
||||
<div class="portlet-head"><?= $this->getHtml('Group'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<table class="layout wf-100" style="table-layout: fixed">
|
||||
|
|
@ -33,7 +36,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<option value="<?= GroupStatus::INACTIVE; ?>"><?= $this->getHtml('Inactive'); ?>
|
||||
</select>
|
||||
<tr><td><label for="iGname"><?= $this->getHtml('Name'); ?></label>
|
||||
<tr><td><input id="iGname" name="name" type="text" spellcheck="false" autocomplete="off" placeholder=" Guest" required>
|
||||
<tr><td><input id="iGname" name="name" type="text" spellcheck="false" autocomplete="off" required>
|
||||
<tr><td><?= $this->getData('editor')->render('group-editor'); ?>
|
||||
<tr><td><?= $this->getData('editor')->getData('text')->render('group-editor', 'description', 'fGroupCreate'); ?>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -22,55 +22,66 @@ use phpOMS\Uri\UriFactory;
|
|||
$groups = $this->getData('groups') ?? [];
|
||||
$memberCount = $this->getData('memberCount') ?? [];
|
||||
|
||||
$previous = empty($groups) ? '{/prefix}admin/group/list' : '{/prefix}admin/group/list?{?}&id=' . \reset($groups)->getId() . '&ptype=p';
|
||||
$next = empty($groups) ? '{/prefix}admin/group/list' : '{/prefix}admin/group/list?{?}&id=' . \end($groups)->getId() . '&ptype=n';
|
||||
$tableView = $this->getData('tableView');
|
||||
$tableView->id = 'groupsList';
|
||||
$tableView->baseUri = '{/prefix}admin/group/list';
|
||||
$tableView->exportUri = '{/api}admin/group/list/export';
|
||||
$tableView->setObjects($groups);
|
||||
|
||||
$previous = $tableView->getPreviousLink(
|
||||
$this->request,
|
||||
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
|
||||
);
|
||||
|
||||
$next = $tableView->getNextLink(
|
||||
$this->request,
|
||||
empty($this->objects) ? null : \end($this->objects),
|
||||
$this->getData('hasNext') ?? false
|
||||
);
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Groups'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
||||
<div class="portlet-head">
|
||||
<?= $tableView->renderTitle(
|
||||
$this->getHtml('Groups')
|
||||
); ?>
|
||||
</div>
|
||||
<div class="slider">
|
||||
<table id="groupList" class="default sticky">
|
||||
<table id="<?= $tableView->id; ?>" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="groupList-r1-asc">
|
||||
<input id="groupList-r1-asc" name="groupList-sort" type="radio">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="groupList-r1-desc">
|
||||
<input id="groupList-r1-desc" name="groupList-sort" type="radio">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<label for="groupList-r2-asc">
|
||||
<input id="groupList-r2-asc" name="groupList-sort" type="radio">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="groupList-r2-desc">
|
||||
<input id="groupList-r2-desc" name="groupList-sort" type="radio">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<label for="groupList-r3-asc">
|
||||
<input id="groupList-r3-asc" name="groupList-sort" type="radio">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="groupList-r3-desc">
|
||||
<input id="groupList-r3-desc" name="groupList-sort" type="radio">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Members'); ?>
|
||||
<label for="groupList-r4-asc">
|
||||
<input id="groupList-r4-asc" name="groupList-sort" type="radio">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="groupList-r4-desc">
|
||||
<input id="groupList-r4-desc" name="groupList-sort" type="radio">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'id',
|
||||
$this->getHtml('ID', '0', '0'),
|
||||
'number'
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'action',
|
||||
$this->getHtml('Status'),
|
||||
'select',
|
||||
[
|
||||
'active' => $this->getHtml('Active'),
|
||||
'inactive' => $this->getHtml('Inactive'),
|
||||
],
|
||||
false // don't render sort
|
||||
); ?>
|
||||
<td class="wf-100"><?= $tableView->renderHeaderElement(
|
||||
'module',
|
||||
$this->getHtml('Name'),
|
||||
'text'
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'module',
|
||||
$this->getHtml('Members'),
|
||||
'number',
|
||||
[],
|
||||
true,
|
||||
false,
|
||||
false
|
||||
); ?>
|
||||
<tbody>
|
||||
<?php $c = 0;
|
||||
foreach ($groups as $key => $value) : ++$c;
|
||||
|
|
@ -92,10 +103,16 @@ echo $this->getData('nav')->render(); ?>
|
|||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
|
||||
<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>
|
||||
<?php if ($this->getData('hasPrevious')) : ?>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData('hasNext')) : ?>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -45,7 +45,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= empty($this->request->uri->fragment) || $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
|
|
|||
|
|
@ -21,54 +21,57 @@ use phpOMS\Uri\UriFactory;
|
|||
|
||||
$modules = $this->getData('modules') ?? [];
|
||||
$active = $this->getData('active') ?? [];
|
||||
$isntalled = $this->getData('isntalled') ?? [];
|
||||
$installed = $this->getData('installed') ?? [];
|
||||
|
||||
$tableView = $this->getData('tableView');
|
||||
$tableView->id = 'moduleList';
|
||||
$tableView->baseUri = '{/prefix}admin/module/list';
|
||||
$tableView->exportUri = '{/api}admin/module/list/export';
|
||||
$tableView->setObjects($modules);
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Modules'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
||||
<div class="portlet-head">
|
||||
<?= $tableView->renderTitle(
|
||||
$this->getHtml('Modules')
|
||||
); ?>
|
||||
</div>
|
||||
<div class="slider">
|
||||
<table id="moduleList" class="default sticky">
|
||||
<table id="<?= $tableView->id; ?>" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="moduleList-sort-1">
|
||||
<input type="radio" name="moduleList-sort" id="moduleList-sort-1">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="moduleList-sort-2">
|
||||
<input type="radio" name="moduleList-sort" id="moduleList-sort-2">
|
||||
<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('Name'); ?>
|
||||
<label for="moduleList-sort-3">
|
||||
<input type="radio" name="moduleList-sort" id="moduleList-sort-3">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="moduleList-sort-4">
|
||||
<input type="radio" name="moduleList-sort" id="moduleList-sort-4">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Version'); ?>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<label for="moduleList-sort-5">
|
||||
<input type="radio" name="moduleList-sort" id="moduleList-sort-5">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="moduleList-sort-6">
|
||||
<input type="radio" name="moduleList-sort" id="moduleList-sort-6">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'id',
|
||||
$this->getHtml('ID', '0', '0'),
|
||||
'number'
|
||||
); ?>
|
||||
<td class="wf-100"><?= $tableView->renderHeaderElement(
|
||||
'name',
|
||||
$this->getHtml('Name'),
|
||||
'text'
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'version',
|
||||
$this->getHtml('Version'),
|
||||
'text',
|
||||
[],
|
||||
false,
|
||||
false,
|
||||
false
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'action',
|
||||
$this->getHtml('Status'),
|
||||
'select',
|
||||
[
|
||||
'active' => $this->getHtml('active'),
|
||||
'available' => $this->getHtml('available'),
|
||||
'inactive' => $this->getHtml('inactive'),
|
||||
],
|
||||
false // don't render sort
|
||||
); ?>
|
||||
<tbody>
|
||||
<?php $count = 0;
|
||||
foreach ($modules as $key => $module) : ++$count;
|
||||
|
|
@ -87,7 +90,7 @@ $isntalled = $this->getData('isntalled') ?? [];
|
|||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module->getExternalName()); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Version'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module->getVersion()); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Status'); ?>">
|
||||
<span class="tag">
|
||||
<span class="tag module-status-<?= $status; ?>">
|
||||
<a href="<?= $url; ?>">
|
||||
<?php if ($status === ModuleStatus::ACTIVE)
|
||||
echo \mb_strtolower($this->getHtml('Active'));
|
||||
|
|
@ -103,7 +106,6 @@ $isntalled = $this->getData('isntalled') ?? [];
|
|||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="portlet-foot"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user