diff --git a/site/app_controller.php b/site/app_controller.php index af2d4d0..b62eedb 100644 --- a/site/app_controller.php +++ b/site/app_controller.php @@ -99,6 +99,12 @@ class AppController extends Controller { } function redirect($url, $status = null, $exit = true) { + // OK, since the controller will not be able to + // utilize our overriden url function in AppHelper, + // we'll have to do it manually here. + App::import('Helper', 'Html'); + $url = HtmlHelper::url($url, true); + if (headers_sent()) { // If we've already sent the headers, it's because // we're debugging, and our debug output has gotten @@ -108,17 +114,15 @@ class AppController extends Controller { // the debug output. So, since we can't redirect // anyway, we may as well go with the flow and just // render this page instead, using an empty template + $this->set('message', + ("Intended redirect:
" .
+ ''.$url.''));
+
echo $this->render('/empty');
if ($exit)
$this->_stop();
}
- // OK, since the controller will not be able to
- // utilize our overriden url function in AppHelper,
- // we'll have to do it manually here.
- App::import('Helper', 'Html');
- $url = HtmlHelper::url($url, true);
-
return parent::redirect($url, $status, $exit);
}
diff --git a/site/controllers/contacts_controller.php b/site/controllers/contacts_controller.php
index eb09b2e..ea2e20d 100644
--- a/site/controllers/contacts_controller.php
+++ b/site/controllers/contacts_controller.php
@@ -126,8 +126,6 @@ class ContactsController extends AppController {
// Now that the work is done, let the user view the updated contact
$this->redirect(array('action'=>'view', $this->data['Contact']['id']));
- //$this->render('/empty');
- return;
}
if ($id) {
diff --git a/site/controllers/customers_controller.php b/site/controllers/customers_controller.php
index c0c5e1a..1439b46 100644
--- a/site/controllers/customers_controller.php
+++ b/site/controllers/customers_controller.php
@@ -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';
diff --git a/site/controllers/leases_controller.php b/site/controllers/leases_controller.php
index de91919..ed501c7 100644
--- a/site/controllers/leases_controller.php
+++ b/site/controllers/leases_controller.php
@@ -158,10 +158,6 @@ class LeasesController extends AppController {
// Since this is a new lease, go to the invoice
// screen so we can start assessing charges.
$this->redirect(array('action'=>'invoice', $lid, 'move-in'));
-
- // For debugging, only if the redirect above have been
- // commented out, otherwise this section isn't reached.
- $this->render('/empty');
}
/**************************************************************************
@@ -231,8 +227,6 @@ class LeasesController extends AppController {
/* function promote_surplus($id) { */
/* $this->Lease->promoteSurplus($id); */
-/* pr("PREVENTING REDIRECT"); */
-/* $this->render('fake'); */
/* $this->redirect(array('controller' => 'leases', */
/* 'action' => 'view', */
/* $id)); */
diff --git a/site/controllers/maps_controller.php b/site/controllers/maps_controller.php
index 79d6692..a6bc7ac 100644
--- a/site/controllers/maps_controller.php
+++ b/site/controllers/maps_controller.php
@@ -109,7 +109,7 @@ class MapsController extends AppController {
));
/* pr(compact('map', 'units')); */
-/* $this->render('/fake'); */
+/* $this->render('/empty'); */
/* return; */
/*****
@@ -171,7 +171,7 @@ class MapsController extends AppController {
}
/* pr($info); */
-/* $this->render('/fake'); */
+/* $this->render('/empty'); */
return $info;
}
diff --git a/site/controllers/tenders_controller.php b/site/controllers/tenders_controller.php
index 0f0a9fa..71b0d04 100644
--- a/site/controllers/tenders_controller.php
+++ b/site/controllers/tenders_controller.php
@@ -233,11 +233,6 @@ class TendersController extends AppController {
}
$this->redirect(array('action'=>'view', $this->Tender->id));
-
- // For debugging, only if the redirects above have been
- // commented out, otherwise this section isn't reached.
- $this->render('/fake');
- return;
}
if ($id) {
diff --git a/site/controllers/units_controller.php b/site/controllers/units_controller.php
index 7dac5ef..d04f7c7 100644
--- a/site/controllers/units_controller.php
+++ b/site/controllers/units_controller.php
@@ -308,11 +308,6 @@ class UnitsController extends AppController {
}
$this->redirect(array('action'=>'view', $this->Unit->id));
-
- // For debugging, only if the redirects above have been
- // commented out, otherwise this section isn't reached.
- $this->render('/fake');
- return;
}
if ($id) {
diff --git a/site/views/empty.ctp b/site/views/empty.ctp
index e69de29..3888feb 100644
--- a/site/views/empty.ctp
+++ b/site/views/empty.ctp
@@ -0,0 +1,5 @@
+