backend - replace event controller with module

This commit is contained in:
Roland Schneider
2019-01-16 18:03:47 +01:00
parent 8967445a28
commit fc11ccc923
7 changed files with 11 additions and 384 deletions

View File

@@ -8,7 +8,7 @@ use common\modules\event\EventModule;
use common\modules\event\models\EventPermissions;
use Yii;
use common\models\Event;
use backend\models\EventSearch;
use common\modules\event\models\EventSearch;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\HttpException;
@@ -33,7 +33,7 @@ class EventController extends Controller
$module = EventModule::getInstance();
$allowedActions = [ 'index','view', 'reserve-card','cancel-registration','delete-registration' ];
if ( $module->mode == 'admin' ){
if ( $module->mode == 'backend' ){
$allowedActions[] = 'create';
$allowedActions[] = 'update';
$allowedActions[] = 'delete';

View File

@@ -31,7 +31,7 @@ class EventPermissions
public function __construct()
{
$moduleMode = EventModule::getInstance()->mode;
if ( $moduleMode == 'admin'){
if ( $moduleMode == 'backend'){
$this->allowCreate = true;
$this->allowDelete = true;
$this->allowEdit = true;

View File

@@ -46,6 +46,7 @@ $indexTableTemplateButtons[] = '{reserve-card}';
$allow = true;
if ( isset($item['allow'])){
$allow = $item['allow'];
unset($item['allow']);
}
if ( $allow ){
$result[] = $item;