add backend theme AdminLte, bind reception/transaction to a permission
This commit is contained in:
@@ -56,17 +56,31 @@ class FrontendMenuStructure{
|
||||
|
||||
protected function addRecepcio(){
|
||||
if ( $this->isLogged() ){
|
||||
|
||||
$isadmin =Yii::$app->user->can('admin') ||Yii::$app->user->can('employee');
|
||||
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/customer','Reception'), 'url' => ['/customer/reception'] ];
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
||||
'items' => [
|
||||
|
||||
$items = [
|
||||
['label' => Yii::t('frontend/account-state','Default account'), 'url' => ['/account/select'] ],
|
||||
['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index'] ],
|
||||
['label' => Yii::t('frontend/account-state','Open account state'), 'url' => ['/account-state/open'] ],
|
||||
['label' => Yii::t('frontend/account-state','Close account state'), 'url' => ['/account-state/close'] ],
|
||||
['label' => Yii::t('frontend/money-movement','Money movements'), 'url' => [ '/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow ] ],
|
||||
['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ],
|
||||
['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ]
|
||||
]
|
||||
];
|
||||
|
||||
if ( $isadmin || Yii::$app->user->can('reception.transfers') ){
|
||||
$items[] = ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ];
|
||||
}
|
||||
|
||||
$items[] = ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ];
|
||||
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
||||
'items' => $items
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user