Compare commits
1 Commits
v0.3_php5.
...
v0.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82a010496d |
@@ -349,8 +349,8 @@ class AppController extends Controller {
|
|||||||
if ($this->dev() && !$this->Option->enabled('dev'))
|
if ($this->dev() && !$this->Option->enabled('dev'))
|
||||||
$this->redirect("/");
|
$this->redirect("/");
|
||||||
|
|
||||||
if ($this->dev())
|
if (!$this->dev())
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', '0');
|
||||||
|
|
||||||
$this->addDefaultSideMenuLinks();
|
$this->addDefaultSideMenuLinks();
|
||||||
//$this->sideMenuEnable('SITE', $this->op_area, false);
|
//$this->sideMenuEnable('SITE', $this->op_area, false);
|
||||||
@@ -948,17 +948,6 @@ class AppController extends Controller {
|
|||||||
'value' => $params['filtValue']);
|
'value' => $params['filtValue']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translate a user specified date into the SQL date format
|
|
||||||
foreach ($searches AS &$search) {
|
|
||||||
if (preg_match('/(_date|stamp)$/', $search['field']) &&
|
|
||||||
preg_match('%(\d{1,2})[-/](\d{1,2})[-/](\d{2,4})%', $search['value'], $matches)) {
|
|
||||||
$search['value'] = sprintf('%04d%02d%02d',
|
|
||||||
$matches[3] + ($matches[3] < 50 ? 2000 : ($matches[3] < 100 ? 1900 : 0)),
|
|
||||||
$matches[2], $matches[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unset($search);
|
|
||||||
|
|
||||||
$ops = array('eq' => array('op' => null, 'pre' => '', 'post' => ''),
|
$ops = array('eq' => array('op' => null, 'pre' => '', 'post' => ''),
|
||||||
'ne' => array('op' => '<>', 'pre' => '', 'post' => ''),
|
'ne' => array('op' => '<>', 'pre' => '', 'post' => ''),
|
||||||
'lt' => array('op' => '<', 'pre' => '', 'post' => ''),
|
'lt' => array('op' => '<', 'pre' => '', 'post' => ''),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
* In production mode, flash messages redirect after a time interval.
|
* In production mode, flash messages redirect after a time interval.
|
||||||
* In development mode, you need to click the flash message to continue.
|
* In development mode, you need to click the flash message to continue.
|
||||||
*/
|
*/
|
||||||
Configure::write('debug', 0);
|
Configure::write('debug', 2);
|
||||||
/**
|
/**
|
||||||
* Application wide charset encoding
|
* Application wide charset encoding
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -330,15 +330,13 @@ class Customer extends AppModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove any contacts which are already destination customer contacts
|
// Remove any contacts which are already destination customer contacts
|
||||||
$new_contacts = array_diff($contacts, array_keys($dst_contacts));
|
$contacts = array_diff($contacts, array_keys($dst_contacts));
|
||||||
$all_contacts = array_merge($new_contacts, array_keys($dst_contacts));
|
|
||||||
$this->pr(17, compact('new_contacts', 'all_contacts'));
|
|
||||||
|
|
||||||
// For now, we'll assume the operation will succeed.
|
// For now, we'll assume the operation will succeed.
|
||||||
$ret = true;
|
$ret = true;
|
||||||
|
|
||||||
// Add each desired source customer contact to the destination customer
|
// Add each desired source customer contact to the destination customer
|
||||||
foreach ($new_contacts AS $contact_id) {
|
foreach ($contacts AS $contact_id) {
|
||||||
$CM = new ContactsCustomer();
|
$CM = new ContactsCustomer();
|
||||||
if (!$CM->save(array('customer_id' => $dst_id)
|
if (!$CM->save(array('customer_id' => $dst_id)
|
||||||
+ $src_contacts[$contact_id], false)) {
|
+ $src_contacts[$contact_id], false)) {
|
||||||
@@ -374,7 +372,7 @@ class Customer extends AppModel {
|
|||||||
$this->delete($src_id);
|
$this->delete($src_id);
|
||||||
|
|
||||||
// Delete all the orphaned customers
|
// Delete all the orphaned customers
|
||||||
foreach (array_diff(array_keys($src_contacts), $all_contacts) AS $contact_id) {
|
foreach (array_diff(array_keys($src_contacts), $contacts) AS $contact_id) {
|
||||||
// Delete un-used or duplicate contacts
|
// Delete un-used or duplicate contacts
|
||||||
// REVISIT <AP> 20100702:
|
// REVISIT <AP> 20100702:
|
||||||
// Not sure if we really want to do this.
|
// Not sure if we really want to do this.
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ class Lease extends AppModel {
|
|||||||
function conditionDelinquent($table_name = 'Lease') {
|
function conditionDelinquent($table_name = 'Lease') {
|
||||||
if (empty($table_name)) $t = ''; else $t = $table_name . '.';
|
if (empty($table_name)) $t = ''; else $t = $table_name . '.';
|
||||||
return ("({$t}close_date IS NULL AND" .
|
return ("({$t}close_date IS NULL AND" .
|
||||||
" NOW() > DATE_ADD({$t}paid_through_date, INTERVAL 1 DAY))");
|
" NOW() > DATE_ADD({$t}paid_through_date, INTERVAL 10 DAY))");
|
||||||
}
|
}
|
||||||
|
|
||||||
function delinquentDaysSQL($table_name = 'Lease') {
|
function delinquentDaysSQL($table_name = 'Lease') {
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class ToolbarComponent extends Object {
|
|||||||
trigger_error(sprintf(__('Could not load DebugToolbar panel %s', true), $panel), E_USER_WARNING);
|
trigger_error(sprintf(__('Could not load DebugToolbar panel %s', true), $panel), E_USER_WARNING);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$panelObj = new $className();
|
$panelObj =& new $className();
|
||||||
if (is_subclass_of($panelObj, 'DebugPanel') || is_subclass_of($panelObj, 'debugpanel')) {
|
if (is_subclass_of($panelObj, 'DebugPanel') || is_subclass_of($panelObj, 'debugpanel')) {
|
||||||
$this->panels[$panel] =& $panelObj;
|
$this->panels[$panel] =& $panelObj;
|
||||||
}
|
}
|
||||||
@@ -456,7 +456,7 @@ class LogPanel extends DebugPanel {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function _parseFile($filename) {
|
function _parseFile($filename) {
|
||||||
$file = new File($filename);
|
$file =& new File($filename);
|
||||||
$contents = $file->read();
|
$contents = $file->read();
|
||||||
$timePattern = '/(\d{4}-\d{2}\-\d{2}\s\d{1,2}\:\d{1,2}\:\d{1,2})/';
|
$timePattern = '/(\d{4}-\d{2}\-\d{2}\s\d{1,2}\:\d{1,2}\:\d{1,2})/';
|
||||||
$chunks = preg_split($timePattern, $contents, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
$chunks = preg_split($timePattern, $contents, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class DebugViewTestCase extends CakeTestCase {
|
|||||||
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
||||||
Router::parse('/');
|
Router::parse('/');
|
||||||
$this->Controller =& ClassRegistry::init('Controller');
|
$this->Controller =& ClassRegistry::init('Controller');
|
||||||
$this->View = new DebugView($this->Controller, false);
|
$this->View =& new DebugView($this->Controller, false);
|
||||||
$this->_debug = Configure::read('debug');
|
$this->_debug = Configure::read('debug');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ class DebugViewTestCase extends CakeTestCase {
|
|||||||
'here' => '/posts/index',
|
'here' => '/posts/index',
|
||||||
);
|
);
|
||||||
$this->Controller->layout = 'default';
|
$this->Controller->layout = 'default';
|
||||||
$View = new DebugView($this->Controller, false);
|
$View =& new DebugView($this->Controller, false);
|
||||||
$View->render('index');
|
$View->render('index');
|
||||||
|
|
||||||
$result = DebugKitDebugger::getTimers();
|
$result = DebugKitDebugger::getTimers();
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ class FirePhpToolbarHelperTestCase extends CakeTestCase {
|
|||||||
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
||||||
Router::parse('/');
|
Router::parse('/');
|
||||||
|
|
||||||
$this->Toolbar = new ToolbarHelper(array('output' => 'DebugKit.FirePhpToolbar'));
|
$this->Toolbar =& new ToolbarHelper(array('output' => 'DebugKit.FirePhpToolbar'));
|
||||||
$this->Toolbar->FirePhpToolbar = new FirePhpToolbarHelper();
|
$this->Toolbar->FirePhpToolbar =& new FirePhpToolbarHelper();
|
||||||
|
|
||||||
$this->Controller =& ClassRegistry::init('Controller');
|
$this->Controller =& ClassRegistry::init('Controller');
|
||||||
if (isset($this->_debug)) {
|
if (isset($this->_debug)) {
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ class HtmlToolbarHelperTestCase extends CakeTestCase {
|
|||||||
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
||||||
Router::parse('/');
|
Router::parse('/');
|
||||||
|
|
||||||
$this->Toolbar = new ToolbarHelper(array('output' => 'DebugKit.HtmlToolbar'));
|
$this->Toolbar =& new ToolbarHelper(array('output' => 'DebugKit.HtmlToolbar'));
|
||||||
$this->Toolbar->HtmlToolbar = new HtmlToolbarHelper();
|
$this->Toolbar->HtmlToolbar =& new HtmlToolbarHelper();
|
||||||
$this->Toolbar->HtmlToolbar->Html = new HtmlHelper();
|
$this->Toolbar->HtmlToolbar->Html =& new HtmlHelper();
|
||||||
$this->Toolbar->HtmlToolbar->Javascript = new JavascriptHelper();
|
$this->Toolbar->HtmlToolbar->Javascript =& new JavascriptHelper();
|
||||||
|
|
||||||
$this->Controller =& ClassRegistry::init('Controller');
|
$this->Controller =& ClassRegistry::init('Controller');
|
||||||
if (isset($this->_debug)) {
|
if (isset($this->_debug)) {
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ $timers = DebugKitDebugger::getTimers();
|
|||||||
?>
|
?>
|
||||||
<h2><?php __('Timers'); ?></h2>
|
<h2><?php __('Timers'); ?></h2>
|
||||||
<p class="request-time">
|
<p class="request-time">
|
||||||
<?php $totalTime = sprintf(__('%s (seconds)', true), DebugKitDebugger::requestTime()); ?>
|
<?php $totalTime = sprintf(__('%s (seconds)', true), $number->precision(DebugKitDebugger::requestTime(), 6)); ?>
|
||||||
<?php echo $toolbar->message(__('Total Request Time:', true), $totalTime)?>
|
<?php echo $toolbar->message(__('Total Request Time:', true), $totalTime)?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php foreach ($timers as $timerName => $timeInfo):
|
<?php foreach ($timers as $timerName => $timeInfo):
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
$timeInfo['message'],
|
$timeInfo['message'],
|
||||||
$timeInfo['time']
|
$number->precision($timeInfo['time'], 6)
|
||||||
);
|
);
|
||||||
$headers = array(__('Message', true), __('time in seconds', true));
|
$headers = array(__('Message', true), __('time in seconds', true));
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
Reference in New Issue
Block a user