BZ6065: confirmation when deleting an order

when clicking on "delete order", there is no confirmation box, the order line is
deleted without any question !

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Paul Poulain 2011-04-05 14:54:48 +02:00 committed by Chris Cormack
parent 5bdfefc7e1
commit 2a28b30a3c

View file

@ -33,6 +33,13 @@
window.location = "<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&basketno=<!-- TMPL_VAR name="basketno" -->&booksellerid=<!-- TMPL_VAR name="booksellerid" -->";
}
}
function confirm_delete_item(ordernumber, biblionumber) {
var is_confirmed = confirm(_('Are you sure you want to delete this order ?'));
if (is_confirmed) {
window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno=<!-- TMPL_VAR NAME="basketno" -->&quantity=0&biblionumber="+biblionumber;
}
}
//]]>
</script>
<!-- TMPL_ELSE -->
@ -270,7 +277,7 @@
<a href="neworderempty.pl?ordernumber=<!-- TMPL_VAR NAME="ordernumber" -->&amp;booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->">Modify</a>
</td>
<td>
<a href="addorder.pl?ordernumber=<!-- TMPL_VAR NAME="ordernumber" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->&amp;quantity=0&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Delete</a>
<a href="javascript:confirm_delete_item(<!-- TMPL_VAR NAME="ordernumber" -->,<!-- TMPL_VAR NAME="biblionumber" -->)" class="button">Delete</a>
</td>
<!-- /TMPL_UNLESS -->
<!-- /TMPL_IF -->