Bugzilla – Attachment 71910 Details for
Bug 19837
Add multiple patrons to a list by cardnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19837: Add multiple patrons to a list by barcode
Bug-19837-Add-multiple-patrons-to-a-list-by-barcod.patch (text/plain), 6.23 KB, created by
Katrin Fischer
on 2018-02-18 14:37:39 UTC
(
hide
)
Description:
Bug 19837: Add multiple patrons to a list by barcode
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-02-18 14:37:39 UTC
Size:
6.23 KB
patch
obsolete
>From 9be943880c970ae8b32a4a0179295a18d77986b5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 15 Dec 2017 17:26:12 +0000 >Subject: [PATCH] Bug 19837: Add multiple patrons to a list by barcode > >This patch adds the interface change and basic functionality for an >option to add multiple patrons to a patron list by scanning barcodes. > >To test, apply the patch and go to Tools -> Patron lists. > >- Create a patron list if necessary, and got to the "Add patrons" > screen. >- Test the process for adding patrons using the "Patron search" text > input. >- Test the process for adding patrons using the "Enter multiple card > numbers" option. > >This should really have some error-handling added to it: Onscreen >messages when a non-existing patron card number is submitted or when a >patron already exists on the list. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/patron_lists/list.tt | 68 +++++++++++++++++----- > patron_lists/list.pl | 9 +++ > 2 files changed, 63 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt >index ba846b5901..9f2eba1b8e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt >@@ -5,6 +5,20 @@ > [% INCLUDE 'doc-head-close.inc' %] > > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> >+<style type="text/css"> >+ #add_patrons_by_search { >+ display: none; >+ } >+ #patron_barcodes_line { >+ display: none; >+ } >+ #patron_barcodes_submit { >+ display: none; >+ } >+ #searchheader { >+ margin-top: 1em; >+ } >+</style> > </head> > > <body id="patlist_list" class="pat patlist"> >@@ -18,25 +32,41 @@ > <div class="yui-b"> > <h1>[% list.name |html %]</h1> > >- <form action="list.pl" id="add_patrons" method="post"> >- <fieldset> >+ <form action="list.pl" id="add_patrons" method="post" class="clearfix"> >+ <fieldset class="rows"> > <legend>Add patrons</legend> >+ <ol> >+ <li id="patron_search_line"> >+ <label for="find_patron">Patron search: </label> >+ <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" /> >+ </li> >+ <li id="add_patrons_by_search"><a href="#"> >+ <span class="label"> </span> >+ <i class="fa fa-plus"></i> Search for patrons</a></li> >+ <li id="add_patrons_by_barcode"><a href="#"> >+ <span class="label"> </span> >+ <i class="fa fa-plus"></i> Enter multiple card numbers</a></li> >+ <li id="patron_barcodes_line"> >+ <label for="patrons_by_barcode">Card number list (one barcode per line):</label> >+ <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset id="patron_barcodes_submit" class="action"> >+ <input type="submit" value="Submit" /> >+ </fieldset> > >- <label for="find_patron">Patron search: </label> >- <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" /> >- <div id="find_patron_container"></div> >+ <div class="clearfix"></div> > >- <fieldset id="patrons_to_add_fieldset"> >- <legend>Patrons to be added</legend> >- <div id="patrons_to_add"></div> >+ <fieldset id="patrons_to_add_fieldset"> >+ <legend>Patrons to be added</legend> >+ <div id="patrons_to_add"></div> > >- <fieldset class="action"> >- <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" /> >- <input type="submit" value="Add patrons" /> >- <a href="lists.pl" class="cancel">Cancel</a> >- </fieldset> >+ <fieldset class="action"> >+ <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" /> >+ <input type="submit" value="Add patrons" /> >+ <a href="lists.pl" class="cancel">Cancel</a> > </fieldset> >- > </fieldset> > </form> > >@@ -159,6 +189,16 @@ > return false; > } > }); >+ >+ $("#add_patrons_by_barcode a").on("click", function(){ >+ $("#add_patrons_by_barcode, #patron_search_line").hide(); >+ $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show(); >+ }); >+ >+ $("#add_patrons_by_search a").on("click", function(){ >+ $("#add_patrons_by_barcode, #patron_search_line").show(); >+ $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide(); >+ }); > }); > </script> > [% END %] >diff --git a/patron_lists/list.pl b/patron_lists/list.pl >index 9a21681c2b..91e6370475 100755 >--- a/patron_lists/list.pl >+++ b/patron_lists/list.pl >@@ -24,6 +24,7 @@ use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Output; > use Koha::List::Patron; >+use List::MoreUtils qw/uniq/; > > my $cgi = new CGI; > >@@ -40,6 +41,14 @@ my ( $template, $logged_in_user, $cookie ) = get_template_and_user( > my ($list) = > GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } ); > >+my $cardnumbers = $cgi->param('patrons_by_barcode'); >+my @patrons_by_barcode; >+ >+if ( $cardnumbers ){ >+ push my @patrons_by_barcode, uniq( split(/\s\n/, $cardnumbers) ); >+ AddPatronsToList( { list => $list, cardnumbers => \@patrons_by_barcode } ); >+} >+ > my @patrons_to_add = $cgi->multi_param('patrons_to_add'); > if (@patrons_to_add) { > AddPatronsToList( { list => $list, cardnumbers => \@patrons_to_add } ); >-- >2.14.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19837
:
69913
|
70240
|
70277
|
70278
| 71910 |
71911