Compare commits
36 Commits
sandbox_0.
...
pre_0.1_wo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e8426fd79 | ||
|
|
6630cdfcd6 | ||
|
|
48d332f40f | ||
|
|
3ede96dad9 | ||
|
|
3e3dff31a8 | ||
|
|
3642724b5e | ||
|
|
0ad68f4d6a | ||
|
|
2628edfbdd | ||
|
|
740bcbedc0 | ||
|
|
2f3046294d | ||
|
|
7a2034aea0 | ||
|
|
bb4046e1da | ||
|
|
f717713842 | ||
|
|
5008452089 | ||
|
|
68a1397ad6 | ||
|
|
ef64644536 | ||
|
|
72ea84ad88 | ||
|
|
0f3aa42f57 | ||
|
|
fb23b7ffaa | ||
|
|
b731ee6165 | ||
|
|
34dcbd8b43 | ||
|
|
87a2ea5cd6 | ||
|
|
6492cd8b22 | ||
|
|
f6a18cbb6c | ||
|
|
7198d7e6f4 | ||
|
|
d79077e279 | ||
|
|
cea9332ac6 | ||
|
|
bf8aaea041 | ||
|
|
63704682fa | ||
|
|
63de5641a0 | ||
|
|
5f6a9ed53f | ||
|
|
328d0f8f51 | ||
|
|
aee6832374 | ||
|
|
63e22ec9bf | ||
|
|
fde8923814 | ||
|
|
696017a82a |
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@ 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');
|
||||||
|
|
||||||
var $sidemenu = array('areas' => array('SITE' => false, 'CONTROLLER' => false, 'ACTION' => false));
|
var $sidemenu = array('areas' => array('SITE' => false, 'CONTROLLER' => false, 'ACTION' => false, 'SANDBOX' => false));
|
||||||
var $std_area = 10;
|
var $std_area = 10;
|
||||||
var $admin_area = 20;
|
var $admin_area = 20;
|
||||||
var $dev_area = 30;
|
var $dev_area = 30;
|
||||||
@@ -71,6 +71,8 @@ class AppController extends Controller {
|
|||||||
$name = Inflector::humanize($this->params['controller']);
|
$name = Inflector::humanize($this->params['controller']);
|
||||||
elseif ($area == 'ACTION')
|
elseif ($area == 'ACTION')
|
||||||
$name = Inflector::humanize(Inflector::singularize($this->params['controller']));
|
$name = Inflector::humanize(Inflector::singularize($this->params['controller']));
|
||||||
|
elseif ($area == 'SANDBOX')
|
||||||
|
$name = 'Sandbox';
|
||||||
|
|
||||||
if (empty($this->sidemenu['areas'][$area]))
|
if (empty($this->sidemenu['areas'][$area]))
|
||||||
$this->sidemenu['areas'][$area]
|
$this->sidemenu['areas'][$area]
|
||||||
@@ -197,7 +199,6 @@ class AppController extends Controller {
|
|||||||
array('controller' => 'transactions', 'action' => 'deposit'), null,
|
array('controller' => 'transactions', 'action' => 'deposit'), null,
|
||||||
'SITE');
|
'SITE');
|
||||||
|
|
||||||
|
|
||||||
$this->addSideMenuLink('Accounts',
|
$this->addSideMenuLink('Accounts',
|
||||||
array('controller' => 'accounts', 'action' => 'index'), null,
|
array('controller' => 'accounts', 'action' => 'index'), null,
|
||||||
'SITE', $this->admin_area);
|
'SITE', $this->admin_area);
|
||||||
@@ -219,10 +220,6 @@ class AppController extends Controller {
|
|||||||
$this->addSideMenuLink('Stmt Entries',
|
$this->addSideMenuLink('Stmt Entries',
|
||||||
array('controller' => 'statement_entries', 'action' => 'index'), null,
|
array('controller' => 'statement_entries', 'action' => 'index'), null,
|
||||||
'SITE', $this->admin_area);
|
'SITE', $this->admin_area);
|
||||||
$this->addSideMenuLink('Assess Charges',
|
|
||||||
array('controller' => 'leases', 'action' => 'assess_all'), null,
|
|
||||||
'SITE', $this->admin_area);
|
|
||||||
|
|
||||||
|
|
||||||
$this->addSideMenuLink('Un-Nuke',
|
$this->addSideMenuLink('Un-Nuke',
|
||||||
'#', array('htmlAttributes' =>
|
'#', array('htmlAttributes' =>
|
||||||
@@ -237,22 +234,50 @@ class AppController extends Controller {
|
|||||||
$this->addSideMenuLink('New Receipt',
|
$this->addSideMenuLink('New Receipt',
|
||||||
array('controller' => 'customers', 'action' => 'receipt'), null,
|
array('controller' => 'customers', 'action' => 'receipt'), null,
|
||||||
'SITE', $this->op_area);
|
'SITE', $this->op_area);
|
||||||
|
|
||||||
$this->addSideMenuLink('New Invoice',
|
$this->addSideMenuLink('New Invoice',
|
||||||
array('controller' => 'leases', 'action' => 'invoice'), null,
|
array('controller' => 'leases', 'action' => 'invoice'), null,
|
||||||
'SITE', $this->op_area);
|
'SITE', $this->op_area);
|
||||||
|
|
||||||
$this->addSideMenuLink('Move-In',
|
$this->addSideMenuLink('Move-In',
|
||||||
array('controller' => 'customers', 'action' => 'move_in'), null,
|
array('controller' => 'customers', 'action' => 'move_in'), null,
|
||||||
'SITE', $this->op_area);
|
'SITE', $this->op_area);
|
||||||
|
|
||||||
$this->addSideMenuLink('Move-Out',
|
$this->addSideMenuLink('Move-Out',
|
||||||
array('controller' => 'leases', 'action' => 'move_out'), null,
|
array('controller' => 'leases', 'action' => 'move_out'), null,
|
||||||
'SITE', $this->op_area);
|
'SITE', $this->op_area);
|
||||||
|
|
||||||
$this->addSideMenuLink('New Deposit',
|
$this->addSideMenuLink('New Deposit',
|
||||||
array('controller' => 'tenders', 'action' => 'deposit'), null,
|
array('controller' => 'tenders', 'action' => 'deposit'), null,
|
||||||
'SITE', $this->op_area);
|
'SITE', $this->op_area);
|
||||||
|
if (!empty($this->params['admin']))
|
||||||
|
$this->addSideMenuLink('Assess Charges',
|
||||||
|
array('controller' => 'leases', 'action' => 'assess_all'), null,
|
||||||
|
'SITE', $this->op_area);
|
||||||
|
|
||||||
|
$url_components = array('plugin', 'controller', 'action', 'named');
|
||||||
|
if (devbox()) {
|
||||||
|
/* $sources = ConnectionManager::sourceList(); */
|
||||||
|
/* $db = ConnectionManager::getDataSource($sources[0])->config['database']; */
|
||||||
|
/* $this->sideMenuAreaName($db, 'SANDBOX', $this->std_area); */
|
||||||
|
$this->sideMenuAreaName('DevBox', 'SANDBOX', $this->std_area);
|
||||||
|
$this->addSideMenuLink('Rebuild DevBox',
|
||||||
|
array('controller' => 'util', 'action' => 'rebuild_devbox'), null,
|
||||||
|
'SANDBOX');
|
||||||
|
}
|
||||||
|
elseif (sandbox()) {
|
||||||
|
$this->addSideMenuLink('Rebuild Sandbox',
|
||||||
|
array('controller' => 'util', 'action' => 'rebuild_sandbox'), null,
|
||||||
|
'SANDBOX');
|
||||||
|
$this->addSideMenuLink('Leave Sandbox',
|
||||||
|
array('sand_route' => false)
|
||||||
|
+ array_intersect_key($this->params, array_flip($url_components))
|
||||||
|
+ $this->params['pass'],
|
||||||
|
null, 'SANDBOX');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->addSideMenuLink('Enter Sandbox',
|
||||||
|
array('sand_route' => true)
|
||||||
|
+ array_intersect_key($this->params, array_flip($url_components))
|
||||||
|
+ $this->params['pass'],
|
||||||
|
null, 'SANDBOX');
|
||||||
|
}
|
||||||
|
|
||||||
// REVISIT <AP>: 20090824
|
// REVISIT <AP>: 20090824
|
||||||
// Depending on preference, we may put this into the gridView
|
// Depending on preference, we may put this into the gridView
|
||||||
@@ -279,14 +304,18 @@ class AppController extends Controller {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function beforeFilter() {
|
function beforeFilter() {
|
||||||
$this->params['dev'] = $this->Option->enabled('dev');
|
$this->params['user'] = $this->Permission->User->currentUser();
|
||||||
$this->params['admin'] = $this->Option->enabled('admin');
|
$this->params['admin'] = $this->Option->enabled('admin');
|
||||||
|
$this->params['dev'] = devbox();
|
||||||
|
|
||||||
|
if ($this->params['dev'] && !$this->Option->enabled('dev'))
|
||||||
|
$this->redirect("/");
|
||||||
|
|
||||||
if (!$this->params['dev'])
|
if (!$this->params['dev'])
|
||||||
Configure::write('debug', '0');
|
Configure::write('debug', '0');
|
||||||
|
|
||||||
$this->addDefaultSideMenuLinks();
|
$this->addDefaultSideMenuLinks();
|
||||||
$this->sideMenuEnable('SITE', $this->op_area, false);
|
//$this->sideMenuEnable('SITE', $this->op_area, false);
|
||||||
|
|
||||||
foreach ($this->sidemenu['areas'] AS $area_name => $area) {
|
foreach ($this->sidemenu['areas'] AS $area_name => $area) {
|
||||||
if (empty($this->params['dev']))
|
if (empty($this->params['dev']))
|
||||||
@@ -295,10 +324,12 @@ class AppController extends Controller {
|
|||||||
$this->sideMenuEnable($area_name, $this->admin_area, false);
|
$this->sideMenuEnable($area_name, $this->admin_area, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->authorize("controller.{$this->params['controller']}");
|
|
||||||
$this->authorize("controller.{$this->params['controller']}");
|
$this->authorize("controller.{$this->params['controller']}");
|
||||||
$this->authorize("action.{$this->params['controller']}.{$this->params['action']}");
|
$this->authorize("action.{$this->params['controller']}.{$this->params['action']}");
|
||||||
$this->authorize("action.{$this->params['controller']}.{$this->params['action']}");
|
|
||||||
|
$this->log('----------------------------------------------------------------------', 'request');
|
||||||
|
$this->log('----------------------------------------------------------------------', 'request');
|
||||||
|
$this->log($this->params, 'request');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -349,7 +380,7 @@ class AppController extends Controller {
|
|||||||
unset($area);
|
unset($area);
|
||||||
|
|
||||||
// Activate a default section (unless already specified)
|
// Activate a default section (unless already specified)
|
||||||
foreach (array_reverse($this->sidemenu['areas']) AS $area_name => $area) {
|
foreach (array_reverse(array_diff_key($this->sidemenu['areas'], array('SANDBOX'=>1))) AS $area_name => $area) {
|
||||||
if (empty($area))
|
if (empty($area))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -398,36 +429,6 @@ class AppController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
**************************************************************************
|
|
||||||
**************************************************************************
|
|
||||||
* function: reset_data
|
|
||||||
* - Development function. TO BE DELETED
|
|
||||||
*/
|
|
||||||
|
|
||||||
function reset_data() {
|
|
||||||
$this->layout = null;
|
|
||||||
$this->autoLayout = false;
|
|
||||||
$this->autoRender = false;
|
|
||||||
Configure::write('debug', '0');
|
|
||||||
$script = $_SERVER['DOCUMENT_ROOT'] . '/pmgr/build.cmd';
|
|
||||||
echo "<P>" . date('r') . "\n";
|
|
||||||
//echo "<P>Script: $script" . "\n";
|
|
||||||
$db = & $this->Account->getDataSource();
|
|
||||||
$script .= ' "' . $db->config['database'] . '"';
|
|
||||||
$script .= ' "' . $db->config['login'] . '"';
|
|
||||||
$script .= ' "' . $db->config['password'] . '"';
|
|
||||||
$handle = popen($script . ' 2>&1', 'r');
|
|
||||||
//echo "<P>Handle: $handle; " . gettype($handle) . "\n";
|
|
||||||
echo "<P><PRE>\n";
|
|
||||||
while (($read = fread($handle, 2096))) {
|
|
||||||
echo $read;
|
|
||||||
}
|
|
||||||
echo "</PRE>\n";
|
|
||||||
pclose($handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -599,7 +600,7 @@ class AppController extends Controller {
|
|||||||
// Grouping (which would not be typical)
|
// Grouping (which would not be typical)
|
||||||
$query['group'] = $this->gridDataCountGroup($params, $model);
|
$query['group'] = $this->gridDataCountGroup($params, $model);
|
||||||
|
|
||||||
// DEBUG PURPOSES ONLY!
|
if ($params['debug'])
|
||||||
$params['count_query'] = $query;
|
$params['count_query'] = $query;
|
||||||
|
|
||||||
// Get the number of records prior to pagination
|
// Get the number of records prior to pagination
|
||||||
@@ -856,7 +857,7 @@ class AppController extends Controller {
|
|||||||
isset($params['sidx']) ? $params['sidx'] : null,
|
isset($params['sidx']) ? $params['sidx'] : null,
|
||||||
isset($params['sord']) ? $params['sord'] : null);
|
isset($params['sord']) ? $params['sord'] : null);
|
||||||
|
|
||||||
// DEBUG PURPOSES ONLY!
|
if ($params['debug'])
|
||||||
$params['query'] = $query;
|
$params['query'] = $query;
|
||||||
|
|
||||||
return $this->gridDataRecordsExecute($params, $model, $query);
|
return $this->gridDataRecordsExecute($params, $model, $query);
|
||||||
@@ -980,6 +981,7 @@ class AppController extends Controller {
|
|||||||
$this->gridDataPostProcessLinks($params, $model, $records, array());
|
$this->gridDataPostProcessLinks($params, $model, $records, array());
|
||||||
|
|
||||||
// DEBUG PURPOSES ONLY!
|
// DEBUG PURPOSES ONLY!
|
||||||
|
//if ($params['debug'])
|
||||||
//$params['records'] = $records;
|
//$params['records'] = $records;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,6 +1059,7 @@ class AppController extends Controller {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// DEBUG PURPOSES ONLY!
|
// DEBUG PURPOSES ONLY!
|
||||||
|
//if ($params['debug'])
|
||||||
//$params['linkrecord'][] = compact('table', 'field', 'id', 'controller', 'record');
|
//$params['linkrecord'][] = compact('table', 'field', 'id', 'controller', 'record');
|
||||||
$record[$table][$field] =
|
$record[$table][$field] =
|
||||||
'<A HREF="' .
|
'<A HREF="' .
|
||||||
|
|||||||
@@ -38,5 +38,13 @@ App::import('Core', 'Helper');
|
|||||||
*/
|
*/
|
||||||
class AppHelper extends Helper {
|
class AppHelper extends Helper {
|
||||||
|
|
||||||
|
function url($url = null, $full = false) {
|
||||||
|
foreach(array('sand_route', 'dev_route') AS $mod) {
|
||||||
|
if (isset($this->params[$mod]) && is_array($url) && !isset($url[$mod]))
|
||||||
|
$url[$mod] = $this->params[$mod];
|
||||||
|
}
|
||||||
|
return parent::url($url, $full);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -509,7 +509,7 @@ class AppModel extends Model {
|
|||||||
|
|
||||||
function INTERNAL_ERROR($msg, $depth = 0, $force_stop = false) {
|
function INTERNAL_ERROR($msg, $depth = 0, $force_stop = false) {
|
||||||
INTERNAL_ERROR($msg, $force_stop, $depth+1);
|
INTERNAL_ERROR($msg, $force_stop, $depth+1);
|
||||||
echo $this->requestAction(array('controller' => 'accounts',
|
echo $this->requestAction(array('controller' => 'util',
|
||||||
'action' => 'render_empty'),
|
'action' => 'render_empty'),
|
||||||
array('return', 'bare' => false)
|
array('return', 'bare' => false)
|
||||||
);
|
);
|
||||||
|
|||||||
5
site/build_devbox.cmd
Normal file
5
site/build_devbox.cmd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@echo off
|
||||||
|
mysqldump --user=pmgr --password=pmgruser --opt property_manager > H:\pmgr_dev.sql
|
||||||
|
mysql --user=pmgr --password=pmgruser --database=pmgr_dev < H:\pmgr_dev.sql
|
||||||
|
del H:\pmgr_dev.sql
|
||||||
|
echo Build Complete!
|
||||||
5
site/build_sandbox.cmd
Normal file
5
site/build_sandbox.cmd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@echo off
|
||||||
|
mysqldump --user=pmgr --password=pmgruser --opt property_manager > H:\pmgr_sand.sql
|
||||||
|
mysql --user=pmgr --password=pmgruser --database=pmgr_sand < H:\pmgr_sand.sql
|
||||||
|
del H:\pmgr_sand.sql
|
||||||
|
echo Build Complete!
|
||||||
@@ -33,14 +33,28 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function sandbox() {
|
function sandbox() {
|
||||||
return preg_match("%^/[^/]*sand/%", $_SERVER['REQUEST_URI']);
|
$r = Router::requestRoute();
|
||||||
|
return !empty($r[3]['sand_route']);
|
||||||
|
}
|
||||||
|
|
||||||
|
function devbox() {
|
||||||
|
$r = Router::requestRoute();
|
||||||
|
return !empty($r[3]['dev_route']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function server_request_var($var) {
|
function server_request_var($var) {
|
||||||
return (preg_match("/^HTTP/", $var));
|
if (preg_match("/^HTTP_ACCEPT|REMOTE_PORT/", $var))
|
||||||
|
return false;
|
||||||
|
return (preg_match("/^HTTP|REQUEST|REMOTE/", $var));
|
||||||
}
|
}
|
||||||
|
|
||||||
function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
|
function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
|
||||||
|
$O = new Object();
|
||||||
|
for ($i=0; $i<3; ++$i) {
|
||||||
|
$O->log(str_repeat("\\", 80));
|
||||||
|
$O->log(str_repeat("/", 80));
|
||||||
|
}
|
||||||
|
$O->log("INTERNAL ERROR: $message");
|
||||||
echo '<DIV class="internal-error" style="color:#000; background:#c22; padding:0.5em 1.5em 0.5em 1.5em;">' . "\n";
|
echo '<DIV class="internal-error" style="color:#000; background:#c22; padding:0.5em 1.5em 0.5em 1.5em;">' . "\n";
|
||||||
echo '<H1 style="color:#000; margin-bottom:0.2em; font-size:2em;">INTERNAL ERROR:</H1>' . "\n";
|
echo '<H1 style="color:#000; margin-bottom:0.2em; font-size:2em;">INTERNAL ERROR:</H1>' . "\n";
|
||||||
echo '<H2 style="color:#000; margin-top:0; margin-left:1.5em; font-size:1.5em">' . $message . '</H2>' . "\n";
|
echo '<H2 style="color:#000; margin-top:0; margin-left:1.5em; font-size:1.5em">' . $message . '</H2>' . "\n";
|
||||||
@@ -48,8 +62,10 @@ function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
|
|||||||
echo '<BR>It is a problem within the application itself and should be reported to the administrator.</H4>' . "\n";
|
echo '<BR>It is a problem within the application itself and should be reported to the administrator.</H4>' . "\n";
|
||||||
|
|
||||||
// Print out the entire stack trace
|
// Print out the entire stack trace
|
||||||
|
$O->log(str_repeat("-", 30));
|
||||||
|
$O->log("Stack:");
|
||||||
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nStack Trace:\n";
|
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nStack Trace:\n";
|
||||||
echo '<OL style="margin-left:1.5em";>' . "\n";
|
echo '<OL style="margin-top:0.5em; margin-left:0.0em";>' . "\n";
|
||||||
$trace = array_slice(debug_backtrace(false), $drop);
|
$trace = array_slice(debug_backtrace(false), $drop);
|
||||||
for ($i = 0; $i < count($trace); ++$i) {
|
for ($i = 0; $i < count($trace); ++$i) {
|
||||||
$bline = $trace[$i]['line'];
|
$bline = $trace[$i]['line'];
|
||||||
@@ -65,23 +81,36 @@ function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
|
|||||||
$bclas = null;
|
$bclas = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$O->log(" $bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")");
|
||||||
echo("<LI>$bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")</LI>\n");
|
echo("<LI>$bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")</LI>\n");
|
||||||
}
|
}
|
||||||
echo "</OL>\n";
|
echo "</OL>\n";
|
||||||
|
|
||||||
|
$O->log(str_repeat("-", 30));
|
||||||
|
$O->log("HTTP Request:");
|
||||||
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nHTTP Request:\n";
|
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nHTTP Request:\n";
|
||||||
echo '<P><PRE style="color:#000; background:#c22; padding:0.5em 0 0 0;">' . "\n";
|
echo '<UL style="margin-top:0.5em; margin-left:0.0em";>' . "\n";
|
||||||
print_r($_REQUEST);
|
foreach($_REQUEST AS $k => $v) {
|
||||||
echo "</PRE>\n";
|
$O->log(sprintf(" %-20s => %s", $k, $v));
|
||||||
|
echo("<LI>$k => $v</LI>\n");
|
||||||
|
}
|
||||||
|
echo "</UL>\n";
|
||||||
|
|
||||||
|
$O->log(str_repeat("-", 30));
|
||||||
|
$O->log("Server:");
|
||||||
|
$SRV = array_intersect_key($_SERVER, array_flip(array_filter(array_keys($_SERVER), 'server_request_var')));
|
||||||
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nServer:\n";
|
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nServer:\n";
|
||||||
echo '<P><PRE style="color:#000; background:#c22; padding:0.5em 0 0 0;">' . "\n";
|
echo '<UL style="margin-top:0.5em; margin-left:0.0em";>' . "\n";
|
||||||
print_r(array_intersect_key($_SERVER, array_flip(array_filter(array_keys($_SERVER), 'server_request_var'))));
|
foreach($SRV AS $k => $v) {
|
||||||
echo "</PRE>\n";
|
if ($k == 'REQUEST_TIME')
|
||||||
|
$v = date('c', $v);
|
||||||
|
$O->log(sprintf(" %-20s => %s", $k, $v));
|
||||||
|
echo("<LI>$k => $v</LI>\n");
|
||||||
|
}
|
||||||
|
echo "</UL>\n";
|
||||||
|
|
||||||
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\n";
|
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\n";
|
||||||
echo 'Started: ' . date('c', $_SERVER['REQUEST_TIME']) . "<BR>\n";
|
echo date('c') . "<BR>\n";
|
||||||
echo 'Current: ' . date('c') . "<BR>\n";
|
|
||||||
|
|
||||||
echo '</DIV>';
|
echo '</DIV>';
|
||||||
if ($exit)
|
if ($exit)
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ class DATABASE_CONFIG {
|
|||||||
);
|
);
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
if (devbox())
|
||||||
|
$this->default['database'] = 'pmgr_dev';
|
||||||
if (sandbox())
|
if (sandbox())
|
||||||
$this->default['database'] = 'pmgr_sand';
|
$this->default['database'] = 'pmgr_sand';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,20 @@ $default_path = array('controller' => 'maps', 'action' => 'view', '1');
|
|||||||
*/
|
*/
|
||||||
Router::connect('/', $default_path);
|
Router::connect('/', $default_path);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Route for sandbox functionality
|
||||||
|
*/
|
||||||
|
Router::connect('/sand',
|
||||||
|
array('sand_route' => true) + $default_path);
|
||||||
|
Router::connect('/sand/:controller/:action/*',
|
||||||
|
array('sand_route' => true, 'action' => null));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Route for developement functionality
|
||||||
|
*/
|
||||||
|
Router::connect('/dev',
|
||||||
|
array('dev_route' => true) + $default_path);
|
||||||
|
Router::connect('/dev/:controller/:action/*',
|
||||||
|
array('dev_route' => true, 'action' => null));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -23,9 +23,9 @@ class CustomersController extends AppController {
|
|||||||
array('controller' => 'customers', 'action' => 'all'), null,
|
array('controller' => 'customers', 'action' => 'all'), null,
|
||||||
'CONTROLLER');
|
'CONTROLLER');
|
||||||
|
|
||||||
$this->addSideMenuLink('New Customer',
|
/* $this->addSideMenuLink('New Customer', */
|
||||||
array('controller' => 'customers', 'action' => 'add'), null,
|
/* array('controller' => 'customers', 'action' => 'add'), null, */
|
||||||
'CONTROLLER', $this->new_area);
|
/* 'CONTROLLER', $this->new_area); */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -394,6 +394,10 @@ class LeasesController extends AppController {
|
|||||||
$this->set(compact('default_late'));
|
$this->set(compact('default_late'));
|
||||||
|
|
||||||
if ($type === 'move-in') {
|
if ($type === 'move-in') {
|
||||||
|
// Make sure we have a valid lease that we're moving in
|
||||||
|
if (empty($lease))
|
||||||
|
$this->redirect(array('action' => 'index'));
|
||||||
|
|
||||||
$movein = array();
|
$movein = array();
|
||||||
$movein['time'] = strtotime($lease['Lease']['movein_date']);
|
$movein['time'] = strtotime($lease['Lease']['movein_date']);
|
||||||
$movein['effective_time'] = strtotime($lease['Lease']['movein_date']);
|
$movein['effective_time'] = strtotime($lease['Lease']['movein_date']);
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ class TransactionsController extends AppController {
|
|||||||
function invoice() { $this->gridView('Invoices'); }
|
function invoice() { $this->gridView('Invoices'); }
|
||||||
function receipt() { $this->gridView('Receipts'); }
|
function receipt() { $this->gridView('Receipts'); }
|
||||||
function deposit() {
|
function deposit() {
|
||||||
$this->addSideMenuLink('New Deposit',
|
/* $this->addSideMenuLink('New Deposit', */
|
||||||
array('controller' => 'tenders', 'action' => 'deposit'), null,
|
/* array('controller' => 'tenders', 'action' => 'deposit'), null, */
|
||||||
'CONTROLLER', $this->new_area);
|
/* 'CONTROLLER', $this->new_area); */
|
||||||
$this->gridView('Deposits');
|
$this->gridView('Deposits');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class TransactionsController extends AppController {
|
|||||||
* - handles the creation of a charge invoice
|
* - handles the creation of a charge invoice
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function postInvoice() {
|
function postInvoice($redirect = true) {
|
||||||
if (!$this->RequestHandler->isPost()) {
|
if (!$this->RequestHandler->isPost()) {
|
||||||
echo('<H2>THIS IS NOT A POST FOR SOME REASON</H2>');
|
echo('<H2>THIS IS NOT A POST FOR SOME REASON</H2>');
|
||||||
return;
|
return;
|
||||||
@@ -127,6 +127,17 @@ class TransactionsController extends AppController {
|
|||||||
die("<H1>INVOICE FAILED</H1>");
|
die("<H1>INVOICE FAILED</H1>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($redirect) {
|
||||||
|
if (!empty($this->data['Customer']['id']))
|
||||||
|
$this->redirect(array('controller' => 'customers',
|
||||||
|
'action' => 'receipt',
|
||||||
|
$this->data['Customer']['id']));
|
||||||
|
else
|
||||||
|
$this->redirect(array('controller' => 'leases',
|
||||||
|
'action' => 'view',
|
||||||
|
$this->data['Lease']['id']));
|
||||||
|
}
|
||||||
|
|
||||||
$this->layout = null;
|
$this->layout = null;
|
||||||
$this->autoLayout = false;
|
$this->autoLayout = false;
|
||||||
$this->autoRender = false;
|
$this->autoRender = false;
|
||||||
@@ -140,7 +151,7 @@ class TransactionsController extends AppController {
|
|||||||
* - handles the creation of a receipt
|
* - handles the creation of a receipt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function postReceipt() {
|
function postReceipt($redirect = true) {
|
||||||
if (!$this->RequestHandler->isPost()) {
|
if (!$this->RequestHandler->isPost()) {
|
||||||
echo('<H2>THIS IS NOT A POST FOR SOME REASON</H2>');
|
echo('<H2>THIS IS NOT A POST FOR SOME REASON</H2>');
|
||||||
return;
|
return;
|
||||||
@@ -164,6 +175,11 @@ class TransactionsController extends AppController {
|
|||||||
die("<H1>RECEIPT FAILED</H1>");
|
die("<H1>RECEIPT FAILED</H1>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($redirect)
|
||||||
|
$this->redirect(array('controller' => 'customers',
|
||||||
|
'action' => 'view',
|
||||||
|
$this->data['Customer']['id']));
|
||||||
|
|
||||||
$this->layout = null;
|
$this->layout = null;
|
||||||
$this->autoLayout = false;
|
$this->autoLayout = false;
|
||||||
$this->autoRender = false;
|
$this->autoRender = false;
|
||||||
@@ -377,9 +393,11 @@ class TransactionsController extends AppController {
|
|||||||
* irreversibly destroys the data. It is not for normal use.
|
* irreversibly destroys the data. It is not for normal use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function destroy($id = null) {
|
function destroy($id) {
|
||||||
|
$this->Transaction->id = $id;
|
||||||
|
$customer_id = $this->Transaction->field('customer_id');
|
||||||
$this->Transaction->destroy($id);
|
$this->Transaction->destroy($id);
|
||||||
//$this->redirect(array('action' => 'index'));
|
$this->redirect(array('controller' => 'customers', 'action' => 'view', $customer_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -423,7 +441,7 @@ class TransactionsController extends AppController {
|
|||||||
"This may leave the database in an unstable state." .
|
"This may leave the database in an unstable state." .
|
||||||
" Do NOT do this unless you know what you're doing." .
|
" Do NOT do this unless you know what you're doing." .
|
||||||
" Proceed anyway?"),
|
" Proceed anyway?"),
|
||||||
'ACTION', $this->dev_area);
|
'ACTION', $this->admin_area);
|
||||||
|
|
||||||
// OK, prepare to render.
|
// OK, prepare to render.
|
||||||
$title = 'Transaction #' . $transaction['Transaction']['id'];
|
$title = 'Transaction #' . $transaction['Transaction']['id'];
|
||||||
|
|||||||
76
site/controllers/util_controller.php
Normal file
76
site/controllers/util_controller.php
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class UtilController extends AppController {
|
||||||
|
|
||||||
|
var $uses = array();
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* function: reset_data
|
||||||
|
* - Development function. TO BE DELETED
|
||||||
|
*/
|
||||||
|
|
||||||
|
function reset_data() {
|
||||||
|
$this->layout = null;
|
||||||
|
$this->autoLayout = false;
|
||||||
|
$this->autoRender = false;
|
||||||
|
Configure::write('debug', '0');
|
||||||
|
$script = $_SERVER['DOCUMENT_ROOT'] . '/pmgr/build.cmd';
|
||||||
|
echo "<P>" . date('r') . "\n";
|
||||||
|
//echo "<P>Script: $script" . "\n";
|
||||||
|
$handle = popen($script . ' 2>&1', 'r');
|
||||||
|
//echo "<P>Handle: $handle; " . gettype($handle) . "\n";
|
||||||
|
echo "<P><PRE>\n";
|
||||||
|
while (($read = fread($handle, 2096))) {
|
||||||
|
echo $read;
|
||||||
|
}
|
||||||
|
echo "</PRE>\n";
|
||||||
|
pclose($handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* function: rebuild_box
|
||||||
|
*/
|
||||||
|
|
||||||
|
function rebuild_box($type) {
|
||||||
|
$this->layout = null;
|
||||||
|
$this->autoLayout = false;
|
||||||
|
$this->autoRender = false;
|
||||||
|
Configure::write('debug', '0');
|
||||||
|
$script = preg_replace('%/webroot/index.php$%',
|
||||||
|
'/build_'.$type.'box.cmd',
|
||||||
|
$_SERVER['SCRIPT_FILENAME']);
|
||||||
|
|
||||||
|
// REVISIT <AP>: 20090828
|
||||||
|
// Just use system call
|
||||||
|
$handle = popen($script . ' 2>&1', 'r');
|
||||||
|
while (($read = fread($handle, 2096))) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
pclose($handle);
|
||||||
|
|
||||||
|
$url = $_SERVER['HTTP_REFERER'];
|
||||||
|
if (empty($url))
|
||||||
|
$url = "/";
|
||||||
|
|
||||||
|
$this->redirect($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function rebuild_sandbox() { $this->rebuild_box('sand'); }
|
||||||
|
function rebuild_devbox() { $this->rebuild_box('dev'); }
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
**************************************************************************
|
||||||
|
* function: logmsg
|
||||||
|
* - action to allow posting log message data
|
||||||
|
*/
|
||||||
|
|
||||||
|
function logmsg() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ class Option extends AppModel {
|
|||||||
|
|
||||||
static $option_set = array();
|
static $option_set = array();
|
||||||
|
|
||||||
function getAll($name) {
|
function getAll($name, $force = false) {
|
||||||
/* $this->prClassLevel(30); */
|
/* $this->prClassLevel(30); */
|
||||||
/* //$this->OptionValue->prClassLevel(30); */
|
/* //$this->OptionValue->prClassLevel(30); */
|
||||||
/* $this->Group->Membership->prClassLevel(30); */
|
/* $this->Group->Membership->prClassLevel(30); */
|
||||||
|
|||||||
@@ -8,19 +8,21 @@ class User extends AppModel {
|
|||||||
|
|
||||||
static $current_user_id;
|
static $current_user_id;
|
||||||
|
|
||||||
|
function currentUser() {
|
||||||
|
if (!empty($_SERVER['REMOTE_USER']))
|
||||||
|
return $_SERVER['REMOTE_USER'];
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function currentUserId() {
|
function currentUserId() {
|
||||||
if (!empty(self::$current_user_id))
|
if (!empty(self::$current_user_id))
|
||||||
return self::$current_user_id;
|
return self::$current_user_id;
|
||||||
|
|
||||||
if (!empty($_SERVER['REMOTE_USER']))
|
|
||||||
$login = $_SERVER['REMOTE_USER'];
|
|
||||||
else
|
|
||||||
$login = null;
|
|
||||||
|
|
||||||
$user = $this->find
|
$user = $this->find
|
||||||
('first',
|
('first',
|
||||||
array('recursive' => -1,
|
array('recursive' => -1,
|
||||||
'conditions' => compact('login')));
|
'conditions' => array('login' => $this->currentUser())));
|
||||||
|
|
||||||
if (!empty($user['User']['id']))
|
if (!empty($user['User']['id']))
|
||||||
self::$current_user_id = $user['User']['id'];
|
self::$current_user_id = $user['User']['id'];
|
||||||
|
|||||||
@@ -178,20 +178,8 @@ echo $this->element('statement_entries', array
|
|||||||
|
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TxFromDate")
|
datepicker('TxFromDate');
|
||||||
.attr('autocomplete', 'off')
|
datepicker('TxThroughDate');
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
$("#TxThroughDate")
|
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
resetForm();
|
resetForm();
|
||||||
});
|
});
|
||||||
--></script>
|
--></script>
|
||||||
|
|||||||
@@ -28,10 +28,16 @@ Configure::write('debug', '0');
|
|||||||
// other available options:
|
// other available options:
|
||||||
//clearForm: true, // clear all form fields after successful submit
|
//clearForm: true, // clear all form fields after successful submit
|
||||||
//resetForm: true, // reset the form after successful submit
|
//resetForm: true, // reset the form after successful submit
|
||||||
|
|
||||||
|
url: "<?php echo $html->url(array('controller' => 'transactions',
|
||||||
|
'action' => 'postReceipt', 0)); ?>"
|
||||||
};
|
};
|
||||||
|
|
||||||
// bind form using 'ajaxForm'
|
// bind form using 'ajaxForm'
|
||||||
|
if ($('#receipt-form').ajaxForm != null)
|
||||||
$('#receipt-form').ajaxForm(options);
|
$('#receipt-form').ajaxForm(options);
|
||||||
|
else
|
||||||
|
$('#repeat, label[for=repeat]').remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
// pre-submit callback
|
// pre-submit callback
|
||||||
@@ -393,12 +399,7 @@ Configure::write('debug', '0');
|
|||||||
|
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
datepicker('TransactionStamp');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
$("#customer-id").val(0);
|
$("#customer-id").val(0);
|
||||||
$("#receipt-customer-name").html("INTERNAL ERROR");
|
$("#receipt-customer-name").html("INTERNAL ERROR");
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
$cols = array();
|
$cols = array();
|
||||||
$cols['Relationship'] = array('index' => 'ContactsCustomer.type', 'formatter' => 'enum');
|
$cols['Relationship'] = array('index' => 'ContactsCustomer.type', 'formatter' => 'enum');
|
||||||
$cols['Name'] = array('index' => 'Contact.display_name', 'formatter' => 'longname');
|
$cols['Name'] = array('index' => 'Contact.display_name', 'formatter' => 'longname');
|
||||||
$cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'longname');
|
$cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'name');
|
||||||
$cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'longname');
|
$cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'name');
|
||||||
$cols['Company'] = array('index' => 'Contact.company_name', 'formatter' => 'longname');
|
$cols['Company'] = array('index' => 'Contact.company_name', 'formatter' => 'longname');
|
||||||
$cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment');
|
$cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment');
|
||||||
|
|
||||||
|
|||||||
@@ -148,8 +148,14 @@ foreach ($jqGridColumns AS $header => &$col) {
|
|||||||
// No special formatting for name
|
// No special formatting for name
|
||||||
unset($col['formatter']);
|
unset($col['formatter']);
|
||||||
}
|
}
|
||||||
elseif ($col['formatter'] === 'enum') {
|
elseif (preg_match("/^(long|short)?enum$/",
|
||||||
|
$col['formatter'], $matches)) {
|
||||||
$default['width'] = 60;
|
$default['width'] = 60;
|
||||||
|
if (!empty($matches[1]) && $matches[1] === 'long')
|
||||||
|
$default['width'] *= 1.5;
|
||||||
|
if (!empty($matches[1]) && $matches[1] === 'short')
|
||||||
|
$default['width'] *= 0.7;
|
||||||
|
|
||||||
//$default['align'] = 'right';
|
//$default['align'] = 'right';
|
||||||
|
|
||||||
// No special formatting for enum
|
// No special formatting for enum
|
||||||
@@ -166,7 +172,8 @@ foreach ($jqGridColumns AS $header => &$col) {
|
|||||||
|
|
||||||
// Just a rough approximation to ensure columns
|
// Just a rough approximation to ensure columns
|
||||||
// are wide enough to fully display their header.
|
// are wide enough to fully display their header.
|
||||||
$min_width = strlen($header) * 10;
|
$min_width = strlen($header) * 7;
|
||||||
|
$min_width = 0; // REVISIT <AP>: 20090829; if/while jqGrid is fixed width
|
||||||
if ((!isset($default['width']) || $default['width'] < $min_width) && !$default['force'])
|
if ((!isset($default['width']) || $default['width'] < $min_width) && !$default['force'])
|
||||||
$default['width'] = $min_width;
|
$default['width'] = $min_width;
|
||||||
}
|
}
|
||||||
@@ -239,6 +246,7 @@ $jqGrid_setup = array_merge
|
|||||||
'colNames' => array_keys($jqGridColumns),
|
'colNames' => array_keys($jqGridColumns),
|
||||||
'colModel' => array('--special' => $jqGridColumns),
|
'colModel' => array('--special' => $jqGridColumns),
|
||||||
'height' => $height,
|
'height' => $height,
|
||||||
|
'width' => 700,
|
||||||
'rowNum' => $limit,
|
'rowNum' => $limit,
|
||||||
'rowList' => $limitOptions,
|
'rowList' => $limitOptions,
|
||||||
'sortname' => $sortname,
|
'sortname' => $sortname,
|
||||||
@@ -258,19 +266,15 @@ $jqGrid_setup = array_merge
|
|||||||
// to kick this thing off.
|
// to kick this thing off.
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<DIV ID="<?php echo $grid_div_id; ?>" CLASS="<?php echo $grid_div_class; ?>">
|
<?php if ($first_grid): ?>
|
||||||
<table id="<?php echo $grid_id; ?>" class="scroll"></table>
|
|
||||||
<div id="<?php echo $grid_id; ?>-pager" class="scroll" style="text-align:right"></div>
|
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
|
var currencyFormatter = function(cellval, opts, rowObject) {
|
||||||
jQuery(document).ready(function(){
|
|
||||||
currencyFormatter = function(cellval, opts, rowObject) {
|
|
||||||
if (!cellval)
|
if (!cellval)
|
||||||
return "";
|
return "";
|
||||||
return fmtCurrency(cellval);
|
return fmtCurrency(cellval);
|
||||||
}
|
}
|
||||||
|
|
||||||
percentageFormatter = function(cellval, opts, rowObject) {
|
var percentageFormatter = function(cellval, opts, rowObject) {
|
||||||
var precision;
|
var precision;
|
||||||
if (typeof(opts.colModel) != 'undefined' &&
|
if (typeof(opts.colModel) != 'undefined' &&
|
||||||
typeof(opts.colModel.formatoptions) != 'undefined' &&
|
typeof(opts.colModel.formatoptions) != 'undefined' &&
|
||||||
@@ -281,27 +285,27 @@ jQuery(document).ready(function(){
|
|||||||
amount = cellval.toString().replace(/\%/g,'');
|
amount = cellval.toString().replace(/\%/g,'');
|
||||||
amount = (amount*100).toFixed(precision);
|
amount = (amount*100).toFixed(precision);
|
||||||
return amount+'%';
|
return amount+'%';
|
||||||
}
|
}
|
||||||
|
|
||||||
idFormatter = function(cellval, opts, rowObject) {
|
var idFormatter = function(cellval, opts, rowObject) {
|
||||||
if (!cellval)
|
if (!cellval)
|
||||||
return cellval;
|
return cellval;
|
||||||
return '#'+cellval;
|
return '#'+cellval;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('#<?php echo $grid_id; ?>').jqGrid(
|
|
||||||
<?php echo FormatHelper::phpVarToJavascript($jqGrid_setup); ?>
|
|
||||||
).navGrid('#<?php echo $grid_id; ?>-pager',
|
|
||||||
{ view:false,
|
|
||||||
edit:false,
|
|
||||||
add:false,
|
|
||||||
del:false,
|
|
||||||
search:true,
|
|
||||||
refresh:true});
|
|
||||||
});
|
|
||||||
|
|
||||||
--></script>
|
--></script>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<DIV ID="<?php echo $grid_div_id; ?>" CLASS="<?php echo $grid_div_class; ?>">
|
||||||
|
<table id="<?php echo $grid_id; ?>" class="scroll"></table>
|
||||||
|
<div id="<?php echo $grid_id; ?>-pager" class="scroll" style="text-align:right"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
jQuery(document).ready(function(){
|
||||||
|
jQuery('#<?php echo $grid_id; ?>').jqGrid(
|
||||||
|
<?php echo FormatHelper::phpVarToJavascript($jqGrid_setup) . "\n"; ?>
|
||||||
|
).navGrid('#<?php echo $grid_id; ?>-pager', { view:false,edit:false,add:false,del:false,search:true,refresh:true});
|
||||||
|
});
|
||||||
|
--></script>
|
||||||
<?php
|
<?php
|
||||||
if (count($search_fields) > 0) {
|
if (count($search_fields) > 0) {
|
||||||
echo('<div>Search By:<BR>' . "\n");
|
echo('<div>Search By:<BR>' . "\n");
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
// Define the table columns
|
// Define the table columns
|
||||||
$cols = array();
|
$cols = array();
|
||||||
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
||||||
$cols['Unit'] = array('index' => 'Unit.name', 'width' => '50', 'align' => 'center');
|
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname', 'align' => 'center');
|
||||||
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
||||||
$cols['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency', 'hiddenz' => true);
|
$cols['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency');
|
||||||
$cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency', 'hiddenz' => true);
|
$cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency');
|
||||||
$cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date');
|
$cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date');
|
||||||
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
|
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
|
||||||
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');
|
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');
|
||||||
$cols['Closed'] = array('index' => 'Lease.close_date', 'formatter' => 'date');
|
$cols['Closed'] = array('index' => 'Lease.close_date', 'formatter' => 'date');
|
||||||
$cols['Paid-Thru'] = array('index' => 'Lease.paid_through_date', 'formatter' => 'date');
|
$cols['Paid-Thru'] = array('index' => 'Lease.paid_through_date', 'formatter' => 'date');
|
||||||
$cols['Status'] = array('index' => 'status', 'formatter' => 'enum', 'width' => 100);
|
$cols['Status'] = array('index' => 'status', 'formatter' => 'longenum');
|
||||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||||
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
|
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
|
||||||
|
|
||||||
|
|||||||
@@ -70,14 +70,16 @@ echo('</DIV>' . "\n"); // End #sidemenu-container
|
|||||||
$javascript->codeBlock(
|
$javascript->codeBlock(
|
||||||
<<<JSCB
|
<<<JSCB
|
||||||
jQuery(document).ready(function(){
|
jQuery(document).ready(function(){
|
||||||
|
if (jQuery("#sidemenu").accordion != null) {
|
||||||
jQuery("#sidemenu").accordion
|
jQuery("#sidemenu").accordion
|
||||||
({ fillSpace : true,
|
({ fillSpace : true,
|
||||||
event : "click hoverintent",
|
event : "click hoverintent",
|
||||||
animated : "bounceslide",
|
animated : "bounceslide"
|
||||||
JSCB
|
JSCB
|
||||||
. (isset($active_section) ? "\tactive : $active_section,\n" : '') .
|
. (isset($active_section) ? ",\n\t active : $active_section\n" : '') .
|
||||||
<<<JSCB
|
<<<JSCB
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
JSCB
|
JSCB
|
||||||
, array('inline' => false));
|
, array('inline' => false));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $cols['Unit'] = array('index' => 'Unit.name', 'formatter' =>
|
|||||||
|
|
||||||
$cols['Comment'] = array('index' => 'StatementEntry.comment', 'formatter' => 'comment', 'width'=>150);
|
$cols['Comment'] = array('index' => 'StatementEntry.comment', 'formatter' => 'comment', 'width'=>150);
|
||||||
|
|
||||||
$cols['Type'] = array('index' => 'StatementEntry.type', 'formatter' => 'enum', 'width'=>120);
|
$cols['Type'] = array('index' => 'StatementEntry.type', 'formatter' => 'longenum');
|
||||||
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
|
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
|
||||||
$cols['Debit'] = array('index' => 'charge', 'formatter' => 'currency');
|
$cols['Debit'] = array('index' => 'charge', 'formatter' => 'currency');
|
||||||
$cols['Credit'] = array('index' => 'disbursement', 'formatter' => 'currency');
|
$cols['Credit'] = array('index' => 'disbursement', 'formatter' => 'currency');
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ $grid
|
|||||||
->defaultFields(array('Date', 'Name', 'Amount'))
|
->defaultFields(array('Date', 'Name', 'Amount'))
|
||||||
->searchFields(array('Name', 'Type'))
|
->searchFields(array('Name', 'Type'))
|
||||||
->render($this, isset($config) ? $config : null,
|
->render($this, isset($config) ? $config : null,
|
||||||
array_diff(array_keys($cols), array('Sub-Total')));
|
array_diff(array_keys($cols), array('Comment', 'Sub-Total')));
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ $cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname'
|
|||||||
$cols['Area'] = array('index' => 'sqft', 'formatter' => 'number');
|
$cols['Area'] = array('index' => 'sqft', 'formatter' => 'number');
|
||||||
$cols['Rent'] = array('index' => 'Unit.rent', 'formatter' => 'currency');
|
$cols['Rent'] = array('index' => 'Unit.rent', 'formatter' => 'currency');
|
||||||
$cols['Deposit'] = array('index' => 'Unit.deposit', 'formatter' => 'currency');
|
$cols['Deposit'] = array('index' => 'Unit.deposit', 'formatter' => 'currency');
|
||||||
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'name'); // We have enough real estate
|
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'enum');
|
||||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||||
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
|
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
|
||||||
|
|
||||||
|
|||||||
@@ -268,14 +268,21 @@ class FormatHelper extends AppHelper {
|
|||||||
|
|
||||||
|
|
||||||
// Helper function to convert PHP vars to javascript
|
// Helper function to convert PHP vars to javascript
|
||||||
function phpVarToJavascript($var, $name = '', $depth='', $special = false) {
|
function phpVarToJavascript($var, $name = '', $depth='', $special = false, $pretty = false) {
|
||||||
|
|
||||||
// Establish a prefix to use before printing $var
|
// Establish a prefix to use before printing $var
|
||||||
|
if ($pretty) {
|
||||||
$prefix = $depth;
|
$prefix = $depth;
|
||||||
|
$pretty_sp = " ";
|
||||||
|
$pretty_nl = "\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$prefix = $pretty_sp = $pretty_nl = '';
|
||||||
|
}
|
||||||
|
|
||||||
// If given a name, set it up JS style
|
// If given a name, set it up JS style
|
||||||
if ($name)
|
if ($name)
|
||||||
$prefix .= $name . ": ";
|
$prefix .= $name . ":" . $pretty_sp;
|
||||||
|
|
||||||
if (!isset($var))
|
if (!isset($var))
|
||||||
return $prefix . 'null';
|
return $prefix . 'null';
|
||||||
@@ -328,22 +335,22 @@ class FormatHelper extends AppHelper {
|
|||||||
// PHP array indices can be a mix of integer and string based.
|
// PHP array indices can be a mix of integer and string based.
|
||||||
// Just guess here, unless flagged as a special case.
|
// Just guess here, unless flagged as a special case.
|
||||||
if (isset($var[0]) || $special)
|
if (isset($var[0]) || $special)
|
||||||
return ($prefix . "[\n"
|
return ($prefix . "[" . $pretty_nl
|
||||||
. implode(",\n",
|
. implode("," . $pretty_nl,
|
||||||
array_map(array('FormatHelper', 'phpVarToJavascript'),
|
array_map(array('FormatHelper', 'phpVarToJavascript'),
|
||||||
array_values($var),
|
array_values($var),
|
||||||
array(),
|
array(),
|
||||||
array_fill(0, count($var), $depth.' ')
|
array_fill(0, count($var), $depth.' ')
|
||||||
))
|
))
|
||||||
. "\n$depth]");
|
. ($pretty ? "\n$depth" : '') . "]");
|
||||||
|
|
||||||
return ($prefix . "{\n"
|
return ($prefix . "{" . $pretty_nl
|
||||||
. implode(",\n",
|
. implode("," . $pretty_nl,
|
||||||
array_map(array('FormatHelper', 'phpVarToJavascript'),
|
array_map(array('FormatHelper', 'phpVarToJavascript'),
|
||||||
array_values($var), array_keys($var),
|
array_values($var), array_keys($var),
|
||||||
array_fill(0, count($var), $depth.' ')
|
array_fill(0, count($var), $depth.' ')
|
||||||
))
|
))
|
||||||
. "\n$depth}");
|
. ($pretty ? "\n$depth" : '') . "}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class GridHelper extends AppHelper {
|
|||||||
var $included, $invalid;
|
var $included, $invalid;
|
||||||
var $columns;
|
var $columns;
|
||||||
var $controller;
|
var $controller;
|
||||||
|
static $first_grid = true;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$this->reset();
|
$this->reset();
|
||||||
@@ -218,8 +219,12 @@ class GridHelper extends AppHelper {
|
|||||||
if (isset($config))
|
if (isset($config))
|
||||||
$this->jqGrid_options = array_merge($this->jqGrid_options, $config);
|
$this->jqGrid_options = array_merge($this->jqGrid_options, $config);
|
||||||
|
|
||||||
|
// Set flag whether or not this is the first grid
|
||||||
|
$this->jqGrid_options['first_grid'] = self::$first_grid;
|
||||||
|
|
||||||
//pr(compact('config') + array('jqGrid_options' => $this->jqGrid_options));
|
//pr(compact('config') + array('jqGrid_options' => $this->jqGrid_options));
|
||||||
echo $view->element('jqGrid', $this->jqGrid_options);
|
echo $view->element('jqGrid', $this->jqGrid_options);
|
||||||
|
self::$first_grid = false;
|
||||||
|
|
||||||
// Since we only have one instance of this class
|
// Since we only have one instance of this class
|
||||||
// as a helper, we must assume it could be used
|
// as a helper, we must assume it could be used
|
||||||
|
|||||||
@@ -34,7 +34,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<?php echo $html->charset(); ?>
|
<?php echo $html->charset(); ?>
|
||||||
<title>
|
<title>
|
||||||
|
<?php if (devbox()) echo "*DEVBOX* "; ?>
|
||||||
|
<?php if (sandbox()) echo "*SANDBOX* "; ?>
|
||||||
Property Manager: <?php echo $title_for_layout; ?>
|
Property Manager: <?php echo $title_for_layout; ?>
|
||||||
|
<?php if (sandbox()) echo " *SANDBOX*"; ?>
|
||||||
|
<?php if (devbox()) echo " *DEVBOX*"; ?>
|
||||||
</title>
|
</title>
|
||||||
<?php
|
<?php
|
||||||
// Reset the __scripts variable, which has already been dumped to
|
// Reset the __scripts variable, which has already been dumped to
|
||||||
@@ -58,23 +62,42 @@
|
|||||||
echo $html->css('layout') . "\n";
|
echo $html->css('layout') . "\n";
|
||||||
echo $html->css('print', null, array('media' => 'print')) . "\n";
|
echo $html->css('print', null, array('media' => 'print')) . "\n";
|
||||||
echo $html->css('sidemenu') . "\n";
|
echo $html->css('sidemenu') . "\n";
|
||||||
echo $javascript->link($protocol . 'ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js') . "\n";
|
|
||||||
echo $javascript->link($protocol . 'ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js') . "\n";
|
|
||||||
|
|
||||||
$theme = 'smoothness';
|
$theme = 'smoothness';
|
||||||
$theme = 'base';
|
$theme = 'base';
|
||||||
$theme = 'dotluv';
|
$theme = 'dotluv';
|
||||||
$theme = 'dark-hive';
|
$theme = 'dark-hive';
|
||||||
$theme = 'start';
|
$theme = 'start';
|
||||||
|
if (devbox())
|
||||||
|
$theme = 'dotluv';
|
||||||
if (sandbox())
|
if (sandbox())
|
||||||
$theme = 'darkness';
|
$theme = 'darkness';
|
||||||
|
|
||||||
echo $html->css('themes/'.$theme.'/ui.all') . "\n";
|
echo $html->css('themes/'.$theme.'/ui.all') . "\n";
|
||||||
|
|
||||||
|
echo $javascript->link('jquery-1.3.2.min') . "\n";
|
||||||
|
echo $javascript->link('jquery-ui-1.7.2.custom.min') . "\n";
|
||||||
|
//echo $javascript->link($protocol . 'ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js') . "\n";
|
||||||
|
//echo $javascript->link($protocol . 'ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js') . "\n";
|
||||||
|
//echo $javascript->link($protocol . 'ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js') . "\n";
|
||||||
|
//echo $javascript->link($protocol . 'ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js') . "\n";
|
||||||
echo $javascript->link('jquery.form') . "\n";
|
echo $javascript->link('jquery.form') . "\n";
|
||||||
echo $javascript->link('pmgr.jquery') . "\n";
|
echo $javascript->link('jquery.hoverIntent') . "\n";
|
||||||
echo $javascript->link('pmgr') . "\n";
|
echo $javascript->link('pmgr') . "\n";
|
||||||
echo $scripts_for_layout . "\n";
|
echo $scripts_for_layout . "\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php if ($this->params['action'] !== 'INTERNAL_ERROR'): ?>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
if (typeof(jQuery) == 'undefined') {
|
||||||
|
window.location.href =
|
||||||
|
"<?php echo $html->url(array('controller' => 'util',
|
||||||
|
'action' => 'INTERNAL_ERROR',
|
||||||
|
'jQuery NOT LOADED!')); ?>";
|
||||||
|
}
|
||||||
|
--></script>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,16 @@ Configure::write('debug', '0');
|
|||||||
// other available options:
|
// other available options:
|
||||||
//clearForm: true, // clear all form fields after successful submit
|
//clearForm: true, // clear all form fields after successful submit
|
||||||
//resetForm: true, // reset the form after successful submit
|
//resetForm: true, // reset the form after successful submit
|
||||||
|
|
||||||
|
url: "<?php echo $html->url(array('controller' => 'transactions',
|
||||||
|
'action' => 'postInvoice', 0)); ?>"
|
||||||
};
|
};
|
||||||
|
|
||||||
// bind form using 'ajaxForm'
|
// bind form using 'ajaxForm'
|
||||||
|
if ($('#invoice-form').ajaxForm != null)
|
||||||
$('#invoice-form').ajaxForm(options);
|
$('#invoice-form').ajaxForm(options);
|
||||||
|
else
|
||||||
|
$('#repeat, label[for=repeat]').remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
// pre-submit callback
|
// pre-submit callback
|
||||||
@@ -61,14 +67,14 @@ function verifyRequest(formData, jqForm, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Terrible way to accomplish this...
|
// Terrible way to accomplish this...
|
||||||
for (var j = 0; j < 20; ++j) {
|
/* for (var j = 0; j < 20; ++j) { */
|
||||||
if (formData[i]['name'] == "data[Entry]["+j+"][amount]" &&
|
/* if (formData[i]['name'] == "data[Entry]["+j+"][amount]" && */
|
||||||
!(formData[i]['value'] > 0)) {
|
/* !(formData[i]['value'] > 0)) { */
|
||||||
//$("#debug").append('<P>Bad Amount');
|
/* //$("#debug").append('<P>Bad Amount'); */
|
||||||
alert("Must enter a valid amount");
|
/* alert("Must enter a valid amount"); */
|
||||||
return false;
|
/* return false; */
|
||||||
}
|
/* } */
|
||||||
}
|
/* } */
|
||||||
}
|
}
|
||||||
|
|
||||||
//$("#debug").append('OK');
|
//$("#debug").append('OK');
|
||||||
@@ -199,19 +205,8 @@ function addChargeSource(flash) {
|
|||||||
'</FIELDSET>'
|
'</FIELDSET>'
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#Entry"+id+"EffectiveDate")
|
datepicker("Entry"+id+"EffectiveDate");
|
||||||
.attr('autocomplete', 'off')
|
datepicker("Entry"+id+"ThroughDate");
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
$("#Entry"+id+"ThroughDate")
|
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -276,6 +271,12 @@ echo $form->input("Lease.id",
|
|||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'value' => 0));
|
'value' => 0));
|
||||||
|
|
||||||
|
if (!empty($movein))
|
||||||
|
echo $form->input("Customer.id",
|
||||||
|
array('id' => 'customer-id',
|
||||||
|
'type' => 'hidden',
|
||||||
|
'value' => $customer['id']));
|
||||||
|
|
||||||
/* echo '<fieldset CLASS="invoice">' . "\n"; */
|
/* echo '<fieldset CLASS="invoice">' . "\n"; */
|
||||||
/* echo ' <legend>Invoice</legend>' . "\n"; */
|
/* echo ' <legend>Invoice</legend>' . "\n"; */
|
||||||
|
|
||||||
@@ -330,12 +331,7 @@ Configure::write('debug', '0');
|
|||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
datepicker('TransactionStamp');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
$("#lease-id").val(0);
|
$("#lease-id").val(0);
|
||||||
$("#invoice-lease").html("INTERNAL ERROR");
|
$("#invoice-lease").html("INTERNAL ERROR");
|
||||||
@@ -355,7 +351,7 @@ Configure::write('debug', '0');
|
|||||||
var id;
|
var id;
|
||||||
resetForm(true);
|
resetForm(true);
|
||||||
|
|
||||||
$("#TransactionStamp").datepicker('disable');
|
$("#TransactionStamp").attr('disabled', true);
|
||||||
$("#TransactionStamp").val("<?php echo date('m/d/Y', $movein['time']); ?>");
|
$("#TransactionStamp").val("<?php echo date('m/d/Y', $movein['time']); ?>");
|
||||||
$('#TransactionStamp').after
|
$('#TransactionStamp').after
|
||||||
('<input type="hidden"' +
|
('<input type="hidden"' +
|
||||||
|
|||||||
@@ -34,6 +34,39 @@ function resetForm() {
|
|||||||
datepickerNow('LeaseMoveDate', false);
|
datepickerNow('LeaseMoveDate', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pre-submit callback
|
||||||
|
function verifyRequest() {
|
||||||
|
//$("#debug").html('');
|
||||||
|
<?php if ($move_type === 'out'): ?>
|
||||||
|
|
||||||
|
if (!($("#lease-id").val() > 0)) {
|
||||||
|
//$("#debug").append('<P>Missing Lease ID');
|
||||||
|
alert("Please select the lease");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
|
||||||
|
if (!($("#customer-id").val() > 0)) {
|
||||||
|
//$("#debug").append('<P>Missing Customer ID');
|
||||||
|
alert("Please select the customer");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!($("#unit-id").val() > 0)) {
|
||||||
|
//$("#debug").append('<P>Missing Unit ID');
|
||||||
|
alert("Please select the unit");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
//$("#debug").append('OK');
|
||||||
|
//return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
function onRowSelect(grid_id, item_type, item_id) {
|
function onRowSelect(grid_id, item_type, item_id) {
|
||||||
cell_name = item_type.charAt(0).toUpperCase() + item_type.substr(1);
|
cell_name = item_type.charAt(0).toUpperCase() + item_type.substr(1);
|
||||||
if (item_type == 'lease')
|
if (item_type == 'lease')
|
||||||
@@ -209,6 +242,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo $form->create(null, array('id' => 'move-inout-form',
|
echo $form->create(null, array('id' => 'move-inout-form',
|
||||||
|
'onsubmit' => 'return verifyRequest();',
|
||||||
'url' => array('controller' => 'leases',
|
'url' => array('controller' => 'leases',
|
||||||
'action' => $move_action)));
|
'action' => $move_action)));
|
||||||
|
|
||||||
@@ -282,13 +316,7 @@ echo $form->end('Perform Move ' . ucfirst($move_type));
|
|||||||
|
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#LeaseMoveDate")
|
datepicker('LeaseMoveDate');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
resetForm();
|
resetForm();
|
||||||
|
|
||||||
<?php if ($move_type === 'out') { ?>
|
<?php if ($move_type === 'out') { ?>
|
||||||
|
|||||||
@@ -6,6 +6,19 @@
|
|||||||
{// for indentation purposes
|
{// for indentation purposes
|
||||||
// Go through each unit, adding a clickable region for the unit
|
// Go through each unit, adding a clickable region for the unit
|
||||||
foreach ($info['units'] AS $unit){
|
foreach ($info['units'] AS $unit){
|
||||||
|
$title = ('Unit #' .
|
||||||
|
$unit['name'] .
|
||||||
|
(empty($unit['data']['CurrentLease']['id'])
|
||||||
|
? ''
|
||||||
|
: ('; ' .
|
||||||
|
/* 'Lease #' . */
|
||||||
|
/* $unit['data']['CurrentLease']['id'] . */
|
||||||
|
/* '; ' . */
|
||||||
|
$unit['data']['Customer']['name'] .
|
||||||
|
'; Paid Through ' .
|
||||||
|
$unit['data']['CurrentLease']['paid_through_date'])
|
||||||
|
));
|
||||||
|
|
||||||
echo(' <area shape="rect"' .
|
echo(' <area shape="rect"' .
|
||||||
' coords="' .
|
' coords="' .
|
||||||
$unit['left'] . ',' .
|
$unit['left'] . ',' .
|
||||||
@@ -16,20 +29,8 @@
|
|||||||
$html->url(array('controller' => 'units',
|
$html->url(array('controller' => 'units',
|
||||||
'action' => 'view',
|
'action' => 'view',
|
||||||
$unit['id'])) .
|
$unit['id'])) .
|
||||||
'" alt="Unit #' .
|
'" alt="' . $title .
|
||||||
$unit['name'] .
|
'" title="' . $title .
|
||||||
'" title="Unit #' .
|
|
||||||
$unit['name'] .
|
|
||||||
(empty($unit['data']['CurrentLease']['id'])
|
|
||||||
? ''
|
|
||||||
: ('; ' .
|
|
||||||
/* 'Lease #' . */
|
|
||||||
/* $unit['data']['CurrentLease']['id'] . */
|
|
||||||
/* '; ' . */
|
|
||||||
$unit['data']['Customer']['name'] .
|
|
||||||
'; Paid Through ' .
|
|
||||||
$unit['data']['CurrentLease']['paid_through_date'])
|
|
||||||
) .
|
|
||||||
'">' . "\n");
|
'">' . "\n");
|
||||||
}
|
}
|
||||||
}// for indentation purposes
|
}// for indentation purposes
|
||||||
|
|||||||
@@ -60,13 +60,7 @@ function resetForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
datepicker('TransactionStamp');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
resetForm();
|
resetForm();
|
||||||
});
|
});
|
||||||
--></script>
|
--></script>
|
||||||
|
|||||||
@@ -60,13 +60,7 @@ function resetForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
datepicker('TransactionStamp');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
resetForm();
|
resetForm();
|
||||||
});
|
});
|
||||||
--></script>
|
--></script>
|
||||||
|
|||||||
@@ -75,13 +75,7 @@ function resetForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
datepicker('TransactionStamp');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
resetForm();
|
resetForm();
|
||||||
});
|
});
|
||||||
--></script>
|
--></script>
|
||||||
|
|||||||
@@ -92,13 +92,7 @@ function resetForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
datepicker('TransactionStamp');
|
||||||
.attr('autocomplete', 'off')
|
|
||||||
.datepicker({ constrainInput: true,
|
|
||||||
numberOfMonths: [1, 1],
|
|
||||||
showCurrentAtPos: 0,
|
|
||||||
dateFormat: 'mm/dd/yy' });
|
|
||||||
|
|
||||||
resetForm();
|
resetForm();
|
||||||
});
|
});
|
||||||
--></script>
|
--></script>
|
||||||
|
|||||||
@@ -22,11 +22,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
* {
|
|
||||||
margin:0;
|
|
||||||
padding:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
#container {
|
#container {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
* Overall page layout
|
* Overall page layout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
body { padding: 0; margin: 0 }
|
||||||
table#layout { width: 100% }
|
table#layout { width: 100% }
|
||||||
td#sidecolumn ,
|
td#sidecolumn ,
|
||||||
td#pagecolumn { vertical-align: top; }
|
td#pagecolumn { vertical-align: top; }
|
||||||
@@ -285,6 +286,7 @@ span.grid-error {
|
|||||||
.ui-jqgrid span.ui-jqgrid-title h2 {
|
.ui-jqgrid span.ui-jqgrid-title h2 {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
19
site/webroot/js/jquery-1.3.2.min.js
vendored
Normal file
19
site/webroot/js/jquery-1.3.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
79
site/webroot/js/jquery-ui-1.7.2.custom.min.js
vendored
Normal file
79
site/webroot/js/jquery-ui-1.7.2.custom.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
136
site/webroot/js/jquery.hoverIntent.js
Normal file
136
site/webroot/js/jquery.hoverIntent.js
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
/**
|
||||||
|
* hoverIntent is similar to jQuery's built-in "hover" function except that
|
||||||
|
* instead of firing the onMouseOver event immediately, hoverIntent checks
|
||||||
|
* to see if the user's mouse has slowed down (beneath the sensitivity
|
||||||
|
* threshold) before firing the onMouseOver event.
|
||||||
|
*
|
||||||
|
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
|
||||||
|
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
|
||||||
|
*
|
||||||
|
* hoverIntent is currently available for use in all personal or commercial
|
||||||
|
* projects under both MIT and GPL licenses. This means that you can choose
|
||||||
|
* the license that best suits your project, and use it accordingly.
|
||||||
|
*
|
||||||
|
* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
|
||||||
|
* $("ul li").hoverIntent( showNav , hideNav );
|
||||||
|
*
|
||||||
|
* // advanced usage receives configuration object only
|
||||||
|
* $("ul li").hoverIntent({
|
||||||
|
* sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
|
||||||
|
* interval: 100, // number = milliseconds of polling interval
|
||||||
|
* over: showNav, // function = onMouseOver callback (required)
|
||||||
|
* timeout: 0, // number = milliseconds delay before onMouseOut function call
|
||||||
|
* out: hideNav // function = onMouseOut callback (required)
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @param f onMouseOver function || An object with configuration options
|
||||||
|
* @param g onMouseOut function || Nothing (use configuration options object)
|
||||||
|
* @author Brian Cherne <brian@cherne.net>
|
||||||
|
*/
|
||||||
|
(function($) {
|
||||||
|
$.fn.hoverIntent = function(f,g) {
|
||||||
|
// default configuration options
|
||||||
|
var cfg = {
|
||||||
|
sensitivity: 7,
|
||||||
|
interval: 100,
|
||||||
|
timeout: 0
|
||||||
|
};
|
||||||
|
// override configuration options with user supplied object
|
||||||
|
cfg = $.extend(cfg, g ? { over: f, out: g } : f );
|
||||||
|
|
||||||
|
// instantiate variables
|
||||||
|
// cX, cY = current X and Y position of mouse, updated by mousemove event
|
||||||
|
// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
|
||||||
|
var cX, cY, pX, pY;
|
||||||
|
|
||||||
|
// A private function for getting mouse position
|
||||||
|
var track = function(ev) {
|
||||||
|
cX = ev.pageX;
|
||||||
|
cY = ev.pageY;
|
||||||
|
};
|
||||||
|
|
||||||
|
// A private function for comparing current and previous mouse position
|
||||||
|
var compare = function(ev,ob) {
|
||||||
|
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
|
||||||
|
// compare mouse positions to see if they've crossed the threshold
|
||||||
|
if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
|
||||||
|
$(ob).unbind("mousemove",track);
|
||||||
|
// set hoverIntent state to true (so mouseOut can be called)
|
||||||
|
ob.hoverIntent_s = 1;
|
||||||
|
return cfg.over.apply(ob,[ev]);
|
||||||
|
} else {
|
||||||
|
// set previous coordinates for next time
|
||||||
|
pX = cX; pY = cY;
|
||||||
|
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
|
||||||
|
ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// A private function for delaying the mouseOut function
|
||||||
|
var delay = function(ev,ob) {
|
||||||
|
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
|
||||||
|
ob.hoverIntent_s = 0;
|
||||||
|
return cfg.out.apply(ob,[ev]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// A private function for handling mouse 'hovering'
|
||||||
|
var handleHover = function(e) {
|
||||||
|
// REVISIT <AP>: 20090829; Unknown why mouseenter/mouseleave are being used
|
||||||
|
var etype = e.type;
|
||||||
|
etype = etype.replace(/mouseenter/, "mouseover");
|
||||||
|
etype = etype.replace(/mouseleave/, "mouseout");
|
||||||
|
|
||||||
|
// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
|
||||||
|
var p = (etype == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
|
||||||
|
while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
|
||||||
|
if ( p == this ) { return false; }
|
||||||
|
|
||||||
|
// copy objects to be passed into t (required for event object to be passed in IE)
|
||||||
|
var ev = jQuery.extend({},e);
|
||||||
|
var ob = this;
|
||||||
|
|
||||||
|
// cancel hoverIntent timer if it exists
|
||||||
|
if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
|
||||||
|
|
||||||
|
// else e.type == "onmouseover"
|
||||||
|
if (etype == "mouseover") {
|
||||||
|
// set "previous" X and Y position based on initial entry point
|
||||||
|
pX = ev.pageX; pY = ev.pageY;
|
||||||
|
// update "current" X and Y position based on mousemove
|
||||||
|
$(ob).bind("mousemove",track);
|
||||||
|
// start polling interval (self-calling timeout) to compare mouse coordinates over time
|
||||||
|
if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
|
||||||
|
|
||||||
|
// else e.type == "onmouseout"
|
||||||
|
} else {
|
||||||
|
// unbind expensive mousemove event
|
||||||
|
$(ob).unbind("mousemove",track);
|
||||||
|
// if hoverIntent state is true, then call the mouseOut function after the specified delay
|
||||||
|
if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// bind the function to the two event listeners
|
||||||
|
return this.mouseover(handleHover).mouseout(handleHover);
|
||||||
|
};
|
||||||
|
})(jQuery);
|
||||||
|
|
||||||
|
|
||||||
|
$.event.special.hoverintent = {
|
||||||
|
setup: function() {
|
||||||
|
$(this).hoverIntent({
|
||||||
|
over: jQuery.event.special.hoverintent.over,
|
||||||
|
out: jQuery.event.special.hoverintent.out
|
||||||
|
});
|
||||||
|
},
|
||||||
|
teardown: function() {
|
||||||
|
},
|
||||||
|
|
||||||
|
over: function(ev) {
|
||||||
|
ev.type = 'hoverintent';
|
||||||
|
jQuery.event.handle.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
out: function(event) {
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
/* ******************************************************************************
|
|
||||||
* hoverintent
|
|
||||||
*
|
|
||||||
* Works like mouseover, but instead of firing immediately when an object
|
|
||||||
* is mouseover'ed, it tries to determine when the user actually _intends_
|
|
||||||
* to have the pointer hover over the object. In other words, it's a lot
|
|
||||||
* like mouseover with a delay before firing, and if the pointer moves
|
|
||||||
* before hoverintent can fire, it doesn't fire at all.
|
|
||||||
*
|
|
||||||
* Found from jQuery UI Ticket #3614
|
|
||||||
* http://dev.jqueryui.com/ticket/3614
|
|
||||||
*/
|
|
||||||
|
|
||||||
var cfg = ($.hoverintent = {
|
|
||||||
sensitivity: 7,
|
|
||||||
interval: 100
|
|
||||||
});
|
|
||||||
|
|
||||||
$.event.special.hoverintent = {
|
|
||||||
setup: function() {
|
|
||||||
$(this).bind("mouseover", jQuery.event.special.hoverintent.handler);
|
|
||||||
},
|
|
||||||
teardown: function() {
|
|
||||||
$(this).unbind("mouseover", jQuery.event.special.hoverintent.handler);
|
|
||||||
},
|
|
||||||
handler: function(event) {
|
|
||||||
event.type = "hoverintent";
|
|
||||||
var self = this,
|
|
||||||
args = arguments,
|
|
||||||
target = $(event.target),
|
|
||||||
cX, cY, pX, pY;
|
|
||||||
|
|
||||||
|
|
||||||
function track(event) {
|
|
||||||
cX = event.pageX;
|
|
||||||
cY = event.pageY;
|
|
||||||
};
|
|
||||||
pX = event.pageX;
|
|
||||||
pY = event.pageY;
|
|
||||||
function clear() {
|
|
||||||
target.unbind("mousemove", track).unbind("mouseout", arguments.callee);
|
|
||||||
clearTimeout(timeout);
|
|
||||||
}
|
|
||||||
function handler() {
|
|
||||||
if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
|
|
||||||
clear();
|
|
||||||
jQuery.event.handle.apply(self, args);
|
|
||||||
} else {
|
|
||||||
pX = cX; pY = cY;
|
|
||||||
timeout = setTimeout(handler, cfg.interval);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var timeout = setTimeout(handler, cfg.interval);
|
|
||||||
target.mousemove(track).mouseout(clear);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
* array/hash/object that is given.
|
* array/hash/object that is given.
|
||||||
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
|
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
|
||||||
*/
|
*/
|
||||||
function dump(arr,level) {
|
function dump_old(arr,level) {
|
||||||
var dumped_text = "";
|
var dumped_text = "";
|
||||||
if(!level) level = 0;
|
if(!level) level = 0;
|
||||||
|
|
||||||
@@ -34,53 +34,55 @@ function dump(arr,level) {
|
|||||||
return dumped_text;
|
return dumped_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dump(element, limit, depth) {
|
||||||
|
limit = (limit == null) ? 1 : limit;
|
||||||
|
depth = (depth == null) ? 0 : depth;
|
||||||
|
|
||||||
function var_dump(element, limit, depth)
|
var rep1 = new Array(5);
|
||||||
{
|
var pad1 = rep1.join(" ");
|
||||||
depth = depth?depth:0;
|
var rep = new Array(depth+1);
|
||||||
limit = limit?limit:1;
|
var pad = rep.join(pad1);
|
||||||
|
|
||||||
returnString = '<ol>';
|
|
||||||
|
|
||||||
|
var props = new Array;
|
||||||
for(property in element)
|
for(property in element)
|
||||||
{
|
{
|
||||||
//Property domConfig isn't accessable
|
//Property domConfig isn't accessable
|
||||||
if (property != 'domConfig')
|
if (property == 'domConfig')
|
||||||
{
|
continue;
|
||||||
returnString += '<li><strong>'+ property + '</strong> <small>(' + (typeof element[property]) +')</small>';
|
|
||||||
|
var propstr = '<strong>'+ property + '</strong>';
|
||||||
|
propstr += ' <small>(' + (typeof element[property]) +')</small>';
|
||||||
|
|
||||||
if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
|
if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
|
||||||
returnString += ' : <em>' + element[property] + '</em>';
|
propstr += ' : <em>' + element[property] + '</em>';
|
||||||
if (typeof element[property] == 'string' && element[property])
|
if (typeof element[property] == 'string' && element[property])
|
||||||
returnString += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
|
propstr += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
|
||||||
element[property].replace(/</g, '&lt;').replace(/>/g, '&gt;') + '</code></div>';
|
htmlEscape(element[property]) + '</code></div>';
|
||||||
|
|
||||||
if ((typeof element[property] == 'object') && (depth < limit))
|
if ((typeof element[property] == 'object') && (depth < limit))
|
||||||
returnString += var_dump(element[property], limit, (depth + 1));
|
propstr += "\n" + pad + dump(element[property], limit, (depth + 1));
|
||||||
|
|
||||||
returnString += '</li>';
|
props.push(propstr);
|
||||||
}
|
|
||||||
}
|
|
||||||
returnString += '</ol>';
|
|
||||||
|
|
||||||
if(depth == 0)
|
|
||||||
{
|
|
||||||
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
|
|
||||||
winpop.document.write('<pre>'+returnString+ '</pre>');
|
|
||||||
winpop.document.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnString;
|
if (props.length == 0)
|
||||||
|
return '';
|
||||||
|
|
||||||
|
return pad + '<ol><li>' + props.join("</li>\n" + pad + pad1 + "<li>") + "</li>\n" + pad + "</ol>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dump_window(element, limit) {
|
||||||
|
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
|
||||||
|
winpop.document.write(dump(element, limit));
|
||||||
|
winpop.document.close();
|
||||||
|
}
|
||||||
|
|
||||||
function htmlEncode(s)
|
function htmlEscape (s) {
|
||||||
{
|
|
||||||
//return s;
|
|
||||||
return s.replace(/&(?!\w+([;\s]|$))/g, "&")
|
return s.replace(/&(?!\w+([;\s]|$))/g, "&")
|
||||||
.replace(/</g, "<").replace(/>/g, ">");
|
.replace(/</g, "<").replace(/>/g, ">");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function htmlEncode(s) { return htmlEscape(s); }
|
||||||
|
|
||||||
function addDiv(id_name, div_name, into_div_name, flash, html, script) {
|
function addDiv(id_name, div_name, into_div_name, flash, html, script) {
|
||||||
var id = $('#'+id_name).val();
|
var id = $('#'+id_name).val();
|
||||||
|
|
||||||
@@ -103,13 +105,12 @@ function addDiv(id_name, div_name, into_div_name, flash, html, script) {
|
|||||||
|
|
||||||
if (flash) {
|
if (flash) {
|
||||||
$('#'+div_name+'-'+id)
|
$('#'+div_name+'-'+id)
|
||||||
.css({'background-color' : 'yellow'})
|
//.addClass('ui-state-focus')
|
||||||
.slideDown()
|
.slideDown()
|
||||||
//.animate({ backgroundColor: "yellow" }, 300)
|
//.removeClass('ui-state-focus', 500)
|
||||||
.animate({ backgroundColor: "white" }, 500);
|
;
|
||||||
} else {
|
} else {
|
||||||
$('#'+div_name+'-'+id)
|
$('#'+div_name+'-'+id).show();
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
id = id - 0 + 1;
|
id = id - 0 + 1;
|
||||||
@@ -128,7 +129,7 @@ function fmtCurrency(amount) {
|
|||||||
// Get rid of any extraneous characters, determine
|
// Get rid of any extraneous characters, determine
|
||||||
// the sign, and round to the nearest cent.
|
// the sign, and round to the nearest cent.
|
||||||
amount = amount.toString().replace(/\$|\,/g,'');
|
amount = amount.toString().replace(/\$|\,/g,'');
|
||||||
sign = (amount == (amount = Math.abs(amount)));
|
var sign = (amount == (amount = Math.abs(amount)));
|
||||||
amount = (amount+0.0000000001).toFixed(2);
|
amount = (amount+0.0000000001).toFixed(2);
|
||||||
|
|
||||||
// Insert thousands separator
|
// Insert thousands separator
|
||||||
@@ -145,13 +146,37 @@ function fmtCurrency(amount) {
|
|||||||
//
|
//
|
||||||
// Datepicker helpers
|
// Datepicker helpers
|
||||||
|
|
||||||
|
function datepicker(id) {
|
||||||
|
$("#"+id).attr('autocomplete', 'off');
|
||||||
|
|
||||||
|
if ($("#"+id).datepicker != null) {
|
||||||
|
$("#"+id)
|
||||||
|
.datepicker({ constrainInput: true,
|
||||||
|
numberOfMonths: [1, 1],
|
||||||
|
showCurrentAtPos: 0,
|
||||||
|
dateFormat: 'mm/dd/yy' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function datepickerNow(id, usetime) {
|
function datepickerNow(id, usetime) {
|
||||||
now = new Date();
|
var now = new Date();
|
||||||
|
if ($("#"+id).datepicker != null) {
|
||||||
// datepicker seems to squash the time portion,
|
// datepicker seems to squash the time portion,
|
||||||
// so we have to pass in a copy of now instead.
|
// so we have to pass in a copy of now instead.
|
||||||
$("#"+id).datepicker('setDate', new Date(now));
|
$("#"+id).datepicker('setDate', new Date(now));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#"+id).val(((now.getMonth()+1) < 10 ? '0' : '')
|
||||||
|
+ (now.getMonth()+1) + '/'
|
||||||
|
+ (now.getDate() < 10 ? '0' : '')
|
||||||
|
+ now.getDate() + '/'
|
||||||
|
+ now.getFullYear());
|
||||||
|
}
|
||||||
|
|
||||||
if (usetime == null)
|
if (usetime == null)
|
||||||
usetime = true;
|
usetime = true;
|
||||||
|
|
||||||
$("#"+id).val($("#"+id).val() +
|
$("#"+id).val($("#"+id).val() +
|
||||||
(usetime
|
(usetime
|
||||||
? (' '
|
? (' '
|
||||||
@@ -163,17 +188,30 @@ function datepickerNow(id, usetime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function datepickerSet(fromid, id, a, b) {
|
function datepickerSet(fromid, id, a, b) {
|
||||||
|
var dt;
|
||||||
if (fromid == null)
|
if (fromid == null)
|
||||||
dt = new Date();
|
dt = new Date();
|
||||||
else
|
else {
|
||||||
|
if ($("#"+id).datepicker != null)
|
||||||
dt = new Date($("#"+fromid).datepicker('getDate'));
|
dt = new Date($("#"+fromid).datepicker('getDate'));
|
||||||
|
else
|
||||||
|
dt = new Date($("#"+fromid).val());
|
||||||
|
}
|
||||||
|
|
||||||
if (a != null)
|
if (a != null)
|
||||||
dt.setDate(a);
|
dt.setDate(a);
|
||||||
if (b != null)
|
if (b != null)
|
||||||
dt.setDate(b);
|
dt.setDate(b);
|
||||||
|
|
||||||
|
if ($("#"+id).datepicker != null)
|
||||||
$("#"+id).datepicker('setDate', dt);
|
$("#"+id).datepicker('setDate', dt);
|
||||||
|
else {
|
||||||
|
$("#"+id).val(((dt.getMonth()+1) < 10 ? '0' : '')
|
||||||
|
+ (dt.getMonth()+1) + '/'
|
||||||
|
+ (dt.getDate() < 10 ? '0' : '')
|
||||||
|
+ dt.getDate() + '/'
|
||||||
|
+ dt.getFullYear());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function datepickerBOM(fromid, id) {
|
function datepickerBOM(fromid, id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user