Add the new variable `FileProcessorFormField::$bigPreview` with getter and setter.
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / acp / page / CronjobLogListPage.class.php
CommitLineData
11ade432 1<?php
a9229942 2
11ade432 3namespace wcf\acp\page;
a9229942 4
15aa606e 5use wcf\data\cronjob\CronjobList;
3addc94c 6use wcf\data\cronjob\I18nCronjobList;
157054c9 7use wcf\data\cronjob\log\CronjobLogList;
11ade432 8use wcf\page\SortablePage;
15aa606e 9use wcf\system\WCF;
11ade432
AE
10
11/**
a987a4ac 12 * Shows cronjob log information.
a9229942
TD
13 *
14 * @author Marcel Werk
15 * @copyright 2001-2019 WoltLab GmbH
16 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
a9229942
TD
17 *
18 * @property CronjobLogList $objectList
11ade432 19 */
a9229942
TD
20class CronjobLogListPage extends SortablePage
21{
22 /**
23 * @inheritDoc
24 */
25 public $activeMenuItem = 'wcf.acp.menu.link.log.cronjob';
26
27 /**
28 * @inheritDoc
29 */
30 public $neededPermissions = ['admin.management.canManageCronjob'];
31
32 /**
33 * @inheritDoc
34 */
35 public $itemsPerPage = 100;
36
37 /**
38 * @inheritDoc
39 */
40 public $defaultSortField = 'execTime';
41
42 /**
43 * @inheritDoc
44 */
45 public $defaultSortOrder = 'DESC';
46
47 /**
48 * @inheritDoc
49 */
50 public $validSortFields = ['cronjobID', 'className', 'description', 'execTime', 'success'];
51
52 /**
53 * @inheritDoc
54 */
55 public $objectListClassName = CronjobLogList::class;
56
57 /**
58 * @var int
59 */
60 public $cronjobID = 0;
61
62 /**
63 * @var int
64 */
65 public $success = -1;
66
67 /**
68 * @var CronjobList
69 */
70 public $availableCronjobs;
71
72 /**
73 * @inheritDoc
74 */
75 public function readParameters()
76 {
77 parent::readParameters();
78
79 if (!empty($_REQUEST['cronjobID'])) {
80 $this->cronjobID = \intval($_REQUEST['cronjobID']);
81 }
82 if (isset($_REQUEST['success'])) {
83 $this->success = \intval($_REQUEST['success']);
84 }
85 }
86
87 /**
88 * @inheritDoc
89 */
90 protected function initObjectList()
91 {
92 parent::initObjectList();
93
94 $this->objectList->sqlSelects = "cronjob.*";
d3bd0a85
MS
95 $this->objectList->sqlJoins = "
96 LEFT JOIN wcf" . WCF_N . "_cronjob cronjob
97 ON cronjob.cronjobID = cronjob_log.cronjobID";
a9229942
TD
98
99 if ($this->cronjobID) {
100 $this->objectList->getConditionBuilder()->add('cronjob_log.cronjobID = ?', [$this->cronjobID]);
101 }
102 if ($this->success != -1) {
103 $this->objectList->getConditionBuilder()->add('cronjob_log.success = ?', [$this->success]);
104 }
105 }
106
107 /**
108 * @inheritDoc
109 */
110 protected function readObjects()
111 {
112 $this->sqlOrderBy = (($this->sortField == 'className' || $this->sortField == 'description') ? 'cronjob.' : 'cronjob_log.') . $this->sortField . " " . $this->sortOrder;
113
114 parent::readObjects();
115 }
116
117 /**
118 * @inheritDoc
119 */
120 public function readData()
121 {
122 parent::readData();
123
124 $this->availableCronjobs = new I18nCronjobList();
125 $this->availableCronjobs->sqlOrderBy = 'descriptionI18n';
126 $this->availableCronjobs->readObjects();
127 }
128
129 /**
130 * @inheritDoc
131 */
132 public function assignVariables()
133 {
134 parent::assignVariables();
135
136 WCF::getTPL()->assign([
137 'cronjobID' => $this->cronjobID,
138 'success' => $this->success,
139 'availableCronjobs' => $this->availableCronjobs,
140 ]);
141 }
11ade432 142}