Modified customer merge functionality to leave everything from the destination customer in-tact, and simply add on contacts from the source customer, if requested. This simplifies things significantly, and also the paradigm shift of starting the operation from the destination customer allows us to merge multiple customers into one with ease (no need to dig around for each source customer before clicking merge)

git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@995 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2010-07-02 20:52:00 +00:00
parent 34844760e8
commit 11aacd5803
4 changed files with 72 additions and 177 deletions

View File

@@ -466,9 +466,9 @@ class CustomersController extends AppController {
$customer = $customer['Customer'];
if (empty($customer))
$this->INTERNAL_ERROR("Customer $id does not exist");
$this->set('src_customer', $customer);
$this->set('src_name', $customer['name']);
$this->set('src_id', $id);
$this->set('dst_customer', $customer);
$this->set('dst_name', $customer['name']);
$this->set('dst_id', $id);
}
else {
$this->INTERNAL_ERROR("Merge called with invalid customer");
@@ -483,8 +483,7 @@ class CustomersController extends AppController {
$post = $this->params['form'];
$this->Customer->merge($post['dst-id'], $post['src-id'],
unserialize($post['contact-ids']),
$post['primary-contact-id']);
unserialize($post['contact-ids']));
$this->redirect(array('action'=>'view', $post['dst-id']));
}