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.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1770 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 9 years ago
parent 6e5c8f8054
commit 4ce0a57e83

@ -11,6 +11,7 @@ class AliasHandler extends PFAHandler {
protected $db_table = 'alias';
protected $id_field = 'address';
protected $domain_field = 'domain';
protected $searchfields = array('address', 'goto');
/**
*

@ -9,6 +9,7 @@ class AliasdomainHandler extends PFAHandler {
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(

@ -9,6 +9,7 @@ class MailboxHandler extends PFAHandler {
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() {

@ -46,6 +46,11 @@ abstract class PFAHandler {
# 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 @@ abstract class PFAHandler {
}
$this->initMsg();
$this->msg['show_simple_search'] = count($this->searchfields) > 0;
}
/**

@ -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}

Loading…
Cancel
Save