|
- <?php
-
-
-
- namespace backend\controllers;
-
- use domain\Ticket\Ticket\Ticket;
- use domain\Ticket\Ticket\TicketSearch;
- use yii\filters\AccessControl;
-
-
- class SupportAdminController extends SupportController
- {
- public function behaviors()
- {
- return [
- 'access' => [
- 'class' => AccessControl::class,
- 'rules' => [
- [
- 'allow' => true,
- 'roles' => ['@'],
- 'matchCallback' => function ($rule, $action) {
- return $this->getUserModule()
- ->getAuthorizationChecker()
- ->isGrantedAsAdministrator($this->getUserCurrent());
- }
- ]
- ],
- ],
- ];
- }
-
- public function actionIndex()
- {
- $searchTicket = new TicketSearch();
- $dataProviderTicketOpen = $searchTicket->search('admin', ['TicketSearch' => ['status' => Ticket::STATUS_OPEN]]);
- $dataProviderTicketClosed = $searchTicket->search('admin', ['TicketSearch' => ['status' => Ticket::STATUS_CLOSED]]);
-
- return $this->render('@backend/views/support/index', [
- 'context' => 'admin',
- 'searchTicket' => $searchTicket,
- 'dataProviderTicketOpen' => $dataProviderTicketOpen,
- 'dataProviderTicketClosed' => $dataProviderTicketClosed
- ]);
- }
-
- }
|