]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 28144: Check if issue_id defined
Nick Clemens [Tue, 13 Apr 2021 15:14:11 +0000 (15:14 +0000)]
Bug 28144: Check if issue_id defined

Historical OVERDUE fines may not have an issue_id - this causes
flooding of the logs when calling update fine

Trivial change, reading the code should be enough, but test plan below

To test:
1 - Create some fines without an issue_id
  - Either checkout an old version of Koha and add manually or
  - Checkout some items (backdated) to a patron, run fines.pl then
    UPDATE accountlines SET issue_id = NULL;
2 - Checkout a backdated item with fines in the circ rule to the same patron
3 - Run fines.pl
4 - Note the errors
5 - Apply patch
6 - Repeat and note no errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bf13a36c8a80d2b7b38c897b4ae3bdf2c91fb934)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f76e8409707fe8da1f35e3ae6192dbe81c8a0448)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28221: Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it
Kyle M Hall [Mon, 26 Apr 2021 10:30:17 +0000 (06:30 -0400)]
Bug 28221: Script process_message_queue.pl uses Try::Tiny but doesn't 'use' it

The message queue processor has a try/catch block, but does not have a 'use Try::Tiny' line. Because of this the following error ocurrs if an instance has any plugins installed that use the before_send_messages hook:

Can't locate object method "catch" via package "1" (perhaps you forgot to load "1"?) at /usr/share/koha/bin/cronjobs/process_message_queue.pl line 86.

Test Plan:
1) Install a plugin that uses the before_send_messages hook
2) Run the message queue processor
3) Note the error message
4) Apply this patch
5) Run the message queue processor again
6) No error!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 808d9a9f81a65921b70af92dba83d407e8e71caf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5a6afac654c2141829f7ab0ec44a4f5f4eaf1c43)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 21818: Replace AutoCommit flag with DBIx transaction in stage-marc-import.pl
Fridolin Somers [Thu, 11 Mar 2021 10:46:46 +0000 (11:46 +0100)]
Bug 21818: Replace AutoCommit flag with DBIx transaction in stage-marc-import.pl

Like it was done in Bug 18806.

Test plan :
Use stage-marc-import.pl with and without patch, with a matcher to find
duplicates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ff849fadbade8b72faec52284b58e6f5dd8a71c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e78a027a148dc44ab41d1f3ac0d06a959f99bc22)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27566: Add generic font family to prevent unstyled select tags
Owen Leonard [Thu, 28 Jan 2021 16:37:13 +0000 (16:37 +0000)]
Bug 27566: Add generic font family to prevent unstyled select tags

This patch adds a default font family "sans-serif" to the OPAC CSS as a
workaround for this Firefox bug:

font-family isn't honored in `<option>` element within `<select>`
dropdown
https://bugzilla.mozilla.org/show_bug.cgi?id=1536148

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

 - Open the OPAC main page in Firefox.
 - Click the search type dropdown. The options should be styled using
   your system's default sans-serif font rather than a serif font.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dee61a7c3e30629f8651823a6dd761e98560d60c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d736d8908c90cba6b075235f9de5b256e1d2cb46)

3 years agoBug 27968: Fix framework import if isurl has an incorrect value
Jonathan Druart [Wed, 17 Mar 2021 08:18:48 +0000 (09:18 +0100)]
Bug 27968: Fix framework import if isurl has an incorrect value

If isurl is set to undef in the DB, it will be exported as an empty
string, which is an invalid value for isurl (int)

Incorrect integer value: '' for column 'isurl'

Test plan:
Export framework structure in CSV and ODS, then reimport it and check that
all the subfields are important correctly

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 01f0e04172432e28f37a94bf6df51a3fd6cdc960)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5b4dd72d3a1772be1a7f9b0745663a2b3c6ecdf8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28064: (QA follow-up) Remove value from button
Martin Renvoize [Thu, 22 Apr 2021 10:45:01 +0000 (11:45 +0100)]
Bug 28064: (QA follow-up) Remove value from button

To clarify that the value is not used on buttons that are not submit
type we remove the value entirely.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e77fa64e31cdf026030c4a354bf73e4ee7e2bb14)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c9c0f8c65dc655306af94a2dd890389180e3d5fb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28064: Add dotransfer field to slip print submission
Martin Renvoize [Wed, 31 Mar 2021 12:06:49 +0000 (13:06 +0100)]
Bug 28064: Add dotransfer field to slip print submission

By changing the code to only do a javascript triggered submission from
the from button we lose the original buttons name and value elements
upon submission.

This patch checks for those fields in the JS capture and triggers the
addition of a new hidden form field to contain the dotransfer data.

Test plan
1/ Set AutomaticItemReturn system preference is set to "Don't"
2/ Check in an item that belongs to another library, a dialog will ask
   you if you want to transfer.
3/ Click 'Yes, print slip'
4/ Look at the item record and note the status is 'Available'.
5/ Apply patch
6/ Follow steps 2 - 4
7/ Note the status is now 'In transit to...'
8/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ccd72425327d50ec7595f48021f9e53a30c0b90d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9f57b8dcc5e1d50298a645880c7e459f8e38ae6a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 23195: (follow-up) One text invoice should be open
Nick Clemens [Wed, 21 Apr 2021 11:16:18 +0000 (11:16 +0000)]
Bug 23195: (follow-up) One text invoice should be open

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0cabe5e184fb1d02464eda4de859bb6ebf2109d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f82407e91776cf0336eade2d5b0b0a478986d661)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 23195: Always count shipping costs as 'spent'
Nick Clemens [Mon, 12 Apr 2021 18:13:47 +0000 (18:13 +0000)]
Bug 23195: Always count shipping costs as 'spent'

As shipping costs are created when an invoice is created, and creation
of an invoice implies that items have been received, the shipment costs
are always assumed to be 'spent'

This logic is true in GetBudgetSpent/GetBudgetOrdered, however, GetBudgetHierarchy
treats open invoices shipping costs as 'ordered' and closed invoice shipping costs
as 'spent'

This leads to inconsistencies in acqui-home vs spent.pl and ordered.pl

To test:
 1 - Find a vendor
 2 - Click 'Receive shipments'
 3 - Create a new invoice with a shipping cost on budget A
 4 - Repeate and create a new invoice with a shipping cost on budget B
 5 - Close the second invoice
 6 - View acquisitions ome
 7 - Note budget A includes the shipping under ordered
 8 - Note budget B includes the shipping under spent
 9 - Click the 'ordered' column on budget A - no shipping is listed on ordered page
10 - Click the spent column on budget A - the shipping is listed here
11 - Apply patch
12 - Both budgets list the shipping as 'spent'
13 - Both 'spent' pages include the shipping
14 - Neither 'ordered' page includes shipping

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 83941d2ee18c4c94485b0feea510d5899c1ee050)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit abbdf0323373a1cbb45ae2671defaafe9cc308e2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 23195: Unit tests
Nick Clemens [Mon, 12 Apr 2021 18:13:21 +0000 (18:13 +0000)]
Bug 23195: Unit tests

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2d505e5ba06ba12194676b5183bed4827d4b9eea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1c4b8ca01c507ab32e8968b167db824dbc9da4b8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27120: (follow-up) also send biblionumber
Fridolin Somers [Thu, 11 Mar 2021 08:14:38 +0000 (09:14 +0100)]
Bug 27120: (follow-up) also send biblionumber

Like in after_biblio_action hook

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c3625010bbf4e1eff428d9d1d7c5db2cd24045aa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eb8636f089dc01028b0a905a472a027e499cf218)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27120: Send biblio to Koha plugins hook 'intranet_catalog_biblio_tab'
Fridolin Somers [Tue, 1 Dec 2020 08:27:01 +0000 (09:27 +0100)]
Bug 27120: Send biblio to Koha plugins hook 'intranet_catalog_biblio_tab'

Koha plugins hook 'intranet_catalog_biblio_tab' should have the datas of the current biblio record.
Koha::Biblio is aleady in template, send it with hooks call.

This will be very usefull to be able to fetch external datas
(wikipedia, youtube, ...) depending on current biblio record.

Test plan :
1) Enable Koha plugins
2) Install plugin attached to this bug
3) Go to staff interface on a biblio record details page
4) Check you see tab 1 containing 'Tab for record {title}'
5) Check you see tab 2 containing 'Tab for record {isbn}'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e4d37b03158aa24c5bd01a13a7acd53df8e2213)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ab6e421152a763270e6d1e0083c433a38c86a277)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27114: (QA follow-up) Add missing POD
Martin Renvoize [Tue, 9 Mar 2021 16:47:35 +0000 (16:47 +0000)]
Bug 27114: (QA follow-up) Add missing POD

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b385e1f529a26e1c592355b9f7c2cec3259812df)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f05e6296bd49cc97b3b1c427966bdc432d7348a2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27114: Use Template Toolkit plugin for Koha plugins hook 'intranet_catalog_biblio...
Fridolin Somers [Mon, 30 Nov 2020 07:39:41 +0000 (08:39 +0100)]
Bug 27114: Use Template Toolkit plugin for Koha plugins hook 'intranet_catalog_biblio_tab'

Koha plugins hook 'intranet_catalog_biblio_tab' is for a template,
it will be better it uses Template Toolkit plugin like intranet_js, ...
It will allow using it in other places like MARC details page for example.

Test plan uses a plugin from git.biblibre.com because this hook is not
yet in KitchenSink.

Test plan :
1) Enable Koha plugins
2) Download and install the latest version of this plugin
https://git.biblibre.com/biblibre/koha-plugin-intranet-detail-hook
3) Browse to catalogue/detail.pl for a record
4) Note you see two new tabs with content

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>
(cherry picked from commit d0fecf3ff77da1344e915fe027a6fb11af475bb5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20bbaf12a61ba91e80a0f5094b75a2cade36213f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27282: fix all occurrences
Lucas Gass [Thu, 7 Jan 2021 15:57:16 +0000 (15:57 +0000)]
Bug 27282: fix all occurrences

This patch fixes all the occurrences, staff and OPAC. The problem only happens on some versions of Chrome.
TO TEST:
-set up a new list with a few items
-go to /cgi-bin/koha/virtualshelves/shelves.pl and view that list.
-Click 'Print List' in Chrome.
-The tab opens but immediately closes itself.
-Apply patch and clear cache
-Try again, the print dialouge remains open

-Go to cgi-bin/koha/sco/sco-main.pl in Chrome, make sure you can finish and print successfully
-In the staff client in Chrome makes sure printing works in the following areas:
    1. /cgi-bin/koha/circ/circulation.pl Print Slip and Print Quick Slip
    2. /cgi-bin/koha/members/boraccount.pl Make a payment and make sure you can print the invoice
    3. cgi-bin/koha/labels/spinelabel-home.pl Make a quick spine label in Chrome and make sure that prints.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 55b050b607869169aae2c52d1f89fd79f62af400)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b4ccde1133d1040d6f6094aa1d3ddcd2b91e9174)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27282: Add window.onafterprint function
Lucas Gass [Fri, 18 Dec 2020 17:28:54 +0000 (17:28 +0000)]
Bug 27282: Add window.onafterprint function

TO TEST:
-set up a new list with a few items
-go to /cgi-bin/koha/virtualshelves/shelves.pl and view that list.
-Click 'Print List' in Chrome.
-The tab opens but immediately closes itself.
-Apply patch and clear cache
-Try again, the print dialouge remains open

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fae72d031a080f840b39d892c95f3a9ee6f659ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5fe3e6592d43668a6648fb1f99471e8a892bb705)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27232: Add missing space between : and </label> in member-alt-contact-style.inc
Jonathan Druart [Mon, 14 Dec 2020 13:44:53 +0000 (14:44 +0100)]
Bug 27232: Add missing space between : and </label> in member-alt-contact-style.inc

It caused the strings to appear twice in the po file

Test plan:
Apply this patch and regenerate the PO for a given language.
Notice that the string "%s State: " only appears once in the PO file

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 61d8ec5075ba95c1fd84be6bfefd547749eaae1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e3bb1444356a9f9f64d368cabe49922731bdeed6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26533: Fix 'is exactly' search for authorities
Aleisha Amohia [Tue, 9 Mar 2021 21:33:16 +0000 (10:33 +1300)]
Bug 26533: Fix 'is exactly' search for authorities

The exact search 6=3 is implemented, but it isn't used as expected when
you select 'is exactly' from the authorities search dropdown. This patch
remedies that.

To test:
1) Ensure you have an authority with more than one word in the name,
    i.e. Electric power production
2) Go to Authorities in the staff client.
3) Change the dropdown to 'is exactly' and search for one of the words
in your record's title, i.e. 'power' in the 'main heading' search
4) Confirm your authority shows in the results, even though it is not an
exact match.
5) Search for a biblio record and go to edit the record.
6) Go to Tab 6 and click the plugin button next to one of the 6xx$a
fields to trigger the authority finder plugin
7) Repeat Step 3 and Step 4
8) Go to the OPAC and go to Authority Search
9) Repeat Step 3 and Step 4

Apply patch

10) Repeat Steps 1 to 9, confirm that this time the record does NOT show
in search results.
11) Repeat Steps 1 to 9 but this time search for the authority record's
full title, i.e. 'Electric power production'. Confirm the record does
show in the search results because the search term now matches title exactly.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a58cf90a3146f385671e6d82ae65de4f36d33316)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c62ca48c5619ceaa7f02d9aaf29bc029701885ac)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28054: DBRev 20.05.11.002
Andrew Fuerste-Henry [Mon, 24 May 2021 15:55:09 +0000 (15:55 +0000)]
Bug 28054: DBRev 20.05.11.002

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 20854: (QA follow-up) Rephrase of the new casServerVersion pref description
Katrin Fischer [Sat, 17 Apr 2021 13:38:43 +0000 (13:38 +0000)]
Bug 20854: (QA follow-up) Rephrase of the new casServerVersion pref description

For another related change, see:
https://en.wikipedia.org/wiki/Central_Authentication_Service

CAS = Central Authentication Service

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6aa6f115bd2330342675781400199a2f3152abf1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a54e729319ea03baae1b8e65f409a8916ff77ba8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 20854: (QA follow-up) Improve readability
Tomas Cohen Arazi [Tue, 16 Mar 2021 19:50:34 +0000 (16:50 -0300)]
Bug 20854: (QA follow-up) Improve readability

The logout_cas method does too little tasks. In this case, I consider we
should not split it into a separate method. As the CAS implementation
lacked tests, it made sense to do it like this, so it is testable. But
now we have higher-level tests for logout_cas, we can bake the behavior
inside of it, and it is testable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c3c066714ce568e507348f1e3a9a6b7db0c4815)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9b3538678ee758632a5d945e3c8d3e5870465a67)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 20854: Add more CAS tests
Tomas Cohen Arazi [Tue, 16 Mar 2021 19:46:14 +0000 (16:46 -0300)]
Bug 20854: Add more CAS tests

This patch aims to add full test coverage for 'logout_cas' the way we do
it nowadays (in a subtest, mocking things, etc). It is provided as a
separate patch so we can test the follow-up tidy and see no behavior
change.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Auth_with_cas.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Apply the refactoring follow-up
5. Repeat 3
=> SUCCESS: Tests still pass!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c71dda04c605b68b439e1a0ea3132447eeb28b45)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 225517a0f3dfed730c1afe38e8a262f8fe02d28e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 20854: Allow correct redirect on logout for Cas servers 3.0 and superior.
Matthias Meusburger [Mon, 12 Oct 2020 13:58:31 +0000 (15:58 +0200)]
Bug 20854: Allow correct redirect on logout for Cas servers 3.0 and superior.

Test plan:

 1) Apply the patch
 2) Set the system preference casLogout to "Yes"
 3) Set the new system preference CasServerVersion to "CAS 3 or superior"
 4) Check that you are redirected to Koha after a CAS logout from a CAS 3 server
 5) Set the new system preference CasServerVersion to "CAS 2 or inferior"
 6) Check that you are redirected to Koha after a CAS logout from a CAS 2 server

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 91307707ed2ff874ec5e2f25658a286019204e54)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26e7262963c2744bdec91a1f7487a830c9017120)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28028: Remove misc/migration_tools/fix_onloan.pl
Jonathan Druart [Fri, 9 Apr 2021 09:39:36 +0000 (11:39 +0200)]
Bug 28028: Remove misc/migration_tools/fix_onloan.pl

There is an obvious error in the script since bug 23463 and it's known
to be broken for 10 years now (since bug 5579). As nobody complains we
can safely remove this script.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c285de980266a23919fe64d26665ccd53355b820)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 689e3ac5fce0ccee109b135bffa98e962db37640)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26940: DBRev 20.05.11.001
Andrew Fuerste-Henry [Mon, 24 May 2021 15:39:09 +0000 (15:39 +0000)]
Bug 26940: DBRev 20.05.11.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26940: Take empty strings into account
Jonathan Druart [Wed, 18 Nov 2020 11:23:48 +0000 (12:23 +0100)]
Bug 26940: Take empty strings into account

Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 789ddd59c92183af350eba427ad545e3dce82422)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8986198c02d024b03e33b0b4e3159401ee3ca6c3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26940: Put in sync borrowers.debarredcomment with comments from borrower_debarment
Jonathan Druart [Tue, 17 Nov 2020 11:18:48 +0000 (12:18 +0100)]
Bug 26940: Put in sync borrowers.debarredcomment with comments from borrower_debarment

Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c309ee36dde958ff8049c4ed6e381c2d5858dc68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 382779ee4c69c73a843625d0221a2f3ae521e607)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26940: don't reset debarredcomment on patron update
Didier Gautheron [Thu, 5 Nov 2020 14:04:41 +0000 (15:04 +0100)]
Bug 26940: don't reset debarredcomment on patron update

Test plan:
1) Create a patron
2) In koha/members/moremember.pl add a manual restriction, with comment foobar
3) try to checkout, you have a message like
    Restricted: Patron's account is restricted with the explanation:
      foobar
4) Got to Edit patron, save
5) try to checkout, foobar is no more
    Restricted: Patron's account is restricted with the explanation:
6) Apply patch
7) Redo 1-4
8) try to checkout, foobar is there.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3b9f1e1560d4cf565f48a4cd09d048b2ee38689e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d1e123fe39039082d83d2f24a48a414a649919e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26989: Safeguard Order Messages from unwanted characters
Colin Campbell [Tue, 10 Nov 2020 14:30:15 +0000 (14:30 +0000)]
Bug 26989: Safeguard Order Messages from unwanted characters

Carriage returns in notes were causing a supplier's parser
to truncate Order messages received from Koha.
Have removed those and also made a global removal of CR, Line feeds
and tabs - the latter two having the possibility of causing
errors in the future

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
There was no test plan to follow, but the patch appears to be making
sensible changes. If someone wants to provide a thorough test plan I can
re-test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d82684a328fd4a6d11bd6b414536ee4c05642f0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bb6161029f401266f17f669d1a7124edb9387023)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27836: Document that CirControl changes which calendar is being used
Joonas Kylmälä [Tue, 2 Mar 2021 15:06:09 +0000 (17:06 +0200)]
Bug 27836: Document that CirControl changes which calendar is being used

You can verify that which branch's Koha calendar is being used to
calculate fines by reading for example the code in
C4::Circulation::_CalculateAndUpdateFine() There you can see that
$control_branchcode variable is being passed to
C4::Overdues::CalcFine() and if you trace that you will see in the end
it decides which branch's calendar to use for calculating chargeable
overdue fine days.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f964efacb92997a45e5e46d3309a5f091c10b461)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32721535a9d42a1499ffa45fc0307c6c0d1c81dd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27861: Warning in C4/XSLT.pm - use of uninitialized value in numeric eq (==)
Fridolin Somers [Thu, 4 Mar 2021 16:27:16 +0000 (17:27 +0100)]
Bug 27861: Warning in C4/XSLT.pm - use of uninitialized value in numeric eq (==)

In C4/XSLT.pm :
 elsif ( exists $itemtypes->{ $item->effective_itemtype }
            && $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 )

itemtype.notforloan is null by default, its generated a warning in logs.

Test plan :
1) Choose a record with itemtype.notforloan = NULL
2) Perform a search in the OPAC which will return results which
   include the record using XSLT
3) See patch removed warning

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bda9b9e122df436d48e6416d140a7bbb45c8546c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa0af2da9f89fe4149336b76ec987713b41a1fc8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27827: (follow-up) add a hint for clarification
Andreas Roussos [Wed, 24 Mar 2021 12:56:15 +0000 (13:56 +0100)]
Bug 27827: (follow-up) add a hint for clarification

When adding a new authority type, there is no indication of how big
the authority type code can be (auth_types.authtypecode in the DB has
a maximum length of 10 characters).

This patch fixes that.

To test, apply the patch and notice the hint appearing right above the
"Authority type:" text box as you add a new authority type: it should
display "10 characters maximum" in grey colour.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c359c154364b0aa2aff0f368e21bd30e458173a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3c8274197fe925eb2915dbee42d8f6415733d80)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27827: make the 'Authority type:' input field wider
Andreas Roussos [Tue, 2 Mar 2021 03:12:37 +0000 (05:12 +0200)]
Bug 27827: make the 'Authority type:' input field wider

When adding a new authority type in the Staff client, the 'Authority type'
input field is too narrow. If you enter something like "OOP_CORPUS" inside
the textbox, you will have to scroll right and left inside the textbox in
order to view its contents.

This patch fixes that.

Test plan:
1) Try to add a new authority type with name "OOP_CORPUS". Notice how
   the input field is too narrow and cannot contain the entire string.
2) Apply this patch.
3) Repeat step 1), this time the input field has been widened and can
   accommodate the entire string.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e20e0006914a118c8c6278be6165ae241a94f0c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 772c53b31c2ac0646f937bb6790d81398c7fa521)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27695: Compiled CSS
Andrew Fuerste-Henry [Mon, 24 May 2021 14:56:15 +0000 (14:56 +0000)]
Bug 27695: Compiled CSS

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27695: (follow-up) Add specificity to CSS changes
Owen Leonard [Fri, 9 Apr 2021 18:07:48 +0000 (18:07 +0000)]
Bug 27695: (follow-up) Add specificity to CSS changes

This patch moves the definition of .alert and .error classes into the
block for .dialog in order to make sure they don't have an effect beyond
the desired scope.

The ".closebtn" section is redundant and has been removed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c42c24fa03709496d0c21b98fe7db228f02d3983)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6fccb68222379985147f7fc5cc8fd4bc5d95779d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27695: Fix style of messages on Elasticsearch configuration page
Owen Leonard [Fri, 12 Feb 2021 17:08:25 +0000 (17:08 +0000)]
Bug 27695: Fix style of messages on Elasticsearch configuration page

This patch makes minor modifications to SCSS and HTML to make messages
on the Elasticsearch configuration page more consistent with other
interfaces.

To test you should have Elasticsearch selected as your search engine.

- Apply the patch and rebuild the staff interface CSS
  (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)
- Go to Administration -> Search engine configuration (Elasticsearch)
- You should see a full-width "note" style message under the page
  heading, "Warning: Any changes..."
- Click the "Reset mappings" button at the bottom of the page. The
  confirmation alert you see should appear above the note-style message.
- I'm not sure how to trigger an "error" type message on this page, but
  you can test the updated style by going to Administration ->
  Currencies and submit a new currency with the same name and symbol as
  one which already exists.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e9d2aa498b38343f51a51822c68995bd72110d50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7d03dfb5990f4b850dce38352ec5e9900a107f3b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28013: (follow-up) Reset the patron loop
Nick Clemens [Fri, 2 Apr 2021 14:35:08 +0000 (14:35 +0000)]
Bug 28013: (follow-up) Reset the patron loop

To test:
1 - Apply all other patches and dependencies
2 - prove -v t/db_dependent/Circulation.t
3 - It fails
4 - Apply this patch
5 - It passes

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 626d1f22a0be9ea1abfc9ee656448c9822ee3438)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 60a44d0da1e7def1699f6d124ce616a6edc04aa0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28013: Unit tests
Nick Clemens [Fri, 2 Apr 2021 14:33:55 +0000 (14:33 +0000)]
Bug 28013: Unit tests

Cover the case of multiple patrons and multiple items that can fill them

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 850ad303935ddd3008db1ad5d8a100f8a22778d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 82e1674c70f486f0d068da519a45d3689bca1584)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28013: (follow-up) Correct and update call to CanItemBeReserved
Nick Clemens [Fri, 2 Apr 2021 14:32:33 +0000 (14:32 +0000)]
Bug 28013: (follow-up) Correct and update call to CanItemBeReserved

The current call checks for truth against a returned hash, we need
to check the 'status' value

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ded05deb102de13de95c5e0f76bfaf79075423cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e26eb6df85c416394633b89d2837697e71d744af)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28013: (QA follow-up) Remove unused variable
Joonas Kylmälä [Mon, 29 Mar 2021 10:47:17 +0000 (13:47 +0300)]
Bug 28013: (QA follow-up) Remove unused variable

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 25d60246558f9e22015e350125627bbd2b96fe89)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d581ecf3a7a4be80b9477b7d840365d3aa454d96)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28013: Performance improvements to CanBookBeRenewed
Nick Clemens [Mon, 22 Mar 2021 13:03:11 +0000 (13:03 +0000)]
Bug 28013: Performance improvements to CanBookBeRenewed

In the case of 'AllowRenewalIfOtherItemsAvailable' we check all existing reserves against
all existing items. This patchset reduces the number of DB/subroutine calls

To test:
1 - Apply patch
2 - prove -v t/db_dependent/Circulation.t

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0b8f4ec614f8e526f814c1d79a6729f7abcac874)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 81254e0db022d407e728d773b835d4f594388174)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28078: (follow-up) Add param check to 'itemAlreadyOnHold' test
Nick Clemens [Tue, 6 Apr 2021 13:21:50 +0000 (13:21 +0000)]
Bug 28078: (follow-up) Add param check to 'itemAlreadyOnHold' test

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a620c1bb116d82ea27934f643789a84f5c002a2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20ce0fdab0896c2f95b49f655c93052f87baeff6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28078: Add 'ignore_hold_counts' param to CanItemBeReserved
Nick Clemens [Fri, 2 Apr 2021 14:29:19 +0000 (14:29 +0000)]
Bug 28078: Add 'ignore_hold_counts' param to CanItemBeReserved

This patch adds an optional param 'ignore_hold_counts' to the routine, while still forbidding holds when 0 are allowed

To test:
1 - prove -v t/db_dependent/Holds.t

Signed-off-by: David Nind <david@davidnind.com>
JK: Commit message amended: Fixed title formatting
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d3adcec676f97a1456dbb072479a99f7224e724c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit da72406fa52fe44574d8a64eeca1d8942cc86e99)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoUpdate release notes for 20.05.11 release v20.05.11
Andrew Fuerste-Henry [Mon, 26 Apr 2021 19:46:05 +0000 (19:46 +0000)]
Update release notes for 20.05.11 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoIncrement version for 20.05.11
Andrew Fuerste-Henry [Mon, 26 Apr 2021 19:37:50 +0000 (19:37 +0000)]
Increment version for 20.05.11

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoTranslation fix again for 20.05.11
Andrew Fuerste-Henry [Mon, 26 Apr 2021 19:36:41 +0000 (19:36 +0000)]
Translation fix again for 20.05.11

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoFix translations for 20.05.11
Andrew Fuerste-Henry [Mon, 26 Apr 2021 19:32:24 +0000 (19:32 +0000)]
Fix translations for 20.05.11

3 years agoTranslation updates for Koha 20.05.11
Koha translators [Mon, 26 Apr 2021 18:18:10 +0000 (15:18 -0300)]
Translation updates for Koha 20.05.11

3 years agoBug 26679: Use index-term-genre for 655
Andrew Fuerste-Henry [Mon, 23 Nov 2020 15:57:46 +0000 (15:57 +0000)]
Bug 26679: Use index-term-genre for 655

To test:
1 - have a bib with a 655 that is not linked to an authority
2 - confirm link on OPAC and intranet details uses subject index
3 - apply patch, restart, reload pages
4 - confirm links now use index-term-genre and give correct results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 21ddbae73524d927116d37083a33febc0dfd7818)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bb3ff613a7164f9f07910d1a06cd0e74fed4b5af)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 18729: Adapt holds.js
Tomas Cohen Arazi [Mon, 14 Dec 2020 15:27:05 +0000 (12:27 -0300)]
Bug 18729: Adapt holds.js

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e56d083461fb5381a21b44c50a06e32a57fee046)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 64a48c633268010b8ae09c54e866f8084192dfbc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 18729: (follow-up) Adjust API to new spec
Tomas Cohen Arazi [Mon, 14 Dec 2020 15:13:38 +0000 (12:13 -0300)]
Bug 18729: (follow-up) Adjust API to new spec

The previous patch introduces some behavioural changes to the API, as
well as the data types that need to be passed; all happens in the tests.

This patch adapts the route so it complies with those changes:
- JSON object containing pickup_library_id attribute is now passed back
  and forth.
- The controller should take care of checking the pickup location is
  valid, using the available tools.

To test:
1. Apply the patches, up to the tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> ERROR: Tests fail because the controller doesn't implement the
desired behavior
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 60a253c983df1cf50193ee60df730e762ce8f504)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eaef2ce2076d1f72231457877b1bee9d1ab3234c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 18729: Add more tests
Tomas Cohen Arazi [Fri, 11 Dec 2020 12:11:15 +0000 (09:11 -0300)]
Bug 18729: Add more tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9294ab967af113e39a575b116f6a1aa680931bfd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f6755b446b47afa2e8d85d630062bbcdae85558f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 18729: Add PUT /holds/{hold_id}/pickup_location
Jonathan Druart [Tue, 1 Dec 2020 11:29:38 +0000 (12:29 +0100)]
Bug 18729: Add PUT /holds/{hold_id}/pickup_location

This patch adds a route to overwrite the current pickup location.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bf2c59a182837ec397c850ac6e22d52c0ec8d045)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1786089ab88ef3a8612aa114dbab574934fbaf3c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28156: Rename Koha::Account::Line->renewal with is_renewal
Jonathan Druart [Fri, 16 Apr 2021 10:12:41 +0000 (12:12 +0200)]
Bug 28156: Rename Koha::Account::Line->renewal with is_renewal

It's a boolean, it must be named is_*

Test plan:
Confirm that
  prove t/db_dependent/Koha/Account/Line.t
is still returning green

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 491147896d5cced31861243b862e403f09d62d98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9d3ea2bd4930864bd1d6234aa2b6faf0be2a39b1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28069: (bug 27715 follow-up) Fix sort for lists
Jonathan Druart [Tue, 6 Apr 2021 15:35:33 +0000 (17:35 +0200)]
Bug 28069: (bug 27715 follow-up) Fix sort for lists

Sort functionality has been broken by bug 27715. We need to specify the
table.column in the datatable init

Note that "count" needs to be handled separately (which is a bit dirty
but cannot find something better)

Test plan:
Create some lists, add contents, change owner and dates
Sort using the different attributes and confirm that it's now working

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f35571410b191770337708f4e389b49bde15e04e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 56bc8c53d1b61c9427f2a3067f234f66f7299ee9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27656: misc/cronjobs/longoverdue.pl better error message
Fridolin Somers [Mon, 8 Feb 2021 14:28:35 +0000 (15:28 +0100)]
Bug 27656: misc/cronjobs/longoverdue.pl better error message

There are two ways of configuring misc/cronjobs/longoverdue.pl :
use --lost arg or system preferencies DefaultLongOverdueLostValue and DefaultLongOverdueDays.

Actually if you don't use any of it, you get a message :
  "ERROR: No --lost (-l) option defined"
Should also say something about preferencies :
  "ERROR: No --lost (-l) option no system preferences DefaultLongOverdueLostValue/DefaultLongOverdueDays defined"

Test plan:
1) Set empty preferences DefaultLongOverdueLostValue and DefaultLongOverdueDays
2) Run : misc/cronjobs/longoverdue.pl --maxdays 365
3) You see error message
4) Set DefaultLongOverdueLostValue = 1 and DefaultLongOverdueDays = 90
5) Run : misc/cronjobs/longoverdue.pl --maxdays 365
6) You don't see error message

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 891145130c1fd4f216026eeb94c37300c8e3fd01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e7c3e5f81b159d100dd40a729d704a1f59a6426e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26528: Z39.50/SRU ignore invalid replies
Didier Gautheron [Thu, 24 Sep 2020 08:13:08 +0000 (10:13 +0200)]
Bug 26528: Z39.50/SRU ignore invalid replies

When searching for authorities if an authorities server reply has invalid records
none are displayed.

At least french BNF SRU server doesn't fully follow norm and can return an error
confusing Koha protocol handler which then returns an empty MARC record.

This patch silently removed bogus records.

To Test:
1- Add BNF SRU server
2- Go to authorities page
3- Add an authority
4- Search for keyword(any) droits de l'homme
5- No result (Internal Server Error)
6- Apply patch
7- restart starman
8- redo 4
9- Many records are displayed

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d8f34430d17fd70e65318532c27dceed184eb7bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cefb8bcf0c58ca31f48b45a693c831a1bf28d0bf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27529: Choose patron's branch or item's homebranch if following group rules and...
Nick Clemens [Mon, 25 Jan 2021 15:34:31 +0000 (15:34 +0000)]
Bug 27529: Choose patron's branch or item's homebranch if following group rules and patron cannot choose branch

This patch defaults the holds pickup location to the items homebranch or the patron's branch when a group option is selected
for the hold fulfillment policy and the patron is not allowed to choose the branch on the OPAC

To test:
1 - Set 'Default checkout, hold and return policy' -> 'Hold pickup library match' to item's hold group or patron's hold group
2 - Set  OPACAllowUserToChooseBranch to 'Don't allow'
3 - Try to place an item level hold on the opac
4 - Ka-boom, etiher:
    The method Koha::Item->patrongroup is not covered by tests!
    The method Koha::Item->itemgroup is not covered by tests!
5 - Apply patch
6 - Repeat
7 - Note the pickup location is set to either the patron's branch or the items homebranch
8 - Repeat plan with the other group setting

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 99c3b9ae1f55066f4fd2bd0e37ba336f18592780)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b78ccb3e479919be83dc027eaf23fc1c44f62fba)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri
Aleisha Amohia [Wed, 17 Mar 2021 20:38:06 +0000 (09:38 +1300)]
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri

To test:
1) Go to Admin -> system preferences and enable the TrackClicks syspref
(set to Track or Track anonymously)
2) Find a record in the staff client with an item. Edit the item and put
two external URLs in the Uniform Resource Identifier field, e.g.
"https://www.google.com/ | https://twitter.com/"
3) Search for that record in the OPAC. Notice the two links in the
holdings table.
4) Click a link and confirm that you are directed to a 404.
5) Apply the patch and refresh the page
6) Click a link and confirm that you are directed to the page as
expected
7) Go back to edit the record in the staff client and remove one of the
links from the URI field
8) Go back to the OPAC and confirm you can still access the link as
expected when there is only one URI

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0da874bde2eb9592e6c2036e840aac3ed09dab44)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63b7ba9767e324fc7fb3b12092292ca23b63c3db)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28123: Fix expected value in unit test
David Cook [Tue, 13 Apr 2021 00:45:42 +0000 (00:45 +0000)]
Bug 28123: Fix expected value in unit test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 559950cae607e64614a6e860e1d966430a59e1f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9a03fb760dd4324303c97faebeb5d9bccbbab4cb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28123: Quote filename value in Content-Disposition header
David Cook [Tue, 13 Apr 2021 00:39:04 +0000 (00:39 +0000)]
Bug 28123: Quote filename value in Content-Disposition header

Chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
error if a Content-Disposition header includes an unquoted filename
that contains commas.

This patch adds quotes around the filename in the Content-Disposition
header, which fixes the problem.

Test plan:
0. Do not apply the patch yet
1. Obtain a PDF and rename it to include a comma in its name
2. Enable the upload.pl plugin in the 856$u of the Default framework
3. Add/edit a record in the Default Framework and upload a file
using the 856$u upload plugin.
4. Click on the resulting file URL in the saved file
5. Note the error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
is returned instead of the file

6. Apply the patch and restart your Plack instance

7. Click on the resulting file URL in the saved file
8. Note that you now get the PDF file instead of the error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 52f997fcfc88488e1a8bab4a8d52eba6c0501895)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 029936828d3feb57d9ee40a6709d62bc6fbb3124)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28103: Fix barcode plugin on the order receive view
Jonathan Druart [Fri, 9 Apr 2021 09:58:34 +0000 (11:58 +0200)]
Bug 28103: Fix barcode plugin on the order receive view

Fix the following error:
Uncaught TypeError: Cannot read property 'field_value' of null

Test plan:
Set "AcqCreateItem" to "receiving an order"
Set "autoBarcode" to "generated in the form <branchcode>yymm0001"

Create an order and go to receive it at a path like
/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=2&invoiceid=1

Click on the barcode input and confirm that it's prefilled
automatically

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 54c5ee570648ef9b35f0333ab88e1353a74d9ffa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 08aee787b663590b06799a7478d9f709f6727de0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28147: Pass itemnumber through to Account->pay
Nick Clemens [Wed, 14 Apr 2021 13:48:08 +0000 (13:48 +0000)]
Bug 28147: Pass itemnumber through to Account->pay

Currently the itemnumber is not passed through when paying a single fine,
we should do that

To test:
1 - Create a manual debit and provide a barcode so the debit is linked to an item
2 - Go to the 'Make a payment' tab. Click the 'Writeoff' button on the individual line
3 - View the 'Transactions tab' The writeoff has no item details
4 - Apply patch
5 - Repeat 1 & 2
6 - View the transactions tab. The writeoff shows item details
7 - Confirm 'Writeoff amount' and 'Writeoff selected' still work and do not link to item

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ddad57a468706c16c2cf0165cda84f6cdb7adb9f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b64f2fe1f26734385f4d8fe268a58a7be01f596)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27739: Advanced editor should use DefaultCountryField008 preference
Phil Ringnalda [Thu, 1 Apr 2021 18:36:43 +0000 (11:36 -0700)]
Bug 27739: Advanced editor should use DefaultCountryField008 preference

Uses the system preference DefaultCountryField008, falling back to ||| (no
attempt to code) if it is not set, for 008/15-17 place of publication in
the advanced cataloging editor..

Test plan:
1) Apply patch and restart all the things, something's over-cached here
2) Administration - Toggle the preference  EnableAdvancedCatalogingEditor
   to "Enable", verify the preference DefaultCountryField008 is empty
3) Cataloging - Advanced editor
4) In field 008, verify that the three characters after the two sets of
   four blank spaces are |||
5) Administration - Set DefaultCountryField008 to fr
6) Cataloging - Advanced editor
7) In field 008, verify that the three characters after the two sets of
   four blank spaces are "fr " (including the space, so following
   characters haven't shifted left, and the last character is still d)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 53e1002e1110896ca96624a7bcf616afa18879b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5e260c39b1dafd6140d4427d8a4b9862fe361e79)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28118: Default to current branch when placing hold
Tomas Cohen Arazi [Mon, 12 Apr 2021 19:01:03 +0000 (16:01 -0300)]
Bug 28118: Default to current branch when placing hold

During bug 27071 development, this line got inadvertedly changed. This
patch restores the original behaviour.

To test:
1. Search for a title
2. Go try place a hold
=> FAIL: Look at the HTML, there's no pickup location with
selected="selected"
3. Switch branch and repeat 2
=> FAIL: Still the same
4. Apply this patch
5. Repeat 2 and 3
=> SUCCESS: Branch is selected, chosen current branch is picked
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a7529e1fd9cb5c1022bdfc846756c536284bda3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit baae4b18b1a11dbe4a0b983dbe6e8ce3bcee8d78)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28015: Fix inventory for timeformat=12h
Jonathan Druart [Fri, 9 Apr 2021 09:22:11 +0000 (11:22 +0200)]
Bug 28015: Fix inventory for timeformat=12h

Inventory explodes with the following stacktrace if timeformat is set to 12h

Invalid value passed, datelastseen=2021-04-09 12:00 AM expected type is date at /usr/share/perl5/Exception/Class/Base.pm line 88
        Exception::Class::Base::throw('Koha::Exceptions::Object::BadValue', 'type', 'date', 'value', '2021-04-09 12:00 AM', 'property', 'datelastseen') called at /kohadevbox/koha/Koha/Object.pm line 196
        Koha::Object::catch {...} ('DBIx::Class::Exception=HASH(0x557a052baeb0)') called at /usr/share/perl5/Try/Tiny.pm line 124
        Try::Tiny::try('CODE(0x557a051931d8)', 'Try::Tiny::Catch=REF(0x557a052bfc30)') called at /kohadevbox/koha/Koha/Object.pm line 206
        Koha::Object::store('Koha::Item=HASH(0x557a0521a048)') called at /kohadevbox/koha/Koha/Item.pm line 202
        Koha::Item::store('Koha::Item=HASH(0x557a0521a048)') called at /kohadevbox/koha/tools/inventory.pl line 220

Test plan:
Set TimeFormat to 12h
Use the inventory
=> Confirm that it's working with this patch applied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 21ea89d774d50b1667b18e252f56abe295a97d34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d5a3f7564de63b38b96d529d867f1241ea38b83)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27927: Prevent renewal on lost forgive
Martin Renvoize [Wed, 24 Mar 2021 17:13:57 +0000 (17:13 +0000)]
Bug 27927: Prevent renewal on lost forgive

The `RenewAccruingItemWhenPaid` preference should only renew upon
payment (and writeoff) and not upon automatic forgival triggered by
`WhenLostForgiveFine`.

Test plan
1/ Enable `WhenLostForgiveFine` and `RenewAccruingItemWhenPaid`
2/ Checkout an item and backdate it's due date
3/ Run longeroverdue.pl to mark the item as lost and create the fine
4/ Confirm that the item is not renewed as part of the process
5/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ac233efccf089c9981e81bba30554339007729f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dc7c62ec4d671ca35ce5d87131acb8dc48a0f5b5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27927: Add Unit Tests
Martin Renvoize [Tue, 6 Apr 2021 10:19:04 +0000 (11:19 +0100)]
Bug 27927: Add Unit Tests

Add a unit test to check that 'FORGIVEN' credits do not prompt an
auto-renewal with `RenewAccruingItemWhenPaid` enabled.

Test plan
1/ Apply the test patch
2/ Run t/db_dependent/Koha/Account/Line.t and confirm it fails
3/ Apply subsequent patch
4/ Re-run the test and confirm it passes

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6eea10dc538d76af1f1545010439d4fcb3d288ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1c2b5952d315aa35ef015fd5244b5fee913c468c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25508: Add info about caller responsabilities
Jonathan Druart [Fri, 16 Apr 2021 10:07:49 +0000 (12:07 +0200)]
Bug 25508: Add info about caller responsabilities

We are removing the test on the existence of item and patron, callers
must call renewable before.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 59f1dc09acfcf602bb2700eb4ee64ecc10f4d09b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e0fe359ca7644368ed4e49ac20c6f4fca7047a08)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25508: (QA follow-up) Add interface
Nick Clemens [Thu, 15 Apr 2021 15:28:58 +0000 (15:28 +0000)]
Bug 25508: (QA follow-up) Add interface

These patches are making the call for an amount match the call for a specific line,
we should also match the passing of interface to ensure the correct pref is checked

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 97c168704b576bf59e4778417f066c1097d3014d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 808fa2a3e2f7aeeb10edc6e5838b5281afdf5da1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25508: Only return renewal outcomes to the controller
Martin Renvoize [Wed, 24 Mar 2021 16:38:32 +0000 (16:38 +0000)]
Bug 25508: Only return renewal outcomes to the controller

There are a few cases where the `renew_item` method in
Koha::Account::Line will return `undef`. For these cases, we should not
pass the error up the chain to the controllers as it leads to malformed
error messages in the UI.

Test plan
1 - Make sure FinesMode is on, RenewAccruingItemWhenPaid is off
2 - Checkout an item to a patron and make it overdue (can backdate the
    checkout)
3 - Make sure the itemtype has fines that will be charged
4 - Charge the fines:
    Set finesMode = production
    perl misc/cronjobs/fines.pl -v
5 - Check the fine appears on the patrons account
6 - Pay off the fine
7 - Receive alert after payment that reads: "The fines on
    the following items were paid off, renewal results are
    displayed below:
        No title ( ): Not renewed - Unknown error"
8 - Apply the patch
9 - Repeat steps 1 through 6 and note that you no longer trigger the
    error message.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d4dc15ee36dc108e074e4d1b78edc055b1a22597)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b51efada26130d16264486514c59e8dca12639a9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25508: Add Unit Tests
Martin Renvoize [Tue, 6 Apr 2021 07:48:38 +0000 (08:48 +0100)]
Bug 25508: Add Unit Tests

Enhance the unit tests to check for the return values of
Koha::Account->pay.

Test plan
1/ Apply just this patch
2/ Run t/db_dependent/Koha/Account.t and watch it fail
3/ Apply the rest of the patch series
4/ Run t/db_dependent/Koha/Account.t and watch it pass
5/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66ad8f77278e7ceb18bc5e027a470fd621e5f9b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8637c8ecbd9ec5eaed6854b55c803d5689d22868)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26312: (follow-up) Fix passing of exception messages
Nick Clemens [Thu, 1 Apr 2021 13:49:19 +0000 (13:49 +0000)]
Bug 26312: (follow-up) Fix passing of exception messages

'error' has special meaning in exceptions so naming the fields:
type, details

Rather than only dealing with a single exception type, we generically
get the ES exception info and pass it up.

I could not recreate timeout still, however, I simply restarted the
ES docker during commit stage to cause NoNodes exceptions

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cc8787bf879630f1c5572008c3637598f56d7aff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 74284f4ddb015de6e6e7a0c97dd6be40d0804f40)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26312: Catch ES Client errors, log, and continue indexing when error encountered
Nick Clemens [Thu, 27 Aug 2020 16:04:57 +0000 (16:04 +0000)]
Bug 26312: Catch ES Client errors, log, and continue indexing when error encountered

This catches a timeout response from the ES server, logs this, and continues the indexing

To test:
1 - perl misc/search_tools/rebuild_elasticsearch.pl
2 - Make the ES server timeout (I don't have good instruction yet)
3 - Watch the job crash
4 - Apply patches
5 - perl misc/search_tools/rebuild_elasticsearch.pl
6 - Make the server timeout
7 - Note the job reports failed commit, and continues

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 26312: (follow-up) Reset buffers even if commit fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 26312: (follow-up) Fix whitespace and missing semicolon

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 72e6999db7cbfc077f200930dd28400d1f86831e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d78690a0ab4d38ef3ad430b6ed9bd02b393834b2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27746: prevent regexp undefined warning when checking subfield contents ($oclc)
Petro Vashchuk [Mon, 22 Feb 2021 11:46:44 +0000 (13:46 +0200)]
Bug 27746: prevent regexp undefined warning when checking subfield contents ($oclc)

Some of the books have subfield "a" of field "035" absent
and it's possible to have such
(it doesn't says "Require" in the interface),
which causes "Use of uninitialized value $oclc in pattern match (m//)"
error.

Solved by screening regex with check for empty variables before the
match.

To reproduce:
    1) Edit existing book or create a new one with empty marc
subfield "a" of field "035"
    2) Use the search feature that will find it along with some other
books.
    3) Check /var/log/koha/kohadev/plack-intranet-error.log to find
"Use of uninitialized value $oclc in pattern match (m//)" error.
    4) Apply the patch.
    5) Repeat the search and check the logs again to ensure
that error didn't appear again.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a34e1f9f0d32e4cf0f282016e52166d309b25ef7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f618fb33a80d7f757dc0c95832b6d6c7d71f819)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28112: Z39.50 does not populate form with all passed criteria
Owen Leonard [Wed, 7 Apr 2021 16:27:31 +0000 (16:27 +0000)]
Bug 28112: Z39.50 does not populate form with all passed criteria

This patch adds output of some already-existing template variables in
the Z39.50 search form so that all parameters can be used to prepopulate
the form.

To test, apply the patch and go to Cataloging.

- Click the "New from Z39.50/SRU" button
  - A window should pop up and the form should be empty.
  - Confirm that searching works correctly.
- Perform the same test from a bibliographic detail page using the Edit
  menu -> Replace record via Z39.50/SRU.
  - Some fields in the search form should be prepopulated, e.g. ISBN,
    title, author.
- Paste this link into your browser:
  http://path.to.your.koha/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
  - The search form should appear with all fields prepopulated.

- Perform the same tests in Acquisitions with the option for adding to a
  basket via an external search.
  - The link for testing all parameters:
    http://path.to.your.koha/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=4&basketno=3&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0f33c0a7d58704dba0e4c30b0b8904131adea111)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 439d7b6405d767210204d69138a54f20509a9dbc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28121: Correct the place of the question mark
Séverine QUEUNE [Fri, 9 Apr 2021 13:25:16 +0000 (15:25 +0200)]
Bug 28121: Correct the place of the question mark

Question mark is wonrgly placed when you want to delete a desk.
Test plan :
- Enable 'UseCirculationDesks'
- On Administration > Desks menu, create a new desk
- Try to delete it : note the question mark in inside the quotation
marks
- Apply patch and refresh page
- Question mark should now be after the last quotation mark

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c6e7ec55dca08bbd2b65ea465f304eca7c60903)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4c4f1a8950b5caa98420eb6b6c94cf38237f2ae2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBIC schema changes
Andrew Fuerste-Henry [Sun, 25 Apr 2021 14:37:29 +0000 (14:37 +0000)]
DBIC schema changes

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.10.001
Andrew Fuerste-Henry [Sun, 25 Apr 2021 14:34:28 +0000 (14:34 +0000)]
DBRev 20.05.10.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27726: Increase 'content' field size
Martin Renvoize [Thu, 25 Mar 2021 14:29:06 +0000 (14:29 +0000)]
Bug 27726: Increase 'content' field size

This alternate patch increases the field size from a 255 character
varchar to a 65535 character text field. This allows for more detailed
problem reports to be submitted.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c854a87d221a92051411d822121398f2440ae1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65c85793737554c76ffc00ea54e7842051b4cb91)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28094: Deal with encoding for overriden sysprefs
Jonathan Druart [Tue, 6 Apr 2021 14:26:23 +0000 (16:26 +0200)]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c32d46b854a73e636b1568eab758868ea9d74a13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0a677be7f106d5bf5dfec43d1d4ec2d57272e7c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28097: Mock finesModes to disable recalculation
Martin Renvoize [Wed, 7 Apr 2021 11:10:38 +0000 (12:10 +0100)]
Bug 28097: Mock finesModes to disable recalculation

Since bug 8338 the recalcuated zero amount fine is subsequently removed
in _FixOverduesOnReturn which causes this test to fail if finesMode is
'production' and 'CalculateFinesOnReturn' is enabled.

Perhaps we should be 'VOID'ing fines rather than completely deleting
them, but that's a question for another day.

Test plan
1/ Enable finesMode in the staff client
2/ Run the test and watch it fail
3/ Apply the patch
4/ Run the test and watch it pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f3e81738c83f6f2bae869f056ba934fc45315c1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ffd059075fd5788eb5456c52a675303f430a0787)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27991: Message field for OPAC problem reporting should have a maxlength set
Owen Leonard [Thu, 18 Mar 2021 17:59:15 +0000 (17:59 +0000)]
Bug 27991: Message field for OPAC problem reporting should have a maxlength set

This patch adds a maxlength attribute to the form field for entering
checkout notes in the OPAC, matching the character limit of the database
column. A note is added to show the 255 character limit.

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

 - Log in to the OPAC as a user who has checkouts.
 - On the "Your summary" page, the "Report a problem" fields should
   have a hint below them, "255 characters maximum."
 - Try entering text in one of the fields. You should not be able to
   enter more than 255 characters:

   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
   nunc mi, fringilla in mauris quis, hendrerit feugiat mi. Sed ultrices
   mollis nulla sit amet faucibus. Sed volutpat augue risus, eu rutrum
   eros commodo eu. Proin rhoncus nisi vitae magna_

 - Test that your submission is saved correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8bb9cb649bf36a650d3b84c29c5c9ddd3b01caa5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8832d917d6bb1e6ee79150ffc4737f6a39dba185)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28077: Add a colon after the 'Reason' label on edit suggestion page
Séverine QUEUNE [Fri, 2 Apr 2021 12:13:28 +0000 (14:13 +0200)]
Bug 28077: Add a colon after the 'Reason' label on edit suggestion page

This patch corrects the missing colon on the 'Edit purchase suggestion'
page.
To test :
- go to Acquistions > Suggestions
- edit a suggestion
- on 'Suggestion management' bloc, see the colon missing after the
'Reason' label
- apply patch
- refresh the page
- colon should now be displayed

Happy sign off !

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dad0a18c7a8a95c3bca7bf97d010953c5a41a0f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 03e3f03c97b27a098339e96cd8b2127f9778ab72)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28044: Increase specificity of calendar tables CSS
Owen Leonard [Mon, 29 Mar 2021 10:33:13 +0000 (10:33 +0000)]
Bug 28044: Increase specificity of calendar tables CSS

This patch adds increased specificity to the CSS which should add colors
to the tables of holidays. The default DataTable CSS was overriding the
custom color-coding.

This patch also moves the calendar CSS into a separate file.

To test, apply the patch and go to Tools -> Calendar.

If necessary, add at least one of the following:
- Unique holiday
- Holiday repeating weekly
- Holiday repeating monthly
- Holiday exception

In the table listing each kind of holiday, the color of the table header
should match the colors in the "Key" section under Hints. The color
should be correct regardless of how the table is sorted.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4df8e3ef02b4490dc813b76b853e3fb706d4a301)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 42ebcdd3dfc3fd766e6242d40ef28c55dd7ecfe4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27738: Fix wording
Jonathan Druart [Tue, 6 Apr 2021 12:39:32 +0000 (14:39 +0200)]
Bug 27738: Fix wording

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 41ac4254257b96ba1742cf249fdab57fa2e2b9a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cfc8a25a3a8073c734b793cdac96439bb5d8abc4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code"
Phil Ringnalda [Sun, 21 Feb 2021 18:41:04 +0000 (10:41 -0800)]
Bug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code"

Current code intended to set a fallback of xxu, an unknown state in the US,
but because the preference is always defined, just sometimes unset, it
actually falls back to three spaces, an invalid value. This patch instead
uses the fallback value ||| which means no attempt to code.

Test plan:
1. Without the patch, verify that the value of the system preference
DefaultCountryField008 is empty.
2. Cataloging - New record - Default framework (if you have the Advanced
editor enabled, Settings - Switch to basic editor, this only applies to the
basic editor)
3. On tab 0, click in the text input for field 008 which fills in default
values, then click the Tag editor button at the end of the field
4. In the popup window, verify that the value for 15-17 is shown as ###
indicating three spaces
5. Apply patch, repeat the steps above, verify that the value is now |||

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d5e7d37d8a0427f50d31d922df89ba4b16e15c98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1837739bbd1aeb65e40a405a7ae674b9eb79792)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28074: Make current_search.offset an integer instead of string
Lucas Gass [Thu, 1 Apr 2021 22:51:07 +0000 (22:51 +0000)]
Bug 28074: Make current_search.offset an integer instead of string

To test:
1. Do a search with 3-4 results, go to the record and use the browse
   controls, when you get to the last record if you attempt to go to the
   'next' you'll end up on a page which says 'record not found.'
2. Do a search with exactly 10 results. Click on the first record, the
   'next' arrow is not a link, you cannot move to the next result.
3. Apply patch
4. Repeat steps 1-2 and the problems should be gone.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5787203a708429bfb746dfa16cfa6fee75a8714a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9e4388038350e2651dbc4aaa0c782503b83dc71c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27900: (QA follow-up) Rephrase link text
Katrin Fischer [Mon, 29 Mar 2021 18:17:37 +0000 (18:17 +0000)]
Bug 27900: (QA follow-up) Rephrase link text

See discussion on IRC from today :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8a6bb8c6cddbb5b9e7458d6c923f6818794528bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f960191c622144908b937b38ffa1ca6452c972ca)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27900: (QA follow-up) Add missing filter
Katrin Fischer [Mon, 29 Mar 2021 17:53:53 +0000 (17:53 +0000)]
Bug 27900: (QA follow-up) Add missing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6f9d888942b134458796bf9d8a389238492b915d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32dcf9c77e11402926600d27f87971e9c506c3a8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27900: Add a link back to the basket view if no result
Jonathan Druart [Thu, 11 Mar 2021 14:03:07 +0000 (15:03 +0100)]
Bug 27900: Add a link back to the basket view if no result

Since bug 24347 the neworderbiblio view has been removed and we now
display the usual search result.
When adding a new order from a search, if there is no result we should
let the user get back to the basket view.

Test plan:
Add to basket from an existing record
Do a search with no results and confirm that there is a new "Go to the
basket view" link

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 191184f28a5efd95994f42cafbe1e94ffff38475)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e2571bb7fc408468b27313b8aa842483c8dd5a88)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28004: Fix breadcrumbs on authorised_values.tt
Lucas Gass [Tue, 23 Mar 2021 23:08:51 +0000 (23:08 +0000)]
Bug 28004: Fix breadcrumbs on authorised_values.tt

To Test:
  - go to a category with at least one value, see the complete breadcrumb "Home › Administration › Authorized values › Authorized values for category" with link on the 3 first menus
  - create a new category / go to an empty category ; see the incomplete breadcrumb "Home › Administration › Authorized values" with link only on the 2 first menus
  - Apply patch
  - go to category with at least one value, breadcrumbs should look like Home › Administration › Authorized values › Authorized values for category CATEGORY
  - got to category with no values, breadcrumbs should look the same as category with values

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 62848497033c601ea928890f903acf32c72d08d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9a2c770c7e9d0020b787ecff8f81906ddd751d3b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text
Joonas Kylmälä [Wed, 17 Mar 2021 11:27:27 +0000 (13:27 +0200)]
Bug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text

The waiting reserves have always been impossible to checkout via
SIP2. There was some confusion whether this is actually true but if
you check the commit "Bug 25690: Remove duplicated logic in SIP2
checkouts" (338ba1d769) and the removed code around line

  $self->screen_msg("Item is on hold for another patron.");

you will be sure that it has been impossible to checkout waiting holds.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3aee4f4eca0a7dfbcb4704416f646dfaef39da70)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a7dc8aa2ecc89fa696faaa670aa935cd94fe3013)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28052: Do not check SYSENV values only keys in loop
Colin Campbell [Tue, 30 Mar 2021 11:13:27 +0000 (12:13 +0100)]
Bug 28052: Do not check SYSENV values only keys in loop

Loop is only interested in key values, because 'keys' is omitted
it is checking values as well. This can lead to misleading errors
being logged (e.g. key is undefined)
Extract keys only to loop array as in the other loops below this

Testing:
1 - tail /var/lib/koha/kohadev/sip-output.log
2 - in another tab use the sip cli tester:
   perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m checkin --item CHESS1
3 - Note errors:
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 1.
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 2.
4 - Apply patch and restart all the things
5 - Repeat 2
6 - Errors mentioned are gone

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cd40febe67b4d75e57311ff1673d0c34299b58fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0a7cf00d207369c3d46d2dc7078fe8e5574abeb2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27397: The description input field when defining numbering patterns is too short
Catherine Ma [Tue, 19 Jan 2021 02:26:54 +0000 (02:26 +0000)]
Bug 27397: The description input field when defining numbering patterns is too short

Test Plan:
1. go to the serials module
2. click on manage numbering patterns in the left hand navigation
3. add or edit a pattern
4. check the description field is as short as the name field, but can
take much more text
5. add patch
6. repeat steps 1-3
7. check the description field is larger than the name field (it should)

Sponsored by Catalyst IT

Works OK!

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 607d7f0a60d8c002dbac7ce22e7bcc128062f208)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 42db687f67885fd0858f5afb19af082f42c187a6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28042: Button corrections in OAI set mappings template
Owen Leonard [Fri, 26 Mar 2021 12:05:44 +0000 (12:05 +0000)]
Bug 28042: Button corrections in OAI set mappings template

This patch makes minor markup changes in the OAI set mappings template
so that the "Add" button looks consistent with other buttons in the
table.

Also changed: Removed unnecessary inline style attributes.

To test, apply the patch and go to Administration -> OAI sets
configuration

- If necessary, create an OAI set.
- Click the "Actions" button and choose "Define mappings."
- In the table of form fields, confirm that the "Add" button is styled
  similarly to the "Delete" button.
- Confirm that the "Add" button works as expected.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0053cc6c3e5a8a5791f96fbcd61a29f92d36fc61)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef75af5285523d2a59390c2ec56fd9eff9d27d68)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28032: Button corrections in point of sale pages
Owen Leonard [Thu, 25 Mar 2021 15:08:03 +0000 (15:08 +0000)]
Bug 28032: Button corrections in point of sale pages

This patch corrects some markup inconsistencies in some templates
related to point of sale:

- Point of sale -> Library details. The "btn-xs" class has been added to
  "Record cashup" and "Cashup all" buttons.
- Administration -> Debit types and Administration -> Credit types:
  - Font Awesome icons are removed from the "save" and "cancel" controls
    in order to keep them consistent with other templates.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d156d5a9fe3b30a0e65f70a5203a8a99bc30e651)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e94709dbb2a775fc424c6eb1236d4d72a02e97e6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28053: Squash warning in C4::Members
Martin Renvoize [Tue, 30 Mar 2021 11:15:22 +0000 (12:15 +0100)]
Bug 28053: Squash warning in C4::Members

This patch sets guarantess_non_issues_charges to '0' upon creation of
the variable and thus prevents 'Use of uninitialized value
$guarantees_non_issues_charges in numeric gt (>) at
/home/martin/kohaclone/C4/Members.pm line 183.' being thrown when the
patron has guaruntees without any charges.

Test plan
1. Run t/db_dependant/SIP/SIPServer.t and note the warning above is
   thrown at least once.
2. Apply the patch
3. Run the test again and note the warning has gone.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 297dbf4a5935931cdb8ebf6b9f00f60e291699df)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d448f7a8b97cfd1bf5717c0aadf7c2694feec0d1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27940: Fix missing email in OpacMaintenance page
Magnus Enger [Fri, 12 Mar 2021 10:28:02 +0000 (11:28 +0100)]
Bug 27940: Fix missing email in OpacMaintenance page

To reproduce:

KohaAdminEmailAddress = Some valid email address
OpacMaintenance = Show

OPAC/cgi-bin/koha/maintenance.pl shows this text:

"Koha online catalog is offline for system maintenance. We'll be back
soon! If you have any questions, please contact the site administrator."

"site administrator" is a link, but it only links to "mailto:", the
actual email address from KohaAdminEmailAddress is missing.

To test:
- Apply the patch
- Reload the maintenance page
- Click on the "site administrator" link and verify it contains the
  address from KohaAdminEmailAddress

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit df3a8d25482e10c748a52cb0a7e66ecf9b854364)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d31f22c89a9b845265a6f47f11e6f3be977aa036)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28054: Reinstate the shebang in SIPServer.pm
Colin Campbell [Tue, 30 Mar 2021 11:49:00 +0000 (12:49 +0100)]
Bug 28054: Reinstate the shebang in SIPServer.pm

Bug 26673 renoved the shebang from SIPServer.pm. This was an error
SIPServer.pm is a program not a perl module, and needs the shebang
for the OS to assign an interpreter unless the command line
calls it as an argument to perl. Restore the shebang

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dfe3753deeddb40610a27ccc48ad71110c2bb350)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9906197508c6ad54d2bec459066c76065093eac0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>