From 90b17a51bbae2a7962ec2ba26a21802dc232465a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 10 Sep 2015 06:35:37 -0400 Subject: [PATCH] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron searhc, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popupo 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items hsoul;d be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not --- .../prog/en/modules/labels/label-edit-batch.tt | 38 +++++++++++++------ .../intranet-tmpl/prog/en/modules/labels/result.tt | 13 ++----- .../prog/en/modules/patroncards/edit-batch.tt | 43 +++++++++++++++++----- labels/label-edit-batch.pl | 22 +++++++---- patroncards/edit-batch.pl | 15 +++++++- 5 files changed, 90 insertions(+), 41 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt index 6832d56..a15ca7e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt @@ -64,14 +64,20 @@ } }; function Add() { - var barcodes = document.getElementById("barcode"); - if (barcodes.value == '') { + var number_list = document.getElementById("number_list"); + if (number_list.value == '') { window.open("/cgi-bin/koha/labels/label-item-search.pl?batch_id=[% batch_id %]&type=labels",'FindABibIndex','width=875,height=400,toolbar=no,scrollbars=yes'); } else { - document.forms["add_by_barcode"].submit(); + document.forms["add_by_number"].submit(); } }; + + function add_item(item_number) { + $("#itemnum_enter").prop("checked",true); + $("#number_list").val($("#number_list").val()+item_number+"\r\n"); + }; + function DeDuplicate() { window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]"; }; @@ -195,17 +201,25 @@
Current library: [% LoginBranchname %]
-
+
  1. - - - - + + +
  2. +
  3. + +
    + + +
  4. +
  5. + +
@@ -263,7 +277,7 @@
  1. There are no items in this batch yet

    -

    Add items by barcode using the text area above or leave empty to add via item search.

    +

    Add items by using the text area above or leave empty to add via item search.

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt index 3b7ce08..65dc131 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt @@ -16,27 +16,22 @@ }); }); function add_item(item_number,batch_id,type_id){ - var getstr=''; + var p = window.opener; if (item_number == 'checked') { items= new Array; if(document.resultform.action.length > 0) { for (var i=0; i < document.resultform.action.length; i++) { if (document.resultform.action[i].checked) { - items.push("item_number=" + document.resultform.action[i].value); + p.add_item(document.resultform.action[i].value); } } - getstr = items.join("&"); } else { - getstr = "item_number="+document.resultform.action.value; + p.add_item(document.resultform.action.value); } } else { - getstr = "item_number="+item_number; + p.add_item(item_number); } - var myurl = "label-edit-batch.pl?op=add&batch_id="+batch_id+ - "&"+getstr; - window.opener.location.href = myurl; - //top.location.href=myurl; } //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt index 25f79d4..35bc9a8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt @@ -6,6 +6,7 @@ [% INCLUDE 'datatables.inc' %]