Implemented ability to add a customer, and fixed the problem with flagging of the primary contact.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@220 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -6,6 +6,7 @@ class CustomersController extends AppController {
|
||||
array('name' => 'Current', 'url' => array('controller' => 'customers', 'action' => 'current')),
|
||||
array('name' => 'Past', 'url' => array('controller' => 'customers', 'action' => 'past')),
|
||||
array('name' => 'All', 'url' => array('controller' => 'customers', 'action' => 'all')),
|
||||
array('name' => 'Add Tenant', 'url' => array('controller' => 'customers', 'action' => 'add')),
|
||||
);
|
||||
|
||||
//var $components = array('RequestHandler');
|
||||
@@ -286,6 +287,9 @@ class CustomersController extends AppController {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->data['Customer']['primary_contact_id']
|
||||
= $this->data['Contact'][$this->data['Customer']['primary_contact_entry']]['id'];
|
||||
|
||||
$this->Customer->create();
|
||||
if (!$this->Customer->save($this->data, false)) {
|
||||
pr("CUSTOMER SAVE FAILED");
|
||||
@@ -367,6 +371,7 @@ class CustomersController extends AppController {
|
||||
*/
|
||||
|
||||
function add() {
|
||||
$this->edit();
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user