DomainHandler.php:

- add some _formatted_*() functions to get a more informative output
  (currently only used in CLI)

MailboxHandler.php:
- add TODO for reading used quota from quota/quota2 table and adding
  a formatted_quota() function



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1573 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 11 years ago
parent 04cd5c5aa4
commit 39001c3ba4

@ -183,6 +183,16 @@ class DomainHandler extends PFAHandler {
return true; return true;
} }
}
/**
* get formatted version of fields
*
* @param array values of current item
*/
public function _formatted_aliases ($item) { return $item['alias_count'] . ' / ' . $item['aliases'] ; }
public function _formatted_mailboxes($item) { return $item['mailbox_count'] . ' / ' . $item['mailboxes']; }
public function _formatted_quota ($item) { return $item['total_quota'] . ' / ' . $item['quota'] ; }
}
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

@ -32,6 +32,7 @@ class MailboxHandler extends PFAHandler {
'name' => pacol( 1, 1, 1, 'text', 'name' , 'pCreate_mailbox_name_text' , '' ), 'name' => pacol( 1, 1, 1, 'text', 'name' , 'pCreate_mailbox_name_text' , '' ),
'quota' => pacol( 1, 1, 1, 'int' , 'pEdit_mailbox_quota' , 'pEdit_mailbox_quota_text' , '' ), # in MB 'quota' => pacol( 1, 1, 1, 'int' , 'pEdit_mailbox_quota' , 'pEdit_mailbox_quota_text' , '' ), # in MB
# read_from_db_postprocess() also sets 'quotabytes' for use in init() # read_from_db_postprocess() also sets 'quotabytes' for use in init()
# TODO: read used quota from quota/quota2 table
'active' => pacol( 1, 1, 1, 'bool', 'active' , '' , 1 ), 'active' => pacol( 1, 1, 1, 'bool', 'active' , '' , 1 ),
'welcome_mail' => pacol( $this->new, $this->new, 0, 'bool', 'pCreate_mailbox_mail' , '' , 1, 'welcome_mail' => pacol( $this->new, $this->new, 0, 'bool', 'pCreate_mailbox_mail' , '' , 1,
/*options*/ '', /*options*/ '',
@ -368,6 +369,10 @@ class MailboxHandler extends PFAHandler {
$this->RAWvalues['domain'] = $domain; $this->RAWvalues['domain'] = $domain;
} }
# TODO: read used quota from quota/quota2 table, then enable _formatted_quota()
# public function _formatted_quota ($item) { return $item['used_quota'] . ' / ' . $item['quota'] ; }
/** /**
* calculate maildir path for the mailbox * calculate maildir path for the mailbox

Loading…
Cancel
Save