From 7d0fa322967b780bd21086371efa3590aa5be2b4 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 9 May 2019 18:21:17 +0200 Subject: [PATCH] Merge global modification log's source and action filter See #2597 --- .../acp/templates/modificationLogList.tpl | 25 +++++-------------- .../page/ModificationLogListPage.class.php | 16 ++++++------ wcfsetup/install/lang/de.xml | 1 + wcfsetup/install/lang/en.xml | 1 + 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/modificationLogList.tpl b/wcfsetup/install/files/acp/templates/modificationLogList.tpl index 9360f8b6d1..1d70ed8623 100644 --- a/wcfsetup/install/files/acp/templates/modificationLogList.tpl +++ b/wcfsetup/install/files/acp/templates/modificationLogList.tpl @@ -37,19 +37,7 @@ -
-
-
- -
-
- -
+
@@ -93,7 +80,7 @@ -{capture assign=pageParameters}{if $username}&username={$username}{/if}{if $packageID}&packageID={@$packageID}{/if}{if $action}&action={$action}{/if}{if $afterDate}&afterDate={$afterDate}{/if}{if $beforeDate}&beforeDate={$beforeDate}{/if}{/capture} +{capture assign=pageParameters}{if $username}&username={$username}{/if}{if $action}&action={$action}{/if}{if $afterDate}&afterDate={$afterDate}{/if}{if $beforeDate}&beforeDate={$beforeDate}{/if}{/capture} {hascontent}
{content}{pages print=true assign=pagesLinks controller="ModificationLogList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$pageParameters"}{/content} diff --git a/wcfsetup/install/files/lib/acp/page/ModificationLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/ModificationLogListPage.class.php index e601e434fe..94a53bd795 100644 --- a/wcfsetup/install/files/lib/acp/page/ModificationLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/ModificationLogListPage.class.php @@ -143,9 +143,6 @@ class ModificationLogListPage extends SortablePage { if (!empty($_REQUEST['beforeDate'])) { $this->beforeDate = StringUtil::trim($_REQUEST['beforeDate']); } - if (!empty($_REQUEST['packageID'])) { - $this->packageID = intval($_REQUEST['packageID']); - } if (!empty($_REQUEST['username'])) { $this->username = StringUtil::trim($_REQUEST['username']); } @@ -192,7 +189,13 @@ class ModificationLogListPage extends SortablePage { if (!empty($this->availableObjectTypeIDs)) { $action = ''; $objectTypeID = 0; - if (preg_match('~^(?P.+)\-(?P[^\-]+)$~', $this->action, $matches)) { + $packageID = 0; + + // an integer signals all actions from the package with the relevant id + if ($this->action == intval($this->action)) { + $packageID = $this->action; + } + else if (preg_match('~^(?P.+)\-(?P[^\-]+)$~', $this->action, $matches)) { foreach ($this->objectTypes as $objectType) { if ($objectType->objectType === $matches['objectType']) { /** @var IExtendedModificationLogHandler $processor */ @@ -212,10 +215,10 @@ class ModificationLogListPage extends SortablePage { $this->objectList->getConditionBuilder()->add('modification_log.action = ?', [$action]); } else { - if (isset($this->packages[$this->packageID])) { + if (isset($this->packages[$packageID])) { $objectTypeIDs = []; foreach ($this->objectTypes as $objectType) { - if ($objectType->packageID == $this->packageID) { + if ($objectType->packageID == $packageID) { $objectTypeIDs[] = $objectType->objectTypeID; } } @@ -304,7 +307,6 @@ class ModificationLogListPage extends SortablePage { 'beforeDate' => $this->beforeDate, 'logItems' => $this->logItems, 'objectTypes' => $this->objectTypes, - 'packageID' => $this->packageID, 'packages' => $this->packages, 'unsupportedObjectTypes' => $this->unsupportedObjectTypes, 'username' => $this->username, diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index e11c09d786..3c4fcf158c 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1195,6 +1195,7 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in + package}“]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index f724f513b4..761392cfc6 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1172,6 +1172,7 @@ This protocol file contains {$data[count]} new entries. The first three error me + package}”]]> -- 2.20.1