Changed the default of the debug flag when generating grid data. The original intention was to have it debug by default, so that debugging would be on if the url were manually typed in. That has never been needed though, and this change not only results in cleaner logic, it makes sure we have no issues with routing.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@546 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -38,7 +38,21 @@ class AppController extends Controller {
|
|||||||
var $helpers = array('Html', 'Form', 'Javascript', 'Format', 'Time', 'Grid');
|
var $helpers = array('Html', 'Form', 'Javascript', 'Format', 'Time', 'Grid');
|
||||||
var $components = array('DebugKit.Toolbar');
|
var $components = array('DebugKit.Toolbar');
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
$this->params['dev'] = false;
|
||||||
|
$this->params['admin'] = false;
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
function sideMenuLinks() {
|
function sideMenuLinks() {
|
||||||
|
// Stupid Cake... our constructor sets admin/dev,
|
||||||
|
// but cake stomps it somewhere along the way
|
||||||
|
// after constructing the CakeError controller.
|
||||||
|
if ($this->name === 'CakeError') {
|
||||||
|
$this->params['dev'] = false;
|
||||||
|
$this->params['admin'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$menu = array();
|
$menu = array();
|
||||||
$menu[] = array('name' => 'Common', 'header' => true);
|
$menu[] = array('name' => 'Common', 'header' => true);
|
||||||
$menu[] = array('name' => 'Site Map', 'url' => array('controller' => 'maps', 'action' => 'view', 1));
|
$menu[] = array('name' => 'Site Map', 'url' => array('controller' => 'maps', 'action' => 'view', 1));
|
||||||
@@ -52,7 +66,8 @@ class AppController extends Controller {
|
|||||||
$menu[] = array('name' => 'Accounts', 'url' => array('controller' => 'accounts', 'action' => 'index'));
|
$menu[] = array('name' => 'Accounts', 'url' => array('controller' => 'accounts', 'action' => 'index'));
|
||||||
$menu[] = array('name' => 'Contacts', 'url' => array('controller' => 'contacts', 'action' => 'index'));
|
$menu[] = array('name' => 'Contacts', 'url' => array('controller' => 'contacts', 'action' => 'index'));
|
||||||
$menu[] = array('name' => 'Ledgers', 'url' => array('controller' => 'ledgers', 'action' => 'index'));
|
$menu[] = array('name' => 'Ledgers', 'url' => array('controller' => 'ledgers', 'action' => 'index'));
|
||||||
$menu[] = array('name' => 'New Ledgers', 'url' => array('controller' => 'accounts', 'action' => 'newledger'));
|
$menu[] = array('name' => 'New Ledgers', 'url' => array('controller' => 'accounts', 'action' => 'newledger'));
|
||||||
|
$menu[] = array('name' => 'Assess Charges', 'url' => array('controller' => 'leases', 'action' => 'assess_all'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->params['dev']) {
|
if ($this->params['dev']) {
|
||||||
@@ -178,16 +193,10 @@ class AppController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gridDataSetup(&$params) {
|
function gridDataSetup(&$params) {
|
||||||
// Assume we're debugging.
|
// Debug only if requested
|
||||||
// The actual grid request will set this to false
|
$params['debug'] = !empty($this->passedArgs['debug']);
|
||||||
$debug = true;
|
|
||||||
|
|
||||||
if (isset($this->passedArgs['debug']))
|
if ($params['debug']) {
|
||||||
$debug = $this->passedArgs['debug'];
|
|
||||||
|
|
||||||
$params['debug'] = $debug;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
ob_start();
|
ob_start();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ $javascript->link('pmgr_jqGrid', false);
|
|||||||
// as part of the data fetch.
|
// as part of the data fetch.
|
||||||
$url = $html->url(array('controller' => $controller,
|
$url = $html->url(array('controller' => $controller,
|
||||||
'action' => 'gridData',
|
'action' => 'gridData',
|
||||||
'debug' => 0,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// Create extra parameters that jqGrid will pass to our
|
// Create extra parameters that jqGrid will pass to our
|
||||||
@@ -202,11 +201,11 @@ foreach (array_merge(array('loadComplete' => '', 'loadError' => ''),
|
|||||||
|
|
||||||
if ($event == 'loadComplete') {
|
if ($event == 'loadComplete') {
|
||||||
$grid_events[$event] =
|
$grid_events[$event] =
|
||||||
array('--special' => "function($params) {url=jQuery('#{$grid_id}').getGridParam('url');url=url.replace(/\/debug.*$/,'?'); pd=jQuery('#{$grid_id}').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#{$grid_id}-query').html('<A HREF=\"'+url+'\">Grid Query</A><BR>'); $statement;}");
|
array('--special' => "function($params) {url=jQuery('#{$grid_id}').getGridParam('url');url=url+'/debug:1?'; pd=jQuery('#{$grid_id}').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#{$grid_id}-query').html('<A HREF=\"'+url+'\">Grid Query</A><BR>'); $statement;}");
|
||||||
}
|
}
|
||||||
elseif ($event == 'loadError') {
|
elseif ($event == 'loadError') {
|
||||||
$grid_events[$event] =
|
$grid_events[$event] =
|
||||||
array('--special' => "function($params) {url=jQuery('#{$grid_id}').getGridParam('url');url=url.replace(/\/debug.*$/,'?'); pd=jQuery('#{$grid_id}').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#{$grid_id}-query').html('<A HREF=\"'+url+'\">Grid Error Query</A><BR>'); $statement;}");
|
array('--special' => "function($params) {url=jQuery('#{$grid_id}').getGridParam('url');url=url+'/debug:1?'; pd=jQuery('#{$grid_id}').getPostData();$.each(pd,function(i){ url+=i+'='+escape(pd[i])+'&'; }); jQuery('#{$grid_id}-query').html('<A HREF=\"'+url+'\">Grid Error Query</A><BR>'); $statement;}");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$grid_events[$event] =
|
$grid_events[$event] =
|
||||||
|
|||||||
Reference in New Issue
Block a user