- link('Principle Index', '/principles/index'); ?>
@@ -152,14 +143,16 @@
- create('Enquiry', array('default'=>false, 'div'=>false));
+ create('Enquiry', array('default'=>false, 'id'=>'searchForm'));
echo 'Search';
echo $html->image('system-search.png');
echo '
';
- echo "Search for anything: Enquiry Number, Job Number, Customer, Contact or Customer Order Number
";
+ echo "Search for: Enquiry Number, Job Number, Customer, Contact or Customer Order Number
";
+
echo $form->input('Enquiry.search_string', array('label'=>false, 'id'=>'searchString'));
- //echo $form->input('Customer.id', array('type'=>'hidden'));
+
echo $form->end();
diff --git a/views/line_items/view_table.ctp b/views/line_items/view_table.ctp
index f8140ac3..92763369 100644
--- a/views/line_items/view_table.ctp
+++ b/views/line_items/view_table.ctp
@@ -148,8 +148,8 @@
echo $quote['Currency']['symbol'].$lineItem['LineItem']['net_price']; ?>
- link(__('View', true), array('controller'=> 'line_items', 'action'=>'view', $lineItem['LineItem']['id'])); ?>
- link(__('Edit', true), array('controller'=> 'line_items', 'action'=>'edit', $lineItem['LineItem']['id']), array('class'=>'editLink')); ?>
+
+ link(__('View/Edit', true), array('controller'=> 'line_items', 'action'=>'edit', $lineItem['LineItem']['id']), array('class'=>'editLink')); ?>
link(__('Remove', true), array('controller'=> 'line_items', 'action'=>'delete', $lineItem['LineItem']['id']), null, sprintf(__('Are you sure you want to remove # %s?', true), $lineItem['LineItem']['item_number'])); ?>
diff --git a/views/products/view.ctp b/views/products/view.ctp
index fe9b989b..ddd07c73 100755
--- a/views/products/view.ctp
+++ b/views/products/view.ctp
@@ -1,3 +1,6 @@
+link('costing_dialog'); ?>
+
+
@@ -38,7 +41,7 @@
- link(__('Edit Product', true), array('action'=>'edit', $product['Product']['id'])); ?>
- link(__('Add Costing', true), array('controller'=>'costings', 'action'=>'add/productid:'.$product['Product']['id']));?>
-
+
diff --git a/views/quotes/view.ctp b/views/quotes/view.ctp
index f0e3345c..1fd42529 100755
--- a/views/quotes/view.ctp
+++ b/views/quotes/view.ctp
@@ -133,11 +133,20 @@ foreach ($quote['QuotePage'] as $quotePage):
echo $form->input('option', array('label'=>'Optional Item'));
echo $form->input('quantity', array('class'=>'nocostinput'));
- echo $form->input('principle_id', array('options'=>$principles, 'empty' =>'Select the Principle for this Product'));
+ echo $form->input('fromDB', array('label'=>'Is this product in the database already?',
+ 'empty'=>'',
+ 'type'=>'select', 'options'=>array('Yes'=>'Yes', 'No'=>'No')));
?>
-
+
+
+
+
+ echo $form->input('principle_id', array('options'=>$principles, 'empty' =>'Select the Principle for this Product', 'div'=>'fromProductDB')); ?>
+
+
+
input('title', array('div'=>'blankItem'));
echo $form->input('description', array('div'=>'blankItem'));
diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css
index bb20b28e..4130fdba 100755
--- a/webroot/css/quotenik.css
+++ b/webroot/css/quotenik.css
@@ -1143,9 +1143,10 @@ form.cmxform label {
}
label span.rightHandLabel {
- position: absolute;
- left: 40em;
- width: 25em; color: #088A4B; font-size: 85%; font-weight: normal; text-transform: uppercase;
+ position: relative;
+ display: inline-block;
+ left: 5em;
+ width: auto; color: #088A4B; font-size: 85%; font-weight: normal; text-transform: uppercase;
}
label span.purchaseCurrency {
@@ -1170,6 +1171,10 @@ label span#exchangeConversion {
}
+form.cmxform {
+ width: 80%;
+}
+
form.cmxform input {
width: auto;
display: inline;
@@ -1229,4 +1234,8 @@ select.editinplace {
position: relative;
margin-top: 10em;
margin-left: 10em;
+}
+
+span.addLineItem {
+ clear: right;
}
\ No newline at end of file
diff --git a/webroot/js/addLineItem.js b/webroot/js/addLineItem.js
index 2efd769e..f271ed07 100644
--- a/webroot/js/addLineItem.js
+++ b/webroot/js/addLineItem.js
@@ -20,6 +20,7 @@ $(function() {
$(".nocosting").hide();
$(".blankItem").hide();
+ $(".fromProductDB").hide();
$("#addLineItem-form").dialog({
@@ -33,8 +34,8 @@ $(function() {
$.post("/line_items/ajaxSave", $("#LineItemAddForm").serialize(), function(data) {
fetchTable();
- $('#mydebug').html(data);
- }
+ $('#mydebug').html(data);
+ }
);
$("#LineItemAddForm").resetForm();
@@ -65,7 +66,7 @@ $(function() {
.button()
.click(function() {
$.post("/quotes/ajaxpdf",quoteID, function(data) {
- $('#mydebug').html(data);
+ $('#mydebug').html(data);
});
});
@@ -81,14 +82,29 @@ $(function() {
});
- $('#addBlankItem').button().click(function () {
+ $('#addBlankItem').button().click(function () {
$("#LineItemPrincipleId").hide();
$(".blankItem").show();
$(".nocosting").show();
return false;
- });
+ });
+ $('#LineItemFromDB').change(function () {
+ if(this.value == 'No') {
+ $(".blankItem").show();
+ $(".nocosting").show();
+ $(".fromProductDB").hide();
+ }
+ else {
+ $(".fromProductDB").show();
+ $(".blankItem").hide();
+ $(".nocosting").hide();
+ }
+
+
+ });
+
});
diff --git a/webroot/js/costing_dialog.js b/webroot/js/costing_dialog.js
index f455ee78..7bfc9365 100644
--- a/webroot/js/costing_dialog.js
+++ b/webroot/js/costing_dialog.js
@@ -1,21 +1,54 @@
$(function() {
-/*
- * Fetch the costing add form. Place it in element ID 'costingdiv'
- *
- * @todo - write a plugin that generalises the method. It would be handy with the cake way of doing things
- *
- */
-function AjaxFetchPage() {
- $.post("/costings/", $("#LineItemQuoteId").serialize(), function (itemTable) {
- $("#productTable").html(itemTable);
+$("#costingdiv").dialog({
+ autoOpen: false,
+ height: 800,
+ width: 800,
+ modal: true,
+ buttons: {
+ 'Add Costing': function() {
+
+ $.post("/line_items/ajaxSave", $("#LineItemAddForm").serialize(), function(data) {
+
+ fetchTable();
+ $('#mydebug').html(data);
+ }
+ );
+
+ $("#LineItemAddForm").resetForm();
+ $(this).dialog('close');
+ },
+ Cancel: function() {
+ $(this).dialog('close');
+ }
+ },
+ close: function() {
+
+ }
});
-}
+
+/**
+ * When add costing button is pressed. Bring up costing dialog
+ */
+$("#addCostingDialog").button().click(function () {
+ $.get('/costings/add/', function(data) {
+ $("#costingdiv").html(data);
+ $('#costingdiv').dialog('open');
+ })
+ });
+
});
+
+
+function AjaxFetchPage() {
+ $.post("/costings/", $("#LineItemQuoteId").serialize(), function (itemTable) {
+ $("#productTable").html(itemTable);
+ });
+}
diff --git a/webroot/js/search.js b/webroot/js/search.js
index b1dc289f..5377a942 100644
--- a/webroot/js/search.js
+++ b/webroot/js/search.js
@@ -8,10 +8,10 @@
$(function() {
- $("#ajaxLoading").hide();
+ $("#ajaxLoading").hide();
- $("#ajaxLoading").bind("ajaxSend", function() {
+ $("#ajaxLoading").bind("ajaxSend", function() {
$(this).show();
}).bind("ajaxComplete", function() {
$(this).hide();
@@ -20,24 +20,23 @@ $(function() {
-$("#dialogDiv").hide();
+ $("#dialogDiv").hide();
- $("#dialogDiv").dialog({
+ $("#dialogDiv").dialog({
autoOpen: false,
width: 900,
- height: 900,
modal: true
-});
+ });
-$("#searchLink").click(function() {
+ $("#searchLink").click(function() {
-$("#dialogDiv").dialog('open');
-return false;
-});
+ $("#dialogDiv").dialog('open');
+ return false;
+ });
$("#searchButton").button().click(function() {
@@ -46,7 +45,11 @@ return false;
});
-
+
+
+ $("#dialogDiv").bind("dialogclose", function() {
+ $("#results").empty();
+ })
});
@@ -57,12 +60,5 @@ function doSearch() {
$.post("/enquiries/doSearch", $("#searchString").serialize(), function(data) {
$("#results").html(data);
});
-
}
-
-function searchDialog() {
- $("")
-}
-
-
|