<?php
namespace ModulesAbstract\ElectronicInvoice\EntityQueueListing; abstract class Controller extends \App\Mvc\Controller\Window\PaginatedListing\ListingAbstract { protected $listOrderingColumns = ['addTime', 'lastUpdateTime', 'status', ]; protected $orderColumn = 'addTime'; protected $useSqlTransaction = true; protected function initialize() { parent::initialize(); $this->actionsCfg['delete'] = []; $this->actionsCfg['openServerLogs'] = ['checkSection' => true, 'checkOption' => false,]; $this->actionsCfg['openCronjobLogs'] = ['checkSection' => true, 'checkOption' => false,]; } protected function optionDefineParams(\App\Mvc\View\Utils\RowOptions\Option\Option $option, $selection) { switch ($option->getId()) { case 'delete': break; case 'openServerLogs': break; case 'openCronjobLogs': break; default: return false; } return true; } abstract protected function selectEntity($id); abstract public function getAllStatuses(); protected function actionOpenServerLogs(array $R) { $queueItem = $this->selectEntity($R['id']); $filters = $this->actionOpenServerLogsGenerateFilters($queueItem); $filters['listing[paramsSlot]'] = \Engine\RandomGenerator::randomString(4); return new \Engine\Mvc\Response\HtmlRedirect(\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/Admin/Server/Logs', 'index', $filters)); } abstract protected function actionOpenServerLogsGenerateFilters(\ModulesAbstract\ElectronicInvoice\EntityQueue\QueueItem $queueItem); protected function actionOpenCronjobLogs(array $R) { $queueItem = $this->selectEntity($R['id']); $filters = $this->actionOpenCronjobLogsGenerateFilters($queueItem); $filters['listing[paramsSlot]'] = \Engine\RandomGenerator::randomString(4); return new \Engine\Mvc\Response\HtmlRedirect(\Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/Admin/CronJobs/Logs', 'index', $filters)); } abstract protected function actionOpenCronjobLogsGenerateFilters(\ModulesAbstract\ElectronicInvoice\EntityQueue\QueueItem $queueItem); abstract protected function bulkActionDelete(array $recordsIds, \App\MessagesCollector $msgs, array $R); protected function optionGetEntityName($id) { return $id; } }