// 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
+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>