| @@ -10,15 +10,17 @@ | ||
| 10 | 10 | use AcyMailing\Helpers\WorkflowHelper; |
| 11 | 11 | |
| 12 | 12 | trait Scheduled |
| 13 | 13 | { |
| 14 | - public function scheduled() | |
| 14 | + public function scheduled(): void | |
| 15 | 15 | { |
| 16 | 16 | acym_setVar('layout', 'scheduled'); |
| 17 | 17 | |
| 18 | + // Get filters data | |
| 18 | 19 | $searchFilter = $this->getVarFiltersListing('string', 'squeue_search', ''); |
| 19 | 20 | $tagFilter = $this->getVarFiltersListing('string', 'squeue_tag', ''); |
| 20 | 21 | |
| 22 | + // Get pagination data | |
| 21 | 23 | $pagination = new PaginationHelper(); |
| 22 | 24 | $campaignsPerPage = $pagination->getListLimit(); |
| 23 | 25 | $page = $this->getVarFiltersListing('int', 'squeue_pagination_page', 1); |
| 24 | 26 | |
| @@ -31,9 +33,10 @@ | ||
| 31 | 33 | 'offset' => ($page - 1) * $campaignsPerPage, |
| 32 | 34 | ] |
| 33 | 35 | ); |
| 34 | 36 | |
| 35 | - $pagination->setStatus($matchingElements['total'], $page, $campaignsPerPage); | |
| 37 | + // Prepare the pagination | |
| 38 | + $pagination->setStatus((int)$matchingElements['total']->total, $page, $campaignsPerPage); | |
| 36 | 39 | $tagClass = new TagClass(); |
| 37 | 40 | |
| 38 | 41 | $viewData = [ |
| 39 | 42 | 'allElements' => $matchingElements['elements'], |
| @@ -51,9 +54,9 @@ | ||
| 51 | 54 | $this->breadcrumb[acym_translation('ACYM_SCHEDULED')] = acym_completeLink('queue&task=scheduled'); |
| 52 | 55 | parent::display($viewData); |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | - public function prepareScheduledToolbar(&$data) | |
| 58 | + public function prepareScheduledToolbar(array &$data): void | |
| 56 | 59 | { |
| 57 | 60 | $toolbarHelper = new ToolbarHelper(); |
| 58 | 61 | $toolbarHelper->addSearchBar($data['search'], 'squeue_search'); |
| 59 | 62 | $toolbarHelper->addFilterByTag($data, 'squeue_tag', 'acym__queue__filter__tags acym__select'); |
| @@ -65,9 +68,9 @@ | ||
| 65 | 68 | ]; |
| 66 | 69 | } |
| 67 | 70 | } |
| 68 | 71 | |
| 69 | - public function cancelScheduledSending() | |
| 72 | + public function cancelScheduledSending(): void | |
| 70 | 73 | { |
| 71 | 74 | $this->cancelSending(); |
| 72 | 75 | $this->scheduled(); |
| 73 | 76 | } |