mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-11 13:38:39 +00:00
continue group/account permission selector impl.
This commit is contained in:
parent
1f76cfa6bc
commit
6ff5bb9cbe
|
|
@ -981,6 +981,13 @@
|
|||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"group_permission_defaultcperm": {
|
||||
"description": "Default permissions a user receives when creating (only relevant if hascreate is true, if null => CRU)",
|
||||
"name": "group_permission_defaultcperm",
|
||||
"type": "VARCHAR(5)",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"group_permission_hasmodify": {
|
||||
"name": "group_permission_hasmodify",
|
||||
"type": "TINYINT(1)",
|
||||
|
|
@ -998,6 +1005,13 @@
|
|||
"type": "TINYINT(1)",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"group_permission_defaultpperm": {
|
||||
"description": "Default permissions a user is allowed to change (only relevant if haspermission is true, if null => all)",
|
||||
"name": "group_permission_defaultpperm",
|
||||
"type": "TEXT",
|
||||
"default": null,
|
||||
"null": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1359,6 +1373,13 @@
|
|||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"account_permission_defaultcperm": {
|
||||
"description": "Default permissions a user receives when creating (only relevant if hascreate is true, if null => CRU)",
|
||||
"name": "account_permission_defaultcperm",
|
||||
"type": "VARCHAR(5)",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"account_permission_hasmodify": {
|
||||
"name": "account_permission_hasmodify",
|
||||
"type": "TINYINT(1)",
|
||||
|
|
@ -1376,6 +1397,13 @@
|
|||
"type": "TINYINT(1)",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"account_permission_defaultpperm": {
|
||||
"description": "Default permissions a user is allowed to change (only relevant if haspermission is true, if null => all)",
|
||||
"name": "account_permission_defaultpperm",
|
||||
"type": "TEXT",
|
||||
"default": null,
|
||||
"null": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -159,7 +159,8 @@ class AccountMapper extends DataMapperFactory
|
|||
->with('permissions')
|
||||
->with('l11n')
|
||||
->where('id', $id)
|
||||
->where('permission/element', null)
|
||||
->where('permissions/element', null)
|
||||
->where('groups/permissions/element', null)
|
||||
->execute();
|
||||
|
||||
return $account;
|
||||
|
|
|
|||
|
|
@ -47,9 +47,11 @@ final class AccountPermissionMapper extends DataMapperFactory
|
|||
'account_permission_component' => ['name' => 'account_permission_component', 'type' => 'int', 'internal' => 'component'],
|
||||
'account_permission_hasread' => ['name' => 'account_permission_hasread', 'type' => 'bool', 'internal' => 'hasRead'],
|
||||
'account_permission_hascreate' => ['name' => 'account_permission_hascreate', 'type' => 'bool', 'internal' => 'hasCreate'],
|
||||
'account_permission_defaultcperm' => ['name' => 'account_permission_defaultcperm', 'type' => 'string', 'internal' => 'defaultCPermissions'],
|
||||
'account_permission_hasmodify' => ['name' => 'account_permission_hasmodify', 'type' => 'bool', 'internal' => 'hasModify'],
|
||||
'account_permission_hasdelete' => ['name' => 'account_permission_hasdelete', 'type' => 'bool', 'internal' => 'hasDelete'],
|
||||
'account_permission_haspermission' => ['name' => 'account_permission_haspermission', 'type' => 'bool', 'internal' => 'hasPermission'],
|
||||
'account_permission_defaultpperm' => ['name' => 'account_permission_defaultpperm', 'type' => 'string', 'internal' => 'defaultPPermissions'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,9 +47,11 @@ final class GroupPermissionMapper extends DataMapperFactory
|
|||
'group_permission_component' => ['name' => 'group_permission_component', 'type' => 'int', 'internal' => 'component'],
|
||||
'group_permission_hasread' => ['name' => 'group_permission_hasread', 'type' => 'bool', 'internal' => 'hasRead'],
|
||||
'group_permission_hascreate' => ['name' => 'group_permission_hascreate', 'type' => 'bool', 'internal' => 'hasCreate'],
|
||||
'group_permission_defaultcperm' => ['name' => 'group_permission_defaultcperm', 'type' => 'string', 'internal' => 'defaultCPermissions'],
|
||||
'group_permission_hasmodify' => ['name' => 'group_permission_hasmodify', 'type' => 'bool', 'internal' => 'hasModify'],
|
||||
'group_permission_hasdelete' => ['name' => 'group_permission_hasdelete', 'type' => 'bool', 'internal' => 'hasDelete'],
|
||||
'group_permission_haspermission' => ['name' => 'group_permission_haspermission', 'type' => 'bool', 'internal' => 'hasPermission'],
|
||||
'group_permission_defaultpperm' => ['name' => 'group_permission_defaultpperm', 'type' => 'string', 'internal' => 'defaultPPermissions'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Admin\Theme\Backend\Components\AccountPermissionSelector;
|
||||
|
||||
use phpOMS\Localization\L11nManager;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
|
||||
/**
|
||||
* Component view.
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class BaseView extends View
|
||||
{
|
||||
/**
|
||||
* Form id
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $id = '';
|
||||
|
||||
/**
|
||||
* Virtual path of the Admin file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $virtualPath = '';
|
||||
|
||||
/**
|
||||
* Name of the image preview
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $name = '';
|
||||
|
||||
public array $permissions = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(L11nManager $l11n = null, RequestAbstract $request, ResponseAbstract $response)
|
||||
{
|
||||
parent::__construct($l11n, $request, $response);
|
||||
$this->setTemplate('/Modules/Admin/Theme/Backend/Components/AccountPermissionSelector/account-permission-selector');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:string, 1?:string, 2?:string} $data */
|
||||
$this->form = $data[0];
|
||||
$this->name = $data[1] ?? 'UNDEFINED';
|
||||
$this->virtualPath = $data[2] ?? $this->virtualPath;
|
||||
$this->permissions = $data[3] ?? $this->permissions;
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
}
|
||||
|
|
@ -12,130 +12,244 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Localization\ISO639Enum;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$account = $this->accounts;
|
||||
$permissions = $this->permissions;
|
||||
$categories = ISO639Enum::getConstants();
|
||||
|
||||
?>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form id="attributeForm" action="<?= UriFactory::build($this->apiUri); ?>" method="post"
|
||||
data-ui-container="#attributeTable tbody"
|
||||
data-add-form="attributeForm"
|
||||
data-add-tpl="#attributeTable tbody .oms-add-tpl-attribute">
|
||||
<div class="portlet-head"><?= $this->getHtml('Attribute', 'Attribute', 'Backend'); ?></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('PermissionSelector', 'Admin', 'Backend'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iAttributeId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" id="iAttributeId" name="id" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
||||
<label><?= $this->getHtml('GroupAccount', 'Admin', 'Backend'); ?></label>
|
||||
<div class="ipt-wrap wf-100">
|
||||
<div class="ipt-first">
|
||||
<span class="input">
|
||||
<button type="button" id="<?= $this->id; ?>-book-button" data-action='[
|
||||
{
|
||||
"key": 1, "listener": "click", "action": [
|
||||
{"key": 1, "type": "dom.popup", "selector": "#group-selector-tpl", "aniIn": "fadeIn", "id": "<?= $this->id; ?>"},
|
||||
{"key": 2, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/base}/admin/group?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
|
||||
{"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1},
|
||||
{"key": 4, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/base}/admin/group?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
|
||||
{"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}
|
||||
]
|
||||
}
|
||||
]'><i class="fa fa-book"></i></button>
|
||||
<input type="text" list="<?= $this->id; ?>-datalist" id="<?= $this->id; ?>" name="receiver" placeholder=" Guest" data-action='[
|
||||
{
|
||||
"key": 1, "listener": "keyup", "action": [
|
||||
{"key": 1, "type": "validate.keypress", "pressed": "!13!37!38!39!40"},
|
||||
{"key": 2, "type": "utils.timer", "id": "<?= $this->id; ?>", "delay": 500, "resets": true},
|
||||
{"key": 3, "type": "dom.datalist.clear", "id": "<?= $this->id; ?>-datalist"},
|
||||
{"key": 4, "type": "message.request", "uri": "{/base}/{/lang}/api/admin/find/group?search={!#<?= $this->id; ?>}", "method": "GET", "request_type": "json"},
|
||||
{"key": 5, "type": "dom.datalist.append", "id": "<?= $this->id; ?>-datalist", "value": "id", "text": "name"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": 2, "listener": "keydown", "action" : [
|
||||
{"key": 1, "type": "validate.keypress", "pressed": "13|9"},
|
||||
{"key": 2, "type": "message.request", "uri": "{/base}/{/lang}/api/admin/find/group?search={!#<?= $this->id; ?>}", "method": "GET", "request_type": "json"},
|
||||
{"key": 3, "type": "dom.setvalue", "overwrite": true, "selector": "#<?= $this->id; ?>-idlist", "value": "{0/id}", "data": ""},
|
||||
{"key": 4, "type": "dom.setvalue", "overwrite": true, "selector": "#<?= $this->id; ?>-taglist", "value": "<span id=\"<?= $this->id; ?>-taglist-{0/id}\" class=\"tag red\" data-id=\"{0/id}\"><i class=\"fa fa-times\"></i> {0/name}</span>", "data": ""},
|
||||
{"key": 5, "type": "dom.setvalue", "overwrite": true, "selector": "#<?= $this->id; ?>", "value": "", "data": ""}
|
||||
]
|
||||
}
|
||||
]'>
|
||||
<datalist id="<?= $this->id; ?>-datalist"></datalist>
|
||||
<input name="datalist-list" type="hidden" id="<?= $this->id; ?>-idlist">
|
||||
</span>
|
||||
</div>
|
||||
<div class="ipt-second"><button><?= $this->getHtml('Add', '0', '0'); ?></button></div>
|
||||
</div>
|
||||
<div class="box taglist" id="<?= $this->id; ?>-taglist" data-action='[
|
||||
{
|
||||
"key": 1, "listener": "click", "selector": "#<?= $this->id; ?>-taglist span fa", "action": [
|
||||
{"key": 1, "type": "dom.getvalue", "base": "self"},
|
||||
{"key": 2, "type": "dom.removevalue", "selector": "#<?= $this->id; ?>-idlist", "data": ""},
|
||||
{"key": 3, "type": "dom.remove", "base": "self"}
|
||||
]
|
||||
}
|
||||
]'></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="form-group">
|
||||
<label for="iAttributesLanguage"><?= $this->getHtml('Language', 'Attribute', 'Backend'); ?></label>
|
||||
<select id="iAttributesLanguage" name="language" data-tpl-text="/language" data-tpl-value="/language">
|
||||
<option value="">
|
||||
<?php foreach ($categories as $code => $category) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($category); ?>
|
||||
<?php endforeach; ?>
|
||||
<label><?= $this->getHtml('Category', 'Admin', 'Backend'); ?></label>
|
||||
<select>
|
||||
<option>All
|
||||
<option>...
|
||||
</select>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<input type="hidden" name="element" value="board-id">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAttributesType"><?= $this->getHtml('Type', 'Attribute', 'Backend'); ?></label>
|
||||
<select id="iAttributesType" name="type" data-tpl-text="/type" data-tpl-value="/type">
|
||||
<?php
|
||||
foreach ($types as $type) : ?>
|
||||
<option value="<?= $type->id; ?>"><?= $this->printHtml($type->getL11n()); ?>
|
||||
<?php endforeach; ?>
|
||||
<label><?= $this->getHtml('Component', 'Admin', 'Backend'); ?></label>
|
||||
<select>
|
||||
<option selected>Own
|
||||
<option>All
|
||||
<option>...
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAttributesUnit"><?= $this->getHtml('Unit', 'Attribute', 'Backend'); ?></label>
|
||||
<select id="iAttributesUnit" name="unit" data-tpl-text="/unit" data-tpl-value="/unit">
|
||||
<option value="">
|
||||
<?php
|
||||
foreach ($units as $unit) : ?>
|
||||
<option value="<?= $unit->id; ?>"><?= $this->printHtml($unit->name); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<label><?= $this->getHtml('Permission'); ?></label>
|
||||
<div>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionCreate">
|
||||
<input id="iPermissionCreate" type="checkbox" name="permissioncreate" value="<?= PermissionType::CREATE; ?>" data-tpl-text="/perm/c" data-tpl-value="/perm/c">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Create'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAttributeValue"><?= $this->getHtml('Value', 'Attribute', 'Backend'); ?></label>
|
||||
<pre class="textarea contenteditable" id="iAttributeValue" data-name="value" data-tpl-value="/value" contenteditable></pre>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionRead">
|
||||
<input id="iPermissionRead" type="checkbox" name="permissionread" value="<?= PermissionType::READ; ?>" data-tpl-text="/perm/r" data-tpl-value="/perm/r">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Read'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionUpdate">
|
||||
<input id="iPermissionUpdate" type="checkbox" name="permissionupdate" value="<?= PermissionType::MODIFY; ?>" data-tpl-text="/perm/u" data-tpl-value="/perm/u">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Update'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionDelete">
|
||||
<input id="iPermissionDelete" type="checkbox" name="permissiondelete" value="<?= PermissionType::DELETE; ?>" data-tpl-text="/perm/d" data-tpl-value="/perm/d">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Delete'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionPermission">
|
||||
<input id="iPermissionPermission" type="checkbox" name="permissionpermission" value="<?= PermissionType::PERMISSION; ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Permission'); ?>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?= $this->getHtml('OwnPermission'); ?></label>
|
||||
<div>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iOwnPermissionCreate">
|
||||
<input id="iOwnPermissionCreate" type="checkbox" name="ownpermissioncreate" value="<?= PermissionType::CREATE; ?>" data-tpl-text="/perm/c" data-tpl-value="/perm/c">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Create'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iOwnPermissionRead">
|
||||
<input id="iOwnPermissionRead" type="checkbox" name="ownpermissionread" value="<?= PermissionType::READ; ?>" data-tpl-text="/perm/r" data-tpl-value="/perm/r">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Read'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iOwnPermissionUpdate">
|
||||
<input id="iOwnPermissionUpdate" type="checkbox" name="ownpermissionupdate" value="<?= PermissionType::MODIFY; ?>" data-tpl-text="/perm/u" data-tpl-value="/perm/u">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Update'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iOwnPermissionDelete">
|
||||
<input id="iOwnPermissionDelete" type="checkbox" name="ownpermissiondelete" value="<?= PermissionType::DELETE; ?>" data-tpl-text="/perm/d" data-tpl-value="/perm/d">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Delete'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iOwnPermissionPermission">
|
||||
<input id="iOwnPermissionPermission" type="checkbox" name="ownpermissionpermission" value="<?= PermissionType::PERMISSION; ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Permission'); ?>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<input id="bAttributeAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
|
||||
<input id="bAttributeSave" formmethod="post" type="submit" class="save-form hidden button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
|
||||
<input type="submit" class="cancel-form hidden button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
|
||||
<input type="Submit" value="<?= $this->getHtml('Add', '0', '0') ?>">
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Attributes', 'Attribute', 'Backend'); ?><i class="lni lni-download download btn end-xs"></i></div>
|
||||
<div class="slider">
|
||||
<table id="attributeTable" class="default"
|
||||
data-tag="form"
|
||||
data-ui-element="tr"
|
||||
data-add-tpl=".oms-add-tpl-attribute"
|
||||
data-update-form="attributeForm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td><?= $this->getHtml('Name', 'Attribute', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td class="wf-100"><?= $this->getHtml('Value', 'Attribute', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td><?= $this->getHtml('Unit', 'Attribute', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<tbody>
|
||||
<template class="oms-add-tpl-attribute">
|
||||
<tr data-id="" draggable="false">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Permissions', 'Admin', 'Backend'); ?><i class="lni lni-download download btn end-xs"></i></div>
|
||||
<div class="slider">
|
||||
<table id="attributeTable" class="default"
|
||||
data-tag="form"
|
||||
data-ui-element="tr"
|
||||
data-add-tpl=".oms-add-tpl-attribute"
|
||||
data-update-form="attributeForm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-cogs btn update-form"></i>
|
||||
<input id="attributeTable-remove-0" type="checkbox" class="hidden">
|
||||
<label for="attributeTable-remove-0" class="checked-visibility-alt"><i class="fa fa-times btn form-action"></i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="attributeTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="attributeTable-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="/type" data-tpl-value="/type" data-value=""></td>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"></td>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<?php $c = 0;
|
||||
foreach ($attribute as $key => $value) : ++$c; ?>
|
||||
<tr data-id="<?= $value->id; ?>">
|
||||
<td>
|
||||
<i class="fa fa-cogs btn update-form"></i>
|
||||
<?php if (!$value->type->isRequired) : ?>
|
||||
<input id="attributeTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||
<label for="attributeTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="fa fa-times btn form-action"></i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="attributeTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="attributeTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||
<td data-tpl-text="/type" data-tpl-value="/type" data-value="<?= $value->type->id; ?>"><?= $this->printHtml($value->type->getL11n()); ?>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"><?= $value->value->getValue() instanceof \DateTime ? $value->value->getValue()->format('Y-m-d') : $this->printHtml((string) $value->value->getValue()); ?>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->value->unit; ?>"><?= $this->printHtml($value->value->unit); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr>
|
||||
<td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td><?= $this->getHtml('Account', 'Admin', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td><?= $this->getHtml('Category', 'Admin', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td><?= $this->getHtml('Element', 'Admin', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<tbody>
|
||||
<template class="oms-add-tpl-attribute">
|
||||
<tr data-id="" draggable="false">
|
||||
<td>
|
||||
<i class="fa fa-cogs btn update-form"></i>
|
||||
<input id="attributeTable-remove-0" type="checkbox" class="hidden">
|
||||
<label for="attributeTable-remove-0" class="checked-visibility-alt"><i class="fa fa-times btn form-action"></i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="attributeTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="attributeTable-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="/type" data-tpl-value="/type" data-value=""></td>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"></td>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<?php $c = 0;
|
||||
foreach ($permissions as $key => $value) : ++$c; ?>
|
||||
<tr data-id="<?= $value->id; ?>">
|
||||
<td>
|
||||
<i class="fa fa-cogs btn update-form"></i>
|
||||
<?php if (!$value->type->isRequired) : ?>
|
||||
<input id="attributeTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||
<label for="attributeTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="fa fa-times btn form-action"></i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="attributeTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="attributeTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||
<td data-tpl-text="/type" data-tpl-value="/type" data-value="<?= $value->type->id; ?>"><?= $this->printHtml($value->type->getL11n()); ?>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"><?= $value->value->getValue() instanceof \DateTime ? $value->value->getValue()->format('Y-m-d') : $this->printHtml((string) $value->value->getValue()); ?>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->value->unit; ?>"><?= $this->printHtml($value->value->unit); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr>
|
||||
<td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -167,45 +167,45 @@ echo $this->data['nav']->render(); ?>
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label><?= $this->getHtml('Permission'); ?></label>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionCreate">
|
||||
<input id="iPermissionCreate" type="checkbox" name="permissioncreate" value="<?= PermissionType::CREATE; ?>" data-tpl-text="/perm/c" data-tpl-value="/perm/c">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Create'); ?>
|
||||
</label>
|
||||
</span>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionCreate">
|
||||
<input id="iPermissionCreate" type="checkbox" name="permissioncreate" value="<?= PermissionType::CREATE; ?>" data-tpl-text="/perm/c" data-tpl-value="/perm/c">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Create'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionRead">
|
||||
<input id="iPermissionRead" type="checkbox" name="permissionread" value="<?= PermissionType::READ; ?>" data-tpl-text="/perm/r" data-tpl-value="/perm/r">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Read'); ?>
|
||||
</label>
|
||||
</span>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionRead">
|
||||
<input id="iPermissionRead" type="checkbox" name="permissionread" value="<?= PermissionType::READ; ?>" data-tpl-text="/perm/r" data-tpl-value="/perm/r">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Read'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionUpdate">
|
||||
<input id="iPermissionUpdate" type="checkbox" name="permissionupdate" value="<?= PermissionType::MODIFY; ?>" data-tpl-text="/perm/u" data-tpl-value="/perm/u">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Update'); ?>
|
||||
</label>
|
||||
</span>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionUpdate">
|
||||
<input id="iPermissionUpdate" type="checkbox" name="permissionupdate" value="<?= PermissionType::MODIFY; ?>" data-tpl-text="/perm/u" data-tpl-value="/perm/u">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Update'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionDelete">
|
||||
<input id="iPermissionDelete" type="checkbox" name="permissiondelete" value="<?= PermissionType::DELETE; ?>" data-tpl-text="/perm/d" data-tpl-value="/perm/d">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Delete'); ?>
|
||||
</label>
|
||||
</span>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionDelete">
|
||||
<input id="iPermissionDelete" type="checkbox" name="permissiondelete" value="<?= PermissionType::DELETE; ?>" data-tpl-text="/perm/d" data-tpl-value="/perm/d">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Delete'); ?>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionPermission">
|
||||
<input id="iPermissionPermission" type="checkbox" name="permissionpermission" value="<?= PermissionType::PERMISSION; ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Permission'); ?>
|
||||
</label>
|
||||
</span>
|
||||
<span class="checkbox">
|
||||
<label class="checkbox" for="iPermissionPermission">
|
||||
<input id="iPermissionPermission" type="checkbox" name="permissionpermission" value="<?= PermissionType::PERMISSION; ?>" data-tpl-text="/perm/p" data-tpl-value="/perm/p">
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('Permission'); ?>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user