Making quick add enquiry fix
This commit is contained in:
parent
b382094091
commit
476be0674f
|
|
@ -77,18 +77,17 @@ class EnquiriesController extends AppController {
|
|||
}
|
||||
|
||||
|
||||
function add() {
|
||||
/* function add() {
|
||||
$this->set('users',$this->Enquiry->User->find('list', array('conditions'=>array('User.type'=>'user', 'User.enabled'=>true))));
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
function add() {
|
||||
|
||||
if(empty($this->data)) {
|
||||
if(isset($this->params['named']['customerid'])) {
|
||||
$customer = $this->Enquiry->Cu
|
||||
* stomer->findById($this->params['named']['customerid']);
|
||||
$customer = $this->Enquiry->Customer->findById($this->params['named']['customerid']);
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please add Enquiries to an existing Customer', true));
|
||||
|
|
@ -96,9 +95,9 @@ class EnquiriesController extends AppController {
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($customer)) {*/
|
||||
if(isset($customer)) {
|
||||
/* Check if the customer exists in the database - otherwise send the user back to step 1*/
|
||||
/*if(!$customer) {
|
||||
if(!$customer) {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please try again', true));
|
||||
$this->redirect(array('action'=>'add'));
|
||||
}
|
||||
|
|
@ -150,15 +149,15 @@ class EnquiriesController extends AppController {
|
|||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/* Internal function to display page 2 of the Add Enquiry Form Wizard
|
||||
* to help make the flow-control logic of the add function clearer.
|
||||
* */
|
||||
/* function __showPage2($customer) { */
|
||||
function __showPage2($customer) {
|
||||
|
||||
/* Combine the first_name and last_name for the Contact Drop Down Box */
|
||||
/* $contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
|
||||
$contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
|
||||
$contacts = Set::Combine($contacts, '{n}.Contact.id', array('{0} {1}', '{n}.Contact.first_name', '{n}.Contact.last_name'));
|
||||
$states = $this->Enquiry->State->find('list');
|
||||
$countries = $this->Enquiry->Country->find('list', array('order'=> 'Country.name asc'));
|
||||
|
|
@ -169,9 +168,9 @@ class EnquiriesController extends AppController {
|
|||
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
|
||||
$this->set('billing_addresses', $customerAddresses);
|
||||
$this->set('shipping_addresses', $customerAddresses);
|
||||
$this->set('errors', $this->Enquiry->invalidFields()); */
|
||||
$this->set('errors', $this->Enquiry->invalidFields());
|
||||
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
|
||||
/*
|
||||
|
||||
if(isset($customerAddresses[0]['BillingAddress'])) {
|
||||
$billing_address_list[0] = "No Address Selected";
|
||||
foreach ($customerAddresses as $address) {
|
||||
|
|
@ -185,8 +184,7 @@ class EnquiriesController extends AppController {
|
|||
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Add enquiry_id to the Email Queue */
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ h1 {
|
|||
margin: 0.1em 0;
|
||||
}
|
||||
h2 {
|
||||
color: #e32;
|
||||
/*color: #e32; */
|
||||
color: #045FB4;
|
||||
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
|
||||
font-size: 190%;
|
||||
margin: 0;
|
||||
|
|
@ -77,7 +78,7 @@ h2 {
|
|||
}
|
||||
|
||||
h2 a {
|
||||
color: #e32;
|
||||
color: #045FB4;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,29 +66,21 @@ $(function() {
|
|||
modal: true,
|
||||
buttons: {
|
||||
"Edit Line Item": function() {
|
||||
|
||||
$('#LineItemDescription').ckeditor(function() {
|
||||
this.updateElement();
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
|
||||
var thisLineItemInputs = $('#LineItemEditForm').find('input,select,textarea');
|
||||
|
||||
$.post('/line_items/ajax_edit', thisLineItemInputs, function(data) {
|
||||
|
||||
|
||||
|
||||
if(data == 'SUCCESS') {
|
||||
$( "#editLineItemModal" ).dialog('close');
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
alert("Line Item could not be saved")
|
||||
$('#LineItemDescription').ckeditor(config);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
|
@ -98,6 +90,10 @@ $(function() {
|
|||
}
|
||||
},
|
||||
close: function() {
|
||||
$('#LineItemDescription').ckeditor(function() {
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
loadLineItems();
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue