create-domain.php:

- assign smarty values only for fields that have the display_in_form flag

model/DomainHandler.php:
- initStruct(): make default_aliases display_in_form dependant on $this->new
  (it's useless in edit mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1235 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 7b15c4b47d
commit 72441d7dd6

@ -112,6 +112,7 @@ if ($error != 1 && $new) { # no error and not in edit mode - reset fields to def
}
foreach($form_fields as $key => $field) {
if($form_fields[$key]['display_in_form']) {
$smartykey = "t" . ucfirst($key); # TODO: ugly workaround until I decide on the template variable names
switch ($field['type']) {
case 'bool':
@ -123,6 +124,7 @@ foreach($form_fields as $key => $field) {
default:
$smarty->assign ($smartykey, $values[$key]);
}
}
}
$smarty->assign ('mode', $mode);

@ -117,7 +117,7 @@ class DomainHandler extends PFAHandler {
/*options*/ $this->getTransports() ),
'backupmx' => pacol( 1, 1, 1, 'bool', 'pAdminEdit_domain_backupmx' , '' ),
'active' => pacol( 1, 1, 1, 'bool', 'pAdminEdit_domain_active' , '' , 1 ),
'default_aliases' => pacol( $this->new, 1, 0, 'bool', 'pAdminCreate_domain_defaultaliases ', '' , 1,'', /*not in db*/ 1 ),
'default_aliases' => pacol( $this->new, $this->new, 0, 'bool', 'pAdminCreate_domain_defaultaliases ', '' , 1,'', /*not in db*/ 1 ),
'created' => pacol( 0, 0, 1, 'ts', '' /* TODO: "created" label */ , '' ),
'modified' => pacol( 0, 0, 1, 'ts', 'pAdminList_domain_modified' , '' ),
);

Loading…
Cancel
Save