]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 24523: Add missing </p>
Lucas Gass [Mon, 27 Jan 2020 22:06:06 +0000 (22:06 +0000)]
Bug 24523: Add missing </p>

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24330: When importing patrons from CSV, automatically strip BOM from file if...
Kyle M Hall [Thu, 2 Jan 2020 15:30:54 +0000 (10:30 -0500)]
Bug 24330: When importing patrons from CSV, automatically strip BOM from file if it exists

We have a partner that exports UTF-8 CSV files, and is experiencing the same thing as the author of this article: https://www.freecodecamp.org/news/a-quick-tale-about-feff-the-invisible-character-cd25cd4630e7/

In short, Excel is inserting an invisible UTF-8 character at the start of the file, so that the column name "cardnumber" is actually named "\x{feff}cardnumber", causing "cardnumber" to be blank.

A simple solution is provided here: https://stackoverflow.com/questions/24390034/remove-bom-from-string-with-perl

Test Plan:
1) Download the example.csv file
2) Attempt to import it using the patron import tool
3) Note the invalid column name error
4) Apply this patch, restart all the things!
5) Attempt the import again
6) Assuming you have a branchcode MPL and a cataegory code S, the patron should import!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Maggie Wong <maggie.wong@yccece.edu.hk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21674: DBRev 19.12.00.017
Martin Renvoize [Thu, 30 Jan 2020 15:44:17 +0000 (15:44 +0000)]
Bug 21674: DBRev 19.12.00.017

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21674: Remove duplicates from library_groups before adding the uniq constraint
Jonathan Druart [Tue, 21 Jan 2020 14:01:51 +0000 (15:01 +0100)]
Bug 21674: Remove duplicates from library_groups before adding the uniq constraint

To avoid to make it fails if duplicates existed prior to this change

Credit for the SQL query goes to Nick, thanks!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21674: Prevent to insert twice the same library in a group
Jonathan Druart [Wed, 11 Dec 2019 11:51:23 +0000 (12:51 +0100)]
Bug 21674: Prevent to insert twice the same library in a group

When you create hierarchical groups of libraries you are not allowed to add
several times the same library to a given group/subgroup. The libraries
that are part of the group is not displayed on the interface, to prevent
the user to select it.

However this restriction is only done template-side, the controller and
module does not handle it.

To prevent that this patchset enforces the constraint at DB level, and
display a message to the end user.

Test plan:
- Go to Home › Administration › Library groups
- Add a group
- Add a library
- reload the page several times
=> Without this patch the same library appears several times in the group
=> With this patch applied you will see a friendly error message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21674: DB changes
Jonathan Druart [Wed, 11 Dec 2019 11:51:14 +0000 (12:51 +0100)]
Bug 21674: DB changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24377: Record passed branch if renewing via cron
Nick Clemens [Thu, 16 Jan 2020 13:09:58 +0000 (13:09 +0000)]
Bug 24377: Record passed branch if renewing via cron

To test:
1 - Checkout an item with auto renewal set and eligible for auto renew
2 - Set no renewal before in the circ rules to 99 (something greater than the checkout period)
3 - perl misc/cronjobs/automatic_renewals.pl
4 - Check the statistics table, note the branch for renewal is null
    SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL'
5 - Apply patch
6 - Repeat 1-4
7 - Note the branch is set to the issuing branch

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24377: Unit test
Nick Clemens [Thu, 16 Jan 2020 13:09:50 +0000 (13:09 +0000)]
Bug 24377: Unit test

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24543: Fix wrong test in api/v1/checkouts.t
Jonathan Druart [Thu, 30 Jan 2020 10:51:25 +0000 (11:51 +0100)]
Bug 24543: Fix wrong test in api/v1/checkouts.t

In t/db_dependent/api/v1/checkouts.t we define a circulation rule with renewalperiod=7.
But then the expected due date is today+14 days.
However, at the beginning of the script, the due_date of the issue is today+14 days.

That highlight that the renewal period is not taken into account.

The circulation rule is created with renewalperiod and renewalsallowed,
however GetLoanLength check the existence of issuelength to return the rule.
GetLoanLength finally return the default rule, with renewalperiod=0

Note that this has been found working on bug 18936, code will be cleaned on that patchset.

Test plan:
 % prove t/db_dependent/api/v1/checkouts.t
must return green before and after this patch

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24487: Add 2 more tests
Jonathan Druart [Thu, 23 Jan 2020 09:47:17 +0000 (10:47 +0100)]
Bug 24487: Add 2 more tests

And make sure tests pass if there is no patron with borrowernumber=10 in
DB.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Ammended test description
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24487: Don't apply matching criteria to path parameters
Agustin Moyano [Thu, 23 Jan 2020 04:50:29 +0000 (01:50 -0300)]
Bug 24487: Don't apply matching criteria to path parameters

This patch separates query parameters from path parameters, and uses exact matching for the later.

To test:
1. Apply this patch
2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t
SUCCESS => tests ok
3. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24487: Regresion test
Agustin Moyano [Wed, 22 Jan 2020 23:44:04 +0000 (20:44 -0300)]
Bug 24487: Regresion test

This patch introduces a regresion test where a path parameter is combined with 'contains' match criteria

To test:
1. apply this patch
2. prove t/db_dependent/Koha/REST/Plugin/Objects.t

Test should fail at this point.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23031: Make 'add to basket' accessible in one click (fix regression)
Jonathan Druart [Mon, 13 Jan 2020 11:04:46 +0000 (12:04 +0100)]
Bug 23031: Make 'add to basket' accessible in one click (fix regression)

Since bug 21364 we have 'view' then 'add to basket' that is accessible
in 2 clicks. We should have it directly accessible.

Test plan:
Create a new basket
Add a new order to the basket (note that the link is directly
accessible)
When a new order is added you can close the basket from the basket list
view
Note that the dropdown button displays correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24347: (follow-up) Remove custom catalog search from acquisitions
Owen Leonard [Mon, 6 Jan 2020 15:09:08 +0000 (15:09 +0000)]
Bug 24347: (follow-up) Remove custom catalog search from acquisitions

This patch removes the "neworderbiblio" script and template which are
made obsolete by the "search to order" feature.

deleted:    acqui/neworderbiblio.pl
deleted:    koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt

Some documentation in addorder.pl has been corrected to remove reference
to neworderbiblio.pl.

To test, apply the patch and verify that the correct files have been
removed.

Search the Koha codebase to verify that no links to
acqui/neworderbiblio.pl remain.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24347: Add a 'search to order' option similar to 'search to hold'
Owen Leonard [Mon, 6 Jan 2020 01:45:21 +0000 (01:45 +0000)]
Bug 24347: Add a 'search to order' option similar to 'search to hold'

This patch modifes the process of searching for an existing record
to add to a basket. Now the search is performed as a keyword search in
the regular catalog rather than via a custom search script. Options are
added to the search results and detail pages to add results to an order.

This process follows the same pattern as the "Search to hold" feature:
When the search is initiated, a cookie is set with the requisite
information--in this case vendor id and basket number.

If the search results or bibliographic detail pages detect that a
"searchToOrder" cookie is present, the correct "Add order" link will be
shown. Like with the "search to hold" feature, the cookie expires in 10
minutes.

To test, apply the patch and log into the staff client as a user who has
permission to add to a basket in acquisitions.

 - Go to Acquisitions -> Vendor -> Basket -> Add to basket.
 - Using the "From an existing record" option, perform a search.
 - On the search results page, test the "Add order" link which appears
   with each result. Clicking the link should take you to the "New
   order" page for the correct vendor and basket. The catalog
   details section of the form should include the correct information.
 - From the search results page view the bibliographic details page for
   any record. There should be a new toolbar button, "Add order." Verify
   that it works correctly.
   - Test the same thing from all bibliographic detail pages: Normal,
     MARC, Labeled MARC, ISBD, as well as the items page
     (moredetail.pl).
 - Test this process for both the locations in acquisitions where one
   can add to an existing basket: Vendor search results and the basket
   detail page
 - Test the cookie timeout: Wait 10 minutes and perform another catalog
   search. The "Add order" link should no longer be present.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23594: Fix bad resolution conflict with bug 16784
Jonathan Druart [Thu, 23 Jan 2020 08:59:55 +0000 (09:59 +0100)]
Bug 23594: Fix bad resolution conflict with bug 16784

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23594: Add missing html filters
Jonathan Druart [Wed, 22 Jan 2020 09:04:21 +0000 (10:04 +0100)]
Bug 23594: Add missing html filters

Also fixes the following QA failure:
forbidden pattern: Attribute type should not be used for script tags (bug 20053) (line 840)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23594: Restore previous view after delete or update itemtype
Jonathan Druart [Tue, 22 Oct 2019 10:00:18 +0000 (12:00 +0200)]
Bug 23594: Restore previous view after delete or update itemtype

We want to restore the previous view when suggestions are deleted or
their itemtypes are updated.
To avoid c/p the code is moved to a new subroutine.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23594: Fix [un]checkall links
Jonathan Druart [Tue, 22 Oct 2019 09:51:54 +0000 (11:51 +0200)]
Bug 23594: Fix [un]checkall links

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23594: Batch modification for itemtypes on suggestions page
Jonathan Druart [Mon, 21 Oct 2019 16:06:07 +0000 (18:06 +0200)]
Bug 23594: Batch modification for itemtypes on suggestions page

This new enhancement adds the ability to update the item types for
selected suggestions on the suggestions management page
(suggestion/suggestion.pl)

To achieve this goal we needed to refresh a bit the template, in order
to get rid of weird code. To not recreate the previous coding awkwardness
some code has been rewritten (mainly the removal of suggestiontype)

Test plan:
- Create some suggestions
- On the suggestions management page, select some of them and a new item
types.
- Submit the form and confirm that the itemtype of the suggestions has
been updated

- Also you should confirm that the "delete" and "change status" still
work as before

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23915: Replace OPAC list sort menu with Bootstrap menu button
Owen Leonard [Mon, 28 Oct 2019 17:57:20 +0000 (17:57 +0000)]
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button

This patch adds JavaScript to the list contents page which converts the
resort form's <select> menu into a Bootstrap dropdown menu. This allows
for a more compact and consistent display.

To test, apply the patch and regenerate the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

View a list in the OPAC. The toolbar of list controls ("New list,"
"Download list," etc.) should have a similary-styled "Sort" button. Each
sorting option should work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23896: logaction should pass the correct interface to Koha::Logger
Marcel de Rooy [Fri, 25 Oct 2019 08:49:15 +0000 (08:49 +0000)]
Bug 23896: logaction should pass the correct interface to Koha::Logger

Trivial fix.

Test plan:
Run t/db../Log.t to ensure that we did not break stuff.
If you set opac to debug in log4perl config, inspect opac-error.log to see
if you have extra loglines from running the test script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17697: Improve NotesBlacklist system preference description
Katrin Fischer [Sun, 12 Jan 2020 10:16:05 +0000 (11:16 +0100)]
Bug 17697: Improve NotesBlacklist system preference description

- Switched 'separator' for more common 'tab' and rephrased sentence
- Added examples
- Added note to use hidden settings for hiding in other spots.

To test:
- Search for NotesBlacklist system preference and read the description
- Apply patch
- Refresh and read again
- If improved, sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24542: (bug 23049 follow-up) Add missing use statement in Koha::Account
Jonathan Druart [Thu, 30 Jan 2020 09:51:51 +0000 (10:51 +0100)]
Bug 24542: (bug 23049 follow-up) Add missing use statement in Koha::Account

Fix the following error when an item is checked out and that
ManInvInNoissuesCharge is turned off:
Can't locate object method "search" via package "Koha::Account::DebitTypes"

Test plan:
0/ Turn off ManInvInNoissuesCharge
1/ Check an item out

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23493: Fix selenium/regressions.t
Jonathan Druart [Thu, 30 Jan 2020 09:20:25 +0000 (10:20 +0100)]
Bug 23493: Fix selenium/regressions.t

One test wants to make sure thead, tfoot and tbody will have th/td's
with the same size/number.
Existing test for tbody was retrieving the grouped td, which has a
colspan of 100%. Note that this 100% value seems to be wrong as it is
interpreted like "100" by the browser. We do not want to test this row
anyway, but the real row, the one with all the td's.

This patch makes it retrieve the second tr and count the number of td it
has.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23493: (RM follow-up) Let datatables calculate colspan for us
Martin Renvoize [Thu, 30 Jan 2020 09:37:55 +0000 (09:37 +0000)]
Bug 23493: (RM follow-up) Let datatables calculate colspan for us

Prior to this we arbitrarily set a colspan of 100 for the rowgroup
header row.  If we remove the td wrapper from the render function then
datatables will automatically wrap the output in an appropraite td with
cell with fullwidth colspan correctly set.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22868: DBRev 19.12.00.016
Martin Renvoize [Thu, 30 Jan 2020 08:34:06 +0000 (08:34 +0000)]
Bug 22868: DBRev 19.12.00.016

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22868: Move suggestions_manage subperm out of acquisition perm
Jonathan Druart [Tue, 14 Jan 2020 09:02:11 +0000 (10:02 +0100)]
Bug 22868: Move suggestions_manage subperm out of acquisition perm

Bug 11911 replaced the permission of suggestions.pl (create a purchase
suggestion) from catalogue => 1 to acquisition => 'suggestions_manage'.
However we have a lot of acquisition scripts that have lax permissions
(acquisition => '*' which means any sub permissions of acquisition is
enough).

That causes problem when a circulation staff can create purchase
suggestions but not access acquisition information.

One solution is to move the suggestions_manage subpermission out of the
acquisition permission and create a new suggestion permission.

Test plan:
0. Setup
* Create a patron with several permission (and full acquisition
permission)
* Create another patron with several permission, and suggestions_manage
permission
* Create another patron without the suggestions_manage permission
1. Apply the patch and execute the update database entry
2. Note that the third patron you create still does not have
suggestions_manage
3. Confirm that you can create a purchase suggestion if you have
suggestions_manage, but cannot access acquisition pages if you do not
have any subpermissions of the acquisition permission

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23493: Remove commented lines
Jonathan Druart [Wed, 29 Jan 2020 09:31:33 +0000 (10:31 +0100)]
Bug 23493: Remove commented lines

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoRevert "Bug 23493: (follow-up) Switch to aDataSort for multi-column sorting"
Martin Renvoize [Wed, 29 Jan 2020 16:12:13 +0000 (16:12 +0000)]
Revert "Bug 23493: (follow-up) Switch to aDataSort for multi-column sorting"

This reverts commit 930fedd46282bc46027332f4986f3baaee72b4ad.

4 years agoRevert "Bug 23493: (follow-up) Disable rowGroup on due date sort"
Martin Renvoize [Wed, 29 Jan 2020 16:11:46 +0000 (16:11 +0000)]
Revert "Bug 23493: (follow-up) Disable rowGroup on due date sort"

This reverts commit 644ed8860aea4b1297d978700c2966a93e10628a.

4 years agoBug 23493: (follow-up) Disable rowGroup on due date sort
Martin Renvoize [Wed, 29 Jan 2020 11:27:51 +0000 (11:27 +0000)]
Bug 23493: (follow-up) Disable rowGroup on due date sort

When sorting by due date you are much more likely to want the true date
sorting without forcing a primary sort on the grouping column. This
patch achieves that by removing the primary sort on checkout date and
disable rowGrouping in such a case.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23493: (follow-up) Switch to aDataSort for multi-column sorting
Martin Renvoize [Tue, 28 Jan 2020 17:18:44 +0000 (17:18 +0000)]
Bug 23493: (follow-up) Switch to aDataSort for multi-column sorting

This patch adds aDataSort configurations for each sortable column such
that we always maintain the group sorting primarily and apply a
secondary sort using the column in question.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23493: Replace rowGrouping with rowGroup
Martin Renvoize [Fri, 23 Aug 2019 09:52:11 +0000 (10:52 +0100)]
Bug 23493: Replace rowGrouping with rowGroup

This patch replaces the unmaintained third party rowGrouping datatables
plugin with the supported core rowGroup replacement.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24305: (follow-up) Remove previous declaration of batch_biblionumbers
Jonathan Druart [Wed, 29 Jan 2020 10:13:45 +0000 (11:13 +0100)]
Bug 24305: (follow-up) Remove previous declaration of batch_biblionumbers

Revert change for cardnumbers, they are not always numbers.
We may need to add a regex to remove special chars however, will be done
on its own bug report if needed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23947: Phase out jquery.cookie.js: Authority merge
Owen Leonard [Fri, 1 Nov 2019 18:15:53 +0000 (18:15 +0000)]
Bug 23947: Phase out jquery.cookie.js: Authority merge

This patch updates the JavaScript which sets cookies during the
authority merge process so that it uses the new js-cookie library.

To test, apply the patch and perform a search in the authority module
which will return multiple results.

 - Select "Merge" from the Actions menu next to any result.
   - A message should appear at the top of the page: "Merging with
     authority: <title>".
   - Click "Cancel merge." The message should disappear.
 - Select a record to merge again.
   - Select another record.
   - The page should redirect to the authority merge page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23944: (follow-up) Update circulation to use new library
Owen Leonard [Fri, 1 Nov 2019 13:18:28 +0000 (13:18 +0000)]
Bug 23944: (follow-up) Update circulation to use new library

This patch updates the circulation page to use the new JavaScript Cookie
library for cookie management.

To test, apply the patch and open a patron record for checkout in the
staff client.

 - Click "Search to hold" in the toolbar and perform a catalog search
   which will return results.
 - On the search results page, the toolbar at the top of the results
   should include a split "Place hold" button. The button's menu should
   include "Place hold for <patron>" and "Forget <patron>" options. Test
   that these work correctly.
 - In the table of search results each title should include a "Place
   hold for <patron>" link.
 - Go to the checkouts page for a patron with one or more checked-out
   items.
   - Check the "Always show checkouts immediately" checkbox.
   - The patron's checkouts should load.
   - Open another patron for checkout who has checked-out items.
   - The table of checkouts should load automatically.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23944: Phase out use of jquery.cookie.js in favor of js.cookie.js
Owen Leonard [Fri, 1 Nov 2019 13:00:03 +0000 (13:00 +0000)]
Bug 23944: Phase out use of jquery.cookie.js in favor of js.cookie.js

This patch adds a new JavaScript file to the staff client's global
JavaScript include file: js.cookie-2.2.1.min.js. This "plugin" will
replace jquery.cookie.js which is no longer maintained.

The "About" page in the staff client is updated to include this new
resource as well as adding previously-missing information about the old
plugin which will remain until all instances of its usage have been
removed.

To test, apply the patch and check the About page to confirm the correct
information is included.

No functionality change is introduced by this bug. The only other
observable change is the existence of the new files and the inclusion of
the minified version of the file in any staff client page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20847: Add more fields to the Batch Patron Modification tool
David Roberts [Fri, 24 Jan 2020 02:15:46 +0000 (02:15 +0000)]
Bug 20847: Add more fields to the Batch Patron Modification tool

This patch adds streetnumber, address, address2, phone and mobile to the
Batch Patron Modify form, also moves Primary email to a more logical
place on the page

To test:

1) Install patch
2) Open Batch Patron Modification tool, and input a borrowernumber to
edit
3) Add some data into the streetnumber, address, address2, phone and
mobile fields and click Save
4) These fields in the user record should now contain your data
5) Test that running the tool again with the option to delete the data
clears the fields correctly
6) Repeat steps 1-5 with a file of user borrowernumbers

Signed-off-by: Daniel J <daniel.jones@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23856: Split author and ISBN/ISSN out of citation in staged MARC record management
Owen Leonard [Mon, 21 Oct 2019 17:01:06 +0000 (17:01 +0000)]
Bug 23856: Split author and ISBN/ISSN out of citation in staged MARC record management

This patch modifies the way data is passed to the staged MARC record
management template, splitting author, ISBN, and ISSN out of the
"citation" variable and passing them separately.

The DataTables configuration for the staged MARC record management page
is modified so that those now-separate variables are conditionally
displayed.

Unrelated minor change: Added a class to the MARC preview modal so that
it displays wider.

To test, apply the patch and view the "Staged MARC management" page for
both batches of bibliographic records and batches of authority records.

In each case the title or authority heading should be displayed as a
link while author, ISBN, and ISSN (if any) should not.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23885: Move staff client search results JavaScript into separate file
Owen Leonard [Tue, 22 Oct 2019 11:47:04 +0000 (11:47 +0000)]
Bug 23885: Move staff client search results JavaScript into separate file

This patch moves most of the JavaScript embedded in results.tt into a
separate file. The JavaScript that remains on the page is everything
which requires processing by Template Toolkit. This is limited to
variable definition.

To test, apply the patch and perform a catalog search in the staff
client. On the results page, test that JavaScript functionality has not
been affected:

 - The search results toolbar should "float" as you scroll
 - Select all and Clear all
 - Default search term highlighting; Unhighlight and highlight controls
 - Adding and removing one or more items from the cart
 - Adding one or more items to a list
 - Placing one or more holds my making selections and clicking "Place
   hold"
 - Browse selected records
 - Z39.50 search (search form should be populated with your search
   terms)
 - "Show more" and "Show less" links in the facets sidebar
 - Book cover image services: Amazon, Coce, local covers, etc.
 - Open a patron record and click "Search to hold"
  - Perform a search and select one or more results
    - Test "Place hold" from the hold menu in the toolbar
    - Test "Place hold for..." from the hold menu in the toolbar
    - Test "Forget..." from the hold menu in the toolbar
 - In Tools -> Patron clubs, locate a club with enrolled members
   - From the "Actions" menu, select "Search to hold"
     - Perform a search and select one or more results
       - Test "Place hold" from the hold menu in the toolbar
       - Test "Place hold for..." from the hold menu in the toolbar
       - Test "Forget..." from the hold menu in the toolbar

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 13121: Move search results "action" links ("Place hold," "Add tag," etc) into...
Owen Leonard [Tue, 7 Jan 2020 13:03:18 +0000 (13:03 +0000)]
Bug 13121: Move search results "action" links ("Place hold," "Add tag," etc) into include file

This patch moves markup for controls repeated across several OPAC
templates into a single include: Place hold, Request article, Add tag,
Save to lists, and Add to cart.

To test, apply the patch and view the following OPAC pages:

 - Search results
 - Shelf contents view
 - User tags list

On each of these pages all the controls should work correctly:

 - Place hold
 - Request art
 - Add tag
 - Save to lists
 - Add to cart

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24296: DBRev 19.12.00.015
Martin Renvoize [Tue, 28 Jan 2020 15:05:44 +0000 (15:05 +0000)]
Bug 24296: DBRev 19.12.00.015

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24296: Update stockrotation process to use branchtransfers.reason
Martin Renvoize [Thu, 16 Jan 2020 09:52:20 +0000 (09:52 +0000)]
Bug 24296: Update stockrotation process to use branchtransfers.reason

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'reason' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24296: Update existing data in the database
Martin Renvoize [Thu, 16 Jan 2020 09:01:34 +0000 (09:01 +0000)]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24287: DBRev 19.12.00.014
Martin Renvoize [Tue, 28 Jan 2020 15:01:30 +0000 (15:01 +0000)]
Bug 24287: DBRev 19.12.00.014

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24287: Add `reason` to `branchtransfers`
Martin Renvoize [Fri, 20 Dec 2019 16:02:01 +0000 (16:02 +0000)]
Bug 24287: Add `reason` to `branchtransfers`

This patch adds the `reason` field to the `branchtransfers` table to
record what triggered a transfer.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24448: Adding a notice to tell the _count methods are temporary
Jonathan Druart [Tue, 28 Jan 2020 14:04:10 +0000 (15:04 +0100)]
Bug 24448: Adding a notice to tell the _count methods are temporary

See bug 24467. You are allowed to flog tcohen with an RJ45 cable if this
is not fixed in the next months.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24448: Add Koha::Biblio->subscriptions_count
Tomas Cohen Arazi [Fri, 17 Jan 2020 14:18:41 +0000 (11:18 -0300)]
Bug 24448: Add Koha::Biblio->subscriptions_count

This patch adds the handy subscriptions_count method to the Koha::Biblio
class. It is intended to be used as a shortcut for

    $biblio->subscriptions->count

in places like the API where we can embed the output of a method.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t \
           t/db_dependent/Koha/Biblios.t
=> SUCCESS: Tests pass! i.e. Biblios.t still passes, and the tests for
the new method in Biblio.t pass as well.
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24448: Unit tests
Tomas Cohen Arazi [Fri, 17 Jan 2020 14:17:33 +0000 (11:17 -0300)]
Bug 24448: Unit tests

This patch adds tests for the new method to be introduced. It also moves
the tests for Koha::Biblio->subscriptions to the Biblio.t where it
really belongs.

To test, run this tests along with the patch implementing the new
method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24348: Pass marc record to _passes_required_checks
Andreas Jonsson [Sun, 5 Jan 2020 13:02:13 +0000 (13:02 +0000)]
Bug 24348: Pass marc record to _passes_required_checks

Test plan:

* Add record matching rule:

 Matching rule code: test
 Description: 001 and 003
 Match threshold: 1000
 Record type: Bibliografic record

 Match points:
    Search index: Control-number
    Score: 1000
    Tag: 001
    Subfields:
    Offset:
    Length:
    Normalization rule: none

 Required match checks:

    Source (incoming) record check field

    Tag: 003
    Subfields:
    Offset:
    Length:
    Normalization rule: none

    Target (database) record check field

    Tag: 003
    Subfields:
    Offset:
    Length:
    Normalization rule: none

* Note the match rule identity number.
* Stage a marc-file for import, for instance this one ftp://ftp.libris.kb.se/pub/export2/X/marc/X.20200104.marc

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev

* Note the batch number and commit the file using the batch number:

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/commit_file.pl --batch-number 1" kohadev

* Again, stage the same marc-file  for import:

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev

* Note the number of records matched.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: (RM followup) Boraccount refund form correction
Martin Renvoize [Tue, 28 Jan 2020 13:13:10 +0000 (13:13 +0000)]
Bug 23442: (RM followup) Boraccount refund form correction

This patch adds a minor correction to the refund form on the borrower
accounts page. It removes the hidden 'registerid' form field and
corrects the select field to submit registerid as intended.

This corrects the behaviour such that the staff user can select which
cash register the payout action should be attributed to.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: (RM followup) Boraccount payout form correction
Martin Renvoize [Tue, 28 Jan 2020 13:12:40 +0000 (13:12 +0000)]
Bug 24080: (RM followup) Boraccount payout form correction

This patch adds a minor correction to the payout form on the borrower
acocunts page. It removes the hidden 'registerid' form field and
corrects the select field to submit registerid as intended.

This corrects the behaviour such that the staff user can select which
cash register the payout action should be attributed to.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23113: members/pay.tt account_grp is not longer used
Owen Leonard [Tue, 7 Jan 2020 12:33:02 +0000 (12:33 +0000)]
Bug 23113: members/pay.tt account_grp is not longer used

This patch removes obsolete markup from pay.tt.

To test, apply the patch and search the Koha codebase for instances of
"account_grp" There should be none.

Log in to the staff client and go to the account of a patron who has
fines. Confirm that the "Accounting" page ("Make a payment" tab) works
correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24361: Silent t/db_dependent/Items.t
Jonathan Druart [Mon, 27 Jan 2020 16:43:17 +0000 (17:43 +0100)]
Bug 24361: Silent t/db_dependent/Items.t

its output is displaying tons of
Use of uninitialized value $field in regexp compilation at /kohadevbox/koha/C4/Items.pm line 2106.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24486: Remove duplicated account information at the OPAC
Nick Clemens [Mon, 27 Jan 2020 11:48:31 +0000 (11:48 +0000)]
Bug 24486: Remove duplicated account information at the OPAC

Test plan:
Create a manual invoice
Pay it
Void it

Go to the opac, account
=> You should see only one "(Voided)"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24421: Check if subfields are valid using the biblio tag
Nick Clemens [Tue, 14 Jan 2020 16:13:25 +0000 (16:13 +0000)]
Bug 24421: Check if subfields are valid using the biblio tag

To test:
 1 - Enable the sysprefs
     AutoCreateAuthorities
     BiblioAddsAuthorities
     CatalogModuleRelink
 2 - Open a record with a subject heading with a subdivision and add a new subfield, or add a new unauthroized heading to a record and save it
    e.g. 650$aChess$xOpenings$vFiction.
 3 - Save the record, note the created authority and that field is linked
 4 - Save the record again and note the authority number changes
 5 - Find and view the authority linked to the record
 6 - The record is for 'Chess', not Chess openings'
 7 - Search authorities for 'Chess' - note duplicated records
 8 - Apply patch, restart all
 9 - Save the record, auth number increases again, we shoudl create the correct record this time
10 - Save again, auth number should not change
11 - Search authorities and confirm the generated authority has the correct subfields

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24421: Unit tests
Nick Clemens [Fri, 24 Jan 2020 13:24:45 +0000 (13:24 +0000)]
Bug 24421: Unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24339: Do not assume there are exactly 3 SIP* AVs
Jonathan Druart [Mon, 27 Jan 2020 10:03:46 +0000 (11:03 +0100)]
Bug 24339: Do not assume there are exactly 3 SIP* AVs

Update DB entry 19.06.00.017:
We created SIP* AV from accountlines if '^Pay[[:digit:]]{2}$', so I
think we should assume that more than SIP00, SIP01, SIP02 can exist.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24339: Remove SIP payment types from staff pay screens
Martin Renvoize [Wed, 8 Jan 2020 12:48:55 +0000 (12:48 +0000)]
Bug 24339: Remove SIP payment types from staff pay screens

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24339: Add SIP2 payment types for installation
Martin Renvoize [Fri, 3 Jan 2020 21:50:51 +0000 (21:50 +0000)]
Bug 24339: Add SIP2 payment types for installation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24497: Turn off smartIndent for SQL
Lucas Gass [Fri, 24 Jan 2020 18:18:33 +0000 (18:18 +0000)]
Bug 24497: Turn off smartIndent for SQL

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24484: Add explanatory text to batch patron deletion
David Roberts [Thu, 23 Jan 2020 12:18:17 +0000 (12:18 +0000)]
Bug 24484: Add explanatory text to batch patron deletion

This patch adds a more detailed explanation about what the tool can do.

To test:

1) Open up the Batch patron deletion and anonymisation tool
2) Check the help text near the top of the screen
3) Install the patch and repeat steps 1 and 2
4) Check the help text has changed to the new version

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24511: Update variable names to avoid confusion
Nick Clemens [Fri, 24 Jan 2020 14:58:25 +0000 (14:58 +0000)]
Bug 24511: Update variable names to avoid confusion

To test:
1 - Create a report
    SELECT borrowernumber, firstname, surname, email, emailpro FROM borrowers WHERE surname='acosta'
2 - Create or edit patron with surname acosta to have a separate email and emailpro
3 - perl misc/cronjobs/patron_emailer --notice HOLDS --module reserves --verbose --email emailpro --report ## --from 'me@you.us'
4 - Note email is used, not email pro
5 - Apply patch
6 - Repeat, correct eamil is used

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24515: Column Configuration for pay-fines-table does not hide Account Type properly
Owen Leonard [Fri, 24 Jan 2020 23:25:20 +0000 (23:25 +0000)]
Bug 24515: Column Configuration for pay-fines-table does not hide Account Type properly

This patch corrects the order of the columns in the columns
configuration YML file. The incorrect order was causing the wrong column
to be hidden when changing the columns settings for the table in
Administration.

To test, apply the patch and go to Administration -> Columns settings.

 - Under Patrons -> pay-fines-table, test hiding the account_type and
   description columns, together and separately.
 - Verify that the correct columns are hidden on the pay fines screen
   (Patron -> Accounting -> Make a payment)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24509: Fix API relared tests failing on MySQL8
Tomas Cohen Arazi [Fri, 24 Jan 2020 12:16:09 +0000 (09:16 -0300)]
Bug 24509: Fix API relared tests failing on MySQL8

This patch makes a trivial change to the tests so they catch the way
MySQL 8 reports the duplicate key message. The difference on the API
error message is irrelevant and so it is ok to just make the tests try
both MySQL 8 output and the rest of the supported engines.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t \
           t/db_dependent/api/v1/libraries.t \
           t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail due to warning and conflict message differences
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8
Jonathan Druart [Fri, 24 Jan 2020 10:13:53 +0000 (11:13 +0100)]
Bug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8

 $ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
 t/db_dependent/Koha/Checkouts/ReturnClaim.t ..
     #   Failed test 'Exception field is correct'
     #   at t/db_dependent/Koha/Checkouts/ReturnClaim.t line 97.
     #          got: 'return_claims.issue_id'
     #     expected: 'issue_id'
     # Looks like you failed 1 test of 8.
 t/db_dependent/Koha/Checkouts/ReturnClaim.t .. 1/1
 #   Failed test 'store() tests'
 #   at t/db_dependent/Koha/Checkouts/ReturnClaim.t line 133.

This is similar to bug 23825.

Test plan:
Confirm that the tests pass on MySQL8 and MariaDB

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24305: (QA follow-up) Strip table name in [[table.field|alias]]
Marcel de Rooy [Fri, 24 Jan 2020 11:17:15 +0000 (11:17 +0000)]
Bug 24305: (QA follow-up) Strip table name in [[table.field|alias]]

When you would use the construct, you wont have batch features unless
we strip the table name. This is consistent with the $sth->{NAME} used
to fill the headers by default.

Test plan:
Use [[items.biblionumber|bibno]] instead of items.biblionumber in a
reporting query.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24305: (follow-up) Add small comment for square brackets in get_prepped_report
Marcel de Rooy [Fri, 24 Jan 2020 11:04:05 +0000 (11:04 +0000)]
Bug 24305: (follow-up) Add small comment for square brackets in get_prepped_report

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24305: Remove previous declaration of batch_biblionumbers
Jonathan Druart [Mon, 13 Jan 2020 11:15:33 +0000 (12:15 +0100)]
Bug 24305: Remove previous declaration of batch_biblionumbers

We should not init batch_biblionumbers before.
Also this patch deals with batch_cardnumbers.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24305: Fix links to batch tools when report's columns do not contain integers
Jonathan Druart [Thu, 26 Dec 2019 10:11:55 +0000 (11:11 +0100)]
Bug 24305: Fix links to batch tools when report's columns do not contain integers

If report's columns do not only contain integers, we should not point to
batch tools.
For instance, if the value is a link, the batch tools will not work as
they will not retrieve the id (itemnnumber or biblionumber) properly

Test plan:
Create a report like:
    SELECT CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is not link to the batch tools

Edit the report like:
    SELECT itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is a link to the batch tools

Edit the report like

    SELECT itemnumber, CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is link to the batch tools

Try other combinations with biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24503: fix missing use in value builder barcode_manual.pl
Fridolin Somers [Fri, 24 Jan 2020 08:20:06 +0000 (09:20 +0100)]
Bug 24503: fix missing use in value builder barcode_manual.pl

Bug 22721 added use C4::Biblio in cataloguing/value_builder/barcode.pl.
This is missing in value builder barcode_manual.pl.
You get the error :
Undefined subroutine &Koha::FrameworkPlugin::GetMarcFromKohaField called at cataloguing/value_builder/barcode_manual.pl line 41.

Test plan :
1) Configure a subfield of item to use value builder barcode_manual.pl
2) Go to a record
3) Try to add a new item
4) Check the value builder is OK

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with autobarcode==year-0001,0002
No internal server error, but generates a barcode now.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23443: Do not checkin an item if checked out to another patron when lost fee...
Jonathan Druart [Tue, 14 Jan 2020 11:39:38 +0000 (12:39 +0100)]
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid

Test plan:
0 - Do not apply this patch
1 - Check out an item to a patron
2 - Make sure a fee will be charged when lost
3 - Mark the item lost
4 - Make sure the fee will not be refunded on return of the item
5 - Return the item
6 - Check it out to a new patron
7 - Write off the fine for the original patron
=> The item is now checked in
8 - Apply this patch and repeat 1 to 7
=> The item is still checked out

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23443: Add tests
Jonathan Druart [Tue, 14 Jan 2020 11:39:36 +0000 (12:39 +0100)]
Bug 23443: Add tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23407: (QA follow-up) Same change for UNIMARC XSLT
Marcel de Rooy [Fri, 24 Jan 2020 07:22:52 +0000 (07:22 +0000)]
Bug 23407: (QA follow-up) Same change for UNIMARC XSLT

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23407: (QA follow-up) Remove some XSLT item leftovers
Marcel de Rooy [Fri, 24 Jan 2020 07:12:31 +0000 (07:12 +0000)]
Bug 23407: (QA follow-up) Remove some XSLT item leftovers

Test plan:
Check intranet results and detail page.
Check opac detail.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23407: Don't process items for XSLT on details pages
Nick Clemens [Wed, 31 Jul 2019 20:14:34 +0000 (20:14 +0000)]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note the load time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24443: Unit test
Fridolin Somers [Fri, 17 Jan 2020 09:48:50 +0000 (10:48 +0100)]
Bug 24443: Unit test

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24443: Consider NULL as 0 for issues in items search
Fridolin Somers [Fri, 17 Jan 2020 09:25:19 +0000 (10:25 +0100)]
Bug 24443: Consider NULL as 0 for issues in items search

In items search, we can filter by items issues count, data coming from items.issues.
Most of the time, for an item with no issues this column contains NULL.
This enhancement proposes to consider NULL as 0 to allow searching items with no issues.

Test plan:
1) Use SQL to count items with items.issues = NULL :
   select count(*) from items where issues is null;
2) Go to items search
3) Perform search with filter "Checkout count" = 0
4) Check you get the same number of results as SQL query

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22831: (RM follow-up) Add libarray-utils-perl to control
Martin Renvoize [Fri, 24 Jan 2020 09:16:01 +0000 (09:16 +0000)]
Bug 22831: (RM follow-up) Add libarray-utils-perl to control

This patch adds the new Array::Utils perl dependancy to the debian
control files.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17084: Automatic debian/control updates (unstable/master)
Nightly Build Bot [Fri, 10 Jan 2020 23:32:51 +0000 (00:32 +0100)]
Bug 17084: Automatic debian/control updates (unstable/master)

Remove Text::Unaccent dependancy

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24149: Skip Koha::Statistics for TestBuilder tests
Jonathan Druart [Fri, 24 Jan 2020 08:44:04 +0000 (09:44 +0100)]
Bug 24149: Skip Koha::Statistics for TestBuilder tests

As statistics does not have a PK we need to adjust the TestBuilder
tests.
Bug 18441 already exists for adding the PK.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24080: (RM follow-up) Add payout to 'accounts.inc'
Martin Renvoize [Thu, 23 Jan 2020 15:48:21 +0000 (15:48 +0000)]
Bug 24080: (RM follow-up) Add payout to 'accounts.inc'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: (RM follow-up) Add 'Refund' to accounts.inc
Martin Renvoize [Thu, 23 Jan 2020 15:47:39 +0000 (15:47 +0000)]
Bug 23442: (RM follow-up) Add 'Refund' to accounts.inc

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23442: (RM follow-up) Fix for missing 'uc' in offset_type call
Martin Renvoize [Thu, 23 Jan 2020 15:45:12 +0000 (15:45 +0000)]
Bug 23442: (RM follow-up) Fix for missing 'uc' in offset_type call

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24149: (QA follow-up) Add pod for Koha::Statistics->object_class
Josef Moravec [Thu, 23 Jan 2020 05:50:34 +0000 (05:50 +0000)]
Bug 24149: (QA follow-up) Add pod for Koha::Statistics->object_class

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24149: Add tests
Jonathan Druart [Tue, 3 Dec 2019 16:40:06 +0000 (17:40 +0100)]
Bug 24149: Add tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24149: Add Koha::Statistic->item
Jonathan Druart [Tue, 26 Nov 2019 18:44:47 +0000 (19:44 +0100)]
Bug 24149: Add Koha::Statistic->item

Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24149: Add Koha::Statistic[s] classes
Jonathan Druart [Tue, 26 Nov 2019 16:52:55 +0000 (17:52 +0100)]
Bug 24149: Add Koha::Statistic[s] classes

Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24478: DBRev 19.12.00.013
Martin Renvoize [Thu, 23 Jan 2020 10:39:38 +0000 (10:39 +0000)]
Bug 24478: DBRev 19.12.00.013

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24478: Fix sequence in sysprefs.sql and add missing comma
Katrin Fischer [Thu, 16 Jan 2020 14:11:11 +0000 (14:11 +0000)]
Bug 24478: Fix sequence in sysprefs.sql and add missing comma

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24478: Use `EnablePointOfSale` preference
Martin Renvoize [Wed, 22 Jan 2020 10:51:55 +0000 (10:51 +0000)]
Bug 24478: Use `EnablePointOfSale` preference

This patch adds the `EnablePointOfSale` preference to the accounting tab
on the preferences editor and ties the display of the Point of Sale
module to it.

Test plan:
1) Enable both `UseCashRegisters` and `EnablePointOfSale` preferences.
2) Ensure you are a superuser or your user has the
   takepayment permission.
3) The Point of Sale module should be present on your staff home page
   with the above configuration, otherwhise it should not.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24478: Add `EnablePointOfSale` system preference
Martin Renvoize [Wed, 22 Jan 2020 10:49:55 +0000 (10:49 +0000)]
Bug 24478: Add `EnablePointOfSale` system preference

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24025: Make CodeMirror content searchable
Lucas Gass [Wed, 22 Jan 2020 16:31:10 +0000 (16:31 +0000)]
Bug 24025: Make CodeMirror content searchable

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23884: Merge strings.inc and browser-strings.inc
Owen Leonard [Wed, 23 Oct 2019 13:16:45 +0000 (13:16 +0000)]
Bug 23884: Merge strings.inc and browser-strings.inc

This patch take the contents of the JavaScript in browser-strings.inc
and puts it in strings.inc. browser-strings.inc is deleted.

To test, apply the patch and perform a catalog search in the staff
client.

 - View any result. In the left-hand sidebar there should be a search
   results browser box with "previous" and "next" arrows and a link back
   to search results.
 - Click on each different "view" tab and confirm that the search
   results navigation box persists: Normal, MARC, Labeled MARC, ISBD,
   Items.
 - From any of these views select Edit -> Edit items. The same
   navigation box should appear.

Note: addbiblio.tt and stockrotation.tt are modified but feature doesn't
currently work on those pages.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19809: Remove some new occurrences
Jonathan Druart [Wed, 22 Jan 2020 10:50:19 +0000 (11:50 +0100)]
Bug 19809: Remove some new occurrences

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19809: Re-allow to call Koha::Objects::find in list context
Julian Maurice [Thu, 14 Dec 2017 08:19:22 +0000 (09:19 +0100)]
Bug 19809: Re-allow to call Koha::Objects::find in list context

and remove 'scalar' keyword in calls where it's not needed.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24105: Fix error when running longoverdue.pl with --itemtypes
Liz Rea [Mon, 25 Nov 2019 17:20:51 +0000 (11:20 -0600)]
Bug 24105: Fix error when running longoverdue.pl with --itemtypes

To test:

Run Longoverdue.pl as koha-shell with both 1 and several --itemtypes specified
notice that it has an error
apply this patch
run longoverdue.pl as koha-shell with both 1 and several --itemtypes specified
notice there isn't an error anymore!

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24452: Advanced editor - show multiple spaces visually
Owen Leonard [Fri, 17 Jan 2020 15:00:31 +0000 (15:00 +0000)]
Bug 24452: Advanced editor - show multiple spaces visually

This patch updates the JavaScript and CSS for the advanced MARC editor
so that multiple consecutive spaces within a line will be detected and
highlighted.

To test the EnableAdvancedCatalogingEditor system preference should be
enabled. Apply the patch and clear your browser cache if necessary.

 - Go to Cataloging -> Advanced editor.
 - On any text entry line (e.g. 245), enter some words with one, two,
   and more spaces in between them. When there are two or more spaces
   between words the spaces between the words should have a dotted red
   underline.
 - Remove the extra spaces and confirm that the dotted line disappears.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22831: (RM follow-up) Code golf
Martin Renvoize [Thu, 23 Jan 2020 10:20:31 +0000 (10:20 +0000)]
Bug 22831: (RM follow-up) Code golf

Rather than performing a symmetric diff and then splitting the results
in a further loop this patch changes to logic to use two asymetric diffs
to get the results more directly.

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