update phân quyền chi tiết
This commit is contained in:
@@ -10,18 +10,26 @@
|
||||
<label class="action-button" onclick="common.form(this, '');" data-href="{Url::to(['tree'])}">
|
||||
<i class="fa fa-sitemap fa-1-5x"></i> Cây thư mục
|
||||
</label>
|
||||
<label class="action-button" onclick="common.form(this, 'area');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{if Yii::$app->user->can("areaCreate")}
|
||||
<label class="action-button" onclick="common.form(this, 'area');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("areaUpdate")}
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("areaDelete")}
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("areaImport")}
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{/if}
|
||||
<label class="action-button" onclick="_logs(this);" data-href="{Url::to(['logs'])}">
|
||||
<i class="fa fa-file fa-1-5x"></i> Ghi nhận hệ thống
|
||||
</label>
|
||||
|
||||
41
views/auth-item/form.tpl
Normal file
41
views/auth-item/form.tpl
Normal file
@@ -0,0 +1,41 @@
|
||||
<div class="form-group" id="name">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Tên quyền <i class="text-red">*</i></div>
|
||||
<input type="text" class="form-control" value="{$model->name|default:""}" name="Name">
|
||||
</div>
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="description">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Ghi chú</div>
|
||||
<input type="text" class="form-control" value="{$model->description|default:""}" name="Description">
|
||||
</div>
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div id="roleArray" class="hidden">{json_encode($roleArray)}</div>
|
||||
<div class="well">
|
||||
{foreach from=$roleArray item=arr key=k}
|
||||
<div class="">
|
||||
<input type='checkbox' value='0' class='checkbox-permission-{$k}' id='checkall-permission-{$k}'>
|
||||
{$arr}
|
||||
<div style="padding-left: 20px;">
|
||||
{$permissions=$query->find()->andWhere(["LIKE","name",$k])->all()}
|
||||
{foreach from=$permissions item=per}
|
||||
<div>
|
||||
<input type='checkbox' value='{$per->name}' class='checkbox-permission checkbox-permission-{$k}' name="checkbox-permission" {if in_array($per->name,$child)}checked=""{/if}>
|
||||
{$per->description}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-primary" onclick="save(this);" data-href="{$url}">
|
||||
<i class="fa fa-floppy-o"></i> Lưu
|
||||
</button>
|
||||
<button class="btn btn-default" data-dismiss="modal">
|
||||
<span class="fa fa-remove"></span> Hủy
|
||||
</button>
|
||||
</div>
|
||||
60
views/auth-item/index.tpl
Normal file
60
views/auth-item/index.tpl
Normal file
@@ -0,0 +1,60 @@
|
||||
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
||||
{use class="yii\helpers\Url"}
|
||||
{use class="yii\grid\GridView"}
|
||||
{use class="yii\widgets\Pjax" type="block"}
|
||||
{use class="app\assets\AuthItemAsset"}
|
||||
{AuthItemAsset::register($this)|void}
|
||||
{block name='content'}
|
||||
<div class="area-index">
|
||||
<div class="" style="font-size: 15px;">
|
||||
<label class="action-button" onclick="common.form(this, 'auth');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
</div>
|
||||
{Pjax id="role-list"}
|
||||
{GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'layout'=> \app\helpers\CommonGrid::getLayout(),
|
||||
'tableOptions' => [
|
||||
'class' => 'table table-striped table-bordered table-hover',
|
||||
'style' => 'background:#fff;min-width:700px;'
|
||||
],
|
||||
'rowOptions' => \app\helpers\AuthItemGrid::rows("auth"),
|
||||
'columns' => [
|
||||
[
|
||||
'class' => 'yii\grid\SerialColumn',
|
||||
'contentOptions' => ['class' => 'text-center'],
|
||||
'headerOptions' => ['class' => 'text-center', 'style' => 'width:3%']
|
||||
],
|
||||
[
|
||||
'header' => "<input type='checkbox' value='0' class='checkbox-role' id='checkall-role'>",
|
||||
'format' => 'raw',
|
||||
'contentOptions' => ['class' => 'text-center'],
|
||||
'headerOptions' => ['class' => 'text-center', 'style' => 'width:3%'],
|
||||
'value' => \app\helpers\AuthItemGrid::checkbox("role")
|
||||
],
|
||||
'name',
|
||||
'description:ntext',
|
||||
[
|
||||
'attribute' => 'created_at',
|
||||
'value' => \app\helpers\CommonGrid::createdAt()
|
||||
]
|
||||
],
|
||||
'pager' => [
|
||||
'firstPageLabel' => "<i class='fa fa-backward'></i>",
|
||||
'lastPageLabel' => "<i class='fa fa-forward'></i>",
|
||||
'nextPageLabel' => "<i class='fa fa-chevron-right'></i>",
|
||||
'prevPageLabel' => "<i class='fa fa-chevron-left'></i>",
|
||||
'maxButtonCount' => 5
|
||||
]
|
||||
])}
|
||||
{/Pjax}
|
||||
</div>
|
||||
{/block}
|
||||
@@ -10,21 +10,31 @@
|
||||
<label class="action-button" onclick="common.form(this, '');" data-href="{Url::to(['tree'])}">
|
||||
<i class="fa fa-sitemap fa-1-5x"></i> Cây thư mục
|
||||
</label>
|
||||
<label class="action-button" onclick="common.form(this, 'department');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
<label class="action-button" onclick="$('#file').trigger('click');">
|
||||
<i class="fa fa-upload fa-1-5x"></i> Nhập
|
||||
</label>
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{if Yii::$app->user->can("departmentCreate")}
|
||||
<label class="action-button" onclick="common.form(this, 'department');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("departmentUpdate")}
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("departmentDelete")}
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("departmentImport")}
|
||||
<label class="action-button" onclick="$('#file').trigger('click');">
|
||||
<i class="fa fa-upload fa-1-5x"></i> Nhập
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("departmentExport")}
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{/if}
|
||||
<label class="action-button" onclick="_logs(this);" data-href="{Url::to(['logs'])}">
|
||||
<i class="fa fa-file fa-1-5x"></i> Ghi nhận hệ thống
|
||||
</label>
|
||||
|
||||
@@ -15,27 +15,41 @@
|
||||
<input type='hidden' name='sync_staffs_url' value="{Url::to(['sync-staffs'])}">
|
||||
<input type='hidden' name='get_logs_sync_url' value="{Url::to(['sync-logs'])}">
|
||||
<div class="" style="font-size: 15px;">
|
||||
<label class="action-button" onclick="common.form(this, 'device');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
<label class="action-button" onclick="_getLogs(this);" data-href="{Url::to(['get-logs'])}">
|
||||
<i class="fa fa-exchange fa-1-5x"></i> Lấy các sự kiện
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['change-ip'])}">
|
||||
<i class="fa fa-pencil fa-1-5x"></i> Thay đổi địa chỉ IP
|
||||
</label>
|
||||
<label class="action-button" onclick="_sync(this);" data-href="{Url::to(['sync'])}">
|
||||
<i class="fa fa-refresh fa-1-5x"></i> Đồng bộ dữ liệu đến thiết bị
|
||||
</label>
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{if Yii::$app->user->can("deviceCreate")}
|
||||
<label class="action-button" onclick="common.form(this, 'device');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("deviceUpdate")}
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("deviceDelete")}
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("deviceSyncDeviceToServer")}
|
||||
<label class="action-button" onclick="_getLogs(this);" data-href="{Url::to(['get-logs'])}">
|
||||
<i class="fa fa-exchange fa-1-5x"></i> Lấy các sự kiện
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("deviceChangeIP")}
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['change-ip'])}">
|
||||
<i class="fa fa-pencil fa-1-5x"></i> Thay đổi địa chỉ IP
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("deviceSyncServerToDevice")}
|
||||
<label class="action-button" onclick="_sync(this);" data-href="{Url::to(['sync'])}">
|
||||
<i class="fa fa-refresh fa-1-5x"></i> Đồng bộ dữ liệu đến thiết bị
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("deviceExport")}
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{/if}
|
||||
<label class="action-button" onclick="_logs(this);" data-href="{Url::to(['logs'])}">
|
||||
<i class="fa fa-file fa-1-5x"></i> Ghi nhận hệ thống
|
||||
</label>
|
||||
|
||||
@@ -7,15 +7,21 @@
|
||||
{block name='content'}
|
||||
<div class="schedule-index">
|
||||
<div class="" style="font-size: 15px;">
|
||||
<label class="action-button" onclick="_create(this);" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
{if Yii::$app->user->can("scheduleCreate")}
|
||||
<label class="action-button" onclick="_create(this);" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("scheduleUpdate")}
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("scheduleDelete")}
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
{/if}
|
||||
</div>
|
||||
{Pjax id="schedule-list"}
|
||||
{GridView::widget([
|
||||
|
||||
@@ -7,21 +7,31 @@
|
||||
{block name='content'}
|
||||
<div class="staff-index">
|
||||
<div class="" style="font-size: 15px;">
|
||||
<label class="action-button" onclick="common.form(this, 'staff', true);" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
<label class="action-button" onclick="$('#file').trigger('click');">
|
||||
<i class="fa fa-upload fa-1-5x"></i> Nhập
|
||||
</label>
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{if Yii::$app->user->can("staffCreate")}
|
||||
<label class="action-button" onclick="common.form(this, 'staff', true);" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("staffUpdate")}
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
<i class="fa fa-edit fa-1-5x"></i> Tùy chỉnh
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("staffDelete")}
|
||||
<label class="action-button" onclick="_delete(this);" data-href="{Url::to(['delete'])}">
|
||||
<i class="fa fa-trash fa-1-5x"></i> Xóa
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("staffImport")}
|
||||
<label class="action-button" onclick="$('#file').trigger('click');">
|
||||
<i class="fa fa-upload fa-1-5x"></i> Nhập
|
||||
</label>
|
||||
{/if}
|
||||
{if Yii::$app->user->can("staffExport")}
|
||||
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
|
||||
<i class="fa fa-download fa-1-5x"></i> Xuất
|
||||
</label>
|
||||
{/if}
|
||||
<label class="action-button" onclick="_logs(this);" data-href="{Url::to(['logs'])}">
|
||||
<i class="fa fa-file fa-1-5x"></i> Ghi nhận hệ thống
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user