add backend theme AdminLte, bind reception/transaction to a permission

This commit is contained in:
2015-11-23 19:55:49 +01:00
parent e13866d7da
commit bcae71155e
25 changed files with 993 additions and 128 deletions

View File

@@ -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
];
}
}