Commit graph

34267 commits

Author SHA1 Message Date
a0148b440a Bug 13895: Refactor test using REST Basic auth
Test plan:
prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 19:38:41 +00:00
a7e704382f Bug 13895: Remove create_item and create_biblio subs from test
Test plan:
prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 19:38:41 +00:00
4672e6e6c4 Bug 13895: Remove the opac checks in privileged endpoint
Test plan:
prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 19:38:41 +00:00
1dfb57164f Bug 13895: (follow-up) Adapt checkout endpoint to openapi, update terminology
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 19:38:41 +00:00
b63fd774c1 Bug 13895: (QA follow-up) Adjust OpenAPI definitions for checkouts
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 19:38:41 +00:00
Julian Maurice
e3f2e346f8 Bug 13895: Add API routes for checkouts retrieval and renewal
GET /checkouts?borrowernumber={borrowernumber}
GET /checkouts/{checkout_id}
PUT /checkouts/{checkout_id}

+ unit tests in t/db_dependent/api/v1/checkouts.t

Test plan:
1. Open a browser tab on Koha staff and log in (to create CGISESSID
   cookie). You should have permission circulate_remaining_permissions.
2. Go to http://yourlibrary/api/v1/checkouts?borrowernumber=XXX (replace
   XXX with a borrowernumber that has checkouts) and check you receive
   correct data
3. Go to http://yourlibrary/api/v1/checkouts/YYY (replace YYY with an
   existing checkout id) and check you receive correct data
4. Send PUT requests to http://yourlibrary/api/v1/checkouts/YYY until
   the maximum number of renewals is reached (you should have a 403
   error)
5. Run unit tests in t/db_dependent/api/v1/checkouts.t

Depends on bugs 16699 and 14868

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Lari Taskula <larit@student.uef.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 19:38:41 +00:00
29c1c8ff92 Bug 21772: (follow-up) Minor markup correction and reindentation
This patch makes one minor markup correction: In HTML5 <tfoot> must be
after <tbody>. Previously the opposite was true.

I've also done a little bit of opinionated reindentation. There should
be no changes visible to the user from this patch.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
281c89dd59 Bug 21772: (QA follow-up) Fix setting variables to PROCESS in holds
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
ab5160a520 Bug 21772: (QA follow-up) Fix button class on Cancel hold button
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
60f817a567 Bug 21772: (QA follow-up) Hide .tdlabel class in sco for consistancy with opac-user page.
Test plan:
1) Compare holds table on selfcheckout and opac-user page, you will see
the difference: In self checkout there are labels like Status, Pickup
location, and so on in every table cell.
2) Apply the patch, the label in selfcheckout dissappear

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
Agustin Moyano
c421f08065 Bug 21772: (follow-up) Included more information on tab label for SCO
Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
Agustin Moyano
ce7096870a Bug 21772: (follow-up) Remove redundant variable
Sponsored-by: City of Portsmouth Public Library

Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
Agustin Moyano
3ce8fa6f10 Bug 21772: Add holds and account information to SCO
This patch introduces holds and account information to the SCO page. It
uses the introduced include files that are also used in OPAC
(opac-user.pl and opac-account.pl).

To test:
1) Have a patron that has holds and account lines
2) Enable the SCO module
3) Use the patron's cardnumber to get to its details
=> SUCCESS: New tabs are presented, and they display holds and account
information as expected
4) Sign off :-D

Sponsored-by: City of Portsmouth Public Library

Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
Agustin Moyano
6a7d4b19c7 Bug 21772: Move OPAC holds and account tables into .inc
This patch moves the code to render the account and holds information
for the patron into include files. They are loaded in the opac-user.tt
and opac-account.tt templates respectively.

To test:
1) Have a patron with account lines and holds
2) Notice they are displayed in the patron's detail section in the OPAC
3) Apply this patch
4) Reload the patron's detail page
=> SUCESS: Everything looks the same, no behaviuor or layout change.
5) Sign off

Sponsored-by: City of Portsmouth Public Library

Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
0b1809bb93 Bug 19722: DBRev 18.12.00.035
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:16:48 +00:00
c18fd98bc7 Bug 19722: Don't show items at job completion if over pref
To test:
1 - Set MaxItemsToDisplayForBatchMod to some number
2 - Modify less items than that
3 - Note they show
    a - Note if over 1000 they show in a simple display
4 - Modify more items
5 - Note they do not show and you see a note

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:06:23 +00:00
0e6f7861a8 Bug 19722: (follow-up) Adjust template parameters
Before we passed 'too_many_items' this was renamed to
'too_many_items_display' but deletion template lacked changes

To test:
1 - Test a batch deletion by list and file
2 - Test with deleting biblios and without
3 - Results should be as expected

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:06:23 +00:00
32cdfed1ec Bug 19722: Add MaxItemsToDisplayForBatchMod systempreference
To test:
1 - Get a list of itemnumbers or barcodes
2 - Set MaxItemsToProcessForBatchMod to less than this number of items
3 - Attempt to batch edit, you arent allowed
4 - Set MaxItemsToProcessForBatchMod to some hugh number like 60000
5 - Try a list of as many items as possible 30000 was good for me (they
        should exist in your system)
6 - Try to batch edit, system will timeout on displaying these items
7 - Apply patch, update database
8 - Set MaxItemsToDisplayForBatchMod to 1000 (default)
9 - Try large file again, should not display items, but allow
modification, wait for this to finish
10 - SetMaxItemsToProcessForBatchMod to 1000 and try large file again
11 - Should be prohibited as before

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:06:22 +00:00
d2e562947e Bug 22525: Navigation arrows on the bottom of Cataloging search pages
This patch adds a second set of pagination links to the cataloging
search result page, at the bottom of the first set of search results.

Also added is a horizontal rule after the second set of links in order
to make it clearer that the links are for the search results above.

To test, apply the patch and go to Cataloging. Perform a search which
will return multiple pages of results. Confirm that the links work
correctly.

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:05:35 +00:00
Julian Maurice
5d4f637a52 Bug 22505: Add column configuration to patron list table
Test plan:
1. Create a list of patrons
2. Add some patrons to this list
3. Go to this patron list
   (/cgi-bin/koha/patron_lists/list.pl?patron_list_id=XXX)
4. Verify that you can show/hide all columns except the one containing
   the checkbox
5. Verify that you can export the table data using the Export menu
6. Go to admin/columns_settings.pl, and verify that the configuration
   works for table 'patron-list-table'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:03:48 +00:00
cf85d02dae Bug 22516: DBRev 18.12.00.034
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 18:02:35 +00:00
a52c3f5fa3 Bug 22516: Database update
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 17:57:15 +00:00
f68fec12df Bug 22516: Remove remaining calls to lastincrement
A few places still set lastincrement and the tests still checked for
correct values. But nowhere in the code still uses lastincrement for
anything meaningful.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 17:57:15 +00:00
775029660c Bug 18213: DBRev 18.12.00.033
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:57:33 +00:00
13ca80c20b Bug 18213: (follow-up) Correctly sort facets
Previously we sorted alphabetically - that works for 1-9.
With a 10th facet category we should sort numerically

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:57:32 +00:00
d1bd416341 Bug 18213: Add Template plugin and fix for C4/Languages
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:57:32 +00:00
e2394f6243 Bug 18213: DB Update (facet order)
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:57:32 +00:00
59918a3c21 Bug 18213: Add language facets to Elasticsearch
This patch add language as a facet to ES results - it adds
a new template plugin for languages to get the appropriate
description given an iso 639-2 code

To test:
1 - Make sure you have records with differing languages (in the MARC21 008
        field characters 35-37 or UNIMARC 101a)
2 - Apply patch
3 - Reload Elasticsearch settings:
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
4 - Reindex your records
5 - Search for a phrase that will return results in several languages
6 - Verify you see factes correctly labelled for 'Language'
7 - Verify the facets work
8 - Verify both opac and staff results
9 - prove t/db_dependent/Languages.t

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:57:32 +00:00
ffef0c0027 Bug 18235: (follow-up) fix tests and remove trailing space
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:57:32 +00:00
7cfeb54374 Bug 18235: DBRev 18.12.00.032
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:41:38 +00:00
450fbad751 Bug 18235: (RM follow-up) fix mappings reset
Without this we could not recreate mappings as there are no defaults for
the additional fields - this restores behavoiur from before patches

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
915b4861fb Bug 18235: (QA follow-up) Restore facet_order for su-geo field in mappings file
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
eba6327299 Bug 18235: (QA follow-up) Series facet name after rebase
Bug 19575 changes many field names so "se" facet field became "title-series"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
b311938370 Bug 18235: (QA follow-up) Make db update idempotent
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
cbfeaca859 Bug 18235: Do not call get_facetable_fields excessively
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
5170880f7a Bug 18235: Update facet_order default value in atomic update
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
6ec68be83a Bug 18235: (QA follow-up) Add missing filters
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:47 +00:00
bd2758c214 Bug 18235: (QA follow-up) Fix POD
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:47 +00:00
Alex Arnaud
854a750376 Bug 18235: Add unit tests for get_facetable_fields
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:48:53 +00:00
565cf4ac40 Bug 18235: DB changes
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:48:53 +00:00
bdb1652360 Bug 18235: Add missing POD to get_facetable_fields
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:48:53 +00:00
b47e01cdc2 Bug 18235: ES - Facets configurable
This patch adds a new section 'Facet order' in the Biblio tab of the
'Search engine configuration' admin page of the Elastic mappings.
The idea is to let the librarians define the facet to display and order
them as their needs.

The ergonomic is not perfect and I am open to any suggestions.

Test plan:
Move up and down the field list to order the facets
Hide/show some facets
Rebuild index
At the OPAC and the staff interface you should see the changes on the
search result page.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:48:53 +00:00
Julian Maurice
856425db1e Bug 21049: Set 007/00 when selecting material type (Rancor)
There is a 1-1 relationship between the material type values and the
position 00 of 007 field. Selecting a material type should set this
position's value.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:46:04 +00:00
Julian Maurice
e85294a738 Bug 21049: Fix value of material select for Rancor 007 widget
The material type is selected in accordance with position 0 of 007

Test plan:
1. Create a new record using the advanced editor
2. Select a material type for field 007 and set at least the position 0
   of this field
3. Save the record and reload the page
4. The material type should remain selected
5. Try with all available material types

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:46:04 +00:00
d522d80c5c Bug 22593: Fix bad ternaries after bug 22008
A series of ternaries were introduced when we moved to add_debit which
defaulted to 'user 0' should a userenv not be set.  This was incorrect
as userenv may well not be set (during cronscript runs for example) and
the new constraint would not allow such a default. We switch to 'undef'
here to satisfy the constraint.

Test plan
1) Ensure you have data in your system that would be caught by the
longoverdues cronjob.
2) Ensure you're sysprefs are setup to charge for lost items
3) Run the script and varify it runs to completion without errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:40:44 +00:00
3c69e084d7 Bug 12159: (QA follow-up) Remove double use module
Speaks for itself.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:05:22 +00:00
e0b9d98827 Bug 12159: (QA follow-up) Rename relation in Patron::Attributes
It seems that we do not need the extra belongs_to in the schema result
files if we rename the relation to code.

Test plan:
Run t/db_dependent/Koha/Patrons.t
Run t/db_dependent/Koha/Patron/Attributes.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:05:22 +00:00
1218364dbe Bug 12159: Add tests
Test plan:
prove t/db_dependent/Koha/Patron/Attributes.t t/db_dependent/Koha/Patrons.t

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:05:22 +00:00
4fe300dec1 Bug 12159: Fix getting extended patron attributes for circ-menu
Changes:
- Replace getting preference ExtendedPatronAttributes by Koha.Preference
in templates
- Add Koha::Patron->attributes for getting patrons extended attributes
- Use this method in circ-menu.inc
- Remove getting attributes from members perl scripts

Test plan:
0) Apply the patch
1) Add some patron attributes type - with free text, authorised value,
    limited by libraries...
2) Add some values to this attributes for some patrons
3) Go through as many patron pages as you can and confirm that
attributes are shown at side panel when they shoul and are not shown
when they should not be shown

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed Koha/Schema/Result/BorrowerAttribute.pm
[EDIT] Added missing semicolon on L114 in Koha/Patron/Attribute.pm

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:05:22 +00:00
100e1e758c Bug 10577: (QA follow-up) Remove tab chars
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 12:46:14 +00:00