From 4078d1660699fb60be924d9875b6708c359de84d Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 18 Sep 2014 12:02:17 -0400 Subject: [PATCH] Bug 10473 - Max length should be 2 digit for adding multiple copies in add items page As per the discussion, a prompt on a hard coded soft-limit is far more acceptable as a solution. TEST PLAN --------- 0) Back up your DB. -- because a backup is always good! 1) Log in to staff client 2) Navigate to any biblio details (e.g. cgi-bin/koha/catalogue/detail.pl?biblionumber=#####) 3) Click the 'Edit' dropdown button. 4) Click 'Edit items'. 5) Click 'Add multiple items' 6) Enter a crazy high number (e.g. 999) 7) Click 'Add' -- Koha just adds it! YIKES! 8) Apply patch 9) Repeat steps 5-7 10) Click 'Cancel' -- Koha does not add the items. 11) Repeat steps 5-7 12) Click 'Ok' -- Koha does add the items. 13) run koha QA test tools 14) Restore your DB. Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 85a4486..53b1843 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -76,6 +76,10 @@ function CheckMultipleAdd(f) { alert(_("Please enter a number of items to create.")); return false; } + + if (f>99) { + return confirm(_("More than 99 copies will be added. Should they be added?")); + } } function Dopop(link,i) { defaultvalue=document.forms[0].field_value[i].value; @@ -241,7 +245,7 @@ $(document).ready(function() { -- 1.7.10.4