Finished implementation of contact edit. This is now saving everything to the database. I hope to now leverage it for a new contact. This checkin includes a bit of code in the sitelink2pmgr script that sets the customer display name. It should have been checked in several revisions ago.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@217 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-05 23:43:35 +00:00
parent c7d772be53
commit 6def9cbb02
8 changed files with 146 additions and 34 deletions

View File

@@ -40,7 +40,7 @@ function contactMethodDiv($obj, $type, $legend, $values = null) {
$stype = strtolower($sname);
$div .=
'<INPUT TYPE="radio" ' . "\n" .
//' NAME="data[Contact'.ucfirst($type).'][%{id}][source]"' . "\n" .
' NAME="data[Contact'.ucfirst($type).'][%{id}][source]"' . "\n" .
' ONCLICK="switchMethodSource(%{id}, '."'{$type}', '{$stype}'".')"' . "\n" .
' CLASS="'.$type.'-method-%{id}-source" ' . "\n" .
' ID="'.$type.'-method-%{id}-source-'.$stype.'"' . "\n" .
@@ -70,24 +70,28 @@ function contactMethodDiv($obj, $type, $legend, $values = null) {
// BEGIN method-div
'<div id="'.$type.'-%{id}-method-div"' . "\n" .
/* (isset($values) */
/* ? '<input type="hidden" name="data[Contact'.ucfirst($type).'][%{id}][ContactsMethod][id]" value="'.$values['ContactsMethod']['id'].'"/>' . "\n" */
/* : '') . */
$obj->element
('form_table',
array('class' => "item contact-{$type} entry",
'field_prefix' => 'Contact'.ucfirst($type).'.%{id}.Method',
'field_prefix' => 'Contact'.ucfirst($type).'.%{id}.ContactsMethod',
'fields' => array
('type' => array
('opts' => array
('options' => $obj->varstore['methodTypes'],
'selected' => (isset($values) ? $values['ContactsMethod']['type'] : null),
)),
'preferences' => array
(
'preference' => array
('opts' => array
('options' => $obj->varstore['methodPreferences'],
'selected' => (isset($values) ? $values['ContactsMethod']['preference'] : null),
)),
'type' => array
('opts' => array
('options' => $obj->varstore['methodTypes'],
'selected' => (isset($values) ? $values['ContactsMethod']['type'] : null),
)),
'comment' => array
('opts' => array
('value' => (isset($values) ? $values['ContactsMethod']['comment'] : null),
@@ -175,9 +179,6 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
}
}
elseif ($type === 'email') {
/* [email] => abijah@PerkinsHouse.com */
/* [comment] => */
if ($stype === 'existing') {
$fields = array
('id' => array('name' => 'Email',
@@ -402,6 +403,6 @@ echo($this->element
; // Alignment
echo $form->submit('Update') . "\n";
echo $form->submit('Cancel') . "\n";
echo $form->submit('Cancel', array('name' => 'cancel')) . "\n";
echo $form->end() . "\n";
echo '</div>' . "\n";