Commit Graph

37762 Commits

Author SHA1 Message Date
Didier Gautheron 5cc580332c Bug 25982: OPAC shelves RSS link output is xml
Output rss feed as text/xml

Test plan:
1) have books entered
2) log in create a list
3) add books to list
4) display list in OPAC
5) click the RSS link button.
   -- output is displayed as html text
6) apply patch
7) repeat steps 4&5
   -- output is displayed as xml tree

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3d0da68d5a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 549cc995b2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-07 14:09:41 +12:00
Owen Leonard 5f209c6cb1 Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js
This patch adds the necessary JavaScript includes to the OPAC to
enable translation of strings in JavaScript. It also updates the
translation of cart-related strings by removing the strings from
opac-bottom.inc and putting them in basket.js where they are used.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

 - Update a translation:

   > cd misc/translator
   > perl translate update fr-FR

 - Open the corresponding .po file for the strings pulled from
   JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
 - Locate strings pulled from bootstrap/js/basket.js for
   translation, e.g.:

   #: koha-tmpl/opac-tmpl/bootstrap/js/basket.js:89
   msgid "Your cart is currently empty"
   msgstr ""

 - Edit the "msgstr" string however you want (it's just for testing)
 - Install the updated translation:

   > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated string appears. In the above example, by clicking the "Cart"
icon in the header when there are no items in the cart.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c8276bf0e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 46710cfc00)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-07 14:06:48 +12:00
Katrin Fischer 5dc4323941 Bug 25499: Fix fund code column when closing a budget
When closing a budget the fund code column in the table is
always empty. This is due to a TT variable not being correct.

To test:
- Create a budget and fund
- Order anything, leave basket open or not, but don't receive
- Duplicate your existing budget
- Close the first budget in order to move the pending orders
- Verify the fund code is not showing in the table
- Apply patch and reload the patch
- Verify fund codes are now showing correctly

Bonus: Changes the column heading Fund id to Fund ID.

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ab015f04dc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6ad9baace2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-07 13:48:41 +12:00
Mason James f19e6015b0 Bug 25920: Add liblocale-codes-perl package to fix ubuntu-stable (focal)
to test on ubuntu-20...

1/ install koha-common pkg
 $ sudo apt install koha-common

2/ confirm liblocale-codes-perl pkg is not installed :(
 $ apt-cache policy  liblocale-codes-perl | grep Installed
 Installed: (none)

3/ apply patch

4/ build and install new koha-common pkg

5/ confirm liblocale-codes-perl pkg is now installed :)
 $ apt-cache policy  liblocale-codes-perl | grep Installed
 Installed: 3.62-1

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 58be086a18)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 43aa7f36bf)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-07 13:42:10 +12:00
Jonathan Druart 493a0f2d54 Bug 24379: Fix failing tests
kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/Koha/Patrons/Import.t
t/db_dependent/Koha/Patrons/Import.t .. 2/159
 #   Failed test 'No warning raised by import_patrons'
 #   at t/db_dependent/Koha/Patrons/Import.t line 171.
 # found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
 # found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
 # didn't expect to find a warning
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
t/db_dependent/Koha/Patrons/Import.t .. 152/159 # Looks like you failed 1 test of 159.
t/db_dependent/Koha/Patrons/Import.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/159 subtests

Test Summary Report
-------------------
t/db_dependent/Koha/Patrons/Import.t (Wstat: 256 Tests: 159 Failed: 1)
  Failed test:  39
  Non-zero exit status: 1
Files=1, Tests=159,  3 wallclock secs ( 0.04 usr  0.01 sys +  2.11 cusr  0.24 csys =  2.40 CPU)
Result: FAIL

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 545e03c173)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c0e665aecc)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-05 12:09:11 +12:00
Aleisha Amohia f6c6a07693 Bug 24379: DBIC
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-05 12:08:00 +12:00
Aleisha Amohia a2139daaa5 Bug 24379: DBRev 19.11.08.002
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-05 12:07:40 +12:00
Nick Clemens f4899bafe3 Bug 24379: Make login_attempts not nullable
While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE

When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1

This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0

Let's default to 0 like we intend

To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
    SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable  OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!

Bug 24379: Fix the test

First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.

Bug 24379: Don't drop default of 0 for login attempts

When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set

To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bb31cffae)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6d675b61ad)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-05 12:04:55 +12:00
Aleisha Amohia 58e7d0b44a Bug 20882: DBIC
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-05 12:00:37 +12:00
Aleisha Amohia e0115e1572 Bug 24640: DBIC
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-08-05 11:55:20 +12:00
Aleisha Amohia adf8e12eb1 Bug 25709: DBRev 19.11.08.001 - fixing output message 2020-08-05 11:46:48 +12:00
Aleisha Amohia 54f653d270 Bug 25709: DBRev 19.11.08.001
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:39:32 +12:00
Nick Clemens aeb39a61bd Bug 25709: Rename systempreference to NotesToHide
In an effort to use more inclusive language we have added a new coding guideline:
https://wiki.koha-community.org/wiki/Coding_Guidelines#TERM3:_Inclusive_Language

This patchset renames a syspref to be clearer and follow the guideline

To test:
1 - Apply patch and updatedatabase
2 - git grep NotesBlacklist
3 - Note all remaining occurrences are translations, db updates, and release notes
4 - Add a field (e.g. '520' ) to the NotesToHide systempreference
5 - View a record with a 520 field on the opac
6 - Confirm the field does not show in the 'Title notes' tab

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5e45076c00)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f00ce94d94)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:38:54 +12:00
Kyle M Hall fa08592991 Bug 23086: Search for collection is broken
It appears that we are quoting the ccode values deep in the search code.
Under ICU chains this breaks searching by limits

To recreate
 1 - Setup Koha using Zebra and icuchains
 2 - Add ccode to AdvancedSearchTypes
 3 - In koha-conf.xml set zebra debug level to include request
  <zebra_loglevels>none,fatal,warn,request,info</zebra_loglevels>
 4 - Set some items into different ccodes
 5 - On opac perform a search for:
    ccode:NFIC
 6 - It works
 7 - tail -n 50 /var/log/koha/kohadev/zebra-output.log
 8 - Note search request like:
    Search biblios OK 26 1 1+0 RPN @attrset Bib-1 @attr 1=8009 NFIC
 9 - On opac go to advanced search, select Collection, and limit to smae code a s above
10 - No results
11 - Check the zebra-output.log:
    Search biblios OK 0 1 1+0 RPN @attrset Bib-1 @attr 1=8009 'NFIC'
12 - Apply patch
13 - Restart all
14 - Repeat search by collection limit
15 - Success!
16 - Check the zebra-output.log:
    Search biblios OK 0 1 1+0 RPN @attrset Bib-1 @attr 1=8009 NFIC
17 - Add a new ccode value: N)N
18 - Set some items to that ccode
19 - Confirm searching by that ccode works

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bc1b76be4a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4733a2a421)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:19:22 +12:00
Nick Clemens df53ab0094 Bug 23086: Unit test
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 40b6e1b8a1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a6e51934d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:19:03 +12:00
Lucas Gass d8c9583f2f Bug 25940: Check for reserve_id before Dopop
TEST PLAN:
1. Have an item belonging to a different branch and check it in.
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.
7. Apply patch
8. Repeat 1-6
9. You should no longer have two print dialogs

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0ec7ba7286)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 25f91e5f43)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:17:08 +12:00
Nick Clemens db5ae24f88 Bug 25724: Do not call ModReserveStatus when completing transfer
I can not see how this code is useful here. It checks for a reserve with priority 0 and found = NULL
That is not a status that should occur when filling a transfer. Either the found is 'T' if we are transferring due
to the hold, or the hold was placed after the transfer was initiated, and so the priority is not 0

Additional, AddReturn checks for reserves later and asks the staff to confirm waiting status.

ModReserveStatus also calls CartToShelf regardless of what happens here.

To test:
1 - Set  UpdateItemLocationOnCheckin  to:
    _ALL_: CART
2 - SetAutomaticItemReturn = Do
3 - Check an item in at a different branch than it's homebranch to create a transfer
4 - Check the item in at it's homebranch
5 - View the item details page
6 - Item is not in CART location
7 - Apply patch
8 - Repeat
9 - Item is in CART location after completion of transfer

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

Signed-off-by: Jason Robb <jrobb@sekls.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e025cd7643)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 51cd56ddb3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:14:49 +12:00
Nick Clemens 63802370ef Bug 25724: Unit tests
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jason Robb <jrobb@sekls.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 028e9a07db)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bc1e7669bd)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:14:40 +12:00
Jonathan Druart e1df84e9ec Bug 25729: Prevent Charges/Fees.t to fail on slow server
We must use t::lib::Dates::compare to compare dates

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fcd659b2d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ddfec0a706)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:12:22 +12:00
Jonathan Druart 63e28d62bd Bug 26033: Use pic.infini.fr instead of framapic
https://framapic.org/ is closing
"""
Framapic will be closing its doors on Tuesday, January 12, 2021. You will find a similar service on this page.
Uploading images is now disabled, but you can still retrieve your images on the My images page.
"""

https://framablog.org/2019/09/26/lets-de-frama-tify-the-internet/
https://framablog.org/2020/03/03/10-bonnes-raisons-de-fermer-certains-services-framasoft-la-5e-est-un-peu-bizarre/
(French)

We can still use another service. However we may think about hosting the
service ourself!

Test plan:
Modify a selenium script to make it fail (for instance modify the path
for a find_element call)
Run it
Confirm that the screenshot has been uploaded correctly and that the
link works

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8aa907379e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e51c7a73c0)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 03:10:03 +12:00
Aleisha Amohia cfedaa31c2 Bug 25984: Compile CSS
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:49:20 +12:00
Owen Leonard b2f5bbbbd7 Bug 25984: Add minimum height and width to shelf browser covers
This patch adds a class to the shelf browser cover image links and a
style for these links defining a minimum height and width. This allows
the browser's default tab focus outline to be visible.

This patch also adds a check for an enabled cover image service before
displaying the cover image links.

This patch introduces whitespace changes so diff accordingly.

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

- Enable the OPACShelfBrowser system preference.
- Enable at least one cover image service (Amazon, Google, Coce, etc).
- Locate a title in the OPAC which has items attached.
- On the bibliographic detail page, click the "Browse shelf" link in the
  table of holdings to display the shelf browser.
- Use the tab key to move the focus to cover images in the shelf
  browser.
- Confirm that the focus outline moves through each cover link whether
  or not there is a cover image available.
- Diable all cover image services.
- Test the shelf browser again and confirm that it's not necessary to
  tap through an empty row.

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>
(cherry picked from commit e722dd1725)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 84caea1238)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:48:37 +12:00
Martin Renvoize 922df35371 Bug 25244: Add specific aria-label to search results
This patch adds an arai-lebel to the select checkboxes on the search
results page of the OPAC.

Test plan
1/ Perform a search that will yield some results
2/ Inspect the 'checkbox' on the left side of the results table
3/ Note that there is no arai-label
4/ Apply patch
5/ Refresh the search results page
6/ Inspect the 'checkbox' on the left side of the results table
7/ Note that the aria-label now appears and contains relavant
information
8/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Bug 25244: (follow-up) QA corrections

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d1a7112a90)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ea51c1a865)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:40:10 +12:00
Julian Maurice 241a985c65 Bug 25922: Fix typo 'arial-label' -> 'aria-label'
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 73ff914d5d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 48ba19be8e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:38:06 +12:00
Martin Renvoize f16bedc635 Bug 25922: Add aria-label to the allowlist for translation
This patch adds aria-label to the allowlist for translations.

To test:
- Apply patches from here and bug 25244
- kshell
- cd misc/translator
- perl translate update de-DE
- Check for the aria-label in the diff
- Verify the strings appear in the po files now
- Translate them
- perl translate install de-DE
- Verify the translated strings appear in the template

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 280f1bdeb3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 21be26f25b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:37:57 +12:00
Martin Renvoize e0b84c8132 Bug 25237: Fix semantic heading for opac-details
Prior to this patch the opac-details view contained semantically incorrect h3
headings for the author information.

Test plan
1/ Perform a search in the OPAC that will yield results
2/ Navigate to any results detailed view
3/ Inspect the page and note that there are semantically incorrect headings
   H1 (Page title) > H2 (Item title) > H5 (Author)
4/ Apply the patch
5/ Reload the page
6/ Inspect the page and note that the semantically incorrect author block has
   been converted to a span with an 'h3' class for styling
7/ Note the page still appears nicely
8/ Signoff

Bonus points: Check with XSLT views enabled and disabled.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6b49a70b94)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bb805283f6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:35:56 +12:00
Martin Renvoize ca7607af5c Bug 25155: (follow-up) Increase headings levels by 1
In the previous patch we reduced the headings levels by 2, but this was
one level too many as we already have an H1 in the navbar and so all
other heading sets should start at level 2 to semantically follow the
title heading.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c9a0243f3a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a9597ea48)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:29:51 +12:00
Martin Renvoize 68f16bb340 Bug 25155: Fixing semantic headings login modal
The login modal headings were semantically incorrect prior to this
patch.

Test plan:
1) Click the 'Log in to your account' option to expose the modal
2) Use a headings inspector and note we jump from H1 (Page Title) -> H3
   (Modal Title)
3) Apply the patch and reload the page.
4) Click the 'Log in to your account' option to expose the modal
5) The modal should still appear well formed
6) Use a headings inspector and note we jump from H1 (Page Title) -> H2
   (Modal Title) -> H3 (Shibboleth title if enabled)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 513b226873)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 482fc13558)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:29:41 +12:00
Hayley Mapley 832076f727 Bug 25155: Fixing semantic headings in opac-auth.tt
Test plan:
1) Follow test plan from comment #1
2) Apply the patch
3) Reload the page, and note that is still displays fine
4) Check that the main heading is now an h1, and that the other headings
on the page make sense

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0bc47b5302)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7e22445509)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:29:30 +12:00
Didier Gautheron bc49cb0b13 Bug 25293: Don't call escapeHtml on null
Test Plan:

    1) Create two Checkouts
    2) view patron's checkout list
       cgi-bin/koha/members/moremember.pl?borrowernumber=pp <show
       checkout>
    3) in mysql shell delete a checkout home branch: update items set
       homebranch = null where itemnumber = xx;
    4) view patron's checkout list, again

    Without this patch the list is empty.

    Same if biblio title is null (update biblio set title = null where
    biblionumber = yy;).
    Javascript error:
    TypeError: oObj.title is null

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2b56ae1d4a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6cbd0a6257)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:11:24 +12:00
Lucas Gass 34127f17bf Bug 24473: Add $raw filter for Syndetics content
Syndetics offers enhanced content in the OPAC under the tabs 'Title Notes',
'Excerpt', 'About the author', 'Editions'. They provide this info as HTML
therefore we should filter it as $raw so the content shows up without the markup.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6b9572e0c8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit def7b5d170)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 02:05:55 +12:00
Didier Gautheron 7d1850d8ba Bug 25862: Prevent TinyMCE to mangle local url links
To test:
1 create a report 1 if it doesn't exist
2 open /cgi-bin/koha/tools/koha-news.pl
3 create a news
4 add a HTML link with Insert/Edit link tinyMCE dialog box to
  /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1"
5 save
6 on the main page "report 1" link returns a 404 error

Apply patch
7 Modify news' URL
8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2fbe775070)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ace1e3e53e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:59:25 +12:00
Fridolin Somers be39690df9 Bug 25868: Fix transfers page to show effective itemtype
In transfers page /cgi-bin/koha/circ/branchtransfers.pl :
Itemtype is always from biblioitems.itemtype, regardless of system preference item-level_itypes.

Patch also changes template to use the object Koha::Item.

Patch also fixes a small typo : closed <form> tag.

Test plan :
1) Test with both values of system preference 'item-level_itypes'
2) Go to Circulation > Transfert
3) Enter a barcode
4) Enter another barcode
5) Check you see in table all datas and that 'Item type' is 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>
(cherry picked from commit e441cb35fb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 797af67544)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:48:08 +12:00
Nick Clemens b4e9d551dc Bug 25869: Fix Coce display for lists
To test:
1 - Enable Coce for Opac
    CoceHost: https://coce.bywatersolutions.com
    CoceProviders: Select all
    OpacCoce: Enable
2 - Do a search on the Opac, confirm you see some covers
3 - Add some of the items with covers to a public list
4 - View the public list
5 - Note no covers display
6 - Apply patch
7 - Success!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f77a377c93)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ca2e551a4a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:33:32 +12:00
David Cook e119734445 Bug 25950: Remove <client> in X-Forwarded-For from proxy tests
This patch removes the <client> ip address in the X-Forwarded-For
header from being tested against koha_trusted_proxies.

Without this patch, REMOTE_ADDR will be set to null, if the <client>
ip address matches against koha_trusted_proxies.

To Test:
1. Run the unit test t/Koha/Middleware/RealIP.t

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7b84fda33b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8c27b372a4)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:26:38 +12:00
Andrew Fuerste-Henry 39547a6279 Bug 25726: make holds to pull ignore holds where found is not null and itemnumber is null
To test:
1- place 2 bib-level holds on available items
2- confirm they both show on Holds to Pull
3- edit one hold from the database to set found='T'
4- reload Holds to Pull, confirm it is now empty
5- apply patch
6- Reload Holds to Pull
7- confirm it now shows the hold you did not edit

Signed-off-by: donnab <donna@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Using capitals for SQL reserved words; added a FIXME
Tested with:
    update reserves set found='T', itemnumber=NULL where reserve_id=...
This should be a workaround while we fix the underlying problem.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 56220d211d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cb76501776)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:24:00 +12:00
Martin Renvoize f4c2d263ae Bug 25944: Schema fix for illrequests route
The illrequests path was missing the `comments` and `status_alias`
embedable relations in the path specification.

Test plan:
1/ Ensure you have the latest Mojolicious + OpenAPI modules installed.
2/ Navigate to the ill requests page and note that the table is empty.
3/ Note that under the networking tab in your browsers developer tools
that the api call fails with a 400 error.
4/ Apply the patch
5/ Refresh the page
6/ The table should now load and the api route should return a proper
200 response.
7/ Signoff

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch to a production server that was having the 400
error on the main ILL page, and the error was gone.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit 40ab030060)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0cd877fb74)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:19:02 +12:00
Nick Clemens fe86de9047 Bug 25566: Add option to ignore found holds and use it when checking high holds
To test:
 1 - Find or create a record with 10 items
 2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
 3 - Set circ rules to allow 1 hold per record on the relevant record
 4 - Place 3 holds on the record
 5 - Check one item in and confirm hold to set to waiting
 6 - Issue to the patron with the waiting hold
 7 - Get a notice that loan period is decreased
 8 - Don't confirm the checkout
 9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 96a8710350)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d59536e289)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 01:15:53 +12:00
Aleisha Amohia 4bc5656927 [19.11.x] Bug 25850: Tests fail when useDaysMode is not set to Calendar
t/db_dependent/Calendar.t tests fail

This patch is needed as long as useDaysMode is checked in
Koha::Calendar->_init

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-31 00:43:58 +12:00
Martin Renvoize ca186563c1 Bug 25850: Add tests for weekday holidays
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4ed4e468d2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e6522ea63c)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:58:04 +12:00
Nick Clemens 3a8c118931 Bug 25850: (QA follow-up) use dt_from_string
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 92970a9aba)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f63c82a30f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:57:55 +12:00
Martin Renvoize 93ad4e2d52 Bug 25850: (QA follow-up) Match logic in is_holiday
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afd88e1d21)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4c0d7b14be)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:57:46 +12:00
Andreas Jonsson 048f154e77 Bug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being Sunday.
1. Go to tools -> calendar and make sure Sundays are holidays by adding
   a holiday on a Sunday and selecting "Holiday repeated every same day
   of the week" and "Copy to all libraries" and save.
2. Go to administration -> system preferences and select "Use the
   calendar to push the due date to the next open matching weekday
   for weekly loan periods, or the next open day otherwise" for the
   system preference "useDaysMode" and save the system preferences.
3. Put the below code in a file name test.pl and execute it using
   the command "sudo koha-shell -c 'perl test.pl' kohadev"

   use Koha::Calendar;

   my $calendar = Koha::Calendar->new( branchcode => 'CPL' );
   $dt = DateTime->new(
       year       => 2020,
       month      => 06,
       day        => 21
   );

   print "This is a sunday: " .
   $dt->day_of_week . "\n";

   my $ndt = $calendar->next_open_days($dt, 0);

   print "This is a monday: " .
   $ndt->day_of_week . "\n";

4. Without the patch applied, this script
   will freeze after printing "This is a
   sunday ...".  Abort using ctrl-c.
5. Apply patch and run the script again.
   The test script will now complete.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 25127f4228)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 238b2af84f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:57:38 +12:00
Martin Renvoize 0656ff9a99 Bug 25850: Regression Test
This patch adds a unit test to test for an infinite loop as highlighted
by the bug.

Test plan
1/ Run the test before applying the fix
2/ The test should fail for 'Sundays'
3/ Apply the subsquent patch
4/ Re-run the test
5/ It should now pass

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 95c8d19530)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f5f3269e25)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:57:29 +12:00
Bernardo Gonzalez Kriegel 73e40ba804 Bug 25443: (follow-up) surround strings with <span>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 46d3ec264c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5680e79f0d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:48:02 +12:00
Katrin Fischer ad619e2dc3 Bug 25443: Improve translation of 'Select the record to link%s to'
Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:

Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link

To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d53b58cab8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f7b93ef9c5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:47:53 +12:00
Nick Clemens 0a1aee38b8 Bug 25890: Update sorting column for checkouts table
Test plan:
- Check some items out, all from different libraries
- Modify the checkout and due dates, like:
    2018-10-22
    2018-01-23
    2018-05-27
- Sort by checkout date, verify it is actually sorting on homebranch
- Apply patch
- Reload page
- Note you can now sort items correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6250c2dc15)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 33cb7a9d0b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:22:12 +12:00
Kyle M Hall fe7bb53b24 Bug 25914: Fix incorrect variable name causing relative's checkouts column to be empty in OPAC
In the OPAC, the title column in the relatives checkouts table is always empty.

Test Plan:
1) Enable viewing of relative's checkouts in OPAC
2) Check some items out to a patron
3) Log into the OPAC as a relative of that patron that should be able to
   view them
4) Note the title column is empty in the relative's checkouts tab
5) Apply this patch
6) Reload the page
7) Titles should appear in the title column!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0b69ff1ed7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d49844d0e1)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-30 23:12:10 +12:00
Aleisha Amohia 781c90b3f7 Update release notes for 19.11.08 release
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-22 14:55:28 +12:00
Aleisha Amohia 68af6695b0 Increment version for 19.11.08 release
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-22 12:53:18 +12:00