Changed jquery.get to jquery.ajax to solve caching issue in documents

This commit is contained in:
Karl Cordes 2011-06-28 14:30:41 +10:00
parent b1ca8b4524
commit 05cadcf644
4 changed files with 108 additions and 114 deletions

View file

@ -61,7 +61,6 @@ $class = ' class="altrow"';?>
<?php echo $enquiry['Enquiry']['comments']; ?>
</span>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Billing Address'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>

View file

@ -1,5 +1,4 @@
<?php
/* Quotenik 1.2 - Default Layout. Some Markup retained from CakePHP Default
<?php /* Quotenik 1.2 - Default Layout. Some Markup retained from CakePHP Default
*/ ?>
@ -12,15 +11,12 @@
<?php echo $title_for_layout; ?>
</title>
<?php
$debugLevel = Configure::read('debug');
if ($debugLevel > 0) {
echo $html->meta('favicon.ico', '/img/core.png', array('type' => 'icon'));
}
else {
} else {
echo $html->meta('icon');
}
echo $html->css('quotenik');
@ -40,8 +36,6 @@
//echo $javascript->link('ckeditor/adapters/jquery');
echo $scripts_for_layout;
?>
@ -57,8 +51,7 @@
<?php
if (isset($currentuser) == FALSE) {
echo $html->link('Login', '/users/login');
}
else {
} else {
$logoutlink = $html->link('Logout', '/users/logout');
echo $html->link($currentuser['User']['username'], '/users/view/' . $currentuser['User']['id']) . ' (' . $logoutlink . ')';
}
@ -139,8 +132,7 @@
<li> echo $html->link('Users Index', '/users/index'); </li>
<li class="last"><?php echo $html->link('Add User', '/users/add'); </li>
</ul>
</li>*/
?>
</li> */ ?>
<li><?php echo $html->link('Search', '/enquiries/search', array('id' => 'searchLink')); ?>
</li>
@ -167,10 +159,9 @@
</div>
<div id="footer">
<?php echo $html->link(
$html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")),
'http://www.cakephp.org/',
array('target'=>'_new'), null, false
<?php
echo $html->link(
$html->image('cake.power.gif', array('alt' => __("CakePHP: the rapid development php framework", true), 'border' => "0")), 'http://www.cakephp.org/', array('target' => '_new'), null, false
);
?>
</div>
@ -188,7 +179,6 @@
echo "<p>Search for: Enquiry Number, Job Number, Customer, Contact or Customer Order Number</p>";
echo $form->input('Enquiry.search_string', array('label' => false, 'id' => 'searchString'));
?>
<div class ="ui-widget">
@ -217,7 +207,6 @@
else
echo round($mem_usage / 1048576, 2) . " megabytes";
echo "<br/>";
?>

View file

@ -1093,9 +1093,8 @@ span.principle-emails {
span.enquiry-view-comments {
color: #000000;
font-size: 100%;
font-size: 90%;
text-align: left;
line-height: 1;
white-space: pre-line;
}

View file

@ -38,8 +38,10 @@ $(function() {
$.post('/line_items/ajax_add', thisLineItemInputs, function(data) {
if(data == 'SUCCESS') {
loadLineItems();
$( "#addLineItemModal" ).dialog('close');
}
else {
alert("Line Item could not be saved")
@ -50,13 +52,10 @@ $(function() {
},
Cancel: function() {
loadLineItems();
$( this ).dialog( "close" );
}
},
close: function() {
loadLineItems();
}
});
@ -410,8 +409,16 @@ function savePages() {
function loadLineItems() {
var documentID = $("#documentID").html();
$.get('/line_items/getTable/'+documentID, function(data) {
/*$.get('/line_items/getTable/'+documentID, function(data) {
$("#lineItems").html(data);
});*/
$.ajax({
url: '/line_items/getTable/'+documentID,
cache: false,
success: function(data) {
$("#lineItems").html(data);
}
});
}