Add `email` filter to EmailLogList
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 19 May 2021 07:39:14 +0000 (09:39 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 19 May 2021 07:41:30 +0000 (09:41 +0200)
Resolves #4224

wcfsetup/install/files/acp/templates/emailLogList.tpl
wcfsetup/install/files/lib/acp/page/EmailLogListPage.class.php

index c8f38a838be7962a40d8c13294b1199f4523a804..13cc8f725f39720be31f124fc346b3d2fe94e1b2 100644 (file)
                                </dd>
                        </dl>
                        
+                       {if $__wcf->session->getPermission('admin.user.canEditMailAddress')}
+                               <dl class="col-xs-12 col-md-4">
+                                       <dt></dt>
+                                       <dd>
+                                               <input
+                                                       class="long"
+                                                       name="filter[email]"
+                                                       placeholder="{lang}wcf.user.email{/lang}"
+                                                       type="email"
+                                                       value="{$filter[email]}"
+                                               >
+                                       </dd>
+                               </dl>
+                       {/if}
+
                        <dl class="col-xs-12 col-md-4">
                                <dt></dt>
                                <dd>
index e1ae17ab47b45db8f22ecbf5936206df8e620822..a908d08c61c447140d71c4607af9b186bdf4b1c1 100644 (file)
@@ -61,6 +61,7 @@ class EmailLogListPage extends SortablePage
     public $filter = [
         'username' => null,
         'status' => null,
+        'email' => null,
     ];
 
     /**
@@ -105,6 +106,11 @@ class EmailLogListPage extends SortablePage
         if (!empty($this->filter['status'])) {
             $this->objectList->getConditionBuilder()->add('status = ?', [$this->filter['status']]);
         }
+        if (WCF::getSession()->getPermission('admin.user.canEditMailAddress')) {
+            if (!empty($this->filter['email'])) {
+                $this->objectList->getConditionBuilder()->add('recipient = ?', [$this->filter['email']]);
+            }
+        }
     }
 
     /**