| @@ -1,79 +1,0 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -namespace AcyMailing\Controllers\Queue; | |
| 4 | - | |
| 5 | -use AcyMailing\Classes\QueueClass; | |
| 6 | -use AcyMailing\Classes\TagClass; | |
| 7 | -use AcyMailing\Helpers\PaginationHelper; | |
| 8 | -use AcyMailing\Helpers\ToolbarHelper; | |
| 9 | -use AcyMailing\Helpers\WorkflowHelper; | |
| 10 | - | |
| 11 | -trait Detailed | |
| 12 | -{ | |
| 13 | - public function detailed(): void | |
| 14 | - { | |
| 15 | - acym_setVar('layout', 'detailed'); | |
| 16 | - $pagination = new PaginationHelper(); | |
| 17 | - | |
| 18 | - $searchFilter = $this->getVarFiltersListing('string', 'dqueue_search', ''); | |
| 19 | - $tagFilter = $this->getVarFiltersListing('string', 'dqueue_tag', ''); | |
| 20 | - | |
| 21 | - $elementsPerPage = $pagination->getListLimit(); | |
| 22 | - $page = $this->getVarFiltersListing('int', 'dqueue_pagination_page', 1); | |
| 23 | - | |
| 24 | - $queueClass = new QueueClass(); | |
| 25 | - $matchingElements = $queueClass->getMatchingResults( | |
| 26 | - [ | |
| 27 | - 'search' => $searchFilter, | |
| 28 | - 'tag' => $tagFilter, | |
| 29 | - 'elementsPerPage' => $elementsPerPage, | |
| 30 | - 'offset' => ($page - 1) * $elementsPerPage, | |
| 31 | - ] | |
| 32 | - ); | |
| 33 | - | |
| 34 | - $pagination->setStatus((int)$matchingElements['total']->total, $page, $elementsPerPage); | |
| 35 | - | |
| 36 | - $tagClass = new TagClass(); | |
| 37 | - $viewData = [ | |
| 38 | - 'allElements' => $matchingElements['elements'], | |
| 39 | - 'pagination' => $pagination, | |
| 40 | - 'search' => $searchFilter, | |
| 41 | - 'tag' => $tagFilter, | |
| 42 | - 'allTags' => $tagClass->getAllTagsByType(TagClass::TYPE_MAIL), | |
| 43 | - 'workflowHelper' => new WorkflowHelper(), | |
| 44 | - ]; | |
| 45 | - | |
| 46 | - $this->prepareToolbarDetailed($viewData); | |
| 47 | - | |
| 48 | - $this->breadcrumb[acym_translation('ACYM_QUEUE_DETAILED')] = acym_completeLink('queue&task=detailed'); | |
| 49 | - parent::display($viewData); | |
| 50 | - } | |
| 51 | - | |
| 52 | - public function prepareToolbarDetailed(array &$data): void | |
| 53 | - { | |
| 54 | - $toolbarHelper = new ToolbarHelper(); | |
| 55 | - $toolbarHelper->addSearchBar($data['search'], 'dqueue_search', 'ACYM_SEARCH'); | |
| 56 | - $otherContent = acym_modal( | |
| 57 | - '<i class="acymicon-paper-plane"></i>'.acym_translation('ACYM_SEND_ALL'), | |
| 58 | - '', | |
| 59 | - null, | |
| 60 | - ['data-reveal-larger' => true], | |
| 61 | - [ | |
| 62 | - 'class' => 'cell medium-shrink button', | |
| 63 | - 'data-reload' => 'true', | |
| 64 | - 'data-ajax' => 'true', | |
| 65 | - 'data-iframe' => '&ctrl=queue&task=continuesend&id=0&totalsend=0', | |
| 66 | - ] | |
| 67 | - ); | |
| 68 | - $toolbarHelper->addOtherContent($otherContent); | |
| 69 | - $toolbarHelper->addFilterByTag($data, 'dqueue_tag', 'acym__queue__filter__tags acym__select'); | |
| 70 | - | |
| 71 | - $data['toolbar'] = $toolbarHelper; | |
| 72 | - $data['cleartask'] = 'detailed'; | |
| 73 | - if (!empty($data['tag'])) { | |
| 74 | - $data['status_toolbar'] = [ | |
| 75 | - 'dqueue_tag' => $data['tag'], | |
| 76 | - ]; | |
| 77 | - } | |
| 78 | - } | |
| 79 | -} | |