Removed AJAX loading of User Enquiries view. This will make the initial load time of the View User page longer, but you can now update the status of the Enquiry again from that page. closes issue #52.
This commit is contained in:
parent
33369009bf
commit
5ddc942a93
|
|
@ -111,13 +111,14 @@ class UsersController extends AppController {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user':
|
case 'user':
|
||||||
//$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
|
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
|
||||||
|
$status_list = $this->User->Enquiry->Status->getJSON();
|
||||||
|
|
||||||
|
|
||||||
|
$this->set('status_list', $status_list);
|
||||||
|
$classNames = $this->User->Enquiry->Status->getClassNamesJSON();
|
||||||
|
$this->set('class_names', $classNames);
|
||||||
|
|
||||||
$this->render('viewUser');
|
$this->render('viewUser');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
echo $javascript->link('global');
|
echo $javascript->link('global');
|
||||||
echo $javascript->link('search');
|
echo $javascript->link('search');
|
||||||
echo $javascript->link('jquery.jeditable.mini');
|
echo $javascript->link('jquery.jeditable.mini');
|
||||||
//echo $javascript->link('ckeditor/adapters/jquery');
|
|
||||||
echo $javascript->link('jquery.validate');
|
echo $javascript->link('jquery.validate');
|
||||||
|
|
||||||
echo $scripts_for_layout;
|
echo $scripts_for_layout;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
<h3><?php __('Enquiries Assigned to this User');?></h3>
|
<h3><?php __('Enquiries Assigned to this User');?></h3>
|
||||||
<? /* If there are enquiries for this user, render the enquiries table passing the $enquiries array */ ?>
|
<? /* If there are enquiries for this user, render the enquiries table passing the $enquiries array */ ?>
|
||||||
<?php if (!empty($user['Enquiry'])) {
|
<?php if (!empty($user['Enquiry'])) {
|
||||||
echo $this->element('enquiry_table', $enquiries);
|
echo $this->element('enquiry_table', $enquiries, $status_list);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "No Enquiries for this User";
|
echo "No Enquiries for this User";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
<?=$javascript->link('view_user'); ?>
|
|
||||||
<?=$javascript->link('view_user_email'); ?>
|
<?=$javascript->link('view_user_email'); ?>
|
||||||
<span id="userID" style="display: none;"><?=$user['User']['id']?></span>
|
<span id="userID" style="display: none;"><?=$user['User']['id']?></span>
|
||||||
|
|
||||||
|
|
@ -33,15 +32,15 @@
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3><?php __('Enquiries Assigned to this User');?></h3>
|
<h3><?php __('Enquiries Assigned to '.$user['User']['first_name'].' '.$user['User']['last_name']);?></h3>
|
||||||
<button id="show" class="showHide">Show</button>
|
<?php if (!empty($enquiries)) {
|
||||||
<button id="hide" class="showHide">Hide</button>
|
echo $this->element('enquiry_table', $enquiries);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "No Enquiries have been assigned";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<div id="ajaxLoadEnquiry" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
|
|
||||||
|
|
||||||
<div id="enquiryTable">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,26 +2,6 @@ $(function() {
|
||||||
|
|
||||||
$('#show').hide();
|
$('#show').hide();
|
||||||
|
|
||||||
$("#ajaxLoadEnquiry").hide();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var userID = $('#userID').text();
|
|
||||||
|
|
||||||
|
|
||||||
var enquiriesURL = '/enquiries/view_user_enquiries/'+userID;
|
|
||||||
|
|
||||||
getPage(enquiriesURL);
|
|
||||||
|
|
||||||
|
|
||||||
$("div.paging > a, div.paging > span > a, th.paginatorSort > a").live('click',function() {
|
|
||||||
destination = $(this).attr('href');
|
|
||||||
getPage(destination);
|
|
||||||
return false;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#hide').click(function() {
|
$('#hide').click(function() {
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$('#show').show();
|
$('#show').show();
|
||||||
|
|
@ -35,14 +15,4 @@ $(function() {
|
||||||
$('#enquiryTable').slideDown('fast');
|
$('#enquiryTable').slideDown('fast');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function getPage(url) {
|
|
||||||
|
|
||||||
$.get(url, function(data) {
|
|
||||||
$('#enquiryTable').html(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
Loading…
Reference in a new issue