AddPatronsToList already took a borrowernumber parameter, however, it
did not check if those were valid numbers. This patch expands the search
to apply to cardnumber or borrowernumbers in the subroutine.
Template and script are adjusted to allow choosing borrowernumbers or cardnumbers
To test:
1 - Apply patch
2 - Browse to Tools->Patron lists
3 - Create a list, or choose Actions->Add patrons for an existing list
4 - Click 'Add multiple patrons'
5 - Cardnumbers is preselected
6 - Enter a list of cardnumbers, ensure you test:
Cardnumber already in list
Cardnumber not in list
Non-existent cardnumber
7 - Patrons should be added/errors reported correctly
8 - Repeat with borowernumbers
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds a new method mock_userenv from t::lib::Mocks in order to
simplify the mock of the userenv.
Test plan:
prove all the test files modified by this patch
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Some libraries would like to allow arbitrary lists to be used by all
librarians with the 'manage_patron_lists' permission.
Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Create or find two patrons with the manage_patron_lists permission
4) Using the first patron, create two new lists, mark one of them as
shared
5) Log in as the second patron, browse to the patron lists page
6) Note the second patron can view, add and remove patrons from
the shared list owned by the first patron
Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
The test files do not need to return 1
Patch generated with:
perl -p -i -e "s/^1;\n//xsm" t/**/*.t
Test plan:
git grep '^1;$' t/**/*.t
should not return any results
NOTE: does not fix C4/SIP/t, nor xt tests.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Add shibboleth parameter to POD of set_userenv.
Removed a 12th set_userenv parameter from Borrower_Discharge.t.
Replaced set_userenv call in PatronLists.t looking like a fortunate typo.
Test plan:
Run the two corrected tests.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch makes t/db_dependent/PatronLists.t run inside a transaction.
It also makes it generate its own data using t::lib::TestBuilder instead
of relying on sample patrons on the DB.
To test:
- Run:
$ prove t/db_dependent/PatronLists.t
=> SUCCESS: Tests pass
- Apply the patch
- Run:
$ prove t/db_dependent/PatronLists.t
=> SUCCESS: Tests pass
- Sign off :-D
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
We need to define a userenv to get rid of the warnings
Test plan:
prove t/db_dependent/PatronLists.t
should not return any warnings
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
The patron lists feature is somewhat similar to the record lists feature
in that it allows a librarian to create a list of patrons for later
retrieval and manipluation. These lists can then be used with the batch
patron modification tool.
Test Plan:
0) Apply the patch for Bug 8798
1) Apply this patch
2) Run updatedatabase.pl
3) Access the patron lists feature from Koha's Tools menu.
4) Create a new list via the "New patron list" button.
5) For this list, click the "Edit" button, and change the list name.
6) For this list, click the "Add patrons" button, and search for and
add some patrons to your list.
7) For this list select some patrons to remove them.
8) Try both adding some new patrons, and removing some old patrons
as a single action.
9) Click the "Patrons" link on the Koha toolbar
10) Search the patrons, or browse by letter to get patron results
11) Check the checkboxes next to one or more patrons, and add the
selected patrons to your existing list.
12) Change the "Selected patrons" pulldown to "All resultant patrons"
and add them to your list.
13) Check the checkboxes next to one or more patrons, and add the
selected patrons to a new list.
14) Try manipulating a list of patrons using the batch patron
modification tool.
15) Go back to the Patron Lists feature and delete your lists.
16) Run 'prove t/db_dependent/PatronLists.t'
Signed-off-by: Nora Blake <nblake@masslibsystem.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>