// stock : bugs fix and update of supplier order add product interface

This commit is contained in:
dSevere
2011-11-08 15:45:45 +00:00
parent 63c2159a98
commit 4812e7baf4
7 changed files with 78 additions and 28 deletions
@@ -75,11 +75,12 @@
{/block}
</h3>
</div>
<div class="leadin">{block name="leadin"}{/block}</div>
</div>
</div>
{/if}
<div class="leadin">{block name="leadin"}{/block}</div>
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
<form id="{$table}_form" class="defaultForm" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
{if $form_id}
@@ -39,7 +39,7 @@
</legend>
<p class="clear">{l s='To add a product to the order, type the first letters of the product name, then select the it from the drop-down list:'}</p>
<input type="text" size="75" id="cur_product_name" />
<input type="text" size="100" id="cur_product_name" />
<span onclick="addProduct();" style="cursor: pointer;"><img src="../img/admin/add.gif" alt="{l s='Add a product to the supplier order'}" title="{l s='Add a product to the supplier order'}" /></span>
<p>&nbsp;</p>
@@ -83,16 +83,16 @@
<input type="hidden" name="input_name_{$product.id_product}_{$product.id_product_attribute}" value="{$product.name}" />
</td>
<td class="center">
<input type="text" name="input_unit_price_te_{$product.id_product}_{$product.id_product_attribute}" value="{$product.unit_price_te|escape:'htmlall':'UTF-8'}" size="8" />
{$currency->prefix}&nbsp;<input type="text" name="input_unit_price_te_{$product.id_product}_{$product.id_product_attribute}" value="{$product.unit_price_te}" size="8" />&nbsp;{$currency->suffix}
</td>
<td class="center">
<input type="text" name="input_quantity_expected_{$product.id_product}_{$product.id_product_attribute}" value="{$product.quantity_expected|escape:'htmlall':'UTF-8'}" size="5" />
<input type="text" name="input_quantity_expected_{$product.id_product}_{$product.id_product_attribute}" value="{$product.quantity_expected}" size="5" />
</td>
<td class="center">
<input type="text" name="input_discount_rate_{$product.id_product}_{$product.id_product_attribute}" value="{$product.discount_rate|escape:'htmlall':'UTF-8'}" size="5" />
<input type="text" name="input_discount_rate_{$product.id_product}_{$product.id_product_attribute}" value="{round($product.discount_rate, 2)}" size="5" />%
</td>
<td class="center">
<input type="text" name="input_tax_rate_{$product.id_product}_{$product.id_product_attribute}" value="{$product.tax_rate|escape:'htmlall':'UTF-8'}" size="5" />
<input type="text" name="input_tax_rate_{$product.id_product}_{$product.id_product_attribute}" value="{round($product.tax_rate, 2)}" size="5" />%
</td>
<td class="center">
<a href="#" id="deletelink|{$product.id_product}_{$product.id_product_attribute}" class="removeProductFromSupplierOrderLink">
@@ -132,10 +132,10 @@
'<td>'+product_infos.reference+'<input type="hidden" name="input_check_'+product_infos.id+'" value="'+product_infos.checksum+'" /><input type="hidden" name="input_name_'+product_infos.id+'" value="'+product_infos.reference+'" /></td>'+
'<td>'+product_infos.ean13+'<input type="hidden" name="input_ean13_'+product_infos.id+'" value="'+product_infos.ean13+'" /></td>'+
'<td>'+product_infos.name+'<input type="hidden" name="input_name_'+product_infos.id+'" value="'+product_infos.name+'" /></td>'+
'<td class="center"><input type="text" name="input_unit_price_te_'+product_infos.id+'" value="0" size="8" /></td>'+
'<td class="center">{$currency->prefix}&nbsp;<input type="text" name="input_unit_price_te_'+product_infos.id+'" value="0" size="8" />&nbsp;{$currency->suffix}</td>'+
'<td class="center"><input type="text" name="input_quantity_expected_'+product_infos.id+'" value="0" size="5" /></td>'+
'<td class="center"><input type="text" name="input_discount_rate_'+product_infos.id+'" value="0" size="5" /></td>'+
'<td class="center"><input type="text" name="input_tax_rate_'+product_infos.id+'" value="0" size="5" /></td>'+
'<td class="center"><input type="text" name="input_discount_rate_'+product_infos.id+'" value="0" size="5" />%</td>'+
'<td class="center"><input type="text" name="input_tax_rate_'+product_infos.id+'" value="0" size="5" />%</td>'+
'<td class="center"><a href="#" class="removeProductFromSupplierOrderLink" id="deletelink|'+product_infos.id+'">'+
'<img src="../img/admin/delete.gif" alt="{l s="Remove this product from the order"}" title="{l s="Remove this product from the order"}" />'+
'</a></td></tr>'
+24 -2
View File
@@ -40,6 +40,9 @@
//get reference on save link
btn_save = $('span[class~="process-icon-save"]').parent();
//get reference on save and stay link
btn_save_and_stay = $('span[class~="process-icon-save-and-stay"]').parent();
//get reference on form submit button
btn_submit = $('#{$table}_form_submit_btn');
@@ -49,8 +52,14 @@
//override save link label with submit button value
lbl_save.html(btn_submit.attr("value"));
//add hidden input to emulate submit button click when posting the form -> field name posted
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
if (btn_save_and_stay)
{
//get reference on current save link label
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
//override save and stay link label with submit button value
lbl_save_and_stay.html(btn_submit.attr("value") + ' and stay');
}
//hide standard submit button
btn_submit.hide();
@@ -58,8 +67,21 @@
//submit the form
{block name=formSubmit}
btn_save.click(function() {
//add hidden input to emulate submit button click when posting the form -> field name posted
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
$('#{$table}_form').submit();
});
if (btn_save_and_stay)
{
btn_save_and_stay.click(function() {
//add hidden input to emulate submit button click when posting the form -> field name posted
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
$('#{$table}_form').submit();
});
}
{/block}
});
</script>