Commit | Line | Data |
---|---|---|
11ade432 | 1 | <?php |
308c880f | 2 | declare(strict_types=1); |
11ade432 | 3 | namespace wcf\acp\page; |
157054c9 | 4 | use wcf\data\cronjob\log\CronjobLogList; |
11ade432 | 5 | use wcf\page\SortablePage; |
11ade432 AE |
6 | |
7 | /** | |
a987a4ac | 8 | * Shows cronjob log information. |
11ade432 AE |
9 | * |
10 | * @author Marcel Werk | |
c839bd49 | 11 | * @copyright 2001-2018 WoltLab GmbH |
11ade432 | 12 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 | 13 | * @package WoltLabSuite\Core\Acp\Page |
fe4f149a MS |
14 | * |
15 | * @property CronjobLogList $objectList | |
11ade432 AE |
16 | */ |
17 | class CronjobLogListPage extends SortablePage { | |
264c6eea | 18 | /** |
0fcfe5f6 | 19 | * @inheritDoc |
264c6eea MS |
20 | */ |
21 | public $activeMenuItem = 'wcf.acp.menu.link.log.cronjob'; | |
22 | ||
11ade432 | 23 | /** |
0fcfe5f6 | 24 | * @inheritDoc |
11ade432 | 25 | */ |
058cbd6a | 26 | public $neededPermissions = ['admin.management.canManageCronjob']; |
11ade432 AE |
27 | |
28 | /** | |
0fcfe5f6 | 29 | * @inheritDoc |
11ade432 AE |
30 | */ |
31 | public $itemsPerPage = 100; | |
32 | ||
33 | /** | |
0fcfe5f6 | 34 | * @inheritDoc |
11ade432 AE |
35 | */ |
36 | public $defaultSortField = 'execTime'; | |
37 | ||
38 | /** | |
0fcfe5f6 | 39 | * @inheritDoc |
11ade432 AE |
40 | */ |
41 | public $defaultSortOrder = 'DESC'; | |
9f959ced | 42 | |
e34164d2 | 43 | /** |
0fcfe5f6 | 44 | * @inheritDoc |
e34164d2 | 45 | */ |
058cbd6a | 46 | public $validSortFields = ['cronjobID', 'className', 'description', 'execTime', 'success']; |
11ade432 AE |
47 | |
48 | /** | |
0fcfe5f6 | 49 | * @inheritDoc |
d726f13d | 50 | */ |
157054c9 | 51 | public $objectListClassName = CronjobLogList::class; |
11ade432 AE |
52 | |
53 | /** | |
0fcfe5f6 | 54 | * @inheritDoc |
11ade432 AE |
55 | */ |
56 | protected function initObjectList() { | |
57 | parent::initObjectList(); | |
58 | ||
59 | $this->objectList->sqlSelects = "cronjob.*"; | |
60 | $this->objectList->sqlJoins = "LEFT JOIN wcf".WCF_N."_cronjob cronjob ON (cronjob.cronjobID = cronjob_log.cronjobID)"; | |
11ade432 AE |
61 | } |
62 | ||
63 | /** | |
0fcfe5f6 | 64 | * @inheritDoc |
11ade432 AE |
65 | */ |
66 | protected function readObjects() { | |
c4c3440e | 67 | $this->sqlOrderBy = (($this->sortField == 'className' || $this->sortField == 'description') ? 'cronjob.' : 'cronjob_log.').$this->sortField." ".$this->sortOrder; |
11ade432 AE |
68 | |
69 | parent::readObjects(); | |
70 | } | |
11ade432 | 71 | } |