Fixed a bug created with each form table when that element was modified to ignore fields set to null. The original intention was that null simply meant 'no special configuration'. However, we needed a way to programatically enable/disable fields, so null was an obvious choice to use. Now that I'm about to check in, I think I should have just made a minor change to use false to skip a field, which would have been backwards compatible (except for the one place using null to exclude the field). However, it's done now, so what the heck.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@290 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-09 16:07:19 +00:00
parent 6e1eba03a0
commit 6507009acc
4 changed files with 28 additions and 22 deletions

View File

@@ -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";

View File

@@ -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";

View File

@@ -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']))

View File

@@ -185,7 +185,7 @@ function addChargeSource(flash) {
array('type' => 'text'),
'between' => '<A HREF="#" ONCLICK="datepickerEOM(\'LedgerEntry%{id}EffectiveDate\',\'LedgerEntry%{id}ThroughDate\'); return false;">EOM</A>',
),
"amount" => null,
"amount" => true,
"comment" => array('opts' => array('size' => 50)),
),
))) . "+\n";