Cleaned up several places regarding redirect and rendering during development for debug purposes. Also, added a link to the intended redirect target when we've rendered instead. These changes haven't been tested, hopefully they are benign.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@563 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -287,23 +287,20 @@ class CustomersController extends AppController {
|
||||
if (isset($this->params['form']['cancel'])) {
|
||||
if (isset($this->data['Customer']['id']))
|
||||
$this->redirect(array('action'=>'view', $this->data['Customer']['id']));
|
||||
else
|
||||
$this->redirect(array('action'=>'index'));
|
||||
return;
|
||||
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
|
||||
// Make sure we have at least one contact
|
||||
if (!isset($this->data['Contact']) || count($this->data['Contact']) == 0) {
|
||||
$this->Session->setFlash("MUST SPECIFY AT LEAST ONE CONTACT", true);
|
||||
$this->redirect(array('action'=>'view', $this->data['Customer']['id']));
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure there is a primary contact
|
||||
if (!isset($this->data['Customer']['primary_contact_entry'])) {
|
||||
$this->Session->setFlash("MUST SPECIFY A PRIMARY CONTACT", true);
|
||||
$this->redirect(array('action'=>'view', $this->data['Customer']['id']));
|
||||
return;
|
||||
}
|
||||
|
||||
// Go through each customer and strip the bogus ID if new
|
||||
@@ -320,17 +317,12 @@ class CustomersController extends AppController {
|
||||
pr("CUSTOMER SAVE FAILED");
|
||||
}
|
||||
|
||||
// If existing customer, then view it. Otherwise, since
|
||||
// this is a new customer, go to the move in screen.
|
||||
// If existing customer, then view it.
|
||||
if ($this->data['Customer']['id'])
|
||||
$this->redirect(array('action'=>'view', $this->Customer->id));
|
||||
else
|
||||
$this->redirect(array('action'=>'move_in', $this->Customer->id));
|
||||
|
||||
// For debugging, only if the redirects above have been
|
||||
// commented out, otherwise this section isn't reached.
|
||||
$this->render('/empty');
|
||||
return;
|
||||
// Since this is a new customer, go to the move in screen.
|
||||
$this->redirect(array('action'=>'move_in', $this->Customer->id));
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
@@ -499,7 +491,8 @@ class CustomersController extends AppController {
|
||||
|
||||
/* pr(compact('unreconciled')); */
|
||||
/* echo htmlspecialchars($xml->serialize($unreconciled)); */
|
||||
/* $this->render('/fake'); */
|
||||
/* $this->render('/empty'); */
|
||||
/* return; */
|
||||
|
||||
$opts = array();
|
||||
//$opts['format'] = 'tags';
|
||||
|
||||
Reference in New Issue
Block a user