koha.git
2 years agoMerge remote-tracking branch 'security/21.11.x' into 21.11.x
Kyle Hall [Fri, 25 Feb 2022 15:57:26 +0000 (10:57 -0500)]
Merge remote-tracking branch 'security/21.11.x' into 21.11.x

2 years agoBug 30133: (follow-up) Update objects.search POD
Tomas Cohen Arazi [Mon, 21 Feb 2022 11:59:05 +0000 (08:59 -0300)]
Bug 30133: (follow-up) Update objects.search POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations
Tomas Cohen Arazi [Fri, 18 Feb 2022 19:07:02 +0000 (16:07 -0300)]
Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations

This patch does the same thing we did for items on the previous patch,
but for biblios. The tests are almost the same as well.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Simplify code
Tomas Cohen Arazi [Fri, 18 Feb 2022 18:22:36 +0000 (15:22 -0300)]
Bug 30133: Simplify code

This patch simplifies the code, and also fixes a problem with branchcode
comparisson failing, highlighted when running the tests

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> FAIL: Tests fail. Notably:
- Link header pagination is wrong
- X-*Total-Count headers have two values (dupicated)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Avoid calling c->objects->search twice
Nick Clemens [Fri, 18 Feb 2022 14:25:41 +0000 (14:25 +0000)]
Bug 30133: Avoid calling c->objects->search twice

Calling this twice sets double pagination headers, which messes up the page for the requests and
retrieves on ly the end of the list

This patch simply avoids a doulbe call

TO DO: must implement same for Biblio->pickup_locations and cover with tests
this also returns all as needing override

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30133: Regression tests
Tomas Cohen Arazi [Fri, 18 Feb 2022 18:33:42 +0000 (15:33 -0300)]
Bug 30133: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30129: Add test
Jonathan Druart [Mon, 21 Feb 2022 11:59:40 +0000 (12:59 +0100)]
Bug 30129: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30129: remove the third required date that was causing 500 error
Petro Vashchuk [Fri, 18 Feb 2022 11:42:34 +0000 (13:42 +0200)]
Bug 30129: remove the third required date that was causing 500 error

This problem appeared because of this commit:
Bug 14435 Add the ability to store result's report
cf9031711282f4be23e4a639797d0fd178940e1f

This patch fixes it by removing the third $date that wasn't removed
back then.

To reproduce:
1) Head over to Reports page.
2) Search for report by date. It should cause 500 error.
3) Apply the patch.
4) Repeat the search again, it should be working now.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29962: (bug 27526 follow-up): Fix columns button on item list
Jonathan Druart [Fri, 28 Jan 2022 08:49:44 +0000 (09:49 +0100)]
Bug 29962: (bug 27526 follow-up): Fix columns button on item list

The "Columns" button on the item list view has been broken (hidden) by
bug 27526.
"column_name" was removed from the item_header_loop:
-    if ( $kohafield && $kohafield =~ /items.(.+)/ ) {
-        $header_value{column_name} = $1;
-    }

We can still access the attribute name using 'attribute' however.
The difference is that non-mapped subfield will have an "attribute", but
there is a net to prevent a crash in columns_settings.inc:
 12         var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
 13         var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
 14         if ( used_id == -1 ) return;

We should simply pass attribute.

Test plan:
Create a non-mapped subfield (952$k)
Edit an item, add a value for k
On the item table at the top of the edit form notice that the "Columns"
button is back and that it's working correctly.
Note that 'k' cannot be hidden (may be considered as a bug, but it's not
a regression).

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29803: Do not wait for the images more than 5 seconds
Jonathan Druart [Mon, 10 Jan 2022 11:29:11 +0000 (12:29 +0100)]
Bug 29803: Do not wait for the images more than 5 seconds

In case of the previous bug, the page was calling the callback function
every 100ms, endlessly. We should add a test to prevent future similar
problem.

Test plan:
Remove the previous patch "Prevent local cover image to be hidden if
Coce is enabled"
Recreate the test plan
=> You should see the local image displayed after 5 seconds, and a
log in the JS console

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29803: Prevent local cover image to be hidden if Coce is enabled
Jonathan Druart [Mon, 10 Jan 2022 11:19:54 +0000 (12:19 +0100)]
Bug 29803: Prevent local cover image to be hidden if Coce is enabled

If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)

The getURL is returning early if no image is returned by the service and
the "done" flag is never set.

Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce

=> If no image is returned by Coce then the local image should be
displayed anyway

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27770: ES: Deprecated aggregation order key [_term] used, replaced by [_key]
Kevin Carnes [Tue, 8 Feb 2022 13:35:18 +0000 (14:35 +0100)]
Bug 27770: ES: Deprecated aggregation order key [_term] used, replaced by [_key]

Starting in Elasticsearch 6.0 _key should be used instead of _term to order
buckets by their term

To test:
1) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
2) If you observe an error about types, apply patch for bug 25669
3) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
4) Observe if you get a deprecation warning about order key
5) Apply patch
6) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
7) Observe no deprecation warning about order key
8) Sign off

Sponsored-by: Lund University Library
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation
Jonathan Druart [Fri, 28 Jan 2022 14:04:49 +0000 (15:04 +0100)]
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation

If you cancel holds in bulk, the list is not updated as we enqueued the
task. But the "Update hold(s)" button will explode if clicked.

Test plan:
Place several holds on a bib record
Use the "Cancel selected" link to cancel holds in bulk
The job is enqueued and the hold list still show the holds you cancelled
Click "Update holds"
=> Without this patch you get an ugly 500
Can't call method "found" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1060
=> With this patch applied the table is refresh, no crash (and there is
a warning in the log, that may not be necessary)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30115: Uninitialized value warning in C4/Output.pm
Blou [Tue, 15 Feb 2022 21:18:15 +0000 (16:18 -0500)]
Bug 30115: Uninitialized value warning in C4/Output.pm

Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 180.
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 197.
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 211.

This is in pagination_bar sub.  A lot of pages call it.  For me it
happened with any Authority search (authorities/authorities-home.pl)
producing multiple results.

Simple fix is initializing the variable.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29625: Add test for get_all_biblios_iterator
Jonathan Druart [Fri, 18 Feb 2022 10:01:55 +0000 (11:01 +0100)]
Bug 29625: Add test for get_all_biblios_iterator

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29625: Fix var name in Koha::BiblioUtils get_all_biblios_iterator
Fridolin Somers [Thu, 2 Dec 2021 22:21:45 +0000 (12:21 -1000)]
Bug 29625: Fix var name in Koha::BiblioUtils get_all_biblios_iterator

In Koha::BiblioUtils, get_all_biblios_iterator method is a class level method like get_from_biblionumber.
So its first arg should be named $class instead of $self.
Even if this var in not used.

Test plan :
1) Run Elasticsearch full rebuild with and without patch
2) Check all biblio records are in index

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 22671: Show warning if browser doesn't support applicationCache
Owen Leonard [Mon, 18 Oct 2021 12:29:19 +0000 (12:29 +0000)]
Bug 22671: Show warning if browser doesn't support applicationCache

This patch adds a check for browser support for the "applicationCache"
feature required by the offline circulation tool. If the feature is not
available, a message is shown to the user that offline circulation is
disabled.

To test, apply the patch and enable the AllowOfflineCirculation system
preference.

In a browser which supports applicationCache (Firefox < 81, Chrome < 94,
Safari <= 15), go to Circulation -> Built-in offline circulation
interface.

- You should see the standard Offline Circulation menu options: Check
  out, check in, syncrhonize, etc.
- Click "Synchronize," then "Download records."
- The process should complete correctly, updating the "last synced"
  information on the page.

Follow the same steps in a browser which has dropped support for
applicationCache. As soon as you reach the built-in offline circulation
page you should see a message, "Your browser is not compatible..."

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29853: Add HTML filter before KohaSpan filter
Fridolin Somers [Wed, 12 Jan 2022 05:40:35 +0000 (19:40 -1000)]
Bug 29853: Add HTML filter before KohaSpan filter

Usage of Template Toolkit plugin KohaSpan as filter is actually :
  Group [% added.title | $KohaSpan class = 'name' | $raw %] created.

But KohaSpan filter does not escape HTML characters.
Whe should filter HTML then KohaSpan.

This patch adds TT html filter before KohaSpan.
Also replaces in Javascript html() with text()
to ensure special caracters are still encoded.
See https://api.jquery.com/text/

Test plan :
1) Create a library with name Libra&apos;rie
2) Create a library group with name Grou&apos;pe
3) Play with this group
4) Add library
5) Remove library
6) Edit group
7) Delete group
8) Each time check that &apos, is not interpreted as single quote

Signed-off-by: Solène Desvaux <solene.desvaux@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29761: Prevent batch patron modification to process several time the same patron
Alex Buckley [Mon, 13 Dec 2021 02:31:51 +0000 (02:31 +0000)]
Bug 29761: Prevent batch patron modification to process several time the same patron

If a cardnumber, SMS number, or borrower number is inputted multiple times then the batch patron
modification page should not display that patron multiple times.

Test plan:
1. Create three text files that list card numbers, SMS numbers, and borrower numbers for three patrons. Example lists are below, notice in each there is one number duplicated:

Card numbers:
  23529000035676
  23529000651225
  23529000080862
  23529000035676

Borrower numbers:
  19
  49
  7
  49

SMS numbers:
  2125551212
  2125551212
  2125551213
  2125551214

2. Enable sending of SMS messages:
* Set SMSSendDriver system preference to Email

3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
above belong to patrons in your Koha

4. Go to Tools > Batch patron modification

5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above, and confirm the following is happening in the batch patron modification page:
- Upload the text file of cardnumbers. Notice one patron is displayed twice
- Paste in the list of cardnumbers. Notice one patron is displayed twice
- Upload the text file of SMS numbers. Notice one patron is displayed twice
- Paste in the list of SMS numbers. Notice one patron is displayed twice
- Upload the text file of borrower numbers. Notice one patron is displayed twice
- Paste in the list of borrower numbers. Notice one patron is displayed twice

6. Apply patch and restart services

7. Repeat step 5 and this time observe that the patron record is not duplicated in the batch patron modification page

Sponsored-By: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29795: add empty value for branchcode on self-reg form
Lucas Gass [Tue, 4 Jan 2022 22:44:32 +0000 (22:44 +0000)]
Bug 29795: add empty value for branchcode on self-reg form

1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField
2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically
3. Fill out the other required fields and the captcha. Don't change the branchcode value.
4. Submit the form, it submits.
5. If branchcode is required it should default to an empty value and force the user to make a choice.
6. Apply patch
7. Repeat 1-3
8. Now you cannot submit the form unless you choose a branchcode
9. Make sure it still works normally when branchcode is not in PatronSelfRegistrationBorrowerMandatoryField

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30099: Fix error when accessing circulation.pl without patron parameter
Fridolin Somers [Mon, 14 Feb 2022 20:35:53 +0000 (10:35 -1000)]
Bug 30099: Fix error when accessing circulation.pl without patron parameter

If I access circulation.pl directly, with no patron cardnumber or borrowernumber submitted, I get an error:
Can't call method "messages" on an undefined value at /kohadevbox/koha/circ/circulation.pl line 525

This is caused by Bug 29230 which calls $patron outside a
"if ($aptron)".

Test plan :
1) In staff interface, click in 'check out' search box
2) Hit enter (without a search text)
=> Without patch you get an error
=> With patch you see a blank page /cgi-bin/koha/circ/circulation.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30090: Don't export some columns in patron search results
Fridolin Somers [Mon, 14 Feb 2022 21:04:25 +0000 (11:04 -1000)]
Bug 30090: Don't export some columns in patron search results

The checkout and Edit buttons should not export (Exel, Print) on the patron search result list.
Same for fist column with checkboxes.

Test plan :
1) Go to patrons module /cgi-bin/koha/members/members-home.pl
2) Perform a search with results
3) Click on 'Export' then 'Print'
=> Check you dont see column with checkboxes (text 'Select patron') and colum with actions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30082: Bibliographic details tab missing when user can't add local cover image
Owen Leonard [Fri, 11 Feb 2022 15:24:43 +0000 (15:24 +0000)]
Bug 30082: Bibliographic details tab missing when user can't add local cover image

This patch corrects the template logic which determines whether the
"Images" tab should be displayed on the bibliographic detail page. The
"Images" tab should display whenever local cover images are enabled, not
just if the user has permission to manage cover images.

To test, apply the patch and go to Administration -> System preferences.

- Enable the LocalCoverImages system preference.
- Locate and view the detail page for a bibliographic record in the
  catalog which doesn't have a local cover image attached.

  - If you are logged in as a user with upload_local_cover_images
    permission you should see an "Images" tab with the message "No
    images have been uploaded for this bibliographic record yet" and an
    upload button.
  - If you are logged in as a user without upload_local_cover_images
    permission you should see an "Images" tab with just the "No
    images..." message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29952: Replace obsolete DataTable column filter function
Owen Leonard [Thu, 27 Jan 2022 11:50:28 +0000 (11:50 +0000)]
Bug 29952: Replace obsolete DataTable column filter function

The "Filter paid transactions" link on the Accounting -> Transactions
page is broken because it uses an obsolete DataTables function for
filtering. This patch updates it to use the current syntax, available in
DataTables since version 1.10.

To test, apply the patch and locate a patron in the staff interface who
has multiple fines, some paid.

- View the patron's "Accounting" page and click the "Transactions" tab.
- Click the "Filter paid transactions" link. The table should be
  filtered so that only transactions with an outstanding amount > zero
  are shown.
- The filter link should change to read "Show all transactions."
- Clicking "Show all transactions" should clear the filter.
- Test with one or more columns hidden using the "Columns" control.
  Filtering should still work correctly with columns hidden.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29706: (follow-up) Adjust code to work for multi-holds
Nick Clemens [Tue, 8 Feb 2022 12:30:23 +0000 (12:30 +0000)]
Bug 29706: (follow-up) Adjust code to work for multi-holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29706: Hide items that cannot be held by default when placing hold on OPAC
Nick Clemens [Thu, 16 Dec 2021 01:59:50 +0000 (01:59 +0000)]
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC

This patch adds a 'holdable' and 'unholdable' class to the rows of the table

Additionally I rename the 'backgroundcolor' field to 'onloan' as that is what it contains.
Note: Out of the box, there is no css associated with this class

I add a div around the table to allow hiding the new buttons as well when optiuons are hidden

It would be nice in the future to utilise a Koha table here, however, it is complicated by multi-holds

To test:
 1 - Add a number of items to a record, ensuring they belong to different libraries
 2 - Set 'Default checkout, hold and return policy'->'Hold policy' to 'From home library'
 3 - Sign in to opac and attempt to placehold on the record
 4 - Click 'show more options' and 'a specificitem'
 5 - Note holds table includes items that cannot be held
 6 - Apply patch
 7 - Reload holds page
 8 - Note items that cannot be heldare hidden
 9 - Click 'Show unholdable items' and note they appear
10 - Click 'Hide unholdable items' and veriofy they hide
11 - Test with multi holds

Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29706: Improve table elements
Nick Clemens [Thu, 16 Dec 2021 01:12:52 +0000 (01:12 +0000)]
Bug 29706: Improve table elements

This patch add a thead and tbody element to the 'copiesrow' table

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29385: Catch register_id for payments against fees
Jonathan Druart [Thu, 2 Dec 2021 12:52:45 +0000 (13:52 +0100)]
Bug 29385: Catch register_id for payments against fees

This patch refactors the pay method in SIP FeePayment such that we
consistently pass parameters to both invocations of Koha::Account->pay.

It ensure the missing cash_register definition is passed when a set of
account lines to pay is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28576: Update the maximum size of an image.
The Minh Luong [Tue, 1 Feb 2022 19:44:06 +0000 (14:44 -0500)]
Bug 28576: Update the maximum size of an image.

This patch modifies the maximum size of a patron's image, from 500KB to
2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a
patron, you can now see the supported file types AND the maximum size.

The following places are affected by this patch:
- Home/Patrons/anyPatron
- Home/Tools/Upload patron images
- Home/Tools/Patron card creator/Images

To test:
1)Search for any patron and go to his page.
2)Hover over the image area on the left and click on the "Add" button.
3)Notice that the message above the choose file button only specifies
file types without the maximum size.
4)Add an image bigger than 500KB.
5)Nothing happens. (This is because the maximum size is 5KB)
6)Apply the patch.
7)Repeat steps from 1 to 3.
8)Notice that the message now includes the maximum size.
9)Add an image bigger than 500KB, but smaller than 2MB.
10)The image is succesfully uploaded.
11)Add an image bigger than 2MB.
12)Nothing happens. (The maximum size is now 2MB)
13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and
"Home/Tools/Patron card creator/Images".
14)Notice that the maximum size is updated.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28576: Add patron image in patron detail section does not specify image size...
Salman Ali [Wed, 16 Jun 2021 17:20:24 +0000 (13:20 -0400)]
Bug 28576: Add patron image in patron detail section does not specify image size limit

When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented.

This is not the case with the 2 other places where we can add patron images in which they give warnings:
Home/Tools/Upload patron images
Home/Tools/Patron card creator/Images

For now, i simply added the size limit to the file supported message.

To test:
1)Search for any patron and go to his page
2)Hover over the image area on the left and click on add
3)Notice the message above the choose file button only specifies file types not size.
4)Add an image bigger than 500 kb
5)Nothing happens
6)Apply patch
7)Repeat steps from 1 to 3
8)Notice the message now includes the maximum size

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29519: Allow resolution of claims return at checkin
Martin Renvoize [Wed, 17 Nov 2021 16:07:40 +0000 (16:07 +0000)]
Bug 29519: Allow resolution of claims return at checkin

Add a 'Resolve' button in the alert dialogue that is displayed when a
lost item with a return claim is checked in. The button will trigger the
usual resolution modal allowing the user to pick their resolution.

This patch splits the resolution modal out of checkouts.js and
checkouts-table.inc so it can be used outside of the checkouts table.
We then reload it, optionally based upon the presence of the claims
preference, where needed.  This has the added benefit that it saves a
little bit of page load data in cases where the feature is not enabled.

Test plan
1. As we alter the file locations of the resolution handling code we
   need to test that normal claims functionality continue to work as
   expected.
2. Test the new functoinality by checking in an item that has been
   claimed as returned (but not yet resolved). The dialogue box should
   now contain a 'resolve' button next to each claimant and clicking
   upon it should trigger the resolution modal where the librarian can
   subsequently pick the resolution and submit it.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29570: Simplify for loop
Jonathan Druart [Tue, 8 Feb 2022 16:35:27 +0000 (17:35 +0100)]
Bug 29570: Simplify for loop

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29570: Enable sorting orders by summary
Tomas Cohen Arazi [Wed, 2 Feb 2022 20:10:36 +0000 (17:10 -0300)]
Bug 29570: Enable sorting orders by summary

This patch enables (on receiving) sorting orders by the summary column.
It needs the previous patches to work. Title is given more precedence as
expressed by users on the bug report. Which, by the way, makes sense.

To test:
1. Create a basket
2. Create orders
3. Close basket
4. Receive shipment
5. Enter invoice information
=> SUCCESS: You should see your pending orders
=> FAIL: Verify the 'Summary' column is not sortable
7. Apply this patches
8. Restart Plack
9. Reload the page
=> SUCCESS: Can sort by the summary column
10. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29570: Fix sorting orders by biblioitems columns
Tomas Cohen Arazi [Wed, 2 Feb 2022 20:04:08 +0000 (17:04 -0300)]
Bug 29570: Fix sorting orders by biblioitems columns

The API representation of Koha::Biblio objects includes the
biblioitems.* columns too. This proved problematic as queries had to get
translated so they work (i.e. if a query passes q={"biblio.ean":"123%"}
then the query needs to be tweaked so biblio.ean is translated into
biblio.biblioitem.ean. This is solved, locally, in the controller.

But sorting needs the same kind of tweak, and it was missing. This patch
solves that by doing a similar conversion.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> FAIL: Tests fail, searching on a 'biblioitems' column generates a 500
error.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! We can sort on those fields
5. Sign off :-D

Note: you will notice the tests only cover sorting by ISBN. I consider
it enough as sorting is a DB problem, and we only want to know if the
generated ORDER BY is valid for the underlying query, and MySQL would
complain if it wasn't the case.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29570: Regression tests
Tomas Cohen Arazi [Wed, 2 Feb 2022 19:29:00 +0000 (16:29 -0300)]
Bug 29570: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29754: (QA follow-up) Minor tests tweaks
Tomas Cohen Arazi [Mon, 7 Feb 2022 11:58:43 +0000 (08:58 -0300)]
Bug 29754: (QA follow-up) Minor tests tweaks

This patch does two things:

- Wraps the new SIP tests in a single transaction. We do that to avoid
  sub-test interference, specially when test files get big. The provided
  tests are correct and don't require previous tests data.
- Migrated from the introduced 'diag' calls to 'note', as I just learned
  they are the same, but 'note' is only displayed when in verbose mode.
  Which is great to avoid unnecessary noise in Jenkins.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29754: Don't include patron when fetching guarantees fines
Nick Clemens [Wed, 22 Dec 2021 15:25:44 +0000 (15:25 +0000)]
Bug 29754: Don't include patron when fetching guarantees fines

This patch removes the flag to fetch the patrons own debts as we have already
calculated them

This test plan highlights another issue - the value of NoIssuesChargeGuarantorsWithGuarantees
is not checked in SIP code - we merely get the total owed including guarantees and compares to
noissuescharge
See bug 29755

To test:
 1 - Apply first patch only
 2 - prove t/db_dependent/SIP/Patron.t
 3 - It fails
 4 - Enable NoIssuesChargeGuarantorsWithGuarantees, you can set to 1
 5 - Create/find a patron
 6 - Add a $10 charge to parons account
 7 - Add a guarantee to patron
 8 - Add a $5 charge to guarantee
 9 - Set noissuescharge to 15.01
10 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m patron_information --patron BARCODE
11 - Note the 64 message starts with Y's that mean patron is blocked
12 - Patron shouldn't be blocked as under 15.01
13 - Apply patch
14 - Restart all
15 - repeat 10
16 - Patron is no longer blocked

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29754: Unit test
Nick Clemens [Wed, 22 Dec 2021 15:20:16 +0000 (15:20 +0000)]
Bug 29754: Unit test

This adds a unit test to the SIP code

It also adds some spacing and dividers to make the tests for 'relationships_debt' easier to read

To test:
prove -v t/db_dependent/Koha/Patron.t - passes and is readable
prove -v t/db_dependent/SIP/Patron.t - fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29966: Dont pass authnotrequired true and flags together
Marcel de Rooy [Fri, 28 Jan 2022 09:59:15 +0000 (09:59 +0000)]
Bug 29966: Dont pass authnotrequired true and flags together

Test plan:
Logout in OPAC.
Goto sco help page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29230: Add Koha::Patron->messages
Jonathan Druart [Thu, 21 Oct 2021 07:57:38 +0000 (09:57 +0200)]
Bug 29230: Add Koha::Patron->messages

Add methods to return the messages attached to a patron.

It will add the capability to access them from notice templates.

Test plan:
Define some messages for a given patron
Go to the circulation page of the patron and confirm that they are still
displayed

Test the notice templates:
Add to HOLD_SLIP the following content
"""
[% SET messages = borrower.messages %]
[% IF messages.count %]
Messages:
<ul>
  [% FOR m IN messages.search( message_type => 'L' ) %]
    <li>[% m.message %]</li>
  [% END %]
</ul>
[% END %]
"""

To display all the messages from staff ('L')

Adapt following your needs.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29785: Rename Koha::Object->message with ->object_messages
Jonathan Druart [Tue, 4 Jan 2022 13:28:26 +0000 (14:28 +0100)]
Bug 29785: Rename Koha::Object->message with ->object_messages

It will conflict with other ->messages methods, it's too generic.

Bug 29230 needs Koha::Patron->messages to return Koha::Patron::Messages for instance.

Test plan:
Confirm that the tests modified by this patch still pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28977: Fix cat_issues_top.pl report with strict SQL modes
Michael Hafen [Fri, 14 Jan 2022 18:35:05 +0000 (11:35 -0700)]
Bug 28977: Fix cat_issues_top.pl report with strict SQL modes

To get the 'Most circulated items' report to run in ONLY_FULL_GROUP_BY
Sql mode.

Test plan:

Turn on strict_sql_modes ( make sure <strict_sql_modes> is 1 in KOHA_CONF )
Go to Reports -> Most circulated items
submit the form.

Without the patch you get an error like:
CGI::Compile::ROOT::usr_local_koha_master_reports_cat_issues_top_2epl::calculate(): DBI Exception: DBD::mysql::st execute failed: Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'koha_main_v4.items.itemcallnumber' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [for Statement "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, ccode as CCODE, location as LOC FROM `old_issues`
                  LEFT JOIN items USING(itemnumber)
                  LEFT JOIN biblio USING(biblionumber)
                  LEFT JOIN biblioitems USING(biblionumber)
                  LEFT JOIN borrowers USING(borrowernumber)
                  WHERE 1 AND old_issues.issuedate > '2020-08-03' AND old_issues.issuedate < '2021-05-17' AND old_issues.returndate > '2020-08-27' AND old_issues.returndate < '2021-06-01' AND old_issues.branchcode like '403' AND items.itype like 'F' AND ccode like 'FIC' AND borrowers.categorycode like 'ST' group by biblio.biblionumber order by `RANK` DESC"] at /usr/local/koha_master/reports/cat_issues_top.pl line 67
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

With the patch you will see the report results view.

Signed-off-by: David Nind <david@davidnind.com>
JD Amended patch - adjust commit's title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29932: Use localStorage instead of cookie for bibs_selected
Owen Leonard [Fri, 21 Jan 2022 13:05:40 +0000 (13:05 +0000)]
Bug 29932: Use localStorage instead of cookie for bibs_selected

This patch replaces the use of the jquery.cookie.js plugin in the
"Browse selected records" feature. The feature is modified to use
localStorage instead of cookies.

To test, apply the patch and go to Administration -> System preferences.

 - Enable the "BrowseResultSelection" system preference.
 - Perform a catalog search which will return multiple results.
 - On the search results page, check the checkbox for a number of
   titles.
 - Click the "Browse selected biblios" button in the toolbar.
 - You should be directed to the detail page for the first title you
   checked.
 - Clicking the right-arrow in the sidebar should take you
   through each one of your selected titles.
 - When you click the "Results" link in the sidebar you should be
   returned to the same search results set and the same titles should be
   checked.
 _ If you uncheck those titles and reload the page the checkboxes should
   remain unchecked.
 - If you log out of the staff interface the "bibs_selected" item in
   localStorage should be deleted. See, for example,
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for
   information about viewing local storage.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29933: Fix stray usage of jquery.cookie.js plugin
Owen Leonard [Mon, 24 Jan 2022 18:33:30 +0000 (18:33 +0000)]
Bug 29933: Fix stray usage of jquery.cookie.js plugin

This patch removes a few instances where the old cookie plugin was still
being used for deleting cookies even though the new plugin is being used
to set the cookies.

To test, apply the patch and test the following processes in the staff
interface:

Search to hold:

 - View a patron record and click the "Search to hold" button.
 - Perform a catalog search which will return results.
 - On the search results page there should be a "Place hold for
   <patron>" link under each holdable title.
 - Click the "Place hold" button's dropdown arrow and choose "Forget
   <patron>." The "Place hold for..." links should disappear.

Search to hold for a patron club:

 - If necessary, create a patron club.
 - Add one or more patrons to the club.
 - In Tools -> Patron clubs, find the club you added patrons to.
 - Click the "Actions" button and then "Search to hold."
 - Perform a catalog search which will return results.
 - On the search results page there should be a "Place hold for
   <club>" link under each holdable title.
 - Click the "Place hold" button's dropdown arrow and choose
   "Forget <club>." The "Place hold for..." links should disappear.

Batch item modification show/hide columns:

 - Go to Tools -> Batch item modification.
 - Submit a list of items for modification.
 - Uncheck some checkboxes to hide columns on the page showing the items
   you submitted.
 - In the browser's storage inspector (e.g.
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector),
   should see a "showColumns" cookie with a string of numbers and
   slashes.
 - Click the "Show all columns" checkbox.
 - The "showColumns" cookie should disappear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29881: libdbd-sqlite2-perl is unavailable on deb12 (koha-common wont install)
Mason James [Fri, 14 Jan 2022 06:44:24 +0000 (19:44 +1300)]
Bug 29881: libdbd-sqlite2-perl is unavailable on deb12 (koha-common wont install)

to test...

- attempt to install koha-common pkg on deb12

  confirm error...
   The following packages have unmet dependencies:
   koha-common : Depends: libdbd-sqlite2-perl but it is not installable

- apply patch, rebuild new package

- install new koha-common pkg on deb12 successfully

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30045: (bug 29543 follow-up) Fix SCO print slip
Jonathan Druart [Tue, 8 Feb 2022 11:12:22 +0000 (12:12 +0100)]
Bug 30045: (bug 29543 follow-up) Fix SCO print slip

Certainly since bug 29543 and bug 29914.

We should do the same authentication check than sco-main.pl, and also
make sure to generate the checkout history only for the logged in patron
(the OPAC one, not staff member)

Test plan:
Use the different combinations of the SCO config (AutoSelfCheckAllowed,
SelfCheckoutByLogin and WebBasedSelfCheck) and confirm that this patch
fixes the SCO print slip feature.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29735: Fix flatpickr init from circulation.tt
Jonathan Druart [Fri, 21 Jan 2022 08:44:11 +0000 (09:44 +0100)]
Bug 29735: Fix flatpickr init from circulation.tt

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29956: Prevent login form to be serialized into cookie
Jonathan Druart [Thu, 27 Jan 2022 13:14:27 +0000 (14:14 +0100)]
Bug 29956: Prevent login form to be serialized into cookie

To recrate:
Logout
Go to /cgi-bin/koha/opac-search.pl
Click "Log in to your account"
Fill in the login form
Submit
Check the 'form_serialized' cookie's value

=> Without this patch it contain login/password
=> With this patch applied the cookie is not created

Confirm that the "Return to the last advanced search" feature still
works as expected.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29931: (follow-up) Fix svc/checkouts and return_claims too
Marcel de Rooy [Tue, 25 Jan 2022 12:21:42 +0000 (12:21 +0000)]
Bug 29931: (follow-up) Fix svc/checkouts and return_claims too

Adding the same auth_status check here too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29931: (follow-up) Similar thing in opac-patron-image.pl
Marcel de Rooy [Mon, 24 Jan 2022 13:06:33 +0000 (13:06 +0000)]
Bug 29931: (follow-up) Similar thing in opac-patron-image.pl

Although less harmful indeed. No borrowernumber, no image.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested: logged in, logged out, prefs toggled. All fine.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29931: Check cookie status before continuing
Marcel de Rooy [Mon, 24 Jan 2022 10:24:08 +0000 (10:24 +0000)]
Bug 29931: Check cookie status before continuing

Test plan:
Logout from staff.
Try to run plugins-enable (you should have some active plugin).
Like: https://yourserver:staffport/cgi-bin/koha/plugins/plugins-enable.pl?class=Koha::Plugin::Test&method=enable
Replace class and method as appropriate.
Verify that with this patch, you will be redirected to 401 page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29596: Add Yiddish language
Tomas Cohen Arazi [Mon, 29 Nov 2021 21:35:46 +0000 (18:35 -0300)]
Bug 29596: Add Yiddish language

This patch adds the Yiddish language to Koha. The language codes were
taken from https://www.loc.gov/standards/iso639-2/php/code_list.php

Sponsored-by: Universidad Nacional de San MartĂ­n
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29943: DBRev 21.11.02.004
Kyle Hall [Mon, 7 Feb 2022 17:54:10 +0000 (12:54 -0500)]
Bug 29943: DBRev 21.11.02.004

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29943: Db rev: replace typo in existing notices
Marcel de Rooy [Tue, 25 Jan 2022 15:35:05 +0000 (15:35 +0000)]
Bug 29943: Db rev: replace typo in existing notices

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29943: Fix NOTIFY_MANAGER notice in sample notices
Marcel de Rooy [Tue, 25 Jan 2022 15:27:35 +0000 (15:27 +0000)]
Bug 29943: Fix NOTIFY_MANAGER notice in sample notices

Test plan:
Look good at this change, or do a new install :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: Update DBIC schema
Kyle Hall [Mon, 7 Feb 2022 17:34:17 +0000 (12:34 -0500)]
Bug 29605: Update DBIC schema

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: DBRev 21.11.02.003
Kyle Hall [Mon, 7 Feb 2022 17:33:13 +0000 (12:33 -0500)]
Bug 29605: DBRev 21.11.02.003

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: branchtransfers.cancellation_reason
Jonathan Druart [Thu, 2 Dec 2021 11:55:36 +0000 (12:55 +0100)]
Bug 29605: branchtransfers.cancellation_reason

reason and cancellation_reason was inversed, and the enum values were
lower cases

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: language_script_mapping.language_subtag cannot be null
Jonathan Druart [Thu, 2 Dec 2021 11:48:28 +0000 (12:48 +0100)]
Bug 29605: language_script_mapping.language_subtag cannot be null

It's a PK now

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: search_marc_map.marc_type
Jonathan Druart [Thu, 2 Dec 2021 11:37:33 +0000 (12:37 +0100)]
Bug 29605: search_marc_map.marc_type

NOT NULL was missing when MODIFY

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: additional_contents.lang
Jonathan Druart [Thu, 2 Dec 2021 11:29:37 +0000 (12:29 +0100)]
Bug 29605: additional_contents.lang

Up to 50 on bug 23797 but bug 24387 switched it back to 25 (bad
resolution conflict)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: additional_contents.code
Jonathan Druart [Thu, 2 Dec 2021 11:28:23 +0000 (12:28 +0100)]
Bug 29605: additional_contents.code

Added 100 on 210600016, but 20 in kohastructure

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: account_offsets.type is not null
Jonathan Druart [Thu, 2 Dec 2021 11:17:12 +0000 (12:17 +0100)]
Bug 29605: account_offsets.type is not null

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: Missing FK on tmp_holdsqueue.borrowernumber (tmp_holdsqueue_ibfk_3)
Jonathan Druart [Thu, 2 Dec 2021 11:12:10 +0000 (12:12 +0100)]
Bug 29605: Missing FK on tmp_holdsqueue.borrowernumber (tmp_holdsqueue_ibfk_3)

Bad copy paste on the foreign_key_exists condition

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: (follow-up) Add language_script_mapping primary key
Tomas Cohen Arazi [Tue, 30 Nov 2021 23:06:46 +0000 (20:06 -0300)]
Bug 29605: (follow-up) Add language_script_mapping primary key

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29605: Add missing constraints from bug 15067
Tomas Cohen Arazi [Tue, 30 Nov 2021 22:44:36 +0000 (19:44 -0300)]
Bug 29605: Add missing constraints from bug 15067

This patch fixes a missed update to kohastructure.sql.

To test:
1. Checkout prior to bug 15067
(ab270c026be06f08745a14d1aea992877d20f812) would work.
2.  Run:
   $ reset_all
3. Checkout v21.11.00
4. Run:
   $ updatedatabase
   $ koha-mysql kohadev
   > SHOW CREATE TABLE language_subtag_registry;
=> SUCCESS: There's UNIQUE KEY uniq_lang (subtag, type)
5. Run:
   > SHOW CREATE TABLE language_descriptions;
=>  SUCCESS: There's UNIQUE KEY uniq_desc (subtag, type, lang)
6. Run:
   > SHOW CREATE TABLE language_rfc4646_to_iso639;
=> SUCCESS: There's UNIQUE KEY uniq_code (rfc4646_subtag, iso639_2_code)
7. Replicate a fresh install. Run:
   $ reset_all
8. Repeat 4, 5 and 6
=> FAIL: The UNIQUE constraints are not there!
9. Apply this patch
10. Run:
   $ reset_all
11. Repeat 8
=> SUCCESS: The UNIQUE constraints are there!
12. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29967: extended width of description and opac description inputs on authorised_va...
Lucas Gass [Fri, 28 Jan 2022 20:19:08 +0000 (20:19 +0000)]
Bug 29967: extended width of description and opac description inputs on authorised_values.tt

To test:
-Go to Administration > Authorized values
-In any category, new or existing, look at an authoized value.
-The description and OPAC description inputs both have a maxlenght of 200 but you cannot see very many characters.
-Apply patch
-Look again, the inputs are much bigger and you can see many more characters.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 19865: Add back horizontal scroll bar
Lucas Gass [Thu, 20 Jan 2022 21:45:49 +0000 (21:45 +0000)]
Bug 19865: Add back horizontal scroll bar

To test:
1. Do a Z39.50/SRU search
2. In the search results click on MARC to get the MARC preview. Choose
   something with lots of MARC data so it is both wide and long.
3. See the Y axis scrollbar
4. You must scroll bottom of the modal to see the X axis scrollbar,
   annoying.
5. Apply patch
6. Try steps 1-4 again. This time you should see the X axis scrollbar
   without having to scroll to the bottom.
7. It's not a bad idea to test in multiple browsers.

Note: I also put the CSS onto multiple lines to increase readability

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29895: Fix 'add multiple items' button on neworderempty
Jonathan Druart [Mon, 17 Jan 2022 14:01:56 +0000 (15:01 +0100)]
Bug 29895: Fix 'add multiple items' button on neworderempty

Button [Add multiple items] stops responding when it's pressed and some multiple items added to basket

It has a "visibility: hidden" we are trying to remove setting "display:
inline"

This is pretty ugly and certainly does not clean the code, but it's too
messy and this patch fixes the problem easily.

Test plan:
Add a new order
Click "Add multiple items", enter "2", click "Add".
Confirm that you can use the "Add multiple items" again.

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29809: Fix StockRotationStages.t
Jonathan Druart [Thu, 27 Jan 2022 16:13:32 +0000 (17:13 +0100)]
Bug 29809: Fix StockRotationStages.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29809: (follow-up) Update tests and rename variable
Nick Clemens [Tue, 18 Jan 2022 11:55:59 +0000 (11:55 +0000)]
Bug 29809: (follow-up) Update tests and rename variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29809: Update stockration tool to reflect method name change
Martin Renvoize [Thu, 6 Jan 2022 13:58:26 +0000 (13:58 +0000)]
Bug 29809: Update stockration tool to reflect method name change

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29809: Rename item relation accessor from itemnumber
Martin Renvoize [Thu, 6 Jan 2022 13:49:37 +0000 (13:49 +0000)]
Bug 29809: Rename item relation accessor from itemnumber

This patch renames the item relation accessor method in
StockRotationItem to 'item' from 'itemnumber' to more clearly reflect
that the method returns a Koha::Item object and not an itemnumber.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29906: (follow-up) Clarify actual code use
Martin Renvoize [Thu, 20 Jan 2022 15:15:14 +0000 (15:15 +0000)]
Bug 29906: (follow-up) Clarify actual code use

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29906: fix when hold record forcibly gets unwanted "suspended" state
Petro Vashchuk [Wed, 19 Jan 2022 16:01:15 +0000 (18:01 +0200)]
Bug 29906: fix when hold record forcibly gets unwanted "suspended" state

This code allows for "Perl false" to pass through to $suspended_until
if it is in $hold->suspend_until and in $body->{suspended_until}
But in case of "Perl truth" it calls dt_from_string for that value.

Reproduction:
1. run provided test in kshell: prove t/db_dependent/api/v1/holds.t
2. see the test fails with something like:
    #   Failed test 'Location change shouldn't touch suspended status'
    #   at t/db_dependent/api/v1/holds.t line 1067.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'suspended_until should be undef'
    #   at t/db_dependent/api/v1/holds.t line 1068.
    #          got: '2022-01-20 00:00:00'
    #     expected: undef
    # Looks like you failed 2 tests of 39.
3. apply the changes in this patch to Koha/REST/V1/Holds.pm
4. run provided test in kshell: prove t/db_dependent/api/v1/holds.t
5. test will pass.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29862: Add missing txn begin/rollback in TestBuilder.t
Jonathan Druart [Mon, 17 Jan 2022 10:40:00 +0000 (11:40 +0100)]
Bug 29862: Add missing txn begin/rollback in TestBuilder.t

It fixes the tests when SearchEngine=ES
 t/db_dependent/TestBuilder.t .. 7/15 Invalid MARC field expression: l5ffglZ_upqqcwOvaiyALgXfyJw2Ot2AGRPUsiAPzSFHfd8J_hsnuQ8z75B8RKc_kyo2rFBp8BrPNwcM1FPhc01ngP01HU_Z7Rx1VHfcIcmrifYnjBDWNmYB9N5_4xEnxMH7ZhqC9b2Bz9wf9
 wSEmx64x6t5xFFKX at /kohadevbox/koha/C4/Biblio.pm line 306.
     # Looks like you planned 12 tests but ran 6.

 #   Failed test 'Tests for delete method'
 #   at t/db_dependent/TestBuilder.t line 302.
 Can't call method "biblionumber" on an undefined value at t/db_dependent/TestBuilder.t line 281.
 # Looks like your test exited with 11 just after 8.

Previous subtest created invalid date in the ES mappings.

Test plan:
Set SearchEngine=ES and run the tests, they must pass.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29779: Fix unit tests count for 21.11.x
Kyle Hall [Mon, 7 Feb 2022 16:37:15 +0000 (11:37 -0500)]
Bug 29779: Fix unit tests count for 21.11.x

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29779: Make selenium tests return green even if lib is missing
Jonathan Druart [Mon, 3 Jan 2022 11:38:29 +0000 (12:38 +0100)]
Bug 29779: Make selenium tests return green even if lib is missing

Some selenium tests are not correctly written and they fail is
Selenium::Remote::Driver is missing.

Test plan:
1. Remove the lib rm `pmpath Selenium::Remote::Driver`
2. prove t/db_dependent/selenium/
should return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29482: Replace the term branch with library
Owen Leonard [Tue, 18 Jan 2022 12:46:51 +0000 (12:46 +0000)]
Bug 29482: Replace the term branch with library

This patch replaces the word "branch" with the word "library" in the
self-checkout template, as per terminology guidelines.

To test, apply the patch and go to Administration -> System preferences.

- Set the "IndependentBranches" preference to "Yes."
- Log into the self checkout system using a staff user with permission
  to do self-checkout but not superlibrarian status.
- Try to check out an item which belongs to a library that's different
  to the one you're logged in with.
- You should see a message, "Item cannot be checked out," including the
  text "This item belongs to another library."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29043: Don't fetch items if when are not on the 'Place a hold on' form
Jonathan Druart [Mon, 17 Jan 2022 14:18:13 +0000 (15:18 +0100)]
Bug 29043: Don't fetch items if when are not on the 'Place a hold on' form

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29043: Don't fetch biblios info unless a patron is picked
Jonathan Druart [Fri, 14 Jan 2022 16:15:31 +0000 (17:15 +0100)]
Bug 29043: Don't fetch biblios info unless a patron is picked

If we haven't picked a patron or a club yet we don't need to fetch
biblios, items and holdability infos

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29511: Sort hash keys
Nick Clemens [Tue, 23 Nov 2021 13:39:57 +0000 (13:39 +0000)]
Bug 29511: Sort hash keys

This code exists in authorities/authorities.pl and the hash keys are sorted
I just do the same here

To test:
1 - Find/create a record with 245a 245h populated
2 - Load/reload the record several times and note that fields c and b are ordered randomly
3 - Apply patch
4 - Reload and note c and b are ordered alphabetically
5 - Move subfield h before subfield c
6 - Save and reload
7 - Confirm that existing/filled fields retain order in the MARC record

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21652: Simplify code
Jonathan Druart [Thu, 20 Jan 2022 10:20:49 +0000 (11:20 +0100)]
Bug 21652: Simplify code

And add a test.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21652: Only set waitingdate to today if there is no waitingdate already
Lucas Gass [Thu, 6 Jan 2022 15:16:05 +0000 (15:16 +0000)]
Bug 21652: Only set waitingdate to today if there is no waitingdate already

1- Find or create a hold with a waitingdate other than today
2- Check the item in to generate a new hold alert
3- Select "Confirm and Print"
4- Verify that the waiting date has changed to the current date
5- Apply patch
6- Try 1-3 again, if a waitingdate already exists it should not change
7. Try an item with no waitingdate, it should properly update to today

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 21652: Unit test
Nick Clemens [Fri, 14 Jan 2022 14:17:02 +0000 (14:17 +0000)]
Bug 21652: Unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29320: Update OverDrive availability to V2
Nick Clemens [Tue, 26 Oct 2021 11:22:04 +0000 (11:22 +0000)]
Bug 29320: Update OverDrive availability to V2

This patch updates the call to overdrive_proxy to allow passing a version
and updates the code to use V2 for availability

To test:
1 - Enable OverDrive integration by setting the sysprefs
2 - Log in to your overdrive account in the Koha opac
3 - Perform a search and note availability display
4 - Confirm you can checkout/hold/return books
5 - Apply patch
6 - Repeat search and test functionality
7 - Note that title with '0 out of 0 copies available' now say 'Currently unavailable'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29690: Prevent detail.pl to crash if MARCXML is invalid
Jonathan Druart [Thu, 13 Jan 2022 05:21:15 +0000 (06:21 +0100)]
Bug 29690: Prevent detail.pl to crash if MARCXML is invalid

Bug 23846 added support for invalid MARCXML.
But now page details.pl fails again with software error.
This comes from several Koha::Biblio calling $self->metadata->record without eval.

Test plan :
1) Create a biblio record with invalid MARCXML (see Bug 29690)
In koha-testing-docker there is biblionumber=369
2) Go to page cgi-bin/koha/catalogue/detail.pl?biblionumber=xxx
3) You see the page with a message :
There is an error with this bibliographic record, the view may be degraded.
Error: Invalid data, cannot decode metadata object ...

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29690: Add selenium test
Jonathan Druart [Wed, 15 Dec 2021 07:24:16 +0000 (08:24 +0100)]
Bug 29690: Add selenium test

Run prove t/db_dependent/selenium/regressions.t on KTD with selenium

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28238: (follow-up) Add itemcallnumber to ILS-DI GetAvailability output for unavai...
Marion Durand [Fri, 24 Sep 2021 07:15:37 +0000 (09:15 +0200)]
Bug 28238: (follow-up) Add itemcallnumber to ILS-DI GetAvailability output for unavailable items

Providing the call number for ILS-DI GetAvailability output is useful
for libraries that use discovery tools. Patrons often don't check
further for the call number, and then they don't have it when they look
for the item. It could also be use full to have this call number when
the item isn't available (to make a request for it for instance).

Test plan:
1. Enable the ILS-DI system preference
2. Locate a record with multiple items and make sure they have call
   numbers for each item and that some are unavailable
3. Test these URLs:
   [OPACBASEURL]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[BIBLIONUMBER]&id_type=biblio
   and
   [OPACBASEURL]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[ITEMNUMBER]&id_type=item
   (Where the [OPACBASEURL] is the OPAC URL of your test instance,
   [BIBLIONUMBER] and [ITEMNUMBER] are a record number and item number of
   your choice.)
4. Apply the patch
5. Run the queries from step 3 again - all the results should now have
   the tag itemcallnumber (not only the available's ones)
   Example: <dlf:itemcallnumber>840.08 COR R</dlf:itemcallnumber>

Sponsored-by: University Lyon 3
https://bugs.koha-community.org/show_bug.cgi?id=28238

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28238: Add itemcallnumber to ils-di GetAvailability output
Lyon3 Team [Tue, 27 Apr 2021 14:13:39 +0000 (16:13 +0200)]
Bug 28238: Add itemcallnumber to ils-di GetAvailability output

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28238: Add tests
Marion Durand [Tue, 9 Nov 2021 11:04:34 +0000 (11:04 +0000)]
Bug 28238: Add tests

Add specific tests for the tag itemcallnumber in GetAvailability output.

Sponsored-by: University Lyon 3
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29875: Update wording on maxreserves system preference
Andrew Fuerste-Henry [Thu, 13 Jan 2022 19:17:06 +0000 (19:17 +0000)]
Bug 29875: Update wording on maxreserves system preference

To test:
1 - see the current wording
2 - apply patch
3 - words are changed

Test to confirm accuracy of wording:
1 - set maxreserves to 1
2 - set all/all circ rule to unlimited holds allowed total, holds allowed daily, and holds per record
3 - confirm you can place 1 hold for a patron, but the second is blocked
4 - set maxreserves to 0
5 - confirm you can place and number of holds for the patron
6 - set maxreserves to blank
7 - confirm you can place any number of holds for the patron

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29481: Terminology: Fix other occurrences of 'Collection code'
Katrin Fischer [Sat, 18 Dec 2021 21:04:16 +0000 (22:04 +0100)]
Bug 29481: Terminology: Fix other occurrences of 'Collection code'

This changes "collection code" to be "collection" as Koha displays
the collection description and no codes. This will also help to make
the GUI more consistent overall.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29481: Terminology: Collection code, call number
Owen Leonard [Tue, 16 Nov 2021 19:48:29 +0000 (19:48 +0000)]
Bug 29481: Terminology: Collection code, call number

This patch corrects an instance of the phrase "Collection code,"
replacing it with the standard "Collection."

To test, apply the patch and restart services.

- In the staff interface, go to Administration -> System preferences and
  set the OpacItemLocation preference to "library, collection code, and
  call number."
- In the OPAC, search the catalog using a term which will return
  multiple results.
- In the search results, item descriptions in the "Availability" line
  should read like this:

  [Collection, call number: Non-fiction 394.2663 Bu]

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29686: Adapt Koha to use new fulfillment API for OverDrive
Nick Clemens [Mon, 13 Dec 2021 13:08:28 +0000 (13:08 +0000)]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled
and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all
checked out items and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account'
    tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however,
magazines may not as each checkout has a unique 'reserve id' and the
'parent' id is not checked in our current code

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29722: (QA follow-up) Replace unusual single quote
Fridolin Somers [Sat, 22 Jan 2022 06:45:27 +0000 (20:45 -1000)]
Bug 29722: (QA follow-up) Replace unusual single quote

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29722: Add more sample quotes
Aleisha Amohia [Fri, 17 Dec 2021 02:48:42 +0000 (02:48 +0000)]
Bug 29722: Add more sample quotes

This patch adds sample quotes from women, women of colour, trans women,
Black and Indigenous women, and people who weren't US Presidents!

To test:
1. Install a fresh Koha and import sample quotes
2. Go to Tools -> Quote editor
3. Confirm the quotes show

Sponsored-by: Catalyst IT
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29054: Add verbose check for warn in advance_notices.pl
Hayley Pelham [Mon, 20 Sep 2021 04:23:11 +0000 (04:23 +0000)]
Bug 29054: Add verbose check for warn in advance_notices.pl

To test:
1) Set EnhancedMessagingPreferences to Don't allow
2) In the koha-shell, run misc/cronjobs/advance_notices.pl -c
3) Note that you see the warning "The "EnhancedMessagingPreferences"
syspref is off... etc."
4) Apply the patch and restart services
5) In the koha-shell, run misc/cronjobs/advance_notices.pl -c and note
the warning no longer shows
6) Still in the shell, run misc/cronjobs/advance_notices.pl -c -v and
note the warning does show

Sponsored-by: Catalyst IT
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29397: Add .kohaSelect select2 wrapper function
Martin Renvoize [Wed, 3 Nov 2021 14:37:11 +0000 (14:37 +0000)]
Bug 29397: Add .kohaSelect select2 wrapper function

This patch adds a kohaSelect wrapper function to simplify
paging/infinite scrolling with select2 using the Koha RESTful api's.

Invoke select2 select boxes as you normally would from JS, but instead
of calling .select2(config) use .kohaSelect(config).

If an 'ajax' property is defined in your config object, we wrap the
transport such that responses include a pagination key as expected by
select2.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29797: Fix display of itemnumbers on the background job detail view
Jonathan Druart [Wed, 5 Jan 2022 09:38:27 +0000 (10:38 +0100)]
Bug 29797: Fix display of itemnumbers on the background job detail view

If some items have not been deleted, the detail view of the background job will display "1 item(s) could not be deleted: ", without the list of itemnumbers.
Also add a space character between itemnumbers.

Test plan:
1. Check an item out
2. Use the batch delete items tool to delete the item that is checked
out and another one.
3. On the confirmation view, use the dev tool of your browser to remove
the "disabled" property of the disabled checkbox and select both
items.
4. Submit
5. Go to the detail view of the background job and confirm that you see
the itemnumber of the item that has failed to be deleted

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>