koha.git
3 years agoBug 28234: TestBuilder->build_sample_biblio should set UTF-8 encoding for record
Tomas Cohen Arazi [Tue, 27 Apr 2021 11:24:57 +0000 (08:24 -0300)]
Bug 28234: TestBuilder->build_sample_biblio should set UTF-8 encoding for record

This patch makes the build_sample_biblio method, correctly set the UTF-8
flag for the MARC::Record object.

Tests are added.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/TestBuilder.t
FAIL: Tests fail! An unexpected encoding warning shows
3. Apply this patch
4. Repeat 2
=> SUCCESS: No warning! Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 8fce3401e75604b36cf0aad2ccb4ce65941e0f55)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28234: Regression tests
Tomas Cohen Arazi [Tue, 27 Apr 2021 12:47:43 +0000 (09:47 -0300)]
Bug 28234: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 e5f43c686841f3d144eec98b314e84a8f44f9f4d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines'
Emmi Takkinen [Thu, 3 Dec 2020 08:41:47 +0000 (10:41 +0200)]
Bug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines'

Bug 23051 added option to skip calculating fines even when
"CalculateFinesOnReturn" is enabled. Due this Circulation.t
fails on  test  "AddRenewal left both fines" if
"CalculateFinesOnReturn"  is disabled on ones system.
Mocking syspref while testing fixes failig tests.

To test:
1. Disable "CalculateFinesOnReturn".
2. Run prove t/db_dependent/Circulation.t
=> Tests fail
3. Apply patch.
4. Run prove t/db_dependent/Circulation.t again
=> Tests are succesful

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 95cbefe12d5b5d901d545b602627224dfc2c7034)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28223: Add data elements to negative budgets
Nick Clemens [Mon, 26 Apr 2021 12:40:48 +0000 (12:40 +0000)]
Bug 28223: Add data elements to negative budgets

To test:
1 - Have a parent fund and a child fund
2 - Order an amount from the child fund that is greater than the amount available
3 - Browse to acquisitions
4 - Confirm the totals look right
5 - Click on the over spent fund to go to 'Funds for main budget'
6 - Note the totals are incorrect
7 - Apply patch
8 - Reload
9 - Totals are now correct

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 92f69a01936a361456b962f114e168c48539ee87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28144: Add a regression test
Jonathan Druart [Tue, 27 Apr 2021 13:04:35 +0000 (15:04 +0200)]
Bug 28144: Add a regression test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0140f1e626471c10b487c65e2db91766d31ac225)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
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>
3 years agoBug 28178: Display the correct image in the image viewer
Jonathan Druart [Mon, 19 Apr 2021 10:11:36 +0000 (12:11 +0200)]
Bug 28178: Display the correct image in the image viewer

When there are several images attached to a bibliographic record, one can click
an image and see it in the image viewer. But the first image is always displayed.

Test plan:
0. Turn on LocalCoverImages and AllowMultipleCovers
1. Attach at least two images to a bibliographic record
2. Go to the detail page, click the "Images" tab and click the second
image.
=> With this patch applied you should see the image you selected

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3dc9855b461a598487f2e7395a95f092f1f3e1c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
3 years agoBug 28193: (follow-up) Correct OpacLoginInstructions in login modal
Owen Leonard [Fri, 23 Apr 2021 00:21:30 +0000 (00:21 +0000)]
Bug 28193: (follow-up) Correct OpacLoginInstructions in login modal

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c45d15e231efd11d5f19f3a1186013daef19d300)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28193: OpacLoginInstructions news block broken by Bug 20168
Owen Leonard [Thu, 22 Apr 2021 14:33:25 +0000 (14:33 +0000)]
Bug 28193: OpacLoginInstructions news block broken by Bug 20168

This patch fixes a regression which was introduced by Bug 20168, causing
the OpacLoginInstructions template code to revert back to the old system
preference behavior. This patch returns the correct markup.

To test, apply the patch and view the OPAC login page
(/cgi-bin/koha/opac-user.pl)

 - With no news entry for OpacLoginInstructions you should see the
   default: A block of text with two headings, "Don't have a password
   yet?" and "Don't have a library card?"
 - Go to Tools -> News and create an entry for OpacLoginInstructions.
 - Return to the OPAC and confirm that your custom text appears.
 - Try updating/installing another translation and adding a different
   news entry for that language. Confirm that the correct entry appears.

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 ee4755c97404e464b8d9af6cd2f253201c1f21d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27566: Compiled CSS
Fridolin Somers [Thu, 29 Apr 2021 14:36:10 +0000 (16:36 +0200)]
Bug 27566: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27566: (follow-up) Add generic font family to prevent unstyled select tags
Owen Leonard [Wed, 7 Apr 2021 13:43:40 +0000 (13:43 +0000)]
Bug 27566: (follow-up) Add generic font family to prevent unstyled select tags

This correction fixes the previous patch which was dumb and stupid.

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.
 - Check that other areas of the OPAC are still styled with the correct
   "NotoSans" font. An error with this patch should be obvious when
   looking at a logged-in user's checkouts.

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 4cc224baa77b9879ee64691c8dec565a489f83f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
3 years agoBug 28190: Fix columns_settings.yml itemtypes entry
Tomas Cohen Arazi [Wed, 21 Apr 2021 19:05:35 +0000 (16:05 -0300)]
Bug 28190: Fix columns_settings.yml itemtypes entry

The parent_code column is missing on the columns_settings.yml file, so
columns are shifted and thus 'Library limitations' is not toggable.

To test:
1. Verify you are not offered the chance to hide the column
2. Apply this patch, restart all the things
=> SUCCESS: You can toggle the column
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 295d865b061e5502d07c1127ec7dcc79255e8361)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 14300: Add %P to SIP LogPattern
Martin Renvoize [Fri, 16 Apr 2021 10:03:11 +0000 (11:03 +0100)]
Bug 14300: Add %P to SIP LogPattern

This patch adds `%P` to the SIP log4perl configuration so that PID is
recorded against log lines.

This allows transactions to be more easily tied together under one
SIPServer, thus making it easier to pick out a whole transaction from
start to finish.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e07c9e9f0646352b25d36602e7b6dbb3e839c9c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 21883: Show authorized value description for withdrawn in check-in
Fridolin Somers [Thu, 4 Mar 2021 13:02:52 +0000 (14:02 +0100)]
Bug 21883: Show authorized value description for withdrawn in check-in

During check-in (circ/returns.pl) the withdrawn information may be
displayed in a message :
"Item is withdrawn".

Like Bug 21877 we should display the withdrawn authorized value description during check-in.

This patch adds this display.

Text changed in order to look maximum like in checkout :
https://git.koha-community.org/Koha-community/Koha/src/commit/a57278f39b8c5b7a82b21671f266dbf32e2d41a0/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt#L368
Uses class 'ci-withdrawn' to ease hidding this new information via CSS.

Test plan :
1) On a catalog with items.withdrawn defined with authorized values
   category WITHDRAWN
2) Define in WITHDRAWN an authorized values 1 with description
  'dropped in trash'
3) Define in WITHDRAWN an authorized values 2 with description
   empty
4) Check-out an item
5) Edit this item with withdrawn=1
6) Check-in this item => You see 'Item has been withdrawn (dropped
   in trash)'
7) Edit this item with withdrawn=2
8) Check-in this item => You see 'Item has been withdrawn'

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 596e59f2a91ac8f2756a7b83083f2bac606cd3bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 21883: Pass the item to the template
Martin Renvoize [Thu, 1 Oct 2020 12:40:41 +0000 (13:40 +0100)]
Bug 21883: Pass the item to the template

This patch update the controller to pass a full item object to the
template instead of a subset of item fields and updates the template to
utilise the object.

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 00dfcfcbe8c2f974dd3fe0939fcf8a8087c18dbd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27852: Link YES_NO authorized value category to 942dev in Default framework
Caroline Cyr La Rose [Wed, 3 Mar 2021 19:12:34 +0000 (14:12 -0500)]
Bug 27852: Link YES_NO authorized value category to 942dev in Default framework

This patch add the YES_NO authorised value category to
942dev in the Default framework and sets the default value
to 0 (No).

To test:
1) Load the yaml file
1) Load the yaml file
(I used the load_yaml.pl script after deleting the values from my database)
2) Go to cataloging and open an empty cataloging form
using the Default framework
2) Go to 942dev: the value should read No and there should
be a drop down choice between Yes and No

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 3ae4f91f3b60845751eb17d323fb1798a559823e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27830: Compiled CSS
Fridolin Somers [Thu, 29 Apr 2021 13:03:08 +0000 (15:03 +0200)]
Bug 27830: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27830: (follow-up) Merge DE and FR address formats
Owen Leonard [Wed, 14 Apr 2021 11:35:17 +0000 (11:35 +0000)]
Bug 27830: (follow-up) Merge DE and FR address formats

Library addresses don't include the use of "Street Type" and "Street
Number." DE and FR address formats differ only in the position of street
type and number in the address sequence.

This patch merges DE and FR address markup and uses the unified block if
the address format system preference ISN'T "us".

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 953088f8167c545318fe63d41912eda657cde705)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27830: OPAC library list does not use AddressFormat
Owen Leonard [Thu, 4 Mar 2021 13:57:32 +0000 (13:57 +0000)]
Bug 27830: OPAC library list does not use AddressFormat

This patch adds a new include file for displaying library addresses
according to the AddressFormat system preference. It differs from the
include file used for patrons in the staff interface because library
addresses don't use streetnumber or road types.

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).

- Make sure you have fill address information entered for at least one
  library.
- In the OPAC, view the "Libraries" page.
- Check that the format of the library addresses is correct when using
  any of the three address formats: de, fr, and us.

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 e1e309c62802100b2db1b2cdf2109c275be8da06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
3 years agoBug 20854: DBRev 20.12.00.034
Jonathan Druart [Wed, 21 Apr 2021 08:48:26 +0000 (08:48 +0000)]
Bug 20854: DBRev 20.12.00.034

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit da29bf48db6a5e5c383174962c7b81e6ea5bd5d4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
3 years agoBug 26940: DBRev 20.11.05.001
Jonathan Druart [Wed, 21 Apr 2021 08:48:25 +0000 (08:48 +0000)]
Bug 26940: DBRev 20.11.05.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit adf73341e6883a80323695a4e85a2fd37bf7f53e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
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>
3 years agoBug 27277: Queued vs Enqueued
James O'Keeffe [Wed, 14 Apr 2021 16:23:35 +0000 (16:23 +0000)]
Bug 27277: Queued vs Enqueued

Changed the other occurences of "Enqueued on", "Started on", and "Ended
on" to "Queued", "Started", and "Ended" (As pointed out by Jonathan).

Task Plan:
1. Navigate to th background jobs page
2. Ensure that the spelling of the changes are correct, and that there
   are no other instances of "Enqueued on", "Started on", and "Ended on"
   that have been missed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e62687a1df5e99b013b760353877a2f2be689871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27277: Queued Vs Enqueued
James O'Keeffe [Tue, 19 Jan 2021 02:07:41 +0000 (02:07 +0000)]
Bug 27277: Queued Vs Enqueued

This patch changes "Enqueued on", "Started on", and "Ended on" to
"Queued", "Started", and "Ended" respectively on the bacground jobs
page.

Task plan:
1. Navigate to the background jobs page
2. Ensure the spelling change, and that the spelling is correct.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit df71a27a667936ea5e2ef96f0a31b45179ce53c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28140: Accessibility: OPAC - "sort_by" select isn't labelled on search results...
Henry Bolshaw [Tue, 13 Apr 2021 10:49:09 +0000 (10:49 +0000)]
Bug 28140: Accessibility: OPAC - "sort_by" select isn't labelled on search results page

This patch adds a label to the sort function on the OPAC
results page to provide context to screen readers and improve
accessibility.

The label is visually hidden and does not change how the page
displays.

To test:
- Search for something on the OPAC
- Change how the results are sorted and confirm sort still works
- Confirm that there are no visual changes to the page
- Inspect the sort function to confirm it now has a label
- Ideally confirm the label works with a screenreader

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 d60439b96a708d28bd8612f99c279e69972811b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
3 years agoBug 27125: Show authority type also for UNIMARC in authority search result display
Fridolin Somers [Tue, 1 Dec 2020 13:28:24 +0000 (14:28 +0100)]
Bug 27125: Show authority type also for UNIMARC in authority search result display

Bug 12533 added authority type in authority search result display.
But it does not work for UNIMARC, due to :
https://git.koha-community.org/Koha-community/Koha/src/commit/be9f64b638335cac7465ca302e187c7914534fbe/C4/AuthoritiesMarc.pm#L798

I propose to use result->{authtype}

Test plan :
1) Use UNIMARC catalogue
2) Search for autorities
3) Check you see autority type in column
4) Same for a MARC21 catalogue

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
I followed the test plan, and the patch works as expected for both
UNIMARC and MARC21. There is actually an improvement in the MARC21 case:
previously, the 'Authority type' column for records in the Default
framework would not display anything, whereas now it displays 'Default'.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5a155973fbd0fc9cd422cf9e10b3f64c909b05eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 18017: Use index_heading and index_match_heading in UNIMARC authorities zebra...
Fridolin Somers [Tue, 22 Dec 2020 10:07:03 +0000 (11:07 +0100)]
Bug 18017: Use index_heading and index_match_heading in UNIMARC authorities zebra configuration

For a good management of autorities linking to biblio records,
MARC21 uses index_heading and index_match_heading in authorities zebra configuration.
UNIMARC configuration must use the same.

This patch adds in UNIMARC authorities zebra configuration index_heading and index_match_heading to earch heading
in order to be maximum close to MARC21 authorities zebra configuration.
See changes made in MARC21 :
https://git.koha-community.org/Koha-community/Koha/commit/32cf2af700dfea15d9c4f99bee97e97c85643896

It fixes some indexes names : Personal-name-see => Personal-name-see-from

Removes useless Term-geographic index, a duplicate of Name-geographic.

Sometimes parallel 7xx form whas only on $a, it must contains same subfields
has the main heading.

Test plan :
===========
1.0) Use a UNIMARC install without patch
1.1) Set sysprefs
     BiblioAddsAuthorities = ON
     AutoCreateAuthorities = ON
     LinkerModule = First Match
1.2) Replace authorities zebra configuration files
     cp $KOHA_CLONE/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml $KOHA_CONF_DIR/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml
     cp $KOHA_CLONE/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl $KOHA_CONF_DIR/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl
1.3) Restart zebra server and indexer services
1.4) Reindex authorities
     ./misc/migration_tools/rebuild_zebra.pl -r -a -v
1.5) Search in Z3950 a record with complex heading (with subdivisions),
     for example ISBN 2877620115 "Facteurs culturels et sociaux de la santé en Afrique de l'Oues"
1.6) Import this record and save it : authorities are created
     go to staff:/cgi-bin/koha/cataloguing/addbooks.pl
1.7) Reimport the same record (when asked, say that it's not a duplicate)
1.8) The authority should have been duplicated :
     different url and different $9 value
2.0) Apply this patch
2.1) Replace again the authorities zebra configuration files
2.2) Restart zebra server and indexer services
2.3) Reindex authorities
2.4) Reimport the same record
2.5) The authority should have not been duplicated. Compare with both
       existing records to see which the 3rd has been matched against.
3.0) Play with authorities search to check every mode :
     Search main heading ($a only)
     Search main heading
     Search all headings
     Search entire record

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb83da9b1d6578ef2c8c6b8e447283324f1e4435)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 18017: Add subdivisions to UNIMARC authorities zebra configuration
Fridolin Somers [Thu, 17 Dec 2020 14:47:48 +0000 (15:47 +0100)]
Bug 18017: Add subdivisions to UNIMARC authorities zebra configuration

Like for MARC21, UNIMARC authorities has subdivisions form, general,
chronological and geographic.

In C4::Heading::UNIMARC, use subdivisions in _get_search_heading like in C4::Heading::MARC21.

Adds subdivisions variables into UNIMARC authorities zebra configuration.

Note that unlike MARC21 geographic is subfield $y and chronological is subfield $z.
See https://www.ifla.org/publications/unimarc-formats-and-related-documentation

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb0f2793908b1b2f7da01c2b32a706508902a1b6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28125: Display a warning on the about page for OPACHiddenItems is needed
Jonathan Druart [Tue, 13 Apr 2021 08:47:19 +0000 (10:47 +0200)]
Bug 28125: Display a warning on the about page for OPACHiddenItems is needed

If OPACHiddenItems is containing badly construct it will lead to
inconsistent behaviours. For instance the holds view will not display
any items, when the detail page will display all of them (because we are
not using the same code, we are in transition to merge it).

This patch suggests to add a warning to the about page in case the query
generated by Koha::Items->filter_by_visible_in_opac produces a warning

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 28125: (QA follow-up) Fix missing filter

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 71574961f7322e04e996b11f9932b2006ea93215)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28139: Simplify logic for handling found holds in returns.pl
Joonas Kylmälä [Tue, 13 Apr 2021 08:34:55 +0000 (11:34 +0300)]
Bug 28139: Simplify logic for handling found holds in returns.pl

We are handling in this if-else block 3 cases:
 - Hold found and waiting
 - Hold found but not waiting AND whether HoldsAutoFill is enabled
 - Hold found but not waiting AND whether HoldsAutoFill disabled

If we simply first handle hold found = Waiting case first then we
don't have to individually list all those other found cases and that
simplifies this code a lot.

To test:
 1. Apply patch
 2. Make sure HoldsAutoFill is disabled
 3. Make item-level hold on branch A
 4. Check-in the item at branch A and you should get pop-up confirming
    the hold, ignore it
 5. Set HoldsAutoFill is enabled
 4. Check-in the item again and you now the hold should have been
    automatically filled

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 70239b355c6776065e20ed371f93483b110b7cda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 28139: Handle Processing status with HoldsAutoFill pref turned on
Joonas Kylmälä [Tue, 13 Apr 2021 08:22:16 +0000 (11:22 +0300)]
Bug 28139: Handle Processing status with HoldsAutoFill pref turned on

To test:
 1: Turn on HoldsAutoFill setting
 2: Place a item-level hold on item X at Branch A
 3: Make the hold to Processing state:
 $ koha-mysql kohadev
 > select * from reserves; # look up the reserve_id
 > UPDATE reserves SET found = 'P', priority = 0 WHERE reserve_id = XXX;
 4: Check in the item X at Branch A - A pop-up asking confirmation comes
 5: Apply patch & restart plack
 6: Check in the item X again at Branch A - now the hold is confirmed automatically

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 49da7cd462488e58572730da2ccd8dbf8aed839c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27695: Compiled CSS
Fridolin Somers [Thu, 29 Apr 2021 09:14:59 +0000 (11:14 +0200)]
Bug 27695: Compiled CSS

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>
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>
3 years agoBug 25476: Add ability to browse file uploads by category
David Cook [Thu, 14 May 2020 04:00:32 +0000 (04:00 +0000)]
Bug 25476: Add ability to browse file uploads by category

This patch adds the ability to search/browse files by category.
(Note it doesn't include temporary uploads since they don't have
 a "category" per se.)

Test Plan:
0) Apply patch
1) Go to /cgi-bin/koha/admin/authorised_values.pl
2) Create "UPLOAD" authorized value category
3) Create "test" authorized value in "UPLOAD" category
4) Go to /cgi-bin/koha/tools/upload.pl
5) Note "Search uploads by category" fieldset
6) Upload new file to "test" category
7) Click "Back"
8) Choose "test" category in "Search uploads by category"
9) Click "Search"
10) Note that your file upload is displayed in result list

Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com>
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 5f25235b9ea4838cf1a875b10f873dc68c00ba0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
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>
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>
3 years agoUpdate release notes for 20.11.05 release v20.11.05
Fridolin Somers [Mon, 26 Apr 2021 12:47:15 +0000 (14:47 +0200)]
Update release notes for 20.11.05 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoFix translations for Koha 20.11.05
Fridolin Somers [Tue, 23 Feb 2021 15:29:01 +0000 (16:29 +0100)]
Fix translations for Koha 20.11.05

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoMerge remote-tracking branch 'translate/20.11.05-translate-20210426' into 20.11.x
Fridolin Somers [Mon, 26 Apr 2021 12:32:25 +0000 (14:32 +0200)]
Merge remote-tracking branch 'translate/20.11.05-translate-20210426' into 20.11.x

3 years agoIncrement version for 20.11.05 release
Fridolin Somers [Mon, 26 Apr 2021 12:31:46 +0000 (14:31 +0200)]
Increment version for 20.11.05 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoTranslation updates for Koha 20.11.05
Koha translators [Mon, 26 Apr 2021 12:31:01 +0000 (09:31 -0300)]
Translation updates for Koha 20.11.05

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>
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>
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>
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>
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>
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>
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>
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>
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>
3 years agoBug 27961: Ensure external URLs are filtered
Aleisha Amohia [Mon, 15 Mar 2021 21:41:53 +0000 (10:41 +1300)]
Bug 27961: Ensure external URLs are filtered

TT variables are used to build the link in items.uri . This is a problem
particularly when TrackClicks is enabled because the items.uri value
doesn't get escaped, resulting in a 404.

To test:
1) Enable the TrackClicks system preference (set to Track or Track
    anonymously)
2) Find a record with an item
3) Edit the item and put an external URL under the Uniform Resource
Identifier field
4) Go to that record in the OPAC
5) Click on Link to resource
6) Confirm you are not redirected to the URL and instead see a 404
7) Apply the patch and refresh the page
8) Click on Link to resource
9) Confirm you are redirected as expected
10) Go back to the staff client to edit your item. This time put two
URLs in the Uniform Resource Identifier field, separated by ' | '.
(Don't forget the spaces around the pipe, and don't forget to add a
 trailing slash to the URL).
11) Go back to the OPAC and refresh the page.
12) Confirm both URLs redirect as expected.

Sponsored-by: Parliamentary Library New Zealand
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 4a5c946d95fabaa4fcea03e4c456b5ef6197ca44)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>
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>
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>
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>
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>
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>
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>
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>
3 years agoBug 27796: (QA follow-up) Missing filters
Nick Clemens [Thu, 15 Apr 2021 18:58:33 +0000 (18:58 +0000)]
Bug 27796: (QA follow-up) Missing filters

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d3683d873ad4cbc6a94cea2d4040675e2ddecd85)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27796: (QA follow-up) Fix for missing 'Account credit'
Martin Renvoize [Thu, 11 Mar 2021 15:03:18 +0000 (15:03 +0000)]
Bug 27796: (QA follow-up) Fix for missing 'Account credit'

Good catch Sally!  The data-member attribute was using an incorrect
parameter name to fetch the accountline borrowernumber data.

Signed-off-by: Kyle M Hall <kyle@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 1dd6e0bd30cf3e9570adcea112ba65cb6f69b608)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27796: Centralise payment/transaction type handling
Martin Renvoize [Thu, 25 Feb 2021 17:28:33 +0000 (17:28 +0000)]
Bug 27796: Centralise payment/transaction type handling

This patch centralises the payment/transaction type select options
handling so the SIP types are properly in all cases.

Test plan
1) Check that SIP payment types are properly hidden on the following
   modals.
1a) Refund modal on the borrower account page (The 'Account credit'
option should appear here)
1b) Payout modal on borrower account page
1c) Payment via paycollect
1d) Payment via point of sale
1e) Refund via point of sale, register details page (The 'Account
credit' option should only appear for debts associated to a patron and
not for payments accepted via point of sale)
2) Signoff

Signed-off-by: Kyle M Hall <kyle@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 89cea3d7a791be8f160e492d664b0bfd2bd8d496)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
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>