Implemented edit functionality for customer. Like with contacts, the interface leaves much to be desired, since it's limited in functionality. Namely, you can add a contact, but you can't add contact methods (phone/mail/email). Also, it doesn't use jqGrid to present the selection choices, and so the user is stuck with the fields we've chosen to display, as well as the sort order we've chosen. Enhancement is possible someday, but for now, it gets the job done.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@219 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-06 02:06:23 +00:00
parent 207808d6d5
commit e150237fd8
5 changed files with 379 additions and 1 deletions

View File

@@ -1,7 +1,8 @@
<?php
class Contact extends AppModel {
var $name = 'Contact';
var $displayField = 'display_name';
var $validate = array(
'id' => array('numeric'),
'display_name' => array('notempty'),
@@ -11,6 +12,7 @@ class Contact extends AppModel {
var $hasMany = array(
'ContactsMethod',
'ContactsCustomer',
);
var $hasAndBelongsToMany = array(
@@ -35,5 +37,12 @@ class Contact extends AppModel {
),
);
function contactList() {
return $this->find('list',
array('order' =>
//array('last_name', 'first_name', 'middle_name'),
array('display_name'),
));
}
}
?>

View File

@@ -0,0 +1,11 @@
<?php
class ContactsCustomer extends AppModel {
var $primaryKey = false;
var $belongsTo = array(
'Contact',
'Customer',
);
}
?>

View File

@@ -20,6 +20,7 @@ class Customer extends AppModel {
),
'Lease',
'LedgerEntry',
'ContactsCustomer',
);
var $hasAndBelongsToMany = array(