// stock : update and bugs fix on supplier order add product interface and supplier order view interface + toolbar bug fix

This commit is contained in:
dSevere
2011-11-09 15:11:36 +00:00
parent 1675e394bf
commit c0ab2bcbc5
5 changed files with 273 additions and 222 deletions
+39 -34
View File
@@ -40,49 +40,54 @@
//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');
//get reference on current save link label
lbl_save = $('#desc-{$table}-save div');
//override save link label with submit button value
lbl_save.html(btn_submit.attr("value"));
if (btn_save_and_stay)
if (btn_save.length > 0)
{
//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');
//get reference on current save link label
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
lbl_save = $('#desc-{$table}-save div');
//override save and stay link label with submit button value
lbl_save_and_stay.html(btn_submit.attr("value") + ' and stay');
}
//override save link label with submit button value
if (btn_submit.attr("value").length > 0)
lbl_save.html(btn_submit.attr("value"));
//hide standard submit button
btn_submit.hide();
//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)
if (btn_save_and_stay.length > 0)
{
btn_save_and_stay.click(function() {
//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
if (btn_submit.attr("value").length > 0)
lbl_save_and_stay.html(btn_submit.attr("value") + ' and stay');
}
//hide standard submit button
btn_submit.hide();
//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")+'AndStay" value="1" />');
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
$('#{$table}_form').submit();
});
}
{/block}
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>
{/block}