[Koha-patches] [PATCH] [SIGNED-OFF] BZ6065: confirmation when deleting an order

Katrin Fischer Katrin.Fischer.83 at web.de
Tue Apr 5 14:54:48 CEST 2011


From: Paul Poulain <paul.poulain at biblibre.com>

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 at web.de>
---
 .../prog/en/modules/acqui/basket.tmpl              |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
index aaa7462..02b0a06 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
@@ -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 -->
-- 
1.7.1



More information about the Koha-patches mailing list