Merge global modification log's source and action filter
authorMatthias Schmidt <gravatronics@live.com>
Thu, 9 May 2019 16:21:17 +0000 (18:21 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 9 May 2019 16:21:17 +0000 (18:21 +0200)
See #2597

wcfsetup/install/files/acp/templates/modificationLogList.tpl
wcfsetup/install/files/lib/acp/page/ModificationLogListPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 9360f8b6d1a0117e1f7f14ba60b8aac1bb276214..1d70ed8623bd445ea0cc2920627f885010c46a16 100644 (file)
                                </dd>
                        </dl>
                        
-                       <dl class="col-xs-12 col-md-4">
-                               <dt></dt>
-                               <dd>
-                                       <select name="packageID" id="packageID">
-                                               <option value="0"{if $packageID === 0} selected{/if}>{lang}wcf.acp.modificationLog.package.all{/lang}</option>
-                                               {foreach from=$packages item=package}
-                                                       <option value="{@$package->packageID}"{if $packageID == $package->packageID} selected{/if}>{$package}</option>
-                                               {/foreach}
-                                       </select>
-                               </dd>
-                       </dl>
-                       
-                       <dl class="col-xs-12 col-md-4">
+                       <dl class="col-xs-12 col-md-8">
                                <dt></dt>
                                <dd>
                                        <select name="action" id="action">
                                                {foreach from=$actions key=_packageID item=$availableActions}
                                                        {assign var=_package value=$packages[$_packageID]}
                                                        
-                                                       <optgroup label="{$_package}" data-package-id="{@$_package->packageID}">
-                                                               {foreach from=$availableActions key=actionName item=actionLabel}
-                                                                       <option value="{$actionName}"{if $action === $actionName} selected{/if}>{$actionLabel}</option>
-                                                               {/foreach}
-                                                       </optgroup>
+                                                       <option value="{@$_package->packageID}"{if $action == $_package->packageID} selected{/if}>{lang package=$_package}wcf.acp.modificationLog.action.allPackageActions{/lang}</option>
+                                                       {foreach from=$availableActions key=actionName item=actionLabel}
+                                                               <option value="{$actionName}"{if $action === $actionName} selected{/if}>{@'&nbsp;'|str_repeat:4}{$actionLabel}</option>
+                                                       {/foreach}
                                                {/foreach}
                                        </select>
                                </dd>
@@ -93,7 +80,7 @@
        </section>
 </form>
 
-{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}
        <div class="paginationTop">
                {content}{pages print=true assign=pagesLinks controller="ModificationLogList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$pageParameters"}{/content}
index e601e434fe75f8762cffe4c76846da069f76e56d..94a53bd7955d5cfac980a1dfd550ea0a0c16ac23 100644 (file)
@@ -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<objectType>.+)\-(?P<action>[^\-]+)$~', $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<objectType>.+)\-(?P<action>[^\-]+)$~', $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,
index e11c09d786ae772b359c4a57301a5cfff1216616..3c4fcf158c13ff9d92760533d3cdbc4b6aa58a03 100644 (file)
@@ -1195,6 +1195,7 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in
                <item name="wcf.acp.modificationLog.time.afterDate"><![CDATA[Ab dem Zeitpunkt]]></item>
                <item name="wcf.acp.modificationLog.time.beforeDate"><![CDATA[Vor dem Zeitpunkt]]></item>
                <item name="wcf.acp.modificationLog.unsupportedObjectTypes"><![CDATA[Einige Typen werden aktuell nicht unterstützt und müssen zuvor vom Hersteller angepasst werden.]]></item>
+               <item name="wcf.acp.modificationLog.action.allPackageActions"><![CDATA[Alle Aktionen aus „{$package->package}“]]></item>
        </category>
        <category name="wcf.acp.notice">
                <item name="wcf.acp.notice.add"><![CDATA[Hinweis hinzufügen]]></item>
index f724f513b4b4ed449abec65e95db85d21c1d432f..761392cfc6bcd5efe638062a03422178c643283c 100644 (file)
@@ -1172,6 +1172,7 @@ This protocol file contains {$data[count]} new entries. The first three error me
                <item name="wcf.acp.modificationLog.time.afterDate"><![CDATA[After the date]]></item>
                <item name="wcf.acp.modificationLog.time.beforeDate"><![CDATA[Before the date]]></item>
                <item name="wcf.acp.modificationLog.unsupportedObjectTypes"><![CDATA[Some types are currently not supported and require changes to be made by the vendor.]]></item>
+               <item name="wcf.acp.modificationLog.action.allPackageActions"><![CDATA[All Actions from “{$package->package}”]]></item>
        </category>
        <category name="wcf.acp.notice">
                <item name="wcf.acp.notice.add"><![CDATA[Add Notice]]></item>