diff --git a/views/contacts/edit.ctp b/views/contacts/edit.ctp index 5574fd9..163af2f 100644 --- a/views/contacts/edit.ctp +++ b/views/contacts/edit.ctp @@ -120,9 +120,9 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { elseif ($stype === 'new') { $fields = array ('type' => array('opts' => array('options' => $obj->varstore['phoneTypes'])), - 'phone' => null, + 'phone' => true, 'ext' => array('name' => "Extension"), - 'comment' => null, + 'comment' => true, ); } elseif ($stype === 'show') { @@ -149,12 +149,12 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { } elseif ($stype === 'new') { $fields = array - ('address' => null, - 'city' => null, - 'state' => null, + ('address' => true, + 'city' => true, + 'state' => true, 'postcode' => array('name' => 'Zip Code'), - 'country' => null, - 'comment' => null, + 'country' => true, + 'comment' => true, ); } elseif ($stype === 'show') { @@ -182,8 +182,8 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { } elseif ($stype === 'new') { $fields = array - ('email' => null, - 'comment' => null, + ('email' => true, + 'comment' => true, ); } elseif ($stype === 'show') { @@ -345,17 +345,17 @@ echo($this->element array('class' => 'item contact detail', 'caption' => isset($this->data['Contact']) ? 'Edit Contact' : 'New Contact', 'fields' => array - ('first_name' => null, - 'last_name' => null, - 'middle_name' => null, - 'display_name' => null, + ('first_name' => true, + 'last_name' => true, + 'middle_name' => true, + 'display_name' => true, 'company_name' => array('name' => 'Company'), 'id_federal' => array('name' => 'SSN'), 'id_local' => array('name' => 'ID #'), 'id_local_state' => array('name' => 'ID State'), /* 'id_local_exp' => array('name' => 'ID Expiration', */ /* 'opts' => array('empty' => true)), */ - 'comment' => null, + 'comment' => true, ))) . "\n"); echo $form->submit('Update') . "\n"; diff --git a/views/customers/edit.ctp b/views/customers/edit.ctp index b9c4ec9..9b66f61 100644 --- a/views/customers/edit.ctp +++ b/views/customers/edit.ctp @@ -120,17 +120,17 @@ function customerContactTypeDiv($obj, $stype, $values = null) { } elseif ($stype === 'new') { $fields = array - ('first_name' => null, - 'last_name' => null, - 'middle_name' => null, - 'display_name' => null, + ('first_name' => true, + 'last_name' => true, + 'middle_name' => true, + 'display_name' => true, 'company_name' => array('name' => 'Company'), 'id_federal' => array('name' => 'SSN'), 'id_local' => array('name' => 'ID #'), 'id_local_state' => array('name' => 'ID State'), /* 'id_local_exp' => array('name' => 'ID Expiration', */ /* 'opts' => array('empty' => true)), */ - 'comment' => null, + 'comment' => true, ); } elseif ($stype === 'show') { @@ -247,8 +247,8 @@ echo($this->element array('class' => 'item customer detail', 'caption' => isset($this->data['Customer']) ? 'Edit Customer' : 'New Customer', 'fields' => array - ('name' => null, - 'comment' => null, + ('name' => true, + 'comment' => true, ))) . "\n"); echo $form->submit('Update') . "\n"; diff --git a/views/elements/form_table.ctp b/views/elements/form_table.ctp index 6fc374e..cecc4ad 100644 --- a/views/elements/form_table.ctp +++ b/views/elements/form_table.ctp @@ -48,6 +48,12 @@ foreach ($fields AS $field => $config) { if (!isset($config)) continue; + if (is_bool($config) && !$config) + continue; + + if (is_bool($config) && $config) + $config = array(); + if (!isset($config['name'])) $config['name'] = implode(' ', array_map('ucfirst', explode('_', $field))); if (!isset($config['opts'])) diff --git a/views/leases/invoice.ctp b/views/leases/invoice.ctp index 76359f4..802db38 100644 --- a/views/leases/invoice.ctp +++ b/views/leases/invoice.ctp @@ -185,7 +185,7 @@ function addChargeSource(flash) { array('type' => 'text'), 'between' => 'EOM', ), - "amount" => null, + "amount" => true, "comment" => array('opts' => array('size' => 50)), ), ))) . "+\n";