Changes to have the software function without the presence of jquery-ui (which may not be complete). Also, brought the jquery libraries to the server, instead of using them as hosted from google. Some browser configurations may have an issue with what they deem to be cross site scripting.

git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@822 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-29 20:27:12 +00:00
parent d79077e279
commit 7198d7e6f4
13 changed files with 172 additions and 95 deletions

View File

@@ -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>

View File

@@ -393,12 +393,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");

View File

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

View File

@@ -50,7 +50,7 @@
// mechanism _additional_ to what Cake has provided :-/ // mechanism _additional_ to what Cake has provided :-/
$this->__scripts = array(); $this->__scripts = array();
if (!empty($_SERVER['HTTPS'])) if (!empty($_SERVER['HTTPS']))
$protocol = 'https://'; $protocol = 'https://';
else else
$protocol = 'http://'; $protocol = 'http://';
@@ -60,8 +60,6 @@
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';
@@ -72,6 +70,13 @@
$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('jquery.hoverIntent') . "\n"; echo $javascript->link('jquery.hoverIntent') . "\n";
echo $javascript->link('pmgr') . "\n"; echo $javascript->link('pmgr') . "\n";

View File

@@ -199,19 +199,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;
} }
@@ -330,12 +319,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 +339,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"' +

View File

@@ -282,13 +282,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') { ?>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

19
site/webroot/js/jquery-1.3.2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -104,14 +104,13 @@ function addDiv(id_name, div_name, into_div_name, flash, html, script) {
$("#"+into_div_name).append(html); $("#"+into_div_name).append(html);
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;
@@ -147,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) {
var now = new Date(); var now = new Date();
// datepicker seems to squash the time portion, if ($("#"+id).datepicker != null) {
// so we have to pass in a copy of now instead. // datepicker seems to squash the time portion,
$("#"+id).datepicker('setDate', new Date(now)); // 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());
}
if (usetime == null) if (usetime == null)
usetime = true; usetime = true;
$("#"+id).val($("#"+id).val() + $("#"+id).val($("#"+id).val() +
(usetime (usetime
? (' ' ? (' '
@@ -168,15 +191,27 @@ function datepickerSet(fromid, id, a, b) {
var dt; var dt;
if (fromid == null) if (fromid == null)
dt = new Date(); dt = new Date();
else else {
dt = new Date($("#"+fromid).datepicker('getDate')); if ($("#"+id).datepicker != null)
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);
$("#"+id).datepicker('setDate', dt); 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());
}
} }
function datepickerBOM(fromid, id) { function datepickerBOM(fromid, id) {