BZ6065: confirmation when deleting an order
authorPaul Poulain <paul.poulain@biblibre.com>
Tue, 5 Apr 2011 12:54:48 +0000 (14:54 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 6 Apr 2011 04:13:07 +0000 (16:13 +1200)
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>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl

index aaa7462..02b0a06 100644 (file)
                     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 -->
                                 <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 -->