Fixed edit Enquiry user
This commit is contained in:
parent
62ff111e38
commit
70d53e892d
|
|
@ -394,7 +394,7 @@ class EnquiriesController extends AppController {
|
|||
$this->data = $this->Enquiry->read(null, $id);
|
||||
}
|
||||
$enquiry = $this->Enquiry->read(null, $id);
|
||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
|
||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username'), 'conditions'=>array('User.type'=>'user')));
|
||||
//$customer = $this->Enquiry->Customer->findById($enquiry['Enquiry']['customer_id']);
|
||||
|
||||
$contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $enquiry['Enquiry']['customer_id'])));
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
class Shipment extends AppModel {
|
||||
|
||||
var $name = 'Shipment';
|
||||
var $validate = array(
|
||||
/* var $validate = array(
|
||||
'freight_forwarder_id' => array('numeric'),
|
||||
'airway_bill' => array('notempty')
|
||||
);
|
||||
); */
|
||||
|
||||
var $recursive = 1;
|
||||
|
||||
|
|
|
|||
1
views/jobs/autocomplete.ctp
Normal file
1
views/jobs/autocomplete.ctp
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$jobs_json;?>
|
||||
1
views/purchase_orders/autocomplete.ctp
Normal file
1
views/purchase_orders/autocomplete.ctp
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$POs_json?>
|
||||
|
|
@ -1,16 +1,6 @@
|
|||
<div class="shipments index">
|
||||
<h2><?php __('Shipments');?></h2>
|
||||
|
||||
<div id="alphaMessage">
|
||||
<h3>This is Alpha version of this functionality</h3>
|
||||
<pre>
|
||||
You're welcome to look around. Don't start relying on anything in it just yet though.
|
||||
|
||||
Validation still needs to be finished. Also, Box weights/dimensions and Invoice details.
|
||||
|
||||
Will hopefully be finished tomorrow (Friday Apr 29) - Karl</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<?php echo $javascript->link('shipment_index');?>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -1456,3 +1456,24 @@ table.shipments {
|
|||
padding-left: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.boxForm {
|
||||
border: 1px solid;
|
||||
width: 15em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.boxForm input {
|
||||
display: inline;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.boxForm label {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
text-align: right;
|
||||
width: 8em;
|
||||
}
|
||||
|
||||
.boxForm div {
|
||||
}
|
||||
|
|
@ -9,11 +9,11 @@ $(function() {
|
|||
modal: true,
|
||||
buttons: {
|
||||
"New Shipment": function() {
|
||||
var thisShipmentInputs = $('#ShipmentAddForm').find('input,select');
|
||||
var thisShipmentInputs = $('#ShipmentAddForm').find('input,select,textarea');
|
||||
|
||||
$.post('/shipments/ajax_edit', thisShipmentInputs, function(data) {
|
||||
$( "#dialog-form" ).dialog('close');
|
||||
window.location.reload();
|
||||
window.location.reload(); //Change this to fetch a new copy of the table and update a <div>.
|
||||
});
|
||||
|
||||
},
|
||||
|
|
@ -48,14 +48,19 @@ $(function() {
|
|||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display the relevent elements depending on this Shipment Type */
|
||||
$("#shipmentType").change(function() {
|
||||
|
||||
var shipmentTypeID = getSelectedID('#shipmentType');
|
||||
shipmentTypeID = parseInt(shipmentTypeID);
|
||||
$(".hiddenDefault").hide();
|
||||
|
||||
if(shipmentTypeID == 1) { //Import
|
||||
$("#importFields").show();
|
||||
$("#principle").show();
|
||||
switch(shipmentTypeID) {
|
||||
case 1:
|
||||
$("#importFields, #principle, #purchaseOrder, #freight_forwarder, #airway_bill, #boxes").show();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
@ -93,7 +98,7 @@ $(function() {
|
|||
//alert($('#PurchaseOrderID_'+ui.item.id).length);
|
||||
|
||||
|
||||
if($('#PurchaseOrderID_'+ui.item.id).length == 0) { //This Principle is already in the List. Don't do anything.'
|
||||
if($('#PurchaseOrderID_'+ui.item.id).length == 0) { //This PO is already in the List. Don't do anything.'
|
||||
addToList('PurchaseOrder', ui.item.id, ui.item.value, $('#purchaseOrdersList'));
|
||||
}
|
||||
|
||||
|
|
@ -107,15 +112,23 @@ $(function() {
|
|||
select: function( event, ui ) {
|
||||
//alert(ui.item.value + ":" + ui.item.id);
|
||||
|
||||
if($('#JobID_'+ui.item.id).length == 0) { //This Principle is already in the List. Don't do anything.'
|
||||
if($('#JobID_'+ui.item.id).length == 0) { //This Job is already in the List. Don't do anything.'
|
||||
addToList('Job', ui.item.id, ui.item.value, $('#jobsList'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#addBox").button().click(function() {
|
||||
addBox();
|
||||
});
|
||||
|
||||
$(".removeBox").click(function() {
|
||||
alert("REMOVE THIS SHIT MAN");
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Resets the Form to its default site
|
||||
*/
|
||||
|
|
@ -123,11 +136,27 @@ $(function() {
|
|||
function resetForm() {
|
||||
|
||||
$(".hiddenDefault").hide();
|
||||
$("#principle").hide();
|
||||
$("#ShipmentAddForm")[0].reset();
|
||||
}
|
||||
|
||||
|
||||
function addBox() {
|
||||
var newBoxForm = $("#boxFactory").clone();
|
||||
|
||||
|
||||
newBoxForm.attr('id','');
|
||||
newBoxForm.show();
|
||||
|
||||
var closeButton = $('<button>X</button>');
|
||||
closeButton.addClass('removeBox');
|
||||
closeButton.button();
|
||||
|
||||
newBoxForm.prepend(closeButton);
|
||||
|
||||
$("#boxes").append(newBoxForm);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A more generic way of handling the HABTM <ul> <li>[REMOVE BUTTON] NAME [HIDDEN INPUT]</li> </ul>
|
||||
|
|
@ -171,4 +200,7 @@ $(function() {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue