From 15aa606e7a596fd3393f3255bb0f182969be2cc9 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 6 Jun 2020 19:52:58 +0200 Subject: [PATCH] Filtering the cronjob log Closes #3359 --- .../files/acp/templates/cronjobLogList.tpl | 54 +++++++++++++++-- .../lib/acp/page/CronjobLogListPage.class.php | 58 +++++++++++++++++++ 2 files changed, 106 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/cronjobLogList.tpl b/wcfsetup/install/files/acp/templates/cronjobLogList.tpl index 3c86a6e744..b6f8ae9e63 100644 --- a/wcfsetup/install/files/acp/templates/cronjobLogList.tpl +++ b/wcfsetup/install/files/acp/templates/cronjobLogList.tpl @@ -31,9 +31,51 @@ {/hascontent} +
+
+

{lang}wcf.global.filter{/lang}

+ +
+
+
+
+ +
+
+ +
+
+
+ +
+
+ + {event name='filterFields'} +
+ +
+ + {@SECURITY_TOKEN_INPUT_TAG} +
+
+
+ +{assign var='linkParameters' value=''} +{if $cronjobID}{capture append=linkParameters}&cronjobID={@$cronjobID}{/capture}{/if} +{if $success != -1}{capture append=linkParameters}&success={@$success}{/capture}{/if} + {hascontent}
- {content}{pages print=true assign=pagesLinks controller="CronjobLogList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}{/content} + {content}{pages print=true assign=pagesLinks controller="CronjobLogList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$linkParameters"}{/content}
{/hascontent} @@ -42,11 +84,11 @@ - - - - - + + + + + {event name='columnHeads'} diff --git a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php index a459262c61..4c7dfea87d 100755 --- a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php @@ -1,7 +1,9 @@ cronjobID = intval($_REQUEST['cronjobID']); + if (isset($_REQUEST['success'])) $this->success = intval($_REQUEST['success']); + } + /** * @inheritDoc */ @@ -57,6 +84,13 @@ class CronjobLogListPage extends SortablePage { $this->objectList->sqlSelects = "cronjob.*"; $this->objectList->sqlJoins = "LEFT JOIN wcf".WCF_N."_cronjob cronjob ON (cronjob.cronjobID = cronjob_log.cronjobID)"; + + if ($this->cronjobID) { + $this->objectList->getConditionBuilder()->add('cronjob_log.cronjobID = ?', [$this->cronjobID]); + } + if ($this->success != -1) { + $this->objectList->getConditionBuilder()->add('cronjob_log.success = ?', [$this->success]); + } } /** @@ -67,4 +101,28 @@ class CronjobLogListPage extends SortablePage { parent::readObjects(); } + + /** + * @inheritDoc + */ + public function readData() { + parent::readData(); + + $this->availableCronjobs = new CronjobList(); + $this->availableCronjobs->sqlOrderBy = 'cronjobID'; + $this->availableCronjobs->readObjects(); + } + + /** + * @inheritDoc + */ + public function assignVariables() { + parent::assignVariables(); + + WCF::getTPL()->assign([ + 'cronjobID' => $this->cronjobID, + 'success' => $this->success, + 'availableCronjobs' => $this->availableCronjobs, + ]); + } } -- 2.20.1
{lang}wcf.global.objectID{/lang}{lang}wcf.acp.cronjob.className{/lang}{lang}wcf.acp.cronjob.description{/lang}{lang}wcf.acp.cronjob.log.execTime{/lang}{lang}wcf.acp.cronjob.log.status{/lang}{lang}wcf.global.objectID{/lang}{lang}wcf.acp.cronjob.className{/lang}{lang}wcf.acp.cronjob.description{/lang}{lang}wcf.acp.cronjob.log.execTime{/lang}{lang}wcf.acp.cronjob.log.status{/lang}