From: Katrin Fischer Date: Mon, 5 Dec 2011 06:18:21 +0000 (+0100) Subject: Bug 6740: can add items at ordering/receiving but not remove X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=d0ef505fc4423f597402445a1a12b8b2bd512894;p=koha.git Bug 6740: can add items at ordering/receiving but not remove The problem was, that the script was looking for the first and second tag in the code. When using plugins in the framework this can't work. The patch changes the script to select the correct tags by using a class. Also changes + and - to 'Add' and 'Delete' to make the meaning clearer and clicking on them a bit easier. To test: 1) AcqCreateItem = order - Create a basket - Create an order line - Create more than one item - Delete items - Check quantity is calculated correctly - Check items are created correctly 2) AcqCreateItem = receive - Create basket - Create 2 order lines, order >1 items - Do a partial item by removing items from the receive form - Receive all missing items - Receive more items than ordered Signed-off-by: Owen Leonard Signed-off-by: Paul Poulain --- diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js index 86583244a4..efcb8eb58d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js @@ -17,9 +17,10 @@ function cloneItemBlock(index) { var CloneButtonPlus; var CloneButtonMinus; // try{ - CloneButtonPlus = clone.getElementsByTagName('a')[0]; + var jclone = $(clone); + CloneButtonPlus = $("a.addItem", jclone).get(0); CloneButtonPlus.setAttribute('onclick',"cloneItemBlock('" + index + random + "')"); - CloneButtonMinus = clone.getElementsByTagName('a')[1]; + CloneButtonMinus = $("a.delItem", jclone).get(0); CloneButtonMinus.setAttribute('onclick',"deleteItemBlock('" + index + random + "')"); CloneButtonMinus.setAttribute('style',"display:inline"); // change itemids of the clone diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index 68c290adba..d58582eeaa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -337,8 +337,8 @@ $(document).ready(function() [% END %] - + - - + Add + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 7147b196e8..ac391410e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -62,8 +62,8 @@ [% END %] - + - - + Add +