SF.net SVN: postfixadmin:[1770] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2015-04-05 20:23:45
|
Revision: 1770 http://sourceforge.net/p/postfixadmin/code/1770 Author: christian_boltz Date: 2015-04-05 20:23:38 +0000 (Sun, 05 Apr 2015) Log Message: ----------- PFAHandler: - add protected $searchfields = array(); - list of fields to search by default, if just a search term is given. This will be done with $search['_'], but that code is not implemented yet. - add $this->msg['show_simple_search'] (true if $searchfields is non-empty) list.tpl: - display search input box and search overview only if $searchfields is not empty AliasdomainHandler: - add 'alias_domain' and 'target_domain' to $searchfields MailboxHandler: - add 'username' to $searchfields AliasHandler: - add 'address' and 'goto' to $searchfields This effectively means that the search input box is no longer displayed in list.php for admin, domain and fetchmail listings. Modified Paths: -------------- trunk/model/AliasHandler.php trunk/model/AliasdomainHandler.php trunk/model/MailboxHandler.php trunk/model/PFAHandler.php trunk/templates/list.tpl Modified: trunk/model/AliasHandler.php =================================================================== --- trunk/model/AliasHandler.php 2015-04-05 19:21:15 UTC (rev 1769) +++ trunk/model/AliasHandler.php 2015-04-05 20:23:38 UTC (rev 1770) @@ -11,6 +11,7 @@ protected $db_table = 'alias'; protected $id_field = 'address'; protected $domain_field = 'domain'; + protected $searchfields = array('address', 'goto'); /** * Modified: trunk/model/AliasdomainHandler.php =================================================================== --- trunk/model/AliasdomainHandler.php 2015-04-05 19:21:15 UTC (rev 1769) +++ trunk/model/AliasdomainHandler.php 2015-04-05 20:23:38 UTC (rev 1770) @@ -9,6 +9,7 @@ protected $db_table = 'alias_domain'; protected $id_field = 'alias_domain'; protected $domain_field = 'alias_domain'; + protected $searchfields = array('alias_domain', 'target_domain'); protected function initStruct() { $this->struct=array( Modified: trunk/model/MailboxHandler.php =================================================================== --- trunk/model/MailboxHandler.php 2015-04-05 19:21:15 UTC (rev 1769) +++ trunk/model/MailboxHandler.php 2015-04-05 20:23:38 UTC (rev 1770) @@ -9,6 +9,7 @@ protected $db_table = 'mailbox'; protected $id_field = 'username'; protected $domain_field = 'domain'; + protected $searchfields = array('username'); # init $this->struct, $this->db_table and $this->id_field protected function initStruct() { Modified: trunk/model/PFAHandler.php =================================================================== --- trunk/model/PFAHandler.php 2015-04-05 19:21:15 UTC (rev 1769) +++ trunk/model/PFAHandler.php 2015-04-05 20:23:38 UTC (rev 1770) @@ -46,6 +46,11 @@ # disable for "edit password" forms protected $skip_empty_pass = true; + # fields to search when using simple search ("?search[_]=...") + # array with one or more fields to search (all fields will be OR'ed in the query) + # searchmode is always 'contains' (using LIKE "%searchterm%") + protected $searchfields = array(); + /** * internal variables - filled by methods of *Handler */ @@ -189,6 +194,7 @@ } $this->initMsg(); + $this->msg['show_simple_search'] = count($this->searchfields) > 0; } /** Modified: trunk/templates/list.tpl =================================================================== --- trunk/templates/list.tpl 2015-04-05 19:21:15 UTC (rev 1769) +++ trunk/templates/list.tpl 2015-04-05 20:23:38 UTC (rev 1770) @@ -5,9 +5,12 @@ <input class="button" type="submit" name="go" value="{$PALANG.go}" /> {/if} </form> -{#form_search#} +{if $msg.show_simple_search} + {#form_search#} +{/if} </div> +{if $msg.show_simple_search} {if ($search|count > 0)} <div class='searchparams'> <p>{$PALANG.searchparams} @@ -19,6 +22,7 @@ <span><a href="list.php?table={$table}&reset_search=1">[x]</a></span> </div> {/if} +{/if} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |