koha.git
2 years agoBug 19821: Install sample data, ES mappings and Version syspref
Julian Maurice [Fri, 16 Feb 2018 15:00:34 +0000 (16:00 +0100)]
Bug 19821: Install sample data, ES mappings and Version syspref

Also move .proverc to .proverc.dist, so it cannot be used by accident.

Different ways to use it:

1/ prove --rc .proverc.dist
   Use defaults

2/ cp .proverc.dist .proverc && prove
   Allows to configure db name, marcflavour, and prove options

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 19821: Close filehandle after writing
Julian Maurice [Mon, 18 Dec 2017 08:09:58 +0000 (09:09 +0100)]
Bug 19821: Close filehandle after writing

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 19821: Run tests on a separate database
Julian Maurice [Fri, 15 Dec 2017 14:18:24 +0000 (15:18 +0100)]
Bug 19821: Run tests on a separate database

Running the tests on the same database as the one used for dev has some
drawbacks:
- Everybody has different data, so we cannot make any assumptions about
data in tests and it can make tests fail for non-obvious reasons.
- Tests have to clean up every change to the database using SQL
transactions, so we cannot write testable code that use transactions
(AFAIK)
- Transactions in tests happen to be committed sometimes, resulting in
garbage data added to the dev database

This patch provides a .proverc file that will load t/lib/Bootstrap.pm
before the tests are run.
t/lib/Bootstrap.pm is responsible for recreating a fresh database and
telling the test scripts to use it.
To use it, just run prove normally from the root directory of Koha.
By default, the database is 'koha_test' and it's created using MARC21
SQL files, it can be changed by running:

    prove --norc \
    --Mt::lib::Bootstrap=database,koha_test,marcflavour,UNIMARC

Test plan:
1. Apply bug 19185 which will also apply these patches
2. In the DBMS run `select count(*) from koha_kohadev.borrowers;`
     (adapt if your usual koha DB isn't koha_kohadev)
3. Run the test plan of bug 19185 and during execution of the
   installation test, pay attention to the following:
4. List the databases in the DBMS (show databases;) to ensure that
   koha_test is created
5. After the test has run, the koha_test database should not be here anymore.
6. In the DBMS run `select count(*) from koha_kohadev.borrowers;`
7. That was to verify that the database you use usually was untouched.
   The counts should be the same.

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29200: DBRev 21.06.00.036
Jonathan Druart [Thu, 21 Oct 2021 10:20:03 +0000 (12:20 +0200)]
Bug 29200: DBRev 21.06.00.036

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29231: Add missing Flatpickr to inventory page
Owen Leonard [Wed, 13 Oct 2021 18:39:36 +0000 (18:39 +0000)]
Bug 29231: Add missing Flatpickr to inventory page

This patch corrects a stray instance of the "datepicker" class in the
inventory template and replaces it with "flatpickr" to trigger a
Flatpickr.

To test, apply the patch and go to Tools -> Inventory. Check that the
"Last inventory date" field is a Flatpickr widget.

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>
2 years agoBug 29052: Compiled CSS
Jonathan Druart [Thu, 21 Oct 2021 10:22:14 +0000 (12:22 +0200)]
Bug 29052: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29052: Make consistent use of spans and div with hint class
Owen Leonard [Wed, 28 Jul 2021 15:12:09 +0000 (15:12 +0000)]
Bug 29052: Make consistent use of spans and div with hint class

This patch makes minor HTML corrections to several templates, primarily
to wrap form help text in <span class="hint"> or <div class="hint">.

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

View the following pages to confirm that forms look correct:

- Administration -> Authority types -> Authority type -> Edit.
- Administration -> Authority types -> Authority type -> MARC structure.
  -> Subfields -> Edit.
- Administration -> Authorised values -> View category -> New authorized
  value.
- Administration -> Credit types -> New credit type.
- Administration -> Debit types -> New debit type.
- Administration -> Item types -> New item type.
  Also changed: Added link to ITEMTYPECAT authorized value page for
  users with the correct permission.
- Administration -> MARC frameworks -> MARC structure -> Edit subfields.
- Administration -> Patron attribute types -> New patron attribute type.
- Administration -> Share content with Mana KB.
- Administration -> Z39.50/SRU servers -> New Z39.50 server.

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>
2 years agoBug 28867: (follow-up) Make error message translatable
Owen Leonard [Tue, 19 Oct 2021 11:08:36 +0000 (11:08 +0000)]
Bug 28867: (follow-up) Make error message translatable

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28867: Compiled CSS
Jonathan Druart [Thu, 21 Oct 2021 10:22:05 +0000 (12:22 +0200)]
Bug 28867: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28867: Use Bootstrap button menu and modal for adding patrons to lists
Owen Leonard [Thu, 23 Sep 2021 16:09:12 +0000 (16:09 +0000)]
Bug 28867: Use Bootstrap button menu and modal for adding patrons to lists

This patch reworks the controls for adding patrons to a list from the
patron search results page. The <select> is converted to a Bootstrap
dropdown menu, and the list creation form is moved into a Bootstrap
modal.

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

- In the staff interface, perform a patron search that will return
  multiple results.
- In the toolbar at the top of the search results you should see two
  disabled Bootstrap-styled buttons: "Add to patron list" and "Merge
  selected patrons."
- The "Select all" and "Clear all" links should work to enable and
  disable the toolbar buttons.
- "Clear all" and then check the checkbox next to one of the results.
  The "Add to patron list" button should be enabled.
- Check a second checkbox. The "Merge selected patrons" button should be
  enabled.
- Test the "Add to patron list" button. It should trigger a dropdown
  menu listing existing patrons lists and a "New list" link.
  - Test adding to an exising patron list. It should trigger a message
    at the top of the page which shows a link to that list.
  - Test adding to a new list. It should trigger a Bootstrap modal where
    you can enter the name of the new list.
    - Submitting the list title form should close the modal and trigger
      the display of the message showing how many patrons were added to
      your new list. The link to the new list should be correct.
- Test the "Merge selected patrons" button. It should send the selected
  patrons to the patron merge screen.

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>
2 years agoBug 28084: Standardize: Cardnumber, Card number, Card
Owen Leonard [Mon, 11 Oct 2021 16:12:29 +0000 (16:12 +0000)]
Bug 28084: Standardize: Cardnumber, Card number, Card

This patch modifies templates so that instances of "cardnumber" are
replaced with "card number."

Some instances where the word "card" is used by itself have been updated
to "library card" to add some context.

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

- Circulation -> Built-in offline circulation interface -> Submit the
  "Check out" form without entering  number. Check the alert message
  which appears.
- Go to Administration -> System preferences and enable the
  AutoMemberNum system preference and use the BorrowerMandatoryField
  preference to make card number mandatory.
  - Go to Patrons -> New patron. The hint under the "Card number" field
    should refer to "card number" instead of "cardnumber."
- Go to Tools -> Import patrons.
  - Under the page heading, the note should read "If a card number
    exists..."
  - Under "Field to use for record matching" you should see a "Card
    number" option in the menu.
  - If you try to import a CSV with an invalid card number you'll see an
    error message, "Card number X is not a valid card number."
- Under Tools -> Upload patron images, check the "image file" radio
  button. The card number field label should read "Enter patron card
  number."
- Log in to the OPAC as a patron whose card has been marked lost. Try to
  place a hold. You should see a message containing "please take your
  library card to the circulation desk"
  - On the "your summary" page you should see a message, "Your library
    card has been marked as lost or stolen."
  - Try to check out an item to this patron in the self-checkout system.
    You should be shown a message, "This library card has been declared
    lost."

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>
2 years agoBug 29244: Compiled CSS
Jonathan Druart [Thu, 21 Oct 2021 10:21:54 +0000 (12:21 +0200)]
Bug 29244: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29244: Add dialog class where missing in print-notices.tt
Martin Renvoize [Thu, 14 Oct 2021 11:45:05 +0000 (12:45 +0100)]
Bug 29244: Add dialog class where missing in print-notices.tt

The print notices template had it's own implimentation of a message
dialog. To make it consistent with other area's, we should add the
dialog class.

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>
2 years agoBug 29244: Move message inside dialog and remove width
Martin Renvoize [Thu, 14 Oct 2021 11:43:56 +0000 (12:43 +0100)]
Bug 29244: Move message inside dialog and remove width

This patch moves the message css rules inside the dialog ruleset to
clarify their intention and removes the width so it inherits from the
dialog class.

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>
2 years agoBug 16446: (follow-up) Fix translation and adjust radio buttons
Nick Clemens [Mon, 30 Aug 2021 13:08:31 +0000 (13:08 +0000)]
Bug 16446: (follow-up) Fix translation and adjust radio buttons

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 16446: Add ability to add patrons to list by borrowernumber
Nick Clemens [Fri, 27 Aug 2021 12:39:49 +0000 (12:39 +0000)]
Bug 16446: Add ability to add patrons to list by borrowernumber

AddPatronsToList already took a borrowernumber parameter, however, it
did not check if those were valid numbers. This patch expands the search
to apply to cardnumber or borrowernumbers in the subroutine.

Template and script are adjusted to allow choosing borrowernumbers or cardnumbers

To test:
1 - Apply patch
2 - Browse to Tools->Patron lists
3 - Create a list, or choose Actions->Add patrons for an existing list
4 - Click 'Add multiple patrons'
5 - Cardnumbers is preselected
6 - Enter a list of cardnumbers, ensure you test:
    Cardnumber already in list
    Cardnumber not in list
    Non-existent cardnumber
7 - Patrons should be added/errors reported correctly
8 - Repeat with borowernumbers

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27287: Add new columns to the table settings yml file
Jonathan Druart [Thu, 21 Oct 2021 09:48:14 +0000 (11:48 +0200)]
Bug 27287: Add new columns to the table settings yml file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27287: (QA follow-up) Unit tests
Nick Clemens [Mon, 18 Oct 2021 11:43:07 +0000 (11:43 +0000)]
Bug 27287: (QA follow-up) Unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27287: Make note fields from orders history searchable
Hayley Pelham [Mon, 9 Aug 2021 22:54:09 +0000 (10:54 +1200)]
Bug 27287: Make note fields from orders history searchable

This patch adds aqorders.order_internalnote and
aqorders.order_vendornote to the Acquisitions history search.

To test:
1) Apply patch and restart services
2) Create an order in Acquisitions and set an internal note and a vendor note
3) Go to /cgi-bin/acqui/histsearch.pl and search by internal or vendor
note using the terms you set in step 2
4) Note your order is returned and internal note and vendor note are
included in the search results at the end of the table

Sponsored-by: Bibliotheksservice-Zentrum Baden-Wuerttemberg
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>
2 years agoBug 29298: Add 'Managing library' column to table settings for histsearch
Jonathan Druart [Thu, 21 Oct 2021 09:46:07 +0000 (11:46 +0200)]
Bug 29298: Add 'Managing library' column to table settings for histsearch

Bug 14669 added the column to the table but forgot to add it to the
table settings yml file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29200: Compiled CSS
Jonathan Druart [Thu, 21 Oct 2021 09:34:36 +0000 (11:34 +0200)]
Bug 29200: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Remove adlibris conflict
Jonathan Druart [Tue, 19 Oct 2021 14:33:30 +0000 (16:33 +0200)]
Bug 28180: Remove adlibris conflict

Can be squashed when pushed
Edit from RM before push: too many conflicts!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Fix bug with first image does not exist
Jonathan Druart [Sun, 12 Sep 2021 22:08:35 +0000 (00:08 +0200)]
Bug 28180: Fix bug with first image does not exist

This was first written for Adlibris, before its removal from the
codebase.
But this patch maybe still be useful for other services (if first and no image).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Correctly guess if images have been loaded
Jonathan Druart [Wed, 11 Aug 2021 14:35:42 +0000 (16:35 +0200)]
Bug 28180: Correctly guess if images have been loaded

window.load won't assure us that the images loaded using JS code are
correctly loaded.

This patch adds a flag to the different providers when the images are
fully loaded.

Note that the img.naturalHeight check is not working for google jackets
and is actually not needed (test with a bib record with and without
google jacket and confirm that it's working as expected).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Fix collision with existing verify_images
Jonathan Druart [Wed, 11 Aug 2021 11:58:54 +0000 (13:58 +0200)]
Bug 28180: Fix collision with existing verify_images

At the OPAC we already had a verify_images JS function in amazonimages.js
It's preferable to use another function name.
This patch replace our verify_images with verify_cover_images and apply
the change to the staff code as well.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Fix some non-translatable strings
Jonathan Druart [Wed, 11 Aug 2021 12:46:29 +0000 (14:46 +0200)]
Bug 28180: Fix some non-translatable strings

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: (follow-up) Updates to styling of lightbox controls
Owen Leonard [Mon, 10 May 2021 18:21:14 +0000 (18:21 +0000)]
Bug 28180: (follow-up) Updates to styling of lightbox controls

This patch adds style changes like the ones made in Bug 28179. It also
addresses a bug with the way the verify_images() function was firing.
I've moved the function outside of document.ready() and added a call to
it on window load, consistent with how it works in the staff client.

I've removed a redundant call to verify_images() from the footer include
file, opac-bottom.inc.

The cosmetic changes replace the Chocolat image icons with new SVG
assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The
color changes I think help the controls to be more visible.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Restore NO_LOCAL_JACKET
Jonathan Druart [Mon, 10 May 2021 07:15:22 +0000 (09:15 +0200)]
Bug 28180: Restore NO_LOCAL_JACKET

This is a patch to squash. No idea what it got removed previously

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: (follow-up) Remove console.log
Jonathan Druart [Mon, 10 May 2021 07:12:07 +0000 (09:12 +0200)]
Bug 28180: (follow-up) Remove console.log

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock
Jonathan Druart [Tue, 20 Apr 2021 13:50:02 +0000 (15:50 +0200)]
Bug 28180: Bug fix - cannot select cover-nav button when on top of the .contentblock

Found a bug and ended up with this solution, suggestions welcomed!

example with OpenLibrary with isbn=9780670026623, the image is a bit
higher than others and then the cover-nav buttons are on top of
.contentblock and cannot be clicked

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Reintroduce and adjust Baker and Taylor
Jonathan Druart [Tue, 20 Apr 2021 13:32:42 +0000 (15:32 +0200)]
Bug 28180: Reintroduce and adjust Baker and Taylor

Test plan:
1. Turn on BakerTaylorEnabled and fill BakerTaylorUsername/BakerTaylorPassword (if you don't have, ask me)
2. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Reintroduce and adjust OpenLibrary
Jonathan Druart [Tue, 20 Apr 2021 12:41:34 +0000 (14:41 +0200)]
Bug 28180: Reintroduce and adjust OpenLibrary

1. Turn on OpenLibraryCovers
2. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Reintroduce and adjust Google Jackets
Jonathan Druart [Tue, 20 Apr 2021 12:08:01 +0000 (14:08 +0200)]
Bug 28180: Reintroduce and adjust Google Jackets

Test plan:
1. Turn on GoogleJackets
2. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Reintroduce and adjust Syndetics
Jonathan Druart [Tue, 20 Apr 2021 10:06:33 +0000 (12:06 +0200)]
Bug 28180: Reintroduce and adjust Syndetics

Test plan:
1. Enable SyndeticsEnabled and SyndeticsCoverImages
2. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface
Jonathan Druart [Tue, 20 Apr 2021 07:26:43 +0000 (09:26 +0200)]
Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface

This patch is the OPAC version of
  Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface

But there were several difficulties as the staff and OPAC code diverged
a lot.
First we are going to apply the different enhancements that have been
made staff-side:
- Display all the local cover image on the bibliographic detail pages
(before this patch only the first one was displayed)
- The slider functionality added by bug 25031

Test plan:
All the cover images are affected, all the different sources will be
tested.
All the steps will be done on the same bibliographic record.
1. Local cover images
 a. Turn on OPACLocalCoverImages and AllowMultipleCover
 b. Add several local cover images to a bibliographic record
 c. Add several local cover images to an item
 d. Click on an image and confirm that it is displayed in a gallery and
 you can navigate see all the images attached to the bibliographic
 record
 e. Same for items
2. Adlibris
 a. Turn on AdlibrisCoversEnabled
 b. Edit the biliographic record and add an ISBN that will return a
 cover image for this service (9780670026623 for instance)
 c. Display the cover images in the gallery
 d. Note the link to the adlibris.com website at the bottom
3. Amazon
 a. Turn on OPACAmazonCoverImages
 b. Display the cover images in the gallery
4. Coce
 a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080"
 and select some values for CoceProviders.
 b. Display the cover images in the gallery
5. Custom cover images
 a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg
 of anything else meaningful
 b. Display the cover images in the gallery

QA Note: Other sources have been removed by this patch but will be
re-added by follow-ups

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28180: Add Chocolat to OPAC
Jonathan Druart [Mon, 19 Apr 2021 12:31:53 +0000 (14:31 +0200)]
Bug 28180: Add Chocolat to OPAC

See Bug 28179: Add the Chocolat gallery lightbox JS library

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29200: Remove Adlibris cover service
Owen Leonard [Tue, 12 Oct 2021 15:31:46 +0000 (15:31 +0000)]
Bug 29200: Remove Adlibris cover service

This patch removes integration of the Adlibris cover service which has
been discontinued.

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

- Run the database update.
- Go to Administration -> System preferences -> Enhanced content. You
  should see no Adlibris-related preferences.
- Perform a catalog search and confirm that the search result and detail
  pages look correct.
- Enable one or more other cover image services and test that search
  results and detail page look correct.
- Perform the same test in the OPAC including these pages:
  - Catalog search results
  - Bibliographic detail page
  - Lists
  - Comments
  - User summary
  - User reading history

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>
2 years agoBug 29271: (follow-up) Remove changes to accounts.inc
Nick Clemens [Thu, 21 Oct 2021 10:03:30 +0000 (10:03 +0000)]
Bug 29271: (follow-up) Remove changes to accounts.inc

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28079: Set focus to search box field when adding an order to basket
Owen Leonard [Mon, 11 Oct 2021 18:09:27 +0000 (18:09 +0000)]
Bug 28079: Set focus to search box field when adding an order to basket

This patch modifies the "Add to basket" modal in acquisitions so that
focus is automatically moved to the first form field when the modal
appears.

The patch also corrects the modal markup so that it's more consistent
with default Bootstrap markup.

To test, apply the patch and go to Acquisitions.

- Search for a vendor and, if necessary, create a basket.
- Click the "Add to basket" button. The modal which appears should
  have a header reading "Add order to basket <basketname>"
- The form field should have cursor focus.
- View the basket and click the "Add to basket" button in the toolbar.
- The modal shown should also be correct.

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>
2 years agoBug 29216: Correct --where documentation in update_patrons_category.pl
Caroline Cyr La Rose [Fri, 15 Oct 2021 14:03:52 +0000 (10:03 -0400)]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch removes two misleading examples of the --where parameter
documentation in update_patrons_category.pl

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)

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>
2 years agoBug 29225: Don't hide subgroup filter on pag load
Nick Clemens [Thu, 14 Oct 2021 12:28:30 +0000 (12:28 +0000)]
Bug 29225: Don't hide subgroup filter on pag load

When we auto select the last used tab, we hit code that hides the Subgroup
dropdown

Clicking to other tabs shows the dropdown again

There is code on the tab selection to hide subgroups on the 'All' tab,
the other line seems superfluous

To test:
1 - Create a report and assign a group and subgroup, creating if necessary
2 - Browse to "Reports->Use saved"
3 - Click on the tab for the report you just created, see the subgroups dropdown
4 - Reload the page, Subgroups dropdown disappears
5 - Apply patch
6 - Relaod the page
7 - It's back!
8 - Confirm dropdown filters as expected

Signed-off-by: Donna <donna@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29279: Use class for targets
Jonathan Druart [Thu, 21 Oct 2021 08:19:55 +0000 (10:19 +0200)]
Bug 29279: Use class for targets

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29279: Don't sort holds ratio numeric columns as 'natural'
Nick Clemens [Tue, 19 Oct 2021 16:47:50 +0000 (16:47 +0000)]
Bug 29279: Don't sort holds ratio numeric columns as 'natural'

TO test:
1 - Place a variety of holds on some records
2 - Place more holds on records with low biblionumbers and less on ones with high biblionumbers
3 - Go to Circulation->Holds ratios
4 - Set the ration to 1 and load the report
5 - Sort by the 'Holds ratio' column and note it is incorrect
6 - Apply patch
7 - Confirm sort works correctly on first three columns and call numbers column

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29271: (QA follow-up) Fetch and send descriptions to template
Nick Clemens [Wed, 20 Oct 2021 14:06:29 +0000 (14:06 +0000)]
Bug 29271: (QA follow-up) Fetch and send descriptions to template

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29271: (QA follow-up) Add missing filter
Katrin Fischer [Tue, 19 Oct 2021 21:09:00 +0000 (21:09 +0000)]
Bug 29271: (QA follow-up) Add missing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29271: Fix cash register report results
Nick Clemens [Tue, 19 Oct 2021 13:03:07 +0000 (13:03 +0000)]
Bug 29271: Fix cash register report results

This patch changes accounts.inc to use the credit/debit type codes directly
rather than needlessly fetching the credit_type/debit_type object jsut to get
the code. This allows the BLOCK to work on non-object lines

We also only pass a debit or credit type to csv (accountline cannot be both)

empty-line.inc is also removed in favor of correcting the markup

one more column added to total line

To test:
1 - Add some debits and credits to accounts
2 - Browse to Reports->Cash register
3 - Select transaction type 'All transactions'
4 - Output to screen
5 - Run report
6 - Note transaction types column is empty
7 - Output to a file
8 - Run report
9 - Open file and note:
      amount column is out of place
      extra line before total
10 - Apply patch
11 - Repeat and note display and export are correct

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 25030: (QA follow-up) Fix tests
Nick Clemens [Tue, 19 Oct 2021 10:34:38 +0000 (10:34 +0000)]
Bug 25030: (QA follow-up) Fix tests

Fluid is not a valid value for cxn_pool - valid values are:
Sniff,Static,NoPing

AddAuthority call calls index - the indexing call was trying to access
the ES server with mocked values and dying when they were invalid

This patch uses a correct value for cxn_pool and inserts directly into DB
to avoid indexing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 25030: (QA follow-up) Add POD
Nick Clemens [Mon, 18 Oct 2021 11:09:00 +0000 (11:09 +0000)]
Bug 25030: (QA follow-up) Add POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 25030: Implement IncludeSeeFromInSearches with Elasticsearch
Julian Maurice [Tue, 10 Nov 2020 14:22:21 +0000 (15:22 +0100)]
Bug 25030: Implement IncludeSeeFromInSearches with Elasticsearch

Test plan:
1. Create an authority with at least a 1XX$a and a 4XX$a, for instance:
    100 $a Foo
    400 $a Bar
2. Create a biblio and add a link to this authority using the
   cataloguing plugin
3. Disable syspref IncludeSeeFromInSearches
4. Reindex the biblio. You should be able to find it when searching
   'Foo' but not when searching 'Bar'
5. Enable syspref IncludeSeeFromInSearches
6. Reindex the biblio. You should be able to find it when searching
   'Foo' and also when searching 'Bar'
   without the patch, 'Bar' doesn't yeld results. With it, it does.
7. prove t/db_dependent/Koha/SearchEngine/Elasticsearch.t

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29215: (bug 3137 follow-up) Fix guarantor block toggle
Jonathan Druart [Tue, 19 Oct 2021 09:50:37 +0000 (11:50 +0200)]
Bug 29215: (bug 3137 follow-up) Fix guarantor block toggle

The guarantor template must be kept hidden, always.

Test plan:

Edit a patron with a guarantor, click the legend of the "patron
guarantor" block and confirm that the template is not shown

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>
2 years agoBug 29261: (bug 15812 follow-up) Fix translation issue in include file
Jonathan Druart [Mon, 18 Oct 2021 09:05:18 +0000 (11:05 +0200)]
Bug 29261: (bug 15812 follow-up) Fix translation issue in include file

Strings must be surrounded by double quote or it wil break the translate
script.

Without this patch you get:
  5  "dt_name":
  6  "<a %]\"="%]\""
in the translated template and the UI explodes with "Template process
failed: file error - parse error"

Test plan:
Apply this patch, update PO files for a given language, translate
"View". Search for something like:
  msgid "\\\"View\\\""
  msgstr "\\\"Näytä\\\""
Remove fuzzy.
Install the language and search for patrons

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29221: Correctly display refund info
Jonathan Druart [Tue, 19 Oct 2021 09:39:48 +0000 (11:39 +0200)]
Bug 29221: Correctly display refund info

2132             $messages->{'LostItemFeeRefunded'} = $updated_item->{_refunded};

But, in returns.pl:
495     elsif ( $code eq 'LostItemFeeRefunded' ) {
496         $template->param( LostItemFeeRefunded => 1 );
497     }

1. Set BlockReturnOfLostItems to 'don't block'
2. Make sure your 'Default lost item fee refund on return policy' circ rule is set to 'Leave lost item charge'
3. Check something out and then mark it as lost.
4. Check the item in
=> No message to tell there was a refund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 17600: Fix imports for svc/letters/preview
Jonathan Druart [Thu, 21 Oct 2021 07:56:29 +0000 (09:56 +0200)]
Bug 17600: Fix imports for svc/letters/preview

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) Test for hook calls properly
Tomas Cohen Arazi [Tue, 19 Oct 2021 12:46:32 +0000 (09:46 -0300)]
Bug 28211: (QA follow-up) Test for hook calls properly

Some warnings, that mean a hook has been called were not tested.
This patch adds those tests, and does some tidy also.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: (follow-up) Ensure update is idempotent
Nick Clemens [Tue, 19 Oct 2021 11:28:40 +0000 (11:28 +0000)]
Bug 28153: (follow-up) Ensure update is idempotent

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29240: Rename start_for with date_to
Jonathan Druart [Tue, 19 Oct 2021 07:57:26 +0000 (09:57 +0200)]
Bug 29240: Rename start_for with date_to

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29240: (follow-up) Correct more instances
Owen Leonard [Thu, 14 Oct 2021 17:05:07 +0000 (17:05 +0000)]
Bug 29240: (follow-up) Correct more instances

This patch fixes linked date fields in these pages:

 - Reports -> Patrons with the most checkouts
 - Reports -> Patrons statistics wizard
 - Reports -> Most-circulated items
 - Reports -> Catalog statistics wizard
 - Reports -> Guided reports
 - Reports -> Average loan time
 - Reports -> Holds statistics wizard

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29240: Centralise from/to handling
Martin Renvoize [Thu, 14 Oct 2021 14:06:30 +0000 (15:06 +0100)]
Bug 29240: Centralise from/to handling

This patch moves to using a data-start_for attribute to point the 'from'
flatpickr to the 'to' flatpickr.

We also fix the date validation issue in the onClose handler inline.

Test plan.
1. Check that the from/to datpicker combinations work on each of the
   changed pages.
2. Look at the console for errors, there should be none

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>
2 years agoBug 29233: Correct missed jQueryUI datepicker in serials search sidebar
Owen Leonard [Wed, 13 Oct 2021 18:27:17 +0000 (18:27 +0000)]
Bug 29233: Correct missed jQueryUI datepicker in serials search sidebar

This patch fixes the serials search sidebar so that the "Expires before"
field uses Flatpickr instead of jQueryUI datepicker.

To test, apply the patch and go to Serials. Perform a subscription
search which will return multiple results.

In the sidebar, test that the "Expires before" field uses a
Flatpickr widget and works correctly.

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>
2 years agoBug 29232: Clean up obsolete jQueryUI datepicker code from cash register stats template
Owen Leonard [Wed, 13 Oct 2021 17:58:58 +0000 (17:58 +0000)]
Bug 29232: Clean up obsolete jQueryUI datepicker code from cash register stats template

This patch removes some jQueryUI datepicker code from
reports/cash_register_stats.tt which was left behind by Bug 28949.

To test, apply the patch and go to Reports -> Cash register statistics
wizard. The "From" and "To" date fields should work correctly, since
Flatpickr code is unchanged.

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>
2 years agoBug 29263: (bug 24387 follow-up) Fix 'Cancel' link when editing a html custom
Jonathan Druart [Mon, 18 Oct 2021 12:53:05 +0000 (14:53 +0200)]
Bug 29263: (bug 24387 follow-up) Fix 'Cancel' link when editing a html custom

When editing content that is a html customization, the 'cancel' link
should redirect to the html custom list, not the 'news' list.

Test plan:
Create or edit a html customization, click the 'Cancel' link
=> You should be redirected to the html custom list

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29153: Fix CodeMirror textareas to work with all languages
Lucas Gass [Fri, 15 Oct 2021 17:05:42 +0000 (17:05 +0000)]
Bug 29153: Fix CodeMirror textareas to work with all languages

To test:
1. Go to Tools > HTML customizations
2. Open or create a new entry with CodeMirror. ( Edit with text editor )
3. CodeMirror doesn't work, notice a console error.
4. Apply patch
5. Try steps 1 & 2 again. The CodeMirror editor should now load.
6. Make sure it works in both the Default and English(en) tabs.
7. BONUS: install some other language packs and look at the tabs for that language, it should still work.

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>
2 years agoBug 20277: Improve 773 link when $a is present
Katrin Fischer [Sun, 22 Aug 2021 04:07:02 +0000 (04:07 +0000)]
Bug 20277: Improve 773 link when $a is present

At the moment $t (Title) and $a (Main heading - author) are both
searched in ti,phr, which sometimes may work, as ti contains the
full 245 field, including $c with author information. But often
$c will not match what is in 100$a, so the search fails.

This splits the search string so we search for $t in with ti,phr
and for $a in au.

To test:
- Make sure UseControlnumber is deactivated
- Search for a record with an author in 100 in your catalog
  Example from sample data: Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall.
- Add a child record using New > Add child record
- Verify that in 773 $a and $t are filled in
- Complete mandatory fields and save the record
. In OPAC and staff interface:
- Verify the link in the detail page is doing a search with ti,phr
- Verify the link works/doesn't work (more likely the latter)
- Apply patch
- Verify the link has changed and (now) works

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>
2 years agoBug 29254: Fix date formatting on the additional contents form
Jonathan Druart [Mon, 18 Oct 2021 09:50:11 +0000 (11:50 +0200)]
Bug 29254: Fix date formatting on the additional contents form

We are sending ymd but flatpickr is expecting a 'dateformat' formatted
date.

Test plan:
Create a new content, set a date, save, edit again
=> The date must be displayed correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29020: Add link on the admin module
Jonathan Druart [Fri, 8 Oct 2021 13:57:31 +0000 (15:57 +0200)]
Bug 29020: Add link on the admin module

It works! P1 and P2 are inverted in the test plan, but
the principle that user with manage permission accesses
bg jobs from the admin page and user who do not only
have access through main page is there.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29020: Add link on the mainpage for users without admin access
Jonathan Druart [Fri, 8 Oct 2021 13:53:02 +0000 (15:53 +0200)]
Bug 29020: Add link on the mainpage for users without admin access

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: Fix test
Jonathan Druart [Tue, 19 Oct 2021 07:25:25 +0000 (09:25 +0200)]
Bug 28211: Fix test

    #   Failed test 'Plugin enabled, route defined'
    #   at t/db_dependent/Koha/REST/Plugin/PluginRoutes.t line 125.
    # Looks like you failed 1 test of 2.

105         $good_plugin = $plugin
106             if $plugin->{metadata}->{description} eq 'Test plugin';

The wrong plugin was considered the good one.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: DBRev 21.06.00.035
Jonathan Druart [Mon, 18 Oct 2021 09:27:18 +0000 (11:27 +0200)]
Bug 28153: DBRev 21.06.00.035

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: (follow-up) Add installer files and update atomicupdate
Nick Clemens [Fri, 15 Oct 2021 15:02:50 +0000 (15:02 +0000)]
Bug 28153: (follow-up) Add installer files and update atomicupdate

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28153: Add 'Hold reminder' messaging preference
Nick Clemens [Thu, 15 Apr 2021 13:26:55 +0000 (13:26 +0000)]
Bug 28153: Add 'Hold reminder' messaging preference

This adds a new preference for patrons to choose how they wish to receive
'Hold reminder' notices.

The notice is always digested per branch

To test:
 1 - Apply patches
 2 - Update database
 3 - Ensure EnhancedMessagingPreferences and EnhancedMessagingPreferencesOPAC are enabled
 4 - View a patron and note new messaging preference
 5 - Confirm same on the opac for a patron account
 6 - All transports should be disabled by default
 7 - Place a hold for the patron and check it in to confirm
 8 - Run hold reminder script
    perl misc/cronjobs/holds_reminder.pl -v -c
 9 - No message should be queued for patron
10 - Enable the message in a transport for which 'HOLD_REMINDER' notice has content for the patron
11 - Run the script
12 - Patron should have a message queued
13 - Ensure a different transport has content for the notice
14 - Run the script forcing a transport
   perl misc/cronjobs/holds_reminder.pl -v -c -mtt=print
15 - The patron should have a message queued in the forced transport

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28831: DBRev 21.06.00.034
Jonathan Druart [Mon, 18 Oct 2021 09:26:32 +0000 (11:26 +0200)]
Bug 28831: DBRev 21.06.00.034

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28831: Add the new group by substatus-block
Marcel de Rooy [Thu, 9 Sep 2021 09:18:01 +0000 (09:18 +0000)]
Bug 28831: Add the new group by substatus-block

Test plan:
Change OPACResultsUnavailableGroupingBy to substatus.
Verify the result on opac results. (You need a few unavailable items
with different statuses on a few branches.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 28831: Add choose/when, and change indentation
Marcel de Rooy [Thu, 9 Sep 2021 08:56:07 +0000 (08:56 +0000)]
Bug 28831: Add choose/when, and change indentation

As a first step:
[1] Add the new pref OPACResultsUnavailableGroupingBy in the xslt,
    and pass it via C4/XSLT.
[2] Add a choose/when construction in the third part of Availability.
[3] Add indentation (8 spaces) of the inner block handling group by branch.

Test plan:
Make sure that OPACResultsUnavailableGroupingBy eq branch.
Verify that OPAC results are still untouched.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 28831: Database revision, add new preference
Marcel de Rooy [Thu, 9 Sep 2021 09:37:50 +0000 (09:37 +0000)]
Bug 28831: Database revision, add new preference

The preference OPACResultsUnavailableGroupingBy allows you to
group unavailable items by substatus, only showing item counts, on
the OPAC XSLT results.

This is meant to be useful for larger consortia.

Test plan:
Run dbrev.
Check new pref on Admin, preferences, OPAC tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 28211: (QA follow-up) Add unit tests
Kyle M Hall [Thu, 14 Oct 2021 11:57:55 +0000 (11:57 +0000)]
Bug 28211: (QA follow-up) Add unit tests

JD amended patch: typo multipled ==> multiplied

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) POD changes
Marcel de Rooy [Fri, 8 Oct 2021 07:00:10 +0000 (07:00 +0000)]
Bug 28211: (QA follow-up) POD changes

[1] Resolving qa warn on POD coverage.
[2] Adding a line about the passing refs-tric.
[3] Removing an outdated line on available methods.
[4] Removing POD section for after_hold_create. Strayed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: (QA follow-up) Remove test_call_recursive
Marcel de Rooy [Fri, 8 Oct 2021 06:51:03 +0000 (06:51 +0000)]
Bug 28211: (QA follow-up) Remove test_call_recursive

Obsoleted now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28211: Replace use of call_recursive() with call()
Kyle M Hall [Fri, 23 Apr 2021 15:53:51 +0000 (11:53 -0400)]
Bug 28211: Replace use of call_recursive() with call()

This is based on Julian's idea on bug 28026 where we could get rid of call_recursive by passing refs as arguments to call.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Plugins/Plugins.t
3) prove t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28785: Don't send SessionRestrictionByIP to template
Jonathan Druart [Fri, 30 Jul 2021 12:19:02 +0000 (14:19 +0200)]
Bug 28785: Don't send SessionRestrictionByIP to template

It's not used.

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>
2 years agoBug 28785: Add skip_version_check for checkauth
Jonathan Druart [Thu, 29 Jul 2021 09:28:38 +0000 (11:28 +0200)]
Bug 28785: Add skip_version_check for checkauth

We could have this patch but we also could decide to skip it. The idea
is to avoid 2 checks of the version when we are coming from checkauth.

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>
2 years agoBug 28785: Adjust check_cookie_auth calls
Jonathan Druart [Thu, 29 Jul 2021 09:16:40 +0000 (11:16 +0200)]
Bug 28785: Adjust check_cookie_auth calls

The previous patch makes check_cookie_auth return the session instead of
$sessionID, so we are adjusting the different calls to prevent
confusion.
However they are mainly used to check the authentication status and
don't care about this second variable.

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>
2 years agoBug 28785: Centralize cookie auth check in check_cookie_auth
Jonathan Druart [Thu, 29 Jul 2021 09:03:46 +0000 (11:03 +0200)]
Bug 28785: Centralize cookie auth check in check_cookie_auth

This code is duplicated in 3 different places, we must call
check_cookie_auth instead.

It makes check_cookie_auth returns a 'restricted' when
SessionRestrictionByIP is set and the IP changed.
It also returns a third parameters contained the old and new IP, to fill
the "info" hash in checkauth but apparently the oldip and newip
variables are not even used from the template. We may want to remove it
completely.

No change is expected with this patch, the different authentication
methods should still work as before.

Test plan:
Log in the staff and OPAC interfaces, logout.
Log in and call script that call the 3 different subroutines modified by
this patch. For instance you can list checkouts (that is using
check_cookie_auth) and display a patron's image (using check_api_auth).

QA with good knowledge of the C4::Auth module and the different
authentication methods is required.

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>
2 years agoBug 27949: (QA follow-up) Remove TODO
Nick Clemens [Thu, 7 Oct 2021 13:48:55 +0000 (13:48 +0000)]
Bug 27949: (QA follow-up) Remove TODO

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27949: Allow multiple article requests print slip
Agustin Moyano [Thu, 3 Jun 2021 20:41:22 +0000 (17:41 -0300)]
Bug 27949: Allow multiple article requests print slip

This bug allows for batch printing of multiple article requests slips

To test:
1. apply this patch
2. restart_all
3. enable ArticleRequests preference
4. create multiple article requests
5. go to circ/article-requests.pl in staff interface
6. print a single slip from a row
CHECK => it works as expected
7. select all rows and print slip from general actions menu (above the table)
SUCCESS => all article requests slips are printed
8. select multiple rows (not all) and print slip from general actions menu (above the table)
SUCCESS => only selected article requests slips are printed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: Perltidy!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29243: Correct call when adding items from staged records
Nick Clemens [Thu, 14 Oct 2021 11:30:21 +0000 (11:30 +0000)]
Bug 29243: Correct call when adding items from staged records

To test:
1 - Populate system preference  NewItemsDefaultLocation
2 - Stage a file of marc records
3 - Create an acquisitions basket with 'AcqCreateItems' set to 'ordering'
4 - Attempt to add to basket from your staged file
5 - You get a 500 error, and in the logs:
    Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605.
6 - Apply patch
7 - Repeat #4
8 - Success!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: (follow-up) Display count of modified items when too many to display
Nick Clemens [Fri, 15 Oct 2021 16:40:54 +0000 (16:40 +0000)]
Bug 28445: (follow-up) Display count of modified items when too many to display

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Split and join on ' | ' instead of '|' for repeatable
Jonathan Druart [Wed, 13 Oct 2021 15:51:52 +0000 (17:51 +0200)]
Bug 28445: Split and join on ' | ' instead of '|' for repeatable

Is that correct?!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Respect MaxItemsToDisplayForBatchMod from job detail view
Jonathan Druart [Wed, 13 Oct 2021 15:27:23 +0000 (17:27 +0200)]
Bug 28445: Respect MaxItemsToDisplayForBatchMod from job detail view

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: delete_biblios is a boolean
Jonathan Druart [Wed, 13 Oct 2021 15:18:38 +0000 (17:18 +0200)]
Bug 28445: delete_biblios is a boolean

Will fix:
Batch deletion failed: Cannot enqueue this job. (The error was: Can't use string ("on") as an ARRAY ref while "strict refs" in use at /kohadevbox/koha/Koha/BackgroundJob/BatchDeleteItem.pm line 214. , see the Koha log file for more information).

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Don't surround the whole batch with a transaction
Jonathan Druart [Mon, 11 Oct 2021 14:26:12 +0000 (16:26 +0200)]
Bug 28445: Don't surround the whole batch with a transaction

It makes more sense to commit when an item has successfully been modified and
so move the transaction inside the loop.

It also fixes the progress of the whole job.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Fix subfields to blank
Jonathan Druart [Mon, 11 Oct 2021 13:46:05 +0000 (15:46 +0200)]
Bug 28445: Fix subfields to blank

The value of the checkbox was not correct

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Improve robustness of tests
Jonathan Druart [Wed, 6 Oct 2021 13:45:17 +0000 (15:45 +0200)]
Bug 28445: Improve robustness of tests

* Libraries are ordered by name by default but if others have been added
the test may fail

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Don't display the items if not finished yet
Jonathan Druart [Wed, 28 Jul 2021 07:46:45 +0000 (09:46 +0200)]
Bug 28445: Don't display the items if not finished yet

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Fix encoding issue with the background job's report
Jonathan Druart [Tue, 27 Jul 2021 16:19:18 +0000 (18:19 +0200)]
Bug 28445: Fix encoding issue with the background job's report

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: UI change for repeatable and regex
Jonathan Druart [Tue, 27 Jul 2021 13:29:38 +0000 (15:29 +0200)]
Bug 28445: UI change for repeatable and regex

This patch applies the changes describe in the main commit message about
the "limitation" and "the behaviour in master was buggy".

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Use the task queue for the batch delete and update items tool
Jonathan Druart [Tue, 27 Jul 2021 09:05:54 +0000 (11:05 +0200)]
Bug 28445: Use the task queue for the batch delete and update items tool

Here we go!

Disclaimer: this patch is huge and does many things, but splitting it in
several chunks would be time consuming and painful to rebase. However it
adds many tests and isolate/refactor code to make it way more reusable.

This patchset will make the "batch item modification" and "batch item
deletion" features use the task queue (reminder: Since bug 28158, and so
21.05.00, we do no longer use the old "background job" functionality and
the user does not get any info about the progress of the job).

More than that, more of the code to build an item form and a list of
items is now isolated in module (.pm) and include files (.inc)

We are reusing the changes made by bug 27526 that simplifies the way we
edit/create items (no more unecessary serialization Koha > MARC > MARCXML
> XML > HTML)

New module:
* Koha::BackgroundJob::BatchDeleteItem
    Subclass for process item deletion in batch
* Koha::BackgroundJob::BatchUpdateItem
    Subclass for process item modification in batch
* Koha::Item::Attributes
    We needed an object to represent item's attributes that are not
    mapped with a koha field (aka "more subfields xml")
    This module will help us to create the marcxml from a hashref and the
    reverse.
* Koha::UI::Form::Builder::Item
    The code that was used to build the add/edit item form is
    centralised in this module. In conjunction with the
    subfields_for_item BLOCK (from html_helpers.inc) it will be really
    easy to reuse this code in other places where the item form is used
    (acquisition and serials modules)
* Koha::UI::Table::Builder::Items
    Same as previously for the table. We are now using this table from 3
    different places (batch item mod, batch item del, backgroung job
    detail view) and the code is only in one place.
    To use with items_table_batchmod BLOCK (still from html_helpers.inc)

This patch is fixing some bugs about repeatable subfields and regex. A UI
change will reflect the limitation: if you want to apply a regex on a
subfield you cannot add several subfields for the same subfield code.

Test plan:

Prepare the ground:
- Make sure you are always using a bibliographic/item record using the framework
you are modifying!
- Add some subfields for items that are not mapped with a koha field
(note that you can use 'é' for more fun, don't try more funny
characters)
- Make some subfields (mapped and not mapped with a kohafield)
repeatable
- Add default values to some of your subfields

There are 4 main screens to test:
1. Add/edit item form
The behaviour should be the same before and after this patch.
See test plan from bug 27526.
Those 2 prefs must be tested:
    * SubfieldsToAllowForRestrictedEditing
    * SubfieldsToUseWhenPrefill

2. Batch modification
a. Fill some values, play with repeatable and regex.
Note that the behaviour in master was buggy, only the first value was modified by the regex:
    * With subfield = "a | b"
    1 value added with "new"
    => "new | b"

    * With subfield = "a | b"
    2 new fields "new1","new2"
    => "new2 | b"

Important note: For repeatable subfields, a regex will apply on the subfields in
the "concatenated form". To apply the regex on all the different subfields of a given
subfield code you must use the "g" modifier.
This could be improved later, but keep in mind that it's not a regression or behaviour
change.

b. Play with the "Populate fields with default values from default framework" checkbox

c. Use this tool to modify items and play with the different sysprefs that
interfer with it:
    * NewItemsDefaultLocation
    * SubfieldsToAllowForRestrictedBatchmod
    * MaxItemsToDisplayForBatchMod
    * MaxItemsToProcessForBatchMod

3. Batch deletion
a. Batch delete some items
b. Check items out and try to delete them
c. Use the "Delete records if no items remain" checkbox to delete
bibliographic records without remaining items.
d. Play with the following sysprefs and confirm that it works as
expected:
    * MaxItemsToDisplayForBatchDel
e. Stress the tool: Go to the confirmation screen with items that can be
deleted, don't request the job to be processed right away, but check the
item out before.

4. Background job detail view
You must have seen it already if you are curious and tested the above.
When a new modification or deletion batch is requested, the confirmation
screen will tell you that the job has enqueued. A link to the progress
of the job can be followed.
On this screen you will be able to see the result of the job once it's
fully processed.

QA notes:
* There are some FIXME's that are not blocker in my opinion. Feel free to
discuss them if you have suggestions.
* Do we still need MaxItemsToProcessForBatchMod?
* Prior to this patchset we had a "Return to the cataloging module" link
if we went from the cataloguing module and that the biblio was deleted.
We cannot longer know if the biblio will be deleted but we could display
a "Go to the cataloging module" link on the "job has been enqueued"
screen regardless from where we were coming from.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Start form with empty library for batch mod
Jonathan Druart [Tue, 20 Jul 2021 15:44:20 +0000 (17:44 +0200)]
Bug 28445: Start form with empty library for batch mod

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Adjust code to handle regexs
Jonathan Druart [Mon, 26 Jul 2021 16:30:33 +0000 (18:30 +0200)]
Bug 28445: Adjust code to handle regexs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Use Koha::UI::Form::Builder::Item from batchmod as well
Jonathan Druart [Mon, 26 Jul 2021 16:29:16 +0000 (18:29 +0200)]
Bug 28445: Use Koha::UI::Form::Builder::Item from batchmod as well

Now that it's reusable, let use it somewhere else!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Move controller code to Koha::UI::Form::Builder::Item
Jonathan Druart [Mon, 26 Jul 2021 16:26:32 +0000 (18:26 +0200)]
Bug 28445: Move controller code to Koha::UI::Form::Builder::Item

To ease reusability

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>