koha.git
2 years agoBug 27631: (follow-up) Some minor corrections
Owen Leonard [Thu, 30 Sep 2021 15:57:32 +0000 (15:57 +0000)]
Bug 27631: (follow-up) Some minor corrections

This patch makes some corrections to issues found during testing:

Some duplicate headings, a markup error in labeledMARCdetail.tt, a
change of the transfers heading from "Branch transfers" to "Item
transfers."

This patch also undoes the changes to the position of the toolbar on
several pages. I think those changes don't belong in this bug.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: (follow-up) circ/branchtransfers.tt
Wainui Witika-Park [Wed, 2 Jun 2021 08:44:35 +0000 (08:44 +0000)]
Bug 27631: (follow-up) circ/branchtransfers.tt

Changed file to have one <h1> tag showing that describes the page,
rather than the <h1> around the logo.

The hierarchy of other heading tags may be wrong, but this will be
dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to circ/branchtransfers and check that it has an obvious and
   descriptive heading
4) Ensure that the heading is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: (follow-up) reports/guided_reports_start.tt
Wainui Witika-Park [Tue, 1 Jun 2021 04:40:40 +0000 (04:40 +0000)]
Bug 27631: (follow-up) reports/guided_reports_start.tt

Changed file to have one <h1> tag showing that describes the page,
rather than the <h1> around the logo.

The hierarchy of other heading tags may be wrong, but this wil be dealt
with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to reports/guided_reports_start and check that it has an obvious
   and descriptive heading
4) Ensure that the heading is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: (follow-up) tools/marc_modification_templates.tt
Wainui Witika-Park [Fri, 28 May 2021 03:33:22 +0000 (03:33 +0000)]
Bug 27631: (follow-up) tools/marc_modification_templates.tt

Changed file to have one <h1> tag showing that describes the page,
rather than the <h1> around the logo.

The hierarchy of other heading tags may be wrong, but this will be
dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to tools/marc_modification_templates and check that it has an
   obvious and descriptive heading
4) Ensure that the heading is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: (follow-up) course_reserves/course-details.tt
Wainui Witika-Park [Mon, 24 May 2021 15:08:11 +0000 (15:08 +0000)]
Bug 27631: (follow-up) course_reserves/course-details.tt

Changed file to have one <h1> tag showing that describes the page,
rather than the <h1> around the logo.

The hierarchy of other heading tags may be wrong, but this will be
dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to course_reserves/course-details and check that it has an obvious
   and descriptive heading
4) Ensure that the heading is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: admin folder
Wainui Witika-Park [Mon, 19 Apr 2021 05:31:07 +0000 (05:31 +0000)]
Bug 27631: admin folder

Changed each of the pages in the admin folder to have one <h1> tag
showing that describes the page, rather than the <h1> describing the
logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the admin folder and check that they have
   an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: Hidden <h1> on intranet-main.tt
Wainui Witika-Park [Wed, 14 Apr 2021 02:58:19 +0000 (02:58 +0000)]
Bug 27631: Hidden <h1> on intranet-main.tt

This patch visually hides a <h1> on intranet-main.tt so that the
heading is available to be read out by screenreaders in the summary of
headings on the page.

Test plan:

1) Ensure the <h1> "Koha home" heading on the staff client main/home
   page is hidden visually, but in the source code you can see it

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: acqui folder
Wainui Witika-Park [Mon, 5 Apr 2021 21:50:20 +0000 (21:50 +0000)]
Bug 27631: acqui folder

Changed each of the pages in the acqui folder to have one <h1> tag
showing that describes the page, rather than the <h1> describing the
logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the acqui folder and check that they have
   an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: cataloguing folder
Wainui Witika-Park [Tue, 13 Apr 2021 22:41:11 +0000 (22:41 +0000)]
Bug 27631: cataloguing folder

Changed each of the pages in the cataloguing folder to have one <h1>
tag showing that describes the page, rather than the <h1> describing the
logo.

The hierarchy of heading tags may be broken in many pages, but this will
be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the cataloguing folder and check that they
   have an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: reports and serials folders
Wainui Witika-Park [Mon, 5 Apr 2021 09:34:34 +0000 (09:34 +0000)]
Bug 27631: reports and serials folders

Changed each of the pages in the reports and serials folders to
have one <h1> tag showing that describes the page, rather than the <h1>
describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the reports and serials folders and
   check that they have an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: tools and virtualshelves folders
Wainui Witika-Park [Mon, 5 Apr 2021 09:46:17 +0000 (09:46 +0000)]
Bug 27631: tools and virtualshelves folders

Changed each of the pages in the tools and virtualshelves folders to
have one <h1> tag showing that describes the page, rather than the <h1>
describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the tools and virtualshelves folders and
   check that they have an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: catalogue and tags folders
Wainui Witika-Park [Wed, 7 Apr 2021 01:23:49 +0000 (01:23 +0000)]
Bug 27631: catalogue and tags folders

Changed each of the pages in the catalogue and tags folders to have one
<h1> tag showing that describes the page, rather than the <h1>
describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the catalogue and tags folders and check
   that they have an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: offline_circ, patroncards, plugins, pos, reserve, rotating_collections...
Wainui Witika-Park [Mon, 5 Apr 2021 09:30:06 +0000 (09:30 +0000)]
Bug 27631: offline_circ, patroncards, plugins, pos, reserve, rotating_collections folders

Changed each of the pages in the offline_circ, patroncards, plugins,
pos, reserve, rotating_collections folders to have one <h1> tag showing
that describes the page, rather than the <h1> describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the offline_circ, patroncards, plugins,
   pos, reserve, rotating_collections folders and check that they have
   an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: installer and onboarding folders
Wainui Witika-Park [Wed, 7 Apr 2021 01:24:13 +0000 (01:24 +0000)]
Bug 27631: installer and onboarding folders

Changed each of the pages in the installer and onboarding folders to
have one <h1> tag showing that describes the page, rather than the <h1>
describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Ensure that the page source shows logo inside <div> and not inside
   <h1>
4) Go to each of the pages in the installer and onboarding folders and
   check that they have an obvious and descriptive heading
5) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: authorities, clubs, common, course_reserves folders
Wainui Witika-Park [Mon, 5 Apr 2021 08:52:33 +0000 (08:52 +0000)]
Bug 27631: authorities, clubs, common, course_reserves folders

Changed each of the pages in the authorities, clubs, common,
course_reserves folders to have one <h1> tag showing that describes
the page, rather than the <h1> describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the authorities, clubs, common,
   course_reserves folders and check that they have an obvious and
   descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: labels and members folders
Wainui Witika-Park [Mon, 19 Apr 2021 05:51:05 +0000 (05:51 +0000)]
Bug 27631: labels and members folders

Changed each of the pages in the labels and members folders to have one
<h1> tag showing that describes the page, rather than the <h1>
describing the logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the labels and members folders and check
   that they have an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: circ folder
Wainui Witika-Park [Mon, 19 Apr 2021 05:35:46 +0000 (05:35 +0000)]
Bug 27631: circ folder

Changed each of the pages in the circ folder to have one <h1> tag
showing that describes the page, rather than the <h1> describing the
logo.

The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.

To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the circ folder and check that they have
   an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27631: Changed <h1> around logo to <div>
Wainui Witika-Park [Mon, 19 Apr 2021 05:22:08 +0000 (05:22 +0000)]
Bug 27631: Changed <h1> around logo to <div>

To test:
1) Look at Staff Client and the logo
2) Apply patch
3) Check Koha logo moves to the middle of the page when zooming in
4) Ensure page source shows logo inside <div> and not <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 25815: SIP Checkout: add more information on why the patron is blocked.
Matthias Meusburger [Thu, 17 Oct 2019 08:32:18 +0000 (10:32 +0200)]
Bug 25815: SIP Checkout: add more information on why the patron is blocked.

Currently, on SIP checkout, Koha only returns "Patron Blocked" when there is
a problem with the patron.

This patch adds more specific informations, with the following messages:

 - "Patron expired"
 - "Patron debarred"
 - "Patron has fines" (see system preference "noissuescharge")
 - "Patron blocked" (see system preference "OverduesBlockCirc")

Test plan:

 - Try to do a SIP checkout with a patron that is in one of the above situations.
 - Check that the displayed message matches the patron's situation.

Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30223: Move book cover image upload JS to a separate file
Owen Leonard [Wed, 2 Mar 2022 16:12:05 +0000 (16:12 +0000)]
Bug 30223: Move book cover image upload JS to a separate file

This patch moves most of the JavaScript from upload-images.tt into a
separate file, upload-images.js. Functionality should be unchanged.

To test, apply the patch and go to Tools  -> Upload local cover image.

Test all the things:
 - Drag-and-drop upload
 - Click-to-browse upload;
 - Deleting existing images
 - Uploading a zip file

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30509: Fix configuration of Notices accordion widget
Owen Leonard [Mon, 11 Apr 2022 17:04:34 +0000 (17:04 +0000)]
Bug 30509: Fix configuration of Notices accordion widget

The jQueryUI upgrade broke the Accordion on the notices edit page. I'm
not sure why, but defining a "header" option in the accordion
configuration fixes it.

To test, apply the patch and test the notices edit page both with and
without TranslateNotices and multiple languages installed. In both cases
the different sections (Email, Print, SMS) should open and close
correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30540: Fix perl critic complaint of leading zeros
Nick Clemens [Thu, 14 Apr 2022 10:51:18 +0000 (10:51 +0000)]
Bug 30540: Fix perl critic complaint of leading zeros

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30540: eval on set_time_zone
Martin Renvoize [Thu, 14 Apr 2022 08:14:47 +0000 (09:14 +0100)]
Bug 30540: eval on set_time_zone

This patch adds an eval around the call to set_time_zone so that we
don't crash on invalid local dates and instead just keep the passed
floating timezone.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30540: Unit test
Martin Renvoize [Thu, 14 Apr 2022 09:19:47 +0000 (10:19 +0100)]
Bug 30540: Unit test

This patch adds tests for checking the output_pref method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/DateUtils.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29483: Further improve performance of script
Nick Clemens [Fri, 19 Nov 2021 16:13:49 +0000 (16:13 +0000)]
Bug 29483: Further improve performance of script

This patch adds a few tests to cover more cases, and to highlight current functionality.

The script only allows renewal if all outstanding holds can be filled by available items.
This means we can return as soon as we have determined that not all holds can be filled.

I add FIXME and some explanatory comments - I will file a follow-up bug for those, but
I feel we can accept these improvements to the performance and deal with the issues
of how it 'should' work versus how it does work on another report.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29483: Check ItemsAnyAvailableAndNotRestricted once per patron
Nick Clemens [Mon, 15 Nov 2021 13:54:00 +0000 (13:54 +0000)]
Bug 29483: Check ItemsAnyAvailableAndNotRestricted once per patron

ItemsAnyAvailableAndNotRestricted can take a long time and create nested loops.
We can check it once per patron, however, this requires us to flip the loops.
Since an item can only be used once, we now add a check to see if this item has already
been assigned to a borrower.

To test:
1 - Find or create a biblio with 100 items
2 - Place ten 'Next available' holds on a biblio
3 - Set preference 'AllowRenewalIfOtherItemsAvailable' to 'Allow'
    Set circ rules 'On shelf holds allowed' to 'If any unavailable'
4 - Checkout one of the items to a patron, backdated to be overdue
5 - Note a long loading time for the patron's checkouts
6 - Apply patch, restart_all
7 - Patron loads much faster

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29483: Unit tests
Nick Clemens [Thu, 18 Nov 2021 16:11:24 +0000 (16:11 +0000)]
Bug 29483: Unit tests

This patch updates the AllowRenewalIfOtherItemsAvailable tests to
remove deletion of all data, and create specific circ rules for this
test. It adjust several other tests that were relying on the rules from
this test, so thy too create their opwn specific rules.

Additionally, we add tests to cover the case of mutliple items on the record,
and some items cannot fill some reserves.

What is uncovered here is that the same patron is checked twice, so two holds can
be filled, but they only satisfy a single patron

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29602: (follow-up) fix duplicate, missing or mismatching <span>
Victor Grousset/tuxayo [Sat, 5 Feb 2022 20:43:04 +0000 (21:43 +0100)]
Bug 29602: (follow-up) fix duplicate, missing or mismatching <span>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29602: (follow-up) fix crash: SET KohaSpan => USE KohaSpan
Victor Grousset/tuxayo [Fri, 4 Feb 2022 23:21:26 +0000 (00:21 +0100)]
Bug 29602: (follow-up) fix crash: SET KohaSpan => USE KohaSpan

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29602: (follow-up) Fix TT tags broken due to missing %
Victor Grousset/tuxayo [Fri, 4 Feb 2022 22:38:13 +0000 (23:38 +0100)]
Bug 29602: (follow-up) Fix TT tags broken due to missing %

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29602: (follow-up) Surround strings with span tag
Fridolin Somers [Wed, 15 Dec 2021 07:46:43 +0000 (21:46 -1000)]
Bug 29602: (follow-up) Surround strings with span tag

To be nicer with translators.

Update the PO files for whichever languages will show how this is useful.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29602: Surround strings with span tag
Jonathan Druart [Tue, 30 Nov 2021 13:54:15 +0000 (14:54 +0100)]
Bug 29602: Surround strings with span tag

To be nicer with translators.

Update the PO files for whichever languages will show how this is
useful.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30435: Remove unused MACLES cataloging plugin
Owen Leonard [Fri, 1 Apr 2022 15:20:47 +0000 (15:20 +0000)]
Bug 30435: Remove unused MACLES cataloging plugin

This patch removes the files associated with the MACLES cataloging
plugin. The feature is unmaintained.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30518: Correct DateTime maths for needs_advancing
Martin Renvoize [Wed, 13 Apr 2022 07:24:22 +0000 (08:24 +0100)]
Bug 30518: Correct DateTime maths for needs_advancing

The needs_advancing method prior to this patch used basic DateTime
arithmatic, adding a DateTime::Duration in Days to the Arrival date of
the item and then comparing that to today. This, however, can cause bugs
when the arrival + duration date coincides with a DST boundary and as
such may result in an invalid local date.  See
https://metacpan.org/pod/DateTime#Making-Things-Simple for further
details.

This patch updates the code to use the DST safe delta_days method to
count the days between arrival and now instead and then compares this
integer to the defined duration of the stage.

To test:
1. Re-run the unit tests, they should now pass.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30518: Unit test
Martin Renvoize [Wed, 13 Apr 2022 07:52:02 +0000 (08:52 +0100)]
Bug 30518: Unit test

This patch adds tests for checking the needs_advancing method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/db_dependent/StockRotationItems.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30488: Fix error when placing recall via OPAC
Aleisha Amohia [Thu, 7 Apr 2022 22:17:18 +0000 (22:17 +0000)]
Bug 30488: Fix error when placing recall via OPAC

This error occurs due to how UpdateStats is called in Koha/Recalls.pm

To test:
1) Enable the UseRecalls system preference and set some random values in
the recalls circulation and fines rules.
2) Find or create an item. Check this item out to Patron A.
3) Log in to the OPAC as Patron B.
4) Find the item you checked out to Patron A. Click the button to place
a recall.
5) Fill out whatever details you like. Click the Submit button. This
should trigger the error.
6) Apply the patch and refresh the page.
7) Confirm the recall has now been requested successfully.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30410: (follow-up) Instantiate object in unit test
Martin Renvoize [Tue, 19 Apr 2022 07:30:56 +0000 (08:30 +0100)]
Bug 30410: (follow-up) Instantiate object in unit test

This patch updates the unit test for the BackgroundJob->_derived_class()
private method to instantiate a proper object to work on instead of
calling the type_to_class_mapping method directly as non-object method.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30135: (follow-up) Rename accessor in failing test
Martin Renvoize [Thu, 14 Apr 2022 09:44:36 +0000 (10:44 +0100)]
Bug 30135: (follow-up) Rename accessor in failing test

We renamed the LSQ seqment accessor from 'collection_code' to
'sequenece_code' to more clearly reflect the EDI segment name instead of
the Koha field we had mapped it to. (Especially as that mapping is not
optionally to ccode or location).

However, I forgot to update the corresponding test. This patch does that
update.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 29810: Fix patron embed definitions
Tomas Cohen Arazi [Wed, 13 Apr 2022 20:11:27 +0000 (17:11 -0300)]
Bug 29810: Fix patron embed definitions

Due to a race and a bad rebase, the patrons embeds added on bug 30063
didn't get copied to the parameters secition, thus breaking embedding.

To test:
1. In master, open the patron search page and the inspector
2. Perform a search
=> FAIL: No results
=> FAIL: There's an error 500 in the API response, mentioning embedding
is not allowed
3. Apply this patch
4. Restart all
6. Repeat 2
=> SUCCESS: Results are back!
=> SUCCESS: No more API errors
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30410: (QA follow-up) Only fetch plugins mapping once
Kyle Hall [Mon, 11 Apr 2022 17:02:26 +0000 (13:02 -0400)]
Bug 30410: (QA follow-up) Only fetch plugins mapping once

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30410: (QA follow-up) Pluralise new methods, fix minor issues with language
Kyle Hall [Mon, 11 Apr 2022 14:33:24 +0000 (10:33 -0400)]
Bug 30410: (QA follow-up) Pluralise new methods, fix minor issues with language

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30410: Add a way for plugins to expose tasks they implement
Tomas Cohen Arazi [Thu, 31 Mar 2022 15:33:21 +0000 (17:33 +0200)]
Bug 30410: Add a way for plugins to expose tasks they implement

This patch implements a mechanism for plugins to tell Koha they
implement background jobs, by returning a mapping

```
    task => class
```

* _task_ is a string that will be used when queueing new tasks, to let
  the workers know which class to instantiate to launch the job (a.k.a.
  process).

* _class_ is a string for a class name.

For this to  work, plugins need to include the 'namespace' attribute in
their metadata. If they don't, they will be skipped when listing the
valid _background jobs_.

After this, high-level methods for letting plugins (easily) enqueue
their tasks will be provided.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30410: Unit tests
Tomas Cohen Arazi [Thu, 31 Mar 2022 15:32:40 +0000 (17:32 +0200)]
Bug 30410: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: DBRev 21.12.00.033
Fridolin Somers [Wed, 13 Apr 2022 13:01:13 +0000 (15:01 +0200)]
Bug 27783: DBRev 21.12.00.033

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: DBIC update
Tomas Cohen Arazi [Mon, 4 Apr 2022 17:50:57 +0000 (19:50 +0200)]
Bug 27783: DBIC update

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: (follow-up) Rename options
Martin Renvoize [Mon, 11 Apr 2022 15:10:49 +0000 (16:10 +0100)]
Bug 27783: (follow-up) Rename options

Why require `job_`.. it's easiery to just use 'queue' and we have 'job'
from the context of the script we're calling.  This also inproves
consistency between the debian commands and the script params.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: (QA follow-up) Make dbrev executable
Kyle M Hall [Mon, 11 Apr 2022 14:09:24 +0000 (14:09 +0000)]
Bug 27783: (QA follow-up) Make dbrev executable

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: Add queue handling in packaging tools
Tomas Cohen Arazi [Mon, 4 Apr 2022 18:23:09 +0000 (20:23 +0200)]
Bug 27783: Add queue handling in packaging tools

This patch adds queue name handling in is_worker_running and a handy
method to centralize process name handling for queue-specific workers.

To test:
1. Apply this patch
2. Run:
   $ source debian/scripts/koha-functions.sh
   $ get_worker_name kohadev
   kohadev-koha-worker
=> SUCCESS: Default queue means no queue name included
   $ get_worker_name kohadev default
   kohadev-koha-worker
=> SUCCESS: Default queue means no queue name included
   $ get_worker_name kohadev long_tasks
   kohadev-koha-worker-long_tasks
=> SUCCESS: Queue name appended to the name
4. Run:
   $ perl misc4dev/cp_debian_files.pl \
              --koha_dir /kohadevbox/koha \
              --gitify /kohadevbox/gitify \
              --instance kohadev
5. Run:
   $ koha-worker --start --queue oleonard kohadev
=> SUCCESS: Starts!
6. Check:
   $ ps waux | grep oleonard
=> SUCCESS: It is running
7. Play with --stop, --restart, --status and different queue names,
   including 'default' and without the --queue param as well.
=> SUCCESS: All as expected!
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: (QA follow-up) Make dbrev idempotent
Tomas Cohen Arazi [Sat, 2 Apr 2022 10:58:25 +0000 (12:58 +0200)]
Bug 27783: (QA follow-up) Make dbrev idempotent

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: Rename queues and adjust currently defined jobs
Tomas Cohen Arazi [Fri, 1 Apr 2022 11:56:09 +0000 (13:56 +0200)]
Bug 27783: Rename queues and adjust currently defined jobs

This patch renames the queues so the default is the **real-time** one, and
the other (*long_tasks*) is kept for **long running** tasks.

All current *batch* tasks are explicitly assigned to the **long_tasks**
queue as well.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: (follow-up) Add DB change to installer
Martin Renvoize [Wed, 30 Mar 2022 15:29:17 +0000 (16:29 +0100)]
Bug 27783: (follow-up) Add DB change to installer

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: Add missing atomicupdate file
Julian Maurice [Wed, 30 Mar 2022 14:42:55 +0000 (16:42 +0200)]
Bug 27783: Add missing atomicupdate file

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: Replace --job-type by --queue
Julian Maurice [Wed, 30 Mar 2022 12:21:50 +0000 (14:21 +0200)]
Bug 27783: Replace --job-type by --queue

This patch adds a new column background_jobs.queue, which default to
'default'
By default, new jobs are enqueued into this default queue, and the
background job worker will subscribe to the default queue unless told
otherwise by the --job-queue option

The new job UpdateElasticIndex is automatically enqueued in another
queue named 'index'
So you can have 'default' worker with
    misc/background_jobs_worker.pl
and a dedicated indexing worker with
    misc/background_jobs_worker.pl --queue index

This is to address bug 27344 comment #15

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27783: Add --job-type to background_jobs_worker.pl
Jonathan Druart [Fri, 1 Apr 2022 10:10:05 +0000 (12:10 +0200)]
Bug 27783: Add --job-type to background_jobs_worker.pl

This will let sysop adjust the number of workers and how they want to
manage them.
For instance one could want to have one worker for ES indexation and
another worker for other jobs, to prevent ES index to be stuck behind
bigger batch process.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29946: Sort Marc profiles alphabetically
Lucas Gass [Tue, 25 Jan 2022 18:46:44 +0000 (18:46 +0000)]
Bug 29946: Sort Marc profiles alphabetically

To test:
1- Go to Tools > Stage MARC records for import
2- You'll need a MARC file, choose one and hit 'Upload file'
3- Create many Profiles with different names. Add some that include accents/diacritics.
4- Notice that the profiles sort in the order in which you create them
5- Apply patch
6- Try steps 1-2 again
7- Now the dropdown should be sorted alphabetically
8- Make a few more profiles and make sure they are being inserted in the right order alphabetically, including the profiles containing accents/diacritics.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30498: DBRev 21.12.00.032
Fridolin Somers [Wed, 13 Apr 2022 12:47:40 +0000 (14:47 +0200)]
Bug 30498: DBRev 21.12.00.032

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30498: Corresponding DBIx change for SearchField
Marcel de Rooy [Fri, 8 Apr 2022 09:37:59 +0000 (09:37 +0000)]
Bug 30498: Corresponding DBIx change for SearchField

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30498: Fix enum search_field.type
Marcel de Rooy [Fri, 8 Apr 2022 09:19:31 +0000 (09:19 +0000)]
Bug 30498: Fix enum search_field.type

Resolves sync issue with upgrades.

Test plan:
Run dbrev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30481: DBRev 21.12.00.031
Fridolin Somers [Wed, 13 Apr 2022 12:43:07 +0000 (14:43 +0200)]
Bug 30481: DBRev 21.12.00.031

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30481: Drop unique constraint deleteditemsstocknumberidx
Marcel de Rooy [Thu, 7 Apr 2022 11:59:53 +0000 (11:59 +0000)]
Bug 30481: Drop unique constraint deleteditemsstocknumberidx

Resolves a sync issue between database and schema caused by
differences between structure and upgrades. Note: newer
databases do not contain this index any longer.

Test plan:
Run dbrev.
Check SHOW CREATE TABLE deleteditems.
Verify that unique index has been dropped, regular index added.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30376: Fix missing mandatory date acquired error on item save
Jonathan Druart [Wed, 6 Apr 2022 15:00:36 +0000 (17:00 +0200)]
Bug 30376: Fix missing mandatory date acquired error on item save

Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30142: Remove spaces from ElasticSearch mapping MARC fields
Thomas Klausner [Mon, 21 Feb 2022 11:35:15 +0000 (12:35 +0100)]
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields

A first step to "validate" the MARC mappings: Remove all whitespace, so
if a user enters "245a " (with a trailing whitespace, which can easily
happen when copy/pasting) we only store "245a" in the DB. This is
neccessary, because the ES indexer will throw an exception in an invalid
MARC mapping.

Test Plan:
* Go to /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
* Go to the Bibliographic Records Tab
* Enter "100 a b c " (notice the whitespaces!) in the first "mapping"
  field
* Scroll down and save
* Go back to the Bibliographic Records Tab
* The spaces are still there

Now apply the patch

* Repeat the above steps
* After saving you should see "100abc" without any spaces in the
  "mapping" field

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30485: (bug 30063 follow-up) Display all patrons if not term passed
Jonathan Druart [Thu, 7 Apr 2022 12:25:08 +0000 (14:25 +0200)]
Bug 30485: (bug 30063 follow-up) Display all patrons if not term passed

Regression from bug 30063. If you are searching all patrons (not search term passed) from the header, the patron search result is not displayed.

Test plan:
Go to the Koha homepage, search patrons, don't enter a search term and
click "submit"
All patrons must be returned.
Regression test: on the other patron search forms, confirm that there is
no regression, ie. no patron displayed until you search for something

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30476: Remove NORMARC translation files
Bernardo Gonzalez Kriegel [Wed, 6 Apr 2022 17:53:54 +0000 (14:53 -0300)]
Bug 30476: Remove NORMARC translation files

This patch just deletes translation files left behind when removing
support for NORMARC.

To test:
1) Apply the patch
2) Verify there are no more *-marc-NORMARC.po files
   on misc/translator/po/ dir

No consequences are expected.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30135: DBRev 21.12.00.030
Fridolin Somers [Wed, 13 Apr 2022 11:48:16 +0000 (13:48 +0200)]
Bug 30135: DBRev 21.12.00.030

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30135: (QA follow-up) Fix typo in sysprefs.sql
Fridolin Somers [Wed, 13 Apr 2022 13:11:16 +0000 (15:11 +0200)]
Bug 30135: (QA follow-up) Fix typo in sysprefs.sql

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30135: (QA follow-up) Fix typo in update
Nick Clemens [Thu, 31 Mar 2022 11:17:11 +0000 (11:17 +0000)]
Bug 30135: (QA follow-up) Fix typo in update

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30135: (follow-up) Rephrase system preference description to use collection
Katrin Fischer [Sat, 26 Feb 2022 19:24:55 +0000 (19:24 +0000)]
Bug 30135: (follow-up) Rephrase system preference description to use collection

Avoids ccode in favor of collection in the system preference
description. Also makes it a tiny bit easier to translate.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30135: Unit tests
Martin Renvoize [Mon, 21 Feb 2022 17:02:42 +0000 (17:02 +0000)]
Bug 30135: Unit tests

Add a unit test for EdifactLSQ preference.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30135: Add EdifactLSQ mapping preference
Martin Renvoize [Fri, 18 Feb 2022 17:15:11 +0000 (17:15 +0000)]
Bug 30135: Add EdifactLSQ mapping preference

This patch adds a new system preference, EdifactLSQ, to allow
configuration of the ambiguous LSQ, sequence code, field included in the
EDIFACT specifications.

Originally the field was hard coded to map to 'location', but as per the
specification it could have been mapped to 'ccode'.

From the specification:

A code or other designation which identifies stock which is to be
shelved in a specified sequence or collection.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: Add DBRev 21.12.00.029
Fridolin Somers [Wed, 13 Apr 2022 11:40:32 +0000 (13:40 +0200)]
Bug 30130: Add DBRev 21.12.00.029

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: (QA follow-up) Fix tests
Nick Clemens [Tue, 29 Mar 2022 11:48:11 +0000 (11:48 +0000)]
Bug 30130: (QA follow-up) Fix tests

Result was copied and pasted, needed to update check

Was passing objetc instead of standard field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: (QA follow-up) Fix permission on atomic update file
Katrin Fischer [Mon, 21 Feb 2022 21:54:31 +0000 (21:54 +0000)]
Bug 30130: (QA follow-up) Fix permission on atomic update file

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: Unit tests
Martin Renvoize [Mon, 21 Feb 2022 16:21:48 +0000 (16:21 +0000)]
Bug 30130: Unit tests

This patch adds a unit test for the internal 'beginning_of_message'
method in Koha::Edifact::Order to check that the vendor standard
parameter is being interpreted coorectly.

Test plan
1. Run the tests, they should pass

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: (follow-up) Set BiC for 'Ulverscroft'
Martin Renvoize [Fri, 18 Feb 2022 14:38:40 +0000 (14:38 +0000)]
Bug 30130: (follow-up) Set BiC for 'Ulverscroft'

The 'Ulverscroft' supplier is also a BiC follower, this patch adds their
SAN, 5013546031839, to the DB update.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: Use new standard field in account definition
Martin Renvoize [Mon, 21 Feb 2022 16:25:24 +0000 (16:25 +0000)]
Bug 30130: Use new standard field in account definition

This patch uses the new 'standard' field to in the edifact account
configuration area to allow setting the message standard as either
'EDItEUR' or 'BiC'.

This just replaces the currently hard coded hash of SAN's in
Koha::Edifact::Order to distinguish between the two standards instead of
requireing a bug submission per vender san we identify to be a BiC type
vendor.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: DBIC Update
Martin Renvoize [Mon, 21 Feb 2022 16:25:53 +0000 (16:25 +0000)]
Bug 30130: DBIC Update

This patch updates the DBIC schema's with the new 'standard' field.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30130: Add standard field to edi_account
Martin Renvoize [Mon, 21 Feb 2022 16:25:44 +0000 (16:25 +0000)]
Bug 30130: Add standard field to edi_account

This patch add a 'standard' field to the edifact account configuration
table to allow setting the message standard as either 'EDItEUR' or 'BiC'.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: Add DBRev 21.12.00.028
Fridolin Somers [Wed, 13 Apr 2022 11:28:46 +0000 (13:28 +0200)]
Bug 16258: Add DBRev 21.12.00.028

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Add note of disbaled EDIFACT to EDI accounts page
Nick Clemens [Tue, 29 Mar 2022 11:35:42 +0000 (11:35 +0000)]
Bug 16258: (QA follow-up) Add note of disbaled EDIFACT to EDI accounts page

One shouldn't end up here, but nice to have a note if you do

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Fix columns_settings
Martin Renvoize [Mon, 21 Feb 2022 11:49:11 +0000 (11:49 +0000)]
Bug 16258: (QA follow-up) Fix columns_settings

Splice out the relevant field from the columns_settings when EDIFACT is
disabled

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Capitalise EDIFACT
Martin Renvoize [Fri, 18 Feb 2022 13:09:59 +0000 (13:09 +0000)]
Bug 16258: (QA follow-up) Capitalise EDIFACT

EDIFACT is an abreviation, so it should be ALLCAPS.

* Electronic Data Interchange for Administration, Commerce and Transport

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Move 'Edifact' preference
Martin Renvoize [Fri, 18 Feb 2022 12:58:42 +0000 (12:58 +0000)]
Bug 16258: (QA follow-up) Move 'Edifact' preference

This patch moves the global 'Edifact' switch into the 'EDIFACT' section
of the sysprefs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Remove superflous comment from sysprefs
Martin Renvoize [Fri, 18 Feb 2022 12:57:48 +0000 (12:57 +0000)]
Bug 16258: (QA follow-up) Remove superflous comment from sysprefs

This patch removes the errant comment from default syspref SQL.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Hide "Suppliers report" column
Martin Renvoize [Fri, 18 Feb 2022 12:56:44 +0000 (12:56 +0000)]
Bug 16258: (QA follow-up) Hide "Suppliers report" column

As noted by Katrin, this column is only used for Edifact message data
and so can be hidden when Edifact is disabled.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Include Koha plugin for basket.tt
Kyle Hall [Thu, 10 Feb 2022 19:28:17 +0000 (14:28 -0500)]
Bug 16258: (QA follow-up) Include Koha plugin for basket.tt

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Don't set to off for existing install, they may be using EDI
Kyle Hall [Thu, 10 Feb 2022 19:21:33 +0000 (14:21 -0500)]
Bug 16258: (QA follow-up) Don't set to off for existing install, they may be using EDI

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (QA follow-up) Add a guard to the cron script
Kyle Hall [Thu, 10 Feb 2022 19:18:23 +0000 (14:18 -0500)]
Bug 16258: (QA follow-up) Add a guard to the cron script

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (follow-up) Handle 'Create EDIFACT order' button
Martin Renvoize [Thu, 10 Feb 2022 16:23:12 +0000 (16:23 +0000)]
Bug 16258: (follow-up) Handle 'Create EDIFACT order' button

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: (follow-up) Handle admin-menu.inc
Martin Renvoize [Thu, 10 Feb 2022 15:52:59 +0000 (15:52 +0000)]
Bug 16258: (follow-up) Handle admin-menu.inc

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 16258: Add a syspref to govern EDIFACT functionality
Colin Campbell [Wed, 4 May 2016 12:31:01 +0000 (13:31 +0100)]
Bug 16258: Add a syspref to govern EDIFACT functionality

Adds an "Edifact" systempreference to govern whether edifact processing
is enabled. In most places this is hidden if the current
vendor does not appear in the edi vendors table. This preference
hides the admin screens which define this and a couple of links.

Also fixes an anomaly whereby the basketgroup screen was not
making the same check on whether edi ordering should be enabled as
the basket screen. Both now use the same logic.

Rebased-by: Mark Tompsett <mtompset@hotmail.com>
Rebased-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30406: Add column filters before hiding columns
Julian Maurice [Fri, 1 Apr 2022 08:16:09 +0000 (10:16 +0200)]
Bug 30406: Add column filters before hiding columns

The code that adds column filters works only on visible columns, so we
should hide columns after filters are created

Test plan:
1. Apply patch
2. Go to Tables settings. Hide city_state for the cities table.
3. Create some cities and go to the cities page
4. Verify that filtering works as expected.
5. Make the city_state column appear. Verify that filtering on this
   column works too

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30426: Add missing C4::Auth and C4::Output imports
David Cook [Thu, 31 Mar 2022 23:02:35 +0000 (23:02 +0000)]
Bug 30426: Add missing C4::Auth and C4::Output imports

This patch adds missing function imports for C4::Auth and C4::Output
in the opac/svc/suggestion script.

Test plan:

1. Go to http://localhost:8081/cgi-bin/koha/admin/didyoumean.pl
2. Turn on some plugins
3. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
4. Note in your browser's Network tab that the call to
   http://localhost:8080/cgi-bin/koha/svc/suggestion?render=stub&q=test
   generates a 200 response instead of a 500 error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 26019: (follow-up) Set SameSite attribute on Cart cookies
Owen Leonard [Tue, 12 Apr 2022 11:36:46 +0000 (11:36 +0000)]
Bug 26019: (follow-up) Set SameSite attribute on Cart cookies

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 26019: Add two other js cookies
Marcel de Rooy [Thu, 17 Mar 2022 12:45:34 +0000 (12:45 +0000)]
Bug 26019: Add two other js cookies

Test plan:
Same as former patch. Use OPAC adv search here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 26019: Koha should set SameSite attribute on cookies
Owen Leonard [Fri, 11 Feb 2022 15:51:49 +0000 (15:51 +0000)]
Bug 26019: Koha should set SameSite attribute on cookies

This patch modifies the way Koha sets cookies so that the "sameSite"
attribute is explicitly set to "Lax." This option is chosen because it
is the value which is currently assumed by browsers when the sameSite
attribute is not set.

To test, apply the patch and restart services.

- Log in to the staff interface and open your browser's developer tools.
  - In Firefox, look for a "Storage" tab.
  - In Chrome, look for an "Application" tab.
- Under "Cookies," click the URL of the staff interface.
- You should see all the cookies which are set for that domain.
- The CGISESSID cookie should have sameSite set to "Lax."

- Go to Cataloging -> New record.
  - Check the "marcdocs" and "marctags" cookies.
- Switch to the Advanced MARC editor (you may need to enable
  theEnableAdvancedCatalogingEditor preference).
  - Check the "catalogue_editor" cookie.
- Add a new item to an existing bibliographic record.
  - Check the "LastCreatedItem" cookie which is set after you save the
    new item.
- Go to Authorities -> Authority search.
  - In authority search results, click "Merge" from the "Actions" menu
    next to one of the results..
    - Check the "auth_to_merge" cookie.
- Go to Administration -> MARC bibliographic framework
  - Choose "MARC structure" from the menu corresponding to one of the
    frameworks.
  - Check the "Display only used tags/subfields" checkbox.
    - Check the "marctagstructure_selectdisplay" cookie.
- Go to Circulation -> Check out to a patron with checkouts.
  - Check the "Always show checkouts immediately" checkbox.
    - Check the "issues-table-load-immediately-circulation" cookie.
- Go to Tools -> Patron clubs. You will need at least one active club
  with one or more patrons enrolled.
  - From the list of clubs, click Actions -> Search to hold.
    - Check the "holdforclub" cookie.
- Go to Tools -> Batch item modification and submit a batch of items.
  - Uncheck one or more checkboxes in the "Show/hide columns" area.
    - Check the "showColumns" cookie.
- View a patron -> Search to hold.
  - Check the 'holdfor' cookie.
- With WebBasedSelfCheck enabled, log in to the self-checkout page.
  - Check the "JWT" cookie.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29066: Compiled CSS
Fridolin Somers [Wed, 13 Apr 2022 09:01:54 +0000 (11:01 +0200)]
Bug 29066: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29066: (follow-up) Use tooltip when SearchMyLibraryFirst in effect
Owen Leonard [Tue, 29 Mar 2022 14:37:30 +0000 (14:37 +0000)]
Bug 29066: (follow-up) Use tooltip when SearchMyLibraryFirst in effect

This patch proposes to add a Bootstrap tooltip to the OPAC masthead's
search field to indicate to the user when SearchMyLibraryFirst is in
effect. I think this lets the form layout stay clean-looking and is more
informative to the user because they don't have to look for the HTML
title tag tooltip.

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

- Go to Administration -> Global system preferences.
- Set the OpacAddMastheadLibraryPulldown preference to "Don't add."
- Set the SearchMyLibraryFirst preference to "Limit."
- Go to the OPAC and confirm that the main search field in the masthead
  has a filter icon in the background, indicating that searches will be
  limited.
- Hover your mouse over the search field and a tooltip should pop up,
  "Searching in <library> only"
- The message should also be triggered when you click inside the form
  field.
- Change the OpacAddMastheadLibraryPulldown and SearchMyLibraryFirst
  preferences again and the form should return to its normal behavior.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29066: (follow-up) add aria-label and aria-hidden on icons
Fridolin Somers [Sat, 15 Jan 2022 06:53:54 +0000 (20:53 -1000)]
Bug 29066: (follow-up) add aria-label and aria-hidden on icons

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29066: Remove text in OPAC search form and use Font Awesome icons
Fridolin Somers [Mon, 20 Sep 2021 22:33:05 +0000 (12:33 -1000)]
Bug 29066: Remove text in OPAC search form and use Font Awesome icons

In modern front-end websites, first think you see in header region is an large input text with a search icon.
No need to say it is a search form.
We still tell it in 'title' attribut for accessibility.

This patch removes 'Search' text.
If 'my library first' feature is enabled, shows a text in title of a
question mark icon.
In submit button, replaces 'Go' with a seach icon and add title
'Search'.

Test plan :
1)
1.1) Set system preferences :
  OpacAddMastheadLibraryPulldown to 'Add'
  SearchMyLibraryFirst to 'Don't limit'
1.2) Go to OPAC main page
1.3) You don't see 'Search' anymore
1.4) You see in submit button an icon
1.5) Move mouse over submit button to see tooltip text 'Search'
2)
2.1) Set system preferences :
  OpacAddMastheadLibraryPulldown to 'Don't add'
  SearchMyLibraryFirst to 'Limit'
2.2) Go to OPAC main page
2.3) Log in
2.4) You don't see text 'Search (in <library name>) only'
2.5) You see a question mark icon
2.6) Move mouse over submit button to see tooltip text 'Search (in <library name>) only'

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>