Compare commits

..

10 Commits

Author SHA1 Message Date
abijah
1e6c69c70e Really intended to check the sandbox script into the pre_0.1 branch. I'll do that next, then merge here.
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@812 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-28 20:52:15 +00:00
abijah
75eecd9771 Added script to build a sandbox from the current data. The location of the script is unsafe, but since it can only muck up the sandbox database, it doesn't matter.
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@811 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-28 20:50:52 +00:00
abijah
50eb7c0f5d Merge out from the pre_0.1 branch
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@810 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-28 20:48:52 +00:00
abijah
fbc2de9427 Merge out from the pre_0.1 branch (previous so called 'merge in' was also really a merge out)
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@796 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-27 17:28:12 +00:00
abijah
0e8b541e34 Merge in from the pre_0.1 branch
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@794 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-27 17:23:22 +00:00
abijah
d32b002a98 Changed the theme to make it clear when we're in the sandbox.
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@748 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-23 18:53:21 +00:00
abijah
3c7f02e76c Merge in from pre_0.1 branch
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@747 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-23 18:50:59 +00:00
abijah
3e78240974 Modified to use the sandbox database
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@746 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-23 18:49:20 +00:00
abijah
3b98b74517 Merge in from the pre_0.1 branch
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@744 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-23 14:43:16 +00:00
abijah
9e550c7833 Branch to contain the most stable 0.1 work, along with changes to ensure a sandbox database is used.
git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@742 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-23 14:25:05 +00:00
40 changed files with 362 additions and 762 deletions

View File

@@ -1,3 +1,6 @@
@echo off
mysql --user=pmgr --password=pmgruser < %~dp0\db\property_manager.sql
echo Done!
sed "s/property_manager/pmgr_sand/g" %~dp0\db\property_manager.sql > H:\pmgr_sand.sql
mysql --user=pmgr --password=pmgruser < H:\pmgr_sand.sql
del H:\pmgr_sand.sql
echo Rebuild Complete!

View File

@@ -230,7 +230,7 @@ CREATE TABLE `pmgr_contact_addresses` (
`country` varchar(128) DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -282,7 +282,6 @@ INSERT INTO `pmgr_contact_addresses` VALUES (42,'2272 Shoshone','Boise','ID','83
INSERT INTO `pmgr_contact_addresses` VALUES (43,'PO Box 626','Chewelah','WA','99109','USA',NULL);
INSERT INTO `pmgr_contact_addresses` VALUES (44,'4565 Hwy 231','Springdale','WA','99173','USA',NULL);
INSERT INTO `pmgr_contact_addresses` VALUES (45,'3463 B Hwy 395 South','Loon Lake','WA','99148','USA',NULL);
INSERT INTO `pmgr_contact_addresses` VALUES (46,'PO Box 51','Valley','WA','99181',NULL,NULL);
/*!40000 ALTER TABLE `pmgr_contact_addresses` ENABLE KEYS */;
UNLOCK TABLES;
@@ -739,7 +738,6 @@ INSERT INTO `pmgr_contacts_methods` VALUES (65,'PHONE',63,'MAIN','PRIMARY',NULL)
INSERT INTO `pmgr_contacts_methods` VALUES (66,'PHONE',64,'MAIN','PRIMARY',NULL);
INSERT INTO `pmgr_contacts_methods` VALUES (77,'PHONE',65,'MAIN','PRIMARY',NULL);
INSERT INTO `pmgr_contacts_methods` VALUES (76,'PHONE',66,'MAIN','PRIMARY',NULL);
INSERT INTO `pmgr_contacts_methods` VALUES (60,'ADDRESS',46,'MAIN','PRIMARY',NULL);
/*!40000 ALTER TABLE `pmgr_contacts_methods` ENABLE KEYS */;
UNLOCK TABLES;
@@ -811,7 +809,7 @@ INSERT INTO `pmgr_customers` VALUES (40,'Hovland, Pamela',55,1,1,0,NULL);
INSERT INTO `pmgr_customers` VALUES (41,'Hooke, R.R.',57,1,1,0,NULL);
INSERT INTO `pmgr_customers` VALUES (42,'Clark, Bill',58,1,0,1,NULL);
INSERT INTO `pmgr_customers` VALUES (43,'Jackson, Shirley',59,1,0,1,NULL);
INSERT INTO `pmgr_customers` VALUES (44,'Conway, Cathy',60,1,0,1,NULL);
INSERT INTO `pmgr_customers` VALUES (44,'Conway, Cathy',60,1,1,0,NULL);
INSERT INTO `pmgr_customers` VALUES (45,'Walch, John',61,1,0,1,NULL);
INSERT INTO `pmgr_customers` VALUES (46,'Johnson, Joni',62,1,0,1,NULL);
INSERT INTO `pmgr_customers` VALUES (47,'Mancini, Krystan',63,1,1,0,NULL);
@@ -844,7 +842,7 @@ CREATE TABLE `pmgr_default_options` (
`option_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -870,7 +868,7 @@ CREATE TABLE `pmgr_default_permissions` (
`permission_value_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -924,7 +922,7 @@ CREATE TABLE `pmgr_double_entries` (
`credit_entry_id` int(10) unsigned NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=765 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=761 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -1661,10 +1659,6 @@ INSERT INTO `pmgr_double_entries` VALUES (756,1511,1512,NULL);
INSERT INTO `pmgr_double_entries` VALUES (757,1514,1513,NULL);
INSERT INTO `pmgr_double_entries` VALUES (758,1515,1516,NULL);
INSERT INTO `pmgr_double_entries` VALUES (759,1518,1517,NULL);
INSERT INTO `pmgr_double_entries` VALUES (761,1521,1522,NULL);
INSERT INTO `pmgr_double_entries` VALUES (762,1524,1523,NULL);
INSERT INTO `pmgr_double_entries` VALUES (763,1526,1525,NULL);
INSERT INTO `pmgr_double_entries` VALUES (764,1527,1528,NULL);
/*!40000 ALTER TABLE `pmgr_double_entries` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1682,7 +1676,7 @@ CREATE TABLE `pmgr_group_options` (
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `group_key` (`group_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -1710,7 +1704,7 @@ CREATE TABLE `pmgr_group_permissions` (
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `group_key` (`group_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -1739,7 +1733,7 @@ CREATE TABLE `pmgr_groups` (
`rank` smallint(5) unsigned NOT NULL DEFAULT '100',
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -1883,7 +1877,7 @@ INSERT INTO `pmgr_leases` VALUES (34,'34',1,69,41,NULL,'2008-11-14',NULL,'2008-1
INSERT INTO `pmgr_leases` VALUES (35,'35',1,35,1,NULL,'2009-01-01',NULL,'2009-01-01','2009-05-31',NULL,NULL,NULL,'2009-05-31','2009-05-31','2009-05-31',NULL,45.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (36,'36',1,52,43,NULL,'2009-01-01',NULL,'2009-01-01','2009-03-28',NULL,NULL,NULL,'2009-03-28','2009-03-31','2009-03-31',25.00,30.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (37,'37',1,21,46,NULL,'2009-02-01',NULL,'2009-02-01','2009-03-31',NULL,NULL,NULL,'2009-03-31','2009-03-31','2009-03-31',NULL,70.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (38,'38',1,25,44,NULL,'2009-02-01',NULL,'2009-02-01','2009-08-26',NULL,NULL,NULL,'2009-08-26','2009-08-31','2009-08-31',25.00,70.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (38,'38',1,25,44,NULL,'2009-02-01',NULL,'2009-02-01',NULL,NULL,NULL,NULL,NULL,'2009-08-31','2009-08-31',25.00,70.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (39,'39',1,64,45,NULL,'2009-02-01',NULL,'2009-02-01','2009-03-10',NULL,NULL,NULL,'2009-03-10','2009-03-31','2009-03-31',NULL,70.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (40,'40',1,41,8,NULL,'2009-02-01',NULL,'2009-02-01',NULL,NULL,NULL,NULL,NULL,'2009-08-31','2009-08-31',150.00,375.00,NULL,NULL,NULL);
INSERT INTO `pmgr_leases` VALUES (41,'41',1,45,42,NULL,'2009-02-01',NULL,'2009-02-01','2009-03-31',NULL,NULL,NULL,'2009-03-31','2009-03-31','2009-03-31',NULL,49.00,NULL,NULL,NULL);
@@ -1937,7 +1931,7 @@ CREATE TABLE `pmgr_ledger_entries` (
`amount` float(12,2) NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1529 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=1521 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -3402,14 +3396,6 @@ INSERT INTO `pmgr_ledger_entries` VALUES (1515,645,24,55,'DEBIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1516,645,1,27,'CREDIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1517,692,13,39,'CREDIT',10.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1518,692,1,27,'DEBIT',10.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1521,693,12,38,'DEBIT',25.00,'Released Security Deposit');
INSERT INTO `pmgr_ledger_entries` VALUES (1522,693,1,27,'CREDIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1523,693,24,55,'CREDIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1524,693,1,27,'DEBIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1525,694,20,46,'CREDIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1526,694,1,27,'DEBIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1527,693,24,55,'DEBIT',25.00,NULL);
INSERT INTO `pmgr_ledger_entries` VALUES (1528,693,1,27,'CREDIT',25.00,NULL);
/*!40000 ALTER TABLE `pmgr_ledger_entries` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3713,7 +3699,7 @@ CREATE TABLE `pmgr_option_values` (
`value` varchar(255) NOT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -3742,7 +3728,7 @@ CREATE TABLE `pmgr_options` (
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_key` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -3770,7 +3756,7 @@ CREATE TABLE `pmgr_permission_values` (
`level` smallint(5) unsigned DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -3799,7 +3785,7 @@ CREATE TABLE `pmgr_permissions` (
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_key` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -3995,7 +3981,7 @@ CREATE TABLE `pmgr_statement_entries` (
`reverse_transaction_id` int(10) unsigned DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=900 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=897 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -4835,8 +4821,6 @@ INSERT INTO `pmgr_statement_entries` VALUES (891,'REFUND',690,'2009-08-05',NULL,
INSERT INTO `pmgr_statement_entries` VALUES (892,'DISBURSEMENT',646,'2009-08-05',NULL,NULL,58,NULL,25.00,24,891,NULL,NULL);
INSERT INTO `pmgr_statement_entries` VALUES (894,'DISBURSEMENT',645,'2009-08-05',NULL,NULL,59,NULL,25.00,24,893,NULL,NULL);
INSERT INTO `pmgr_statement_entries` VALUES (895,'CHARGE',692,'2009-06-27','2009-07-11',NULL,37,72,10.00,13,NULL,NULL,NULL);
INSERT INTO `pmgr_statement_entries` VALUES (898,'REFUND',694,'2009-09-03',NULL,NULL,44,NULL,25.00,20,NULL,NULL,NULL);
INSERT INTO `pmgr_statement_entries` VALUES (899,'DISBURSEMENT',693,'2009-09-03',NULL,NULL,44,NULL,25.00,24,898,NULL,NULL);
/*!40000 ALTER TABLE `pmgr_statement_entries` ENABLE KEYS */;
UNLOCK TABLES;
@@ -5161,7 +5145,7 @@ CREATE TABLE `pmgr_transactions` (
`amount` float(12,2) DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=695 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=693 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -5837,8 +5821,6 @@ INSERT INTO `pmgr_transactions` VALUES (689,'RECEIPT','2009-08-18 04:19:02',38,1
INSERT INTO `pmgr_transactions` VALUES (690,'PAYMENT','2009-08-05 07:00:00',58,1,27,'DEBIT',25.00,NULL);
INSERT INTO `pmgr_transactions` VALUES (691,'PAYMENT','2009-08-05 07:00:00',59,1,27,'DEBIT',25.00,NULL);
INSERT INTO `pmgr_transactions` VALUES (692,'INVOICE','2009-06-27 07:00:00',37,1,27,'DEBIT',10.00,'In consideration with other leases, $10 for temporary boat trailer storage');
INSERT INTO `pmgr_transactions` VALUES (693,'RECEIPT','2009-08-26 07:00:00',44,1,27,'CREDIT',25.00,'Security Deposit Release');
INSERT INTO `pmgr_transactions` VALUES (694,'PAYMENT','2009-09-03 18:16:00',44,1,27,'DEBIT',25.00,'Paid online. Confirmation #0909040056');
/*!40000 ALTER TABLE `pmgr_transactions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -5970,7 +5952,7 @@ INSERT INTO `pmgr_units` VALUES (21,3,'32','32','VACANT',43,27,25.00,70.00,NULL)
INSERT INTO `pmgr_units` VALUES (22,3,'33','33','OCCUPIED',44,26,25.00,70.00,NULL);
INSERT INTO `pmgr_units` VALUES (23,3,'34','34','OCCUPIED',45,25,25.00,70.00,NULL);
INSERT INTO `pmgr_units` VALUES (24,3,'35','35','VACANT',46,24,25.00,70.00,NULL);
INSERT INTO `pmgr_units` VALUES (25,3,'36','36','VACANT',47,23,25.00,70.00,NULL);
INSERT INTO `pmgr_units` VALUES (25,3,'36','36','OCCUPIED',47,23,25.00,70.00,NULL);
INSERT INTO `pmgr_units` VALUES (26,4,'37','37','OCCUPIED',48,22,25.00,50.00,NULL);
INSERT INTO `pmgr_units` VALUES (27,4,'38','38','COMPANY',49,21,25.00,50.00,'Contains lumber, tools, etc.');
INSERT INTO `pmgr_units` VALUES (28,5,'39','39','OCCUPIED',50,68,25.00,80.00,NULL);
@@ -6093,7 +6075,7 @@ CREATE TABLE `pmgr_users` (
`contact_id` int(10) unsigned DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
@@ -6124,4 +6106,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2009-09-03 18:19:01
-- Dump completed on 2009-08-28 4:00:19

View File

@@ -39,7 +39,7 @@ class AppController extends Controller {
var $helpers = array('Html', 'Form', 'Javascript', 'Format', 'Time', 'Grid');
var $components = array('DebugKit.Toolbar');
var $sidemenu = array('areas' => array('SITE' => false, 'CONTROLLER' => false, 'ACTION' => false, 'SANDBOX' => false));
var $sidemenu = array('areas' => array('SITE' => false, 'CONTROLLER' => false, 'ACTION' => false));
var $std_area = 10;
var $admin_area = 20;
var $dev_area = 30;
@@ -71,8 +71,6 @@ class AppController extends Controller {
$name = Inflector::humanize($this->params['controller']);
elseif ($area == 'ACTION')
$name = Inflector::humanize(Inflector::singularize($this->params['controller']));
elseif ($area == 'SANDBOX')
$name = 'Sandbox';
if (empty($this->sidemenu['areas'][$area]))
$this->sidemenu['areas'][$area]
@@ -199,6 +197,7 @@ class AppController extends Controller {
array('controller' => 'transactions', 'action' => 'deposit'), null,
'SITE');
$this->addSideMenuLink('Accounts',
array('controller' => 'accounts', 'action' => 'index'), null,
'SITE', $this->admin_area);
@@ -223,6 +222,9 @@ class AppController extends Controller {
$this->addSideMenuLink('Assess Charges',
array('controller' => 'leases', 'action' => 'assess_all'), null,
'SITE', $this->admin_area);
$this->addSideMenuLink('RESET DATA',
array('controller' => 'accounts', 'action' => 'reset_data'), null,
'SITE', $this->admin_area);
$this->addSideMenuLink('Un-Nuke',
@@ -232,53 +234,28 @@ class AppController extends Controller {
$this->addSideMenuLink('New Ledgers',
array('controller' => 'accounts', 'action' => 'newledger'), null,
'SITE', $this->dev_area);
//array('name' => 'RESET DATA', array('controller' => 'accounts', 'action' => 'reset_data'));
$this->addSideMenuLink('New Receipt',
array('controller' => 'customers', 'action' => 'receipt'), null,
'SITE', $this->op_area);
$this->addSideMenuLink('New Invoice',
array('controller' => 'leases', 'action' => 'invoice'), null,
'SITE', $this->op_area);
$this->addSideMenuLink('Move-In',
array('controller' => 'customers', 'action' => 'move_in'), null,
'SITE', $this->op_area);
$this->addSideMenuLink('Move-Out',
array('controller' => 'leases', 'action' => 'move_out'), null,
'SITE', $this->op_area);
$this->addSideMenuLink('New Deposit',
array('controller' => 'tenders', 'action' => 'deposit'), 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
// Depending on preference, we may put this into the gridView
// function, making the links available only when navigating.
@@ -304,32 +281,26 @@ class AppController extends Controller {
*/
function beforeFilter() {
$this->params['user'] = $this->Permission->User->currentUser();
$this->params['dev'] = $this->Option->enabled('dev');
$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'])
Configure::write('debug', '0');
$this->addDefaultSideMenuLinks();
//$this->sideMenuEnable('SITE', $this->op_area, false);
$this->sideMenuEnable('SITE', $this->op_area, false);
foreach ($this->sidemenu['areas'] AS $area_name => $area) {
if (empty($this->params['dev']))
$this->sideMenuEnable($area_name, $this->dev_area, false);
if (empty($this->params['admin']))
$this->sideMenuEnable($area_name, $this->admin_area, false);
}
$this->authorize("controller.{$this->params['controller']}");
$this->authorize("controller.{$this->params['controller']}");
$this->authorize("action.{$this->params['controller']}.{$this->params['action']}");
$this->log('----------------------------------------------------------------------', 'request');
$this->log('----------------------------------------------------------------------', 'request');
$this->log($this->params, 'request');
$this->authorize("action.{$this->params['controller']}.{$this->params['action']}");
}
}
@@ -366,21 +337,21 @@ class AppController extends Controller {
foreach ($subarea['priorities'] AS $pname => &$priority) {
if (empty($priority))
unset($subarea['priorities'][$pname]);
}
}
unset($priority);
if (empty($subarea['priorities']))
unset($area['subareas'][$sname]);
}
}
unset($subarea);
if (empty($area['subareas']))
unset($this->sidemenu['areas'][$aname]);
}
}
unset($area);
// Activate a default section (unless already specified)
foreach (array_reverse(array_diff_key($this->sidemenu['areas'], array('SANDBOX'=>1))) AS $area_name => $area) {
foreach (array_reverse($this->sidemenu['areas']) AS $area_name => $area) {
if (empty($area))
continue;
@@ -429,6 +400,35 @@ 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 = preg_replace("%/webroot/index\.php$%",
"/../build.cmd",
$_SERVER['SCRIPT_FILENAME']);
echo "<P>" . date('r') . "\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>\n";
while (($read = fread($handle, 2096))) {
echo str_replace("\n", "<BR>\n", htmlspecialchars($read));
}
pclose($handle);
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -600,8 +600,8 @@ class AppController extends Controller {
// Grouping (which would not be typical)
$query['group'] = $this->gridDataCountGroup($params, $model);
if ($params['debug'])
$params['count_query'] = $query;
// DEBUG PURPOSES ONLY!
$params['count_query'] = $query;
// Get the number of records prior to pagination
return $this->gridDataCountExecute($params, $model, $query);
@@ -857,8 +857,8 @@ class AppController extends Controller {
isset($params['sidx']) ? $params['sidx'] : null,
isset($params['sord']) ? $params['sord'] : null);
if ($params['debug'])
$params['query'] = $query;
// DEBUG PURPOSES ONLY!
$params['query'] = $query;
return $this->gridDataRecordsExecute($params, $model, $query);
}
@@ -981,7 +981,6 @@ class AppController extends Controller {
$this->gridDataPostProcessLinks($params, $model, $records, array());
// DEBUG PURPOSES ONLY!
//if ($params['debug'])
//$params['records'] = $records;
}
@@ -1059,7 +1058,6 @@ class AppController extends Controller {
continue;
// DEBUG PURPOSES ONLY!
//if ($params['debug'])
//$params['linkrecord'][] = compact('table', 'field', 'id', 'controller', 'record');
$record[$table][$field] =
'<A HREF="' .
@@ -1092,7 +1090,7 @@ class AppController extends Controller {
function gridDataOutputHeader(&$params, &$model) {
if (!$params['debug'])
header("Content-type: text/xml;charset=utf-8");
}
}
function gridDataOutputXMLHeader(&$params, &$model) {
echo "<?xml version='1.0' encoding='utf-8'?>\n";

View File

@@ -38,13 +38,5 @@ App::import('Core', '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);
}
}
?>

View File

@@ -509,7 +509,7 @@ class AppModel extends Model {
function INTERNAL_ERROR($msg, $depth = 0, $force_stop = false) {
INTERNAL_ERROR($msg, $force_stop, $depth+1);
echo $this->requestAction(array('controller' => 'util',
echo $this->requestAction(array('controller' => 'accounts',
'action' => 'render_empty'),
array('return', 'bare' => false)
);

View File

@@ -1,5 +0,0 @@
@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!

View File

@@ -1,5 +0,0 @@
@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!

View File

@@ -33,28 +33,14 @@
*/
function sandbox() {
$r = Router::requestRoute();
return !empty($r[3]['sand_route']);
}
function devbox() {
$r = Router::requestRoute();
return !empty($r[3]['dev_route']);
return preg_match("%^/[^/]*sand/%", $_SERVER['REQUEST_URI']);
}
function server_request_var($var) {
if (preg_match("/^HTTP_ACCEPT|REMOTE_PORT/", $var))
return false;
return (preg_match("/^HTTP|REQUEST|REMOTE/", $var));
return (preg_match("/^HTTP/", $var));
}
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 '<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";
@@ -62,10 +48,8 @@ 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";
// 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 '<OL style="margin-top:0.5em; margin-left:0.0em";>' . "\n";
echo '<OL style="margin-left:1.5em";>' . "\n";
$trace = array_slice(debug_backtrace(false), $drop);
for ($i = 0; $i < count($trace); ++$i) {
$bline = $trace[$i]['line'];
@@ -81,36 +65,23 @@ function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
$bclas = null;
}
$O->log(" $bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")");
echo("<LI>$bfile:$bline (" . ($bclas ? "$bclas::$bfunc" : "entry point") . ")</LI>\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 '<UL style="margin-top:0.5em; margin-left:0.0em";>' . "\n";
foreach($_REQUEST AS $k => $v) {
$O->log(sprintf(" %-20s => %s", $k, $v));
echo("<LI>$k =&gt; $v</LI>\n");
}
echo "</UL>\n";
echo '<P><PRE style="color:#000; background:#c22; padding:0.5em 0 0 0;">' . "\n";
print_r($_REQUEST);
echo "</PRE>\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 '<UL style="margin-top:0.5em; margin-left:0.0em";>' . "\n";
foreach($SRV AS $k => $v) {
if ($k == 'REQUEST_TIME')
$v = date('c', $v);
$O->log(sprintf(" %-20s => %s", $k, $v));
echo("<LI>$k =&gt; $v</LI>\n");
}
echo "</UL>\n";
echo '<P><PRE style="color:#000; background:#c22; padding:0.5em 0 0 0;">' . "\n";
print_r(array_intersect_key($_SERVER, array_flip(array_filter(array_keys($_SERVER), 'server_request_var'))));
echo "</PRE>\n";
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\n";
echo date('c') . "<BR>\n";
echo 'Started: ' . date('c', $_SERVER['REQUEST_TIME']) . "<BR>\n";
echo 'Current: ' . date('c') . "<BR>\n";
echo '</DIV>';
if ($exit)

View File

@@ -7,13 +7,11 @@ class DATABASE_CONFIG {
'host' => 'localhost',
'login' => 'pmgr',
'password' => 'pmgruser',
'database' => 'property_manager',
'database' => 'pmgr_sand',
'prefix' => 'pmgr_',
);
function __construct() {
if (devbox())
$this->default['database'] = 'pmgr_dev';
if (sandbox())
$this->default['database'] = 'pmgr_sand';
}

View File

@@ -36,20 +36,4 @@ $default_path = array('controller' => 'maps', 'action' => 'view', '1');
*/
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));
?>

View File

@@ -23,9 +23,9 @@ class CustomersController extends AppController {
array('controller' => 'customers', 'action' => 'all'), null,
'CONTROLLER');
/* $this->addSideMenuLink('New Customer', */
/* array('controller' => 'customers', 'action' => 'add'), null, */
/* 'CONTROLLER', $this->new_area); */
$this->addSideMenuLink('New Customer',
array('controller' => 'customers', 'action' => 'add'), null,
'CONTROLLER', $this->new_area);
}

View File

@@ -48,9 +48,9 @@ class TransactionsController extends AppController {
function invoice() { $this->gridView('Invoices'); }
function receipt() { $this->gridView('Receipts'); }
function deposit() {
/* $this->addSideMenuLink('New Deposit', */
/* array('controller' => 'tenders', 'action' => 'deposit'), null, */
/* 'CONTROLLER', $this->new_area); */
$this->addSideMenuLink('New Deposit',
array('controller' => 'tenders', 'action' => 'deposit'), null,
'CONTROLLER', $this->new_area);
$this->gridView('Deposits');
}

View File

@@ -1,65 +0,0 @@
<?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'); }
}

View File

@@ -11,7 +11,7 @@ class Option extends AppModel {
static $option_set = array();
function getAll($name, $force = false) {
function getAll($name) {
/* $this->prClassLevel(30); */
/* //$this->OptionValue->prClassLevel(30); */
/* $this->Group->Membership->prClassLevel(30); */

View File

@@ -8,21 +8,19 @@ class User extends AppModel {
static $current_user_id;
function currentUser() {
if (!empty($_SERVER['REMOTE_USER']))
return $_SERVER['REMOTE_USER'];
return null;
}
function currentUserId() {
if (!empty(self::$current_user_id))
return self::$current_user_id;
if (!empty($_SERVER['REMOTE_USER']))
$login = $_SERVER['REMOTE_USER'];
else
$login = null;
$user = $this->find
('first',
array('recursive' => -1,
'conditions' => array('login' => $this->currentUser())));
'conditions' => compact('login')));
if (!empty($user['User']['id']))
self::$current_user_id = $user['User']['id'];

View File

@@ -178,8 +178,20 @@ echo $this->element('statement_entries', array
<script type="text/javascript"><!--
$(document).ready(function(){
datepicker('TxFromDate');
datepicker('TxThroughDate');
$("#TxFromDate")
.attr('autocomplete', 'off')
.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();
});
--></script>

View File

@@ -25,19 +25,13 @@ Configure::write('debug', '0');
beforeSubmit: verifyRequest, // pre-submit callback
success: showResponse, // post-submit callback
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postReceipt', 0)); ?>",
// other available options:
//clearForm: true, // clear all form fields after successful submit
//resetForm: true, // reset the form after successful submit
};
// bind form using 'ajaxForm'
if ($('#receipt-form').ajaxForm != null)
$('#receipt-form').ajaxForm(options);
else
$('#repeat, label[for=repeat]').remove();
$('#receipt-form').ajaxForm(options);
});
// pre-submit callback
@@ -399,7 +393,12 @@ Configure::write('debug', '0');
<script type="text/javascript"><!--
$(document).ready(function(){
datepicker('TransactionStamp');
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
$("#customer-id").val(0);
$("#receipt-customer-name").html("INTERNAL ERROR");

View File

@@ -4,8 +4,8 @@
$cols = array();
$cols['Relationship'] = array('index' => 'ContactsCustomer.type', 'formatter' => 'enum');
$cols['Name'] = array('index' => 'Contact.display_name', 'formatter' => 'longname');
$cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'name');
$cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'name');
$cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'longname');
$cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'longname');
$cols['Company'] = array('index' => 'Contact.company_name', 'formatter' => 'longname');
$cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment');

View File

@@ -148,14 +148,8 @@ foreach ($jqGridColumns AS $header => &$col) {
// No special formatting for name
unset($col['formatter']);
}
elseif (preg_match("/^(long|short)?enum$/",
$col['formatter'], $matches)) {
elseif ($col['formatter'] === 'enum') {
$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';
// No special formatting for enum
@@ -172,8 +166,7 @@ foreach ($jqGridColumns AS $header => &$col) {
// Just a rough approximation to ensure columns
// are wide enough to fully display their header.
$min_width = strlen($header) * 7;
$min_width = 0; // REVISIT <AP>: 20090829; if/while jqGrid is fixed width
$min_width = strlen($header) * 10;
if ((!isset($default['width']) || $default['width'] < $min_width) && !$default['force'])
$default['width'] = $min_width;
}
@@ -246,7 +239,6 @@ $jqGrid_setup = array_merge
'colNames' => array_keys($jqGridColumns),
'colModel' => array('--special' => $jqGridColumns),
'height' => $height,
'width' => 700,
'rowNum' => $limit,
'rowList' => $limitOptions,
'sortname' => $sortname,
@@ -266,46 +258,50 @@ $jqGrid_setup = array_merge
// to kick this thing off.
?>
<?php if ($first_grid): ?>
<script type="text/javascript"><!--
var currencyFormatter = function(cellval, opts, rowObject) {
if (!cellval)
return "";
return fmtCurrency(cellval);
}
var percentageFormatter = function(cellval, opts, rowObject) {
var precision;
if (typeof(opts.colModel) != 'undefined' &&
typeof(opts.colModel.formatoptions) != 'undefined' &&
typeof(opts.colModel.formatoptions.precision) != 'undefined')
precision = opts.colModel.formatoptions.precision;
else
precision = 0;
amount = cellval.toString().replace(/\%/g,'');
amount = (amount*100).toFixed(precision);
return amount+'%';
}
var idFormatter = function(cellval, opts, rowObject) {
if (!cellval)
return cellval;
return '#'+cellval;
}
--></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(){
currencyFormatter = function(cellval, opts, rowObject) {
if (!cellval)
return "";
return fmtCurrency(cellval);
}
percentageFormatter = function(cellval, opts, rowObject) {
var precision;
if (typeof(opts.colModel) != 'undefined' &&
typeof(opts.colModel.formatoptions) != 'undefined' &&
typeof(opts.colModel.formatoptions.precision) != 'undefined')
precision = opts.colModel.formatoptions.precision;
else
precision = 0;
amount = cellval.toString().replace(/\%/g,'');
amount = (amount*100).toFixed(precision);
return amount+'%';
}
idFormatter = function(cellval, opts, rowObject) {
if (!cellval)
return cellval;
return '#'+cellval;
}
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});
<?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>
<?php
if (count($search_fields) > 0) {
echo('<div>Search By:<BR>' . "\n");

View File

@@ -3,16 +3,16 @@
// Define the table columns
$cols = array();
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname', 'align' => 'center');
$cols['Unit'] = array('index' => 'Unit.name', 'width' => '50', 'align' => 'center');
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
$cols['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency');
$cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency');
$cols['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency', 'hiddenz' => true);
$cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency', 'hiddenz' => true);
$cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date');
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');
$cols['Closed'] = array('index' => 'Lease.close_date', 'formatter' => 'date');
$cols['Paid-Thru'] = array('index' => 'Lease.paid_through_date', 'formatter' => 'date');
$cols['Status'] = array('index' => 'status', 'formatter' => 'longenum');
$cols['Status'] = array('index' => 'status', 'formatter' => 'enum', 'width' => 100);
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');

View File

@@ -70,16 +70,14 @@ echo('</DIV>' . "\n"); // End #sidemenu-container
$javascript->codeBlock(
<<<JSCB
jQuery(document).ready(function(){
if (jQuery("#sidemenu").accordion != null) {
jQuery("#sidemenu").accordion
({ fillSpace : true,
event : "click hoverintent",
animated : "bounceslide",
jQuery("#sidemenu").accordion
({ fillSpace : true,
event : "click hoverintent",
animated : "bounceslide",
JSCB
. (isset($active_section) ? "\tactive : $active_section,\n" : '') .
<<<JSCB
});
}
});
JSCB
, array('inline' => false));

View File

@@ -15,7 +15,7 @@ $cols['Unit'] = array('index' => 'Unit.name', 'formatter' =>
$cols['Comment'] = array('index' => 'StatementEntry.comment', 'formatter' => 'comment', 'width'=>150);
$cols['Type'] = array('index' => 'StatementEntry.type', 'formatter' => 'longenum');
$cols['Type'] = array('index' => 'StatementEntry.type', 'formatter' => 'enum', 'width'=>120);
$cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name');
$cols['Debit'] = array('index' => 'charge', 'formatter' => 'currency');
$cols['Credit'] = array('index' => 'disbursement', 'formatter' => 'currency');

View File

@@ -17,4 +17,4 @@ $grid
->defaultFields(array('Date', 'Name', 'Amount'))
->searchFields(array('Name', 'Type'))
->render($this, isset($config) ? $config : null,
array_diff(array_keys($cols), array('Comment', 'Sub-Total')));
array_diff(array_keys($cols), array('Sub-Total')));

View File

@@ -9,7 +9,7 @@ $cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname'
$cols['Area'] = array('index' => 'sqft', 'formatter' => 'number');
$cols['Rent'] = array('index' => 'Unit.rent', 'formatter' => 'currency');
$cols['Deposit'] = array('index' => 'Unit.deposit', 'formatter' => 'currency');
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'enum');
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'name'); // We have enough real estate
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');

View File

@@ -268,21 +268,14 @@ class FormatHelper extends AppHelper {
// Helper function to convert PHP vars to javascript
function phpVarToJavascript($var, $name = '', $depth='', $special = false, $pretty = false) {
function phpVarToJavascript($var, $name = '', $depth='', $special = false) {
// Establish a prefix to use before printing $var
if ($pretty) {
$prefix = $depth;
$pretty_sp = " ";
$pretty_nl = "\n";
}
else {
$prefix = $pretty_sp = $pretty_nl = '';
}
$prefix = $depth;
// If given a name, set it up JS style
if ($name)
$prefix .= $name . ":" . $pretty_sp;
$prefix .= $name . ": ";
if (!isset($var))
return $prefix . 'null';
@@ -335,22 +328,22 @@ class FormatHelper extends AppHelper {
// PHP array indices can be a mix of integer and string based.
// Just guess here, unless flagged as a special case.
if (isset($var[0]) || $special)
return ($prefix . "[" . $pretty_nl
. implode("," . $pretty_nl,
return ($prefix . "[\n"
. implode(",\n",
array_map(array('FormatHelper', 'phpVarToJavascript'),
array_values($var),
array(),
array_fill(0, count($var), $depth.' ')
))
. ($pretty ? "\n$depth" : '') . "]");
. "\n$depth]");
return ($prefix . "{" . $pretty_nl
. implode("," . $pretty_nl,
return ($prefix . "{\n"
. implode(",\n",
array_map(array('FormatHelper', 'phpVarToJavascript'),
array_values($var), array_keys($var),
array_fill(0, count($var), $depth.' ')
))
. ($pretty ? "\n$depth" : '') . "}");
. "\n$depth}");
}
}

View File

@@ -6,7 +6,6 @@ class GridHelper extends AppHelper {
var $included, $invalid;
var $columns;
var $controller;
static $first_grid = true;
function __construct() {
$this->reset();
@@ -219,12 +218,8 @@ class GridHelper extends AppHelper {
if (isset($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));
echo $view->element('jqGrid', $this->jqGrid_options);
self::$first_grid = false;
// Since we only have one instance of this class
// as a helper, we must assume it could be used

View File

@@ -34,11 +34,7 @@
<head>
<?php echo $html->charset(); ?>
<title>
<?php if (devbox()) echo "*DEVBOX* "; ?>
<?php if (sandbox()) echo "*SANDBOX* "; ?>
Property Manager: <?php echo $title_for_layout; ?>
<?php if (sandbox()) echo " *SANDBOX*"; ?>
<?php if (devbox()) echo " *DEVBOX*"; ?>
</title>
<?php
// Reset the __scripts variable, which has already been dumped to
@@ -52,7 +48,7 @@
// mechanism _additional_ to what Cake has provided :-/
$this->__scripts = array();
if (!empty($_SERVER['HTTPS']))
if (!empty($_SERVER['HTTPS']))
$protocol = 'https://';
else
$protocol = 'http://';
@@ -62,27 +58,20 @@
echo $html->css('layout') . "\n";
echo $html->css('print', null, array('media' => 'print')) . "\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 = 'base';
$theme = 'dotluv';
$theme = 'dark-hive';
$theme = 'start';
if (devbox())
$theme = 'dotluv';
if (sandbox())
$theme = 'darkness';
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.hoverIntent') . "\n";
echo $javascript->link('pmgr.jquery') . "\n";
echo $javascript->link('pmgr') . "\n";
echo $scripts_for_layout . "\n";
?>

View File

@@ -27,34 +27,19 @@ Configure::write('debug', '0');
// prepare the form when the DOM is ready
$(document).ready(function() {
$("#debug").append('doc ready1' + '<BR>');
var options = {
target: '#output-debug', // target element(s) to be updated with server response
beforeSubmit: verifyRequest, // pre-submit callback
success: showResponse, // post-submit callback
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postInvoice', 0)); ?>",
// other available options:
//clearForm: true, // clear all form fields after successful submit
//resetForm: true, // reset the form after successful submit
};
if ($('#invoice-form').ajaxForm != null)
$("#debug").append('ajax present' + '<BR>');
else
$("#debug").append('ajax not present' + '<BR>');
};
// bind form using 'ajaxForm'
if ($('#invoice-form').ajaxForm != null) {
$("#debug").append('go ajax' + '<BR>');
$('#invoice-form').ajaxForm(options);
$("#debug").append('ajax set' + '<BR>');
}
else
$('#repeat, label[for=repeat]').remove();
});
$('#invoice-form').ajaxForm(options);
});
// pre-submit callback
function verifyRequest(formData, jqForm, options) {
@@ -76,14 +61,14 @@ function verifyRequest(formData, jqForm, options) {
}
// Terrible way to accomplish this...
/* for (var j = 0; j < 20; ++j) { */
/* if (formData[i]['name'] == "data[Entry]["+j+"][amount]" && */
/* !(formData[i]['value'] > 0)) { */
/* //$("#debug").append('<P>Bad Amount'); */
/* alert("Must enter a valid amount"); */
/* return false; */
/* } */
/* } */
for (var j = 0; j < 20; ++j) {
if (formData[i]['name'] == "data[Entry]["+j+"][amount]" &&
!(formData[i]['value'] > 0)) {
//$("#debug").append('<P>Bad Amount');
alert("Must enter a valid amount");
return false;
}
}
}
//$("#debug").append('OK');
@@ -131,13 +116,11 @@ function showResponse(responseText, statusText) {
// Reset the form
function resetForm(nocharge) {
$("#debug").append('reset form: ' + nocharge + '<BR>');
$('#charge-entry-id').val(1);
$('#charges').html('');
if (!nocharge)
addChargeSource(false);
$("#debug").append('reset form done' + '<BR>');
}
@@ -163,7 +146,6 @@ function onRowSelect(grid_id, lease_id) {
}
function onGridState(grid_id, state) {
$("#debug").append('on grid state: ' + grid_id + '; ' + state + '<BR>');
if (state == 'visible') {
$(".lease-selection-invalid").hide();
$(".lease-selection-valid").hide();
@@ -177,11 +159,9 @@ function onGridState(grid_id, state) {
$(".lease-selection-invalid").show();
}
}
$("#debug").append('on grid state done' + '<BR>');
}
function addChargeSource(flash) {
$("#debug").append('add charge source' + '<BR>');
var id = $("#charge-entry-id").val();
addDiv('charge-entry-id', 'charge', 'charges', flash,
// HTML section
@@ -218,14 +198,21 @@ function addChargeSource(flash) {
'</FIELDSET>'
);
$("#debug").append('add div complete' + '<BR>');
$("#debug").append('add datepicker1' + '<BR>');
datepicker("Entry"+id+"EffectiveDate");
$("#debug").append('add datepicker2' + '<BR>');
datepicker("Entry"+id+"ThroughDate");
$("#Entry"+id+"EffectiveDate")
.attr('autocomplete', 'off')
.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' });
$("#debug").append('add charge source complete' + '<BR>');
return id;
}
@@ -289,12 +276,6 @@ echo $form->input("Lease.id",
'type' => 'hidden',
'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 ' <legend>Invoice</legend>' . "\n"; */
@@ -349,8 +330,12 @@ Configure::write('debug', '0');
};
$(document).ready(function(){
$("#debug").append('doc ready2' + '<BR>');
datepicker('TransactionStamp');
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
$("#lease-id").val(0);
$("#invoice-lease").html("INTERNAL ERROR");
@@ -362,17 +347,15 @@ Configure::write('debug', '0');
<?php if (empty($movein)): ?>
$("#debug").append('movein empty' + '<BR>');
resetForm();
datepickerNow('TransactionStamp');
<?php else: ?>
$("#debug").append('movein not empty' + '<BR>');
var id;
resetForm(true);
$("#TransactionStamp").attr('disabled', true);
$("#TransactionStamp").datepicker('disable');
$("#TransactionStamp").val("<?php echo date('m/d/Y', $movein['time']); ?>");
$('#TransactionStamp').after
('<input type="hidden"' +

View File

@@ -34,39 +34,6 @@ function resetForm() {
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) {
cell_name = item_type.charAt(0).toUpperCase() + item_type.substr(1);
if (item_type == 'lease')
@@ -242,7 +209,6 @@ else {
}
echo $form->create(null, array('id' => 'move-inout-form',
'onsubmit' => 'return verifyRequest();',
'url' => array('controller' => 'leases',
'action' => $move_action)));
@@ -316,7 +282,13 @@ echo $form->end('Perform Move ' . ucfirst($move_type));
<script type="text/javascript"><!--
$(document).ready(function(){
datepicker('LeaseMoveDate');
$("#LeaseMoveDate")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
<?php if ($move_type === 'out') { ?>

View File

@@ -60,7 +60,13 @@ function resetForm() {
}
$(document).ready(function(){
datepicker('TransactionStamp');
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
});
--></script>

View File

@@ -60,7 +60,13 @@ function resetForm() {
}
$(document).ready(function(){
datepicker('TransactionStamp');
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
});
--></script>

View File

@@ -75,7 +75,13 @@ function resetForm() {
}
$(document).ready(function(){
datepicker('TransactionStamp');
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
});
--></script>

View File

@@ -92,7 +92,13 @@ function resetForm() {
}
$(document).ready(function(){
datepicker('TransactionStamp');
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
});
--></script>

View File

@@ -22,6 +22,11 @@
*/
* {
margin:0;
padding:0;
}
/* Layout */
#container {
text-align: left;

View File

@@ -11,7 +11,6 @@
* Overall page layout
*/
body { padding: 0; margin: 0 }
table#layout { width: 100% }
td#sidecolumn ,
td#pagecolumn { vertical-align: top; }
@@ -286,7 +285,6 @@ span.grid-error {
.ui-jqgrid span.ui-jqgrid-title h2 {
font-weight: bold;
font-size: 140%;
margin: 0;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,136 +0,0 @@
/**
* 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) {
}
};

View File

@@ -0,0 +1,57 @@
/* ******************************************************************************
* 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;
}
};

View File

@@ -9,7 +9,7 @@
* array/hash/object that is given.
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
*/
function dump_old(arr,level) {
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;
@@ -34,55 +34,53 @@ function dump_old(arr,level) {
return dumped_text;
}
function dump(element, limit, depth) {
limit = (limit == null) ? 1 : limit;
depth = (depth == null) ? 0 : depth;
var rep1 = new Array(5);
var pad1 = rep1.join(" ");
var rep = new Array(depth+1);
var pad = rep.join(pad1);
function var_dump(element, limit, depth)
{
depth = depth?depth:0;
limit = limit?limit:1;
var props = new Array;
for(property in element)
returnString = '<ol>';
for(property in element)
{
//Property domConfig isn't accessable
if (property == 'domConfig')
continue;
//Property domConfig isn't accessable
if (property != 'domConfig')
{
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')
returnString += ' : <em>' + element[property] + '</em>';
if (typeof element[property] == 'string' && element[property])
returnString += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
element[property].replace(/</g, '&amp;lt;').replace(/>/g, '&amp;gt;') + '</code></div>';
if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
propstr += ' : <em>' + element[property] + '</em>';
if (typeof element[property] == 'string' && element[property])
propstr += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
htmlEscape(element[property]) + '</code></div>';
if ((typeof element[property] == 'object') && (depth < limit))
propstr += "\n" + pad + dump(element[property], limit, (depth + 1));
if ((typeof element[property] == 'object') && (depth < limit))
returnString += var_dump(element[property], limit, (depth + 1));
props.push(propstr);
returnString += '</li>';
}
}
returnString += '</ol>';
if (props.length == 0)
return '';
if(depth == 0)
{
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
winpop.document.write('<pre>'+returnString+ '</pre>');
winpop.document.close();
}
return pad + '<ol><li>' + props.join("</li>\n" + pad + pad1 + "<li>") + "</li>\n" + pad + "</ol>";
return returnString;
}
function dump_window(element, limit) {
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
winpop.document.write(dump(element, limit));
winpop.document.close();
}
function htmlEscape (s) {
function htmlEncode(s)
{
//return s;
return s.replace(/&(?!\w+([;\s]|$))/g, "&amp;")
.replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
function htmlEncode(s) { return htmlEscape(s); }
function addDiv(id_name, div_name, into_div_name, flash, html, script) {
var id = $('#'+id_name).val();
@@ -104,13 +102,14 @@ function addDiv(id_name, div_name, into_div_name, flash, html, script) {
$("#"+into_div_name).append(html);
if (flash) {
$('#'+div_name+'-'+id)
//.addClass('ui-state-focus')
.slideDown()
//.removeClass('ui-state-focus', 500)
;
$('#'+div_name+'-'+id)
.css({'background-color' : 'yellow'})
.slideDown()
//.animate({ backgroundColor: "yellow" }, 300)
.animate({ backgroundColor: "white" }, 500);
} else {
$('#'+div_name+'-'+id).show();
$('#'+div_name+'-'+id)
.show();
}
id = id - 0 + 1;
@@ -129,7 +128,7 @@ function fmtCurrency(amount) {
// Get rid of any extraneous characters, determine
// the sign, and round to the nearest cent.
amount = amount.toString().replace(/\$|\,/g,'');
var sign = (amount == (amount = Math.abs(amount)));
sign = (amount == (amount = Math.abs(amount)));
amount = (amount+0.0000000001).toFixed(2);
// Insert thousands separator
@@ -146,37 +145,13 @@ function fmtCurrency(amount) {
//
// 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) {
var now = new Date();
if ($("#"+id).datepicker != null) {
// datepicker seems to squash the time portion,
// so we have to pass in a copy of now instead.
$("#"+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());
}
now = new Date();
// datepicker seems to squash the time portion,
// so we have to pass in a copy of now instead.
$("#"+id).datepicker('setDate', new Date(now));
if (usetime == null)
usetime = true;
$("#"+id).val($("#"+id).val() +
(usetime
? (' '
@@ -188,30 +163,17 @@ function datepickerNow(id, usetime) {
}
function datepickerSet(fromid, id, a, b) {
var dt;
if (fromid == null)
dt = new Date();
else {
if ($("#"+id).datepicker != null)
dt = new Date($("#"+fromid).datepicker('getDate'));
else
dt = new Date($("#"+fromid).val());
}
else
dt = new Date($("#"+fromid).datepicker('getDate'));
if (a != null)
dt.setDate(a);
if (b != null)
dt.setDate(b);
if ($("#"+id).datepicker != null)
$("#"+id).datepicker('setDate', dt);
else {
$("#"+id).val(((dt.getMonth()+1) < 10 ? '0' : '')
+ (dt.getMonth()+1) + '/'
+ (dt.getDate() < 10 ? '0' : '')
+ dt.getDate() + '/'
+ dt.getFullYear());
}
$("#"+id).datepicker('setDate', dt);
}
function datepickerBOM(fromid, id) {