koha.git
3 years agoBug 25984: Add minimum height and width to shelf browser covers
Owen Leonard [Mon, 13 Jul 2020 15:18:23 +0000]
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>

3 years agoBug 25244: Add specific aria-label to search results
Martin Renvoize [Mon, 29 Jun 2020 14:55:17 +0000]
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>

3 years agoBug 25922: Fix typo 'arial-label' -> 'aria-label'
Julian Maurice [Fri, 3 Jul 2020 13:36:04 +0000]
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>

3 years agoBug 25922: Add aria-label to the allowlist for translation
Martin Renvoize [Fri, 3 Jul 2020 13:07:25 +0000]
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>

3 years agoBug 25237: Fix semantic heading for opac-details
Martin Renvoize [Thu, 11 Jun 2020 11:45:57 +0000]
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>

3 years agoBug 25155: (follow-up) Increase headings levels by 1
Martin Renvoize [Thu, 11 Jun 2020 09:14:03 +0000]
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>

3 years agoBug 25155: Fixing semantic headings login modal
Martin Renvoize [Thu, 11 Jun 2020 08:32:45 +0000]
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>

3 years agoBug 25155: Fixing semantic headings in opac-auth.tt
Hayley Mapley [Thu, 11 Jun 2020 01:13:30 +0000]
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>

3 years agoBug 24625: Store showLastPatron information using localStorage
Owen Leonard [Wed, 1 Apr 2020 16:06:33 +0000]
Bug 24625: Store showLastPatron information using localStorage

This patch removes the use of jquery.cookie to store "last patron"
information, using localStorage instead. jquery.cookie.js is obsolete.
See Bug 24624.

localStorage has been chosen as an alternative in this situation because
it does not require transmission between the client and the server. See
Bug 12410.

Because there is no "session only" option with localStorage, additional
handling of the showLastPatron data is added to the login page. That
takes care of "stale" last patron information if user didn't log out but
the session expired for some reason.

To test apply the patch and enable the showLastPatron system preference.

 1. Load a patron's account for checkout
 2. Navigate away from patron-related pages: Perform a catalog search
    from the search header form and open the detail page from the search
    results. Confirm that the correct last patron information still
    shows.
 3. Load another patron's account for checkout
    - There should now be a "Last patron" link in the breadcrumbs bar
      which links to the patron in step 1. Hovering your mouse over the
      link should display a tooltip containing the patron's name and
      card number.
    - Click the "X" to clear the last patron information. The last
      patron link should go away.
 4. Log out and log back in. The last patron information should be gone.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

3 years agoBug 24165: Add ability to send any item field in a library chosen SIP field
Kyle M Hall [Tue, 3 Dec 2019 20:16:57 +0000]
Bug 24165: Add ability to send any item field in a library chosen SIP field

Some SIP devices need access to item fields that are not sent as item information in the checkin, checkout and item information responses.
It makes sense to allow these fields to be sent in an arbitrary and configurable way, rather than hard code in each special case.

Test Plan:
1) Apply this patch
2) Edit your SIP2 config file, add the following within the login stanza:
   <item_field field="XX" code="<item field 1>" />
   <item_field field="XZ" code="<item fied 2>" />
   where <item field 1> and <item field 2> are item table columns of your choosing
3) Using the sip cli emulator, run checkout, checkin and item information
   messages using that item.
4) Note the values you set for the item columns are sent in the
   corrosponding fields!

Signed-off-by: Jill Kleven <jill.kleven@pueblolibrary.org>
Fixed merge conflict with number of tests (was 5, changed to 7 which is correct)
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

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

3 years agoBug 23820: (QA follow-up) Make label clickable for checkbox
Katrin Fischer [Wed, 1 Jul 2020 11:30:18 +0000]
Bug 23820: (QA follow-up) Make label clickable for checkbox

By adding an id the checkbox is selected when the label is clicked
enhancing usability.

Also adds a colon : to the label.

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

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

3 years agoBug 23820: Add test for new behaviour
Agustin Moyano [Fri, 29 May 2020 16:16:29 +0000]
Bug 23820: Add test for new behaviour

To test:
1. prove t/db_dependent/api/v1/clubs_holds.t
2. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS

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

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

3 years agoBug 23820: Add checkout to default to patron's home branch on club hold
Agustin Moyano [Mon, 30 Mar 2020 18:56:18 +0000]
Bug 23820: Add checkout to default to patron's home branch on club hold

This patch adds a checkbox to make holds created by club hold to default to patron's home branch if possible.

To test:
1. Apply this patch
2. Create a club, and add two patrons (from now on called patron A and patron B) to it, each one form a different library..
3. Create a hold for the club, and in the details set pickup location different from any of the patrons.
4. Check "Pickup at patron's home library when possible" checkbox
SUCCESS => when submitted, pickup location of holds defaults to patron's home branch
5. Modify patron A's library and set pickup location to no.
6. Repeat steps 3 and 4.
SUCCESS => when submitted, patron A's hold now points to pickup location setted on step 3, and patron B's hold still points to his home branch.
7. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS

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>

3 years agoBug 23391: DBRev 20.06.00.009
Jonathan Druart [Mon, 20 Jul 2020 14:15:20 +0000]
Bug 23391: DBRev 20.06.00.009

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

3 years agoBug 23391: Remove warnings
Jonathan Druart [Mon, 20 Jul 2020 15:44:40 +0000]
Bug 23391: Remove warnings

t/db_dependent/api/v1/illrequests.t .. Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61.
Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61.
Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61.
Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61.
Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61.
t/db_dependent/api/v1/illrequests.t .. ok

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

3 years agoBug 23391: Hide finished ILL requests
Magnus Enger [Thu, 12 Dec 2019 14:07:03 +0000]
Bug 23391: Hide finished ILL requests

Currently, the main table of ILL requests will display all ILL
requests in the database, regardless of their status. For libraries
with active ILL this quickly leads to a lot of requests being displayed,
and the main page of the ILL module taking a long time to load. This
patch proposes to fix this by introducing the ILLHiddenRequestStatuses
syspref, which can take a pipe-separated list of ILL statuses that
will be hidden from view in the ILL module. This means that the
only way to find a hidden request will be through a report.

To test:
- Apply the patch and make sure the atomic database update is run
- Make sure you have a few ILL requests, with at least two different
  statuses
- Check that all requests are still displayed in the main table of
  ILL requests
- Add one of the statuses* you have in your database to the
  ILLHiddenRequestStatuses syspref, reload the ILL module frontpage
  and verify that requests with the given status are not displayed
- Change the syspref to another status and verify requests with
  that status are now hidden
- Change the syspref to hold both statuses, separated by the pipe
  symbol (e.g.: A|B). Verify that no requests with the given
  statuses are now displayed
- Run the ILL REST API tests, e.g.:
  $ sudo koha-shell -c "prove t/db_dependent/api/v1/illrequests.t" kohadev

* = The ILLHiddenRequestStatuses syspref should hold status codes, like
"REQ" and "NEW", not their human readable counterparts.

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

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

3 years agoBug 23148: DBRev 20.06.00.008
Jonathan Druart [Mon, 20 Jul 2020 14:46:19 +0000]
Bug 23148: DBRev 20.06.00.008

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

3 years agoBug 23148: Fix bridge image paths in de-DE installer files
Julian Maurice [Fri, 3 Jul 2020 06:58:50 +0000]
Bug 23148: Fix bridge image paths in de-DE installer files

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

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

3 years agoBug 23148: (follow-up) Correct image paths in sample data and tests
Owen Leonard [Mon, 29 Jun 2020 11:57:52 +0000]
Bug 23148: (follow-up) Correct image paths in sample data and tests

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

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

3 years agoBug 23148: (follow-up) Replace gif files in the OPAC with pngs
Owen Leonard [Fri, 26 Jun 2020 16:37:28 +0000]
Bug 23148: (follow-up) Replace gif files in the OPAC with pngs

This patch removes the old gif files from the OPAC bridge set and
replaces them with png files.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

3 years agoBug 23148: Replace Bridge icons with transparent PNG files
Owen Leonard [Fri, 11 Oct 2019 20:14:33 +0000]
Bug 23148: Replace Bridge icons with transparent PNG files

This patch adds SVG versions of the Bridge item type icon set to
misc/interface_customization/itemtypeimg/bridge. It adds some
new icons, and updates some existing icons. All GIF versions of the
icons are replaced with transparent PNG files.

Icon changes:

- English text has been removed from all icons
- New icon for "Periodical," to differentiate from "Journal"
- New icon, "Controller" for video games
- New icon for "Laserdisk" to differentiate from "DVD"
- New icon for "Kit" to differentiate from "Archive"
- New icon, "Reference books."
- Updated "badges" on "Juvenile book" and "Reserve book" to try to
  express the information without English-specific letters.

Before applying the patch, update some item types or collection codes
with Bridge icons. Apply the patch and run the database update process.

 - Open the advanced search page in the staff client and confirm that
   your item type or collection code icons were updated correctly.
 - Go to Administration -> Item types and edit an item type.
   - Check the "bridge" tab and confirm that the icon options look
     correct.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

3 years agoBug 23070: Pass no_triggers => 1 to Koha::Objects->update
Jonathan Druart [Wed, 29 Apr 2020 10:19:46 +0000]
Bug 23070: Pass no_triggers => 1 to Koha::Objects->update

To make sure we will update all the objects in one go (and no trigger
the ->set->store from Koha::Object->update)

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

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

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

3 years agoBug 23070: Increment all priorities in 1 query
Jonathan Druart [Mon, 27 Jan 2020 13:55:54 +0000]
Bug 23070: Increment all priorities in 1 query

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

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

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

3 years agoBug 23070: Add tests
Jonathan Druart [Mon, 27 Jan 2020 13:53:23 +0000]
Bug 23070: Add tests

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

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

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

3 years agoBug 23070: Use Koha::Hold in C4::Reserves::RevertWaitingStatus
Jonathan Druart [Thu, 6 Jun 2019 20:14:28 +0000]
Bug 23070: Use Koha::Hold in C4::Reserves::RevertWaitingStatus

We are using raw SQL statements, we should use Koha::Hold instead.

This patch does not seem optimal, we would like to increment priority in
only 1 statement and without the need to fetch and loop all holds.

== Test plan ==
- apply patch
- place some holds on the same record
- check that the priorities look good
- mark one hold as waiting by doing a check-in
- revert the waiting status
- confirm that the priorities are recalculated correctly

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

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

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

3 years agoBug 22844: DBRev 20.06.00.007
Jonathan Druart [Mon, 20 Jul 2020 14:05:38 +0000]
Bug 22844: DBRev 20.06.00.007

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

3 years agoBug 22844: DBIC schema changes
Jonathan Druart [Mon, 20 Jul 2020 12:42:46 +0000]
Bug 22844: DBIC schema changes

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

3 years agoBug 22844: Remove 'separate columns with |' from prefs description
Jonathan Druart [Wed, 29 Apr 2020 08:37:23 +0000]
Bug 22844: Remove 'separate columns with |' from prefs description

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

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

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

3 years agoBug 22844: Make the patron's attribute mandatory at the OPAC
Jonathan Druart [Tue, 28 Apr 2020 11:09:49 +0000]
Bug 22844: Make the patron's attribute mandatory at the OPAC

Test plan:
- Set 1+ patron's attribute(s) mandatory
- Use the self-registration feature and confirm that you cannot selfreg
if the attribute has no value (or empty string)
- Same with the modification form (logged in)

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

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

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

3 years agoBug 22844: Add is_boolean flag for new 'mandatory' column
Jonathan Druart [Mon, 3 Feb 2020 13:50:28 +0000]
Bug 22844: Add is_boolean flag for new 'mandatory' column

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

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

3 years agoBug 22844: (QA follow-up) Build items.json for UniqueItemFields
Marcel de Rooy [Fri, 10 May 2019 08:49:26 +0000]
Bug 22844: (QA follow-up) Build items.json for UniqueItemFields

Adding items.json, built from latest kohastructure.sql.
Control UniqueItemFields with this source file.
And add StatisticsFields.

Test plan:
Go to Preferences, play with UniqueItemFields.
Adjust StatisticsFields and look at patron record, statistics tab.

Moved-from: Bug 22867
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

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

3 years agoBug 22844: Make the attribute mandatory when editing a patron
Jonathan Druart [Fri, 17 May 2019 14:30:02 +0000]
Bug 22844: Make the attribute mandatory when editing a patron

Note: I am not confident with this patch, I think it's not polished. I
will not have time to improve it to make it ready for 19.05.00
1. Conflict with bug 20443 (which would have make this change way much
easier!)
2. It does not work :) You will be able to submit the memberentry form
even if the patron attribute is marked as mandatory (??)
3. What about the OPAC?
4. What about repeatable fields? We certainly will need JS code here
5. What about the "Quick add" feature? (I had trouble in the past to not
introduce regression when we played with this template...)

Do not forget to run updatedatabase.pl and regenerate DBIC schema if you
want to play with this patchset.

Signed-off-by: David Nind <david@davidnind.com>

Bug 22844: (follow-up) Make the attribute mandatory when editing a patron

Previous patch forgot the most important, adding the required attribute
to the select/textarea

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

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

3 years agoBug 22844: Add the new entry to the patron attr types form
Jonathan Druart [Fri, 17 May 2019 14:14:00 +0000]
Bug 22844: Add the new entry to the patron attr types form

Will conflict with bug 20443 \o/

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

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

3 years agoBug 22844: Add the new DB column borrower_attribute_types.mandatory
Jonathan Druart [Fri, 17 May 2019 14:06:04 +0000]
Bug 22844: Add the new DB column borrower_attribute_types.mandatory

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

https://bugs.koha-community.org/show_bug.cgi?id=23391

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

3 years agoBug 22844: (QA follow-up) Add pref PatronQuickAddFields too
Marcel de Rooy [Fri, 10 May 2019 08:54:44 +0000]
Bug 22844: (QA follow-up) Add pref PatronQuickAddFields too

Description slightly adjusted.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

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

3 years agoBug 22844: Simplify the process of selecting database columns for system preferences
Owen Leonard [Fri, 3 May 2019 13:56:02 +0000]
Bug 22844: Simplify the process of selecting database columns for system preferences

This patch introduces a new way for users to select database columns for
system preferences like BorrowerMandatoryField, which currently
require hand-typing of database names.

This new system uses a JSON file containing label:column pairs for
database columns which are relevant to preferences which reference
borrower table columns. My intention was to have user-friendly values as
the labels, but embedding English strings in JSON would make them
untranslatable.

The following preferences are affected:

 - BorrowerMandatoryField
 - BorrowerUnwantedField
 - PatronSelfModificationBorrowerUnwantedField
 - PatronSelfRegistrationBorrowerMandatoryField
 - PatronSelfRegistrationBorrowerUnwantedField

== Test plan ==
 - apply the patches
 - regenerate the staff client CSS (yarn build)
 - updatedatabase
 - dbic
 - flush_memcached
 - restart_all to make sure the updated .pref file is used

 - Go to Administration -> System preferences, and search for
   "PatronSelf"
 - The input fields for PatronSelfModificationBorrowerUnwantedField,
   PatronSelfRegistrationBorrowerMandatoryField, and
   PatronSelfRegistrationBorrowerUnwantedField should appear as "locked"
   (read-only) inputs.
 - Clicking the input field should trigger a modal window with
   checkboxes for each available column from the borrowers table.
 - Test that the "select all" and "clear all" links work correctly.
 - Test that the "cancel" link closes the modal without saving your
   selections.
 - Test that the "Save" button closes the modal, copies your selections
   to the form field, and triggers the preference-saving function (this
   eliminates the need to click a save button again after closing the
   modal).
   - Test this process by making modifications to all three different
     preferences, confirming that the right data is preselected each
     time the modal is shown and the right data is saved to the right
     field each time.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

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

3 years agoBug 8338: (QA follow-up) Clean up warning
Martin Renvoize [Tue, 23 Jun 2020 14:10:50 +0000]
Bug 8338: (QA follow-up) Clean up warning

This patch moves the accountline->store call below the FinesLog code
such that we return the same 'thing' from _FixOverduesOnReturn as the
other clauses of the routine.

We also take the oportunity to clean up the warning thrown by an errant
call to the routine such that we output the actual itemnumber rather
than a HASH reference marker.

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

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

3 years agoBug 8338: (QA follow-up) Fix perlcritic error
Martin Renvoize [Mon, 22 Jun 2020 07:49:15 +0000]
Bug 8338: (QA follow-up) Fix perlcritic error

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

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

3 years agoBug 8338: (follow-up) Fix test
Martin Renvoize [Tue, 2 Jun 2020 16:37:38 +0000]
Bug 8338: (follow-up) Fix test

This patch moves the previous test introduced with bug 24075 into the
same block as the rest of the AddReturn tests and updates it to test for
the new 'remove accountline' behaviour as well as the reduce and refund
behaviour.

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

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

3 years agoBug 8338: Remove zero amount overdues on backdated returns where appropriate
Martin Renvoize [Wed, 13 May 2020 13:11:38 +0000]
Bug 8338: Remove zero amount overdues on backdated returns where appropriate

This patch removes any overdues which would be reversed on a backdated
return if CalcFineOnBackdate is enabled and the user has not already
attempted to pay off the accruing fine.

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>

3 years agoBug 8338: Unit Tests
Martin Renvoize [Wed, 13 May 2020 13:11:16 +0000]
Bug 8338: Unit Tests

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>

3 years agoBug 24153: (QA follow-up) Removing one redundant initialization line
Marcel de Rooy [Thu, 2 Jul 2020 08:35:07 +0000]
Bug 24153: (QA follow-up) Removing one redundant initialization line

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24153: Add the confirm flag to the crontab calls
Jonathan Druart [Wed, 24 Jun 2020 14:14:29 +0000]
Bug 24153: Add the confirm flag to the crontab calls

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24153: Make sure $count will not be reused for another purpose
Jonathan Druart [Wed, 24 Jun 2020 14:11:21 +0000]
Bug 24153: Make sure $count will not be reused for another purpose

The $count variable should be defined per block and set to 0 to avoid
confusion.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24153: Improve verbose messages in dry-run mode
Jonathan Druart [Wed, 24 Jun 2020 14:09:05 +0000]
Bug 24153: Improve verbose messages in dry-run mode

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24153: Remove warning for message queue
Jonathan Druart [Tue, 23 Jun 2020 10:19:09 +0000]
Bug 24153: Remove warning for message queue

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24153: Add a confirm flag to cleanup_database
Jonathan Druart [Sat, 30 Nov 2019 13:16:54 +0000]
Bug 24153: Add a confirm flag to cleanup_database

How handy this will be, right?

This patch will change the behavior of this script as the --confirm flag
will now be required for effective changes.
Without --confirm and with --verbose you will see what could have done
the script in non dry-run mode.

Test plan:
Use different options of the script without the --confirm flag and have
a look at the output. It now tells you what would have been deleted if
the flag was passed.
Now use the --confirm flag and confirm that the changes are now
effective.

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24152: Allow purge with 0 day
Jonathan Druart [Tue, 23 Jun 2020 10:02:35 +0000]
Bug 24152: Allow purge with 0 day

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

3 years agoBug 24152: (QA follow-up) Add tests for alternative from and to pars
Marcel de Rooy [Fri, 19 Jun 2020 07:59:50 +0000]
Bug 24152: (QA follow-up) Add tests for alternative from and to pars

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24152: Add the ability to purge pseudonymized tables
Jonathan Druart [Fri, 29 Nov 2019 15:08:16 +0000]
Bug 24152: Add the ability to purge pseudonymized tables

anonymized_* tables have been added by bug 24151, this patch adds the
usual way to purge data from them.

The cleanup_database.pl script has been adjusted to take new parameters
that will help to delete pseudonymized data.

Test plan:
Call the scrip with the new parameter to remove pseudonymized data
* --pseudo-transactions DAYS will remove entries from pseudonymized_transactions older
than DAYS day
* --pseudo-transactions can be used without the parameter DAYS but with
-- pseudo-transactions-from and/or --pseudo-transactions-to instead, to provide a
range of date

You can use the patch from bug 24153 to make the tests easier, data will
not be deleted if the new --confirm flag is not passed.

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24152: Add a warning about the delete of statistics's table entries
Jonathan Druart [Tue, 24 Sep 2019 21:09:10 +0000]
Bug 24152: Add a warning about the delete of statistics's table entries

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24152: Add method Koha::Objects->filter_by_last_update
Jonathan Druart [Tue, 24 Sep 2019 21:05:38 +0000]
Bug 24152: Add method Koha::Objects->filter_by_last_update

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: DBRev 20.06.00.006
Jonathan Druart [Mon, 20 Jul 2020 14:03:39 +0000]
Bug 24151: DBRev 20.06.00.006

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

3 years agoBug 24151: Rename the config key with 'bcrypt_settings'
Jonathan Druart [Wed, 24 Jun 2020 14:45:12 +0000]
Bug 24151: Rename the config key with 'bcrypt_settings'

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

3 years agoBug 24151: Add description for tests
Jonathan Druart [Tue, 23 Jun 2020 09:49:15 +0000]
Bug 24151: Add description for tests

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

3 years agoBug 24151: (QA follow-up) Fix POD warnings from QA tools
Marcel de Rooy [Fri, 19 Jun 2020 07:27:35 +0000]
Bug 24151: (QA follow-up) Fix POD warnings from QA tools

                POD is missing for get_hash
                POD is missing for new_from_statistic
                POD is missing for 'object_class'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: (QA follow-up) Correct license in two modules
Marcel de Rooy [Fri, 19 Jun 2020 06:10:43 +0000]
Bug 24151: (QA follow-up) Correct license in two modules

Still listing the address..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: DBIC changes
Jonathan Druart [Tue, 17 Mar 2020 16:36:14 +0000]
Bug 24151: DBIC changes

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add items.homebranch to the list
Jonathan Druart [Tue, 17 Mar 2020 16:36:05 +0000]
Bug 24151: Add items.homebranch to the list

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Fix location on return
Jonathan Druart [Mon, 9 Mar 2020 09:17:10 +0000]
Bug 24151: Fix location on return

The item's location where not passed to UpdateStat

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add boolean flag for has_cardnumber
Jonathan Druart [Sat, 30 Nov 2019 12:35:06 +0000]
Bug 24151: Add boolean flag for has_cardnumber

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: DBIC changes
Jonathan Druart [Sat, 11 Jan 2020 17:14:55 +0000]
Bug 24151: DBIC changes

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Sync patron's attributes
Jonathan Druart [Sat, 11 Jan 2020 15:43:40 +0000]
Bug 24151: Sync patron's attributes

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Adding keep_for_anonymized to the UI
Jonathan Druart [Wed, 27 Nov 2019 15:43:00 +0000]
Bug 24151: Adding keep_for_anonymized to the UI

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add new column borrower_attribute_types.keep_for_pseudonymization
Jonathan Druart [Wed, 27 Nov 2019 13:55:04 +0000]
Bug 24151: Add new column borrower_attribute_types.keep_for_pseudonymization

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: DB changes - pseudonymized_borrower_attributes
Jonathan Druart [Wed, 27 Nov 2019 13:49:17 +0000]
Bug 24151: DB changes - pseudonymized_borrower_attributes

Add a new DB table pseudonymized_borrower_attributes

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add key to the config
Jonathan Druart [Tue, 26 Nov 2019 20:07:04 +0000]
Bug 24151: Add key to the config

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add warning to the about page if key is missing in the config
Jonathan Druart [Tue, 26 Nov 2019 19:31:14 +0000]
Bug 24151: Add warning to the about page if key is missing in the config

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add tests - if config does not exist
Jonathan Druart [Sat, 30 Nov 2019 11:48:04 +0000]
Bug 24151: Add tests - if config does not exist

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Add tests
Jonathan Druart [Tue, 26 Nov 2019 16:40:15 +0000]
Bug 24151: Add tests

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: Copy info to the pseudonymized table when a transaction is done
Jonathan Druart [Fri, 22 Nov 2019 16:37:42 +0000]
Bug 24151: Copy info to the pseudonymized table when a transaction is done

This is the commit where you will find useful information about this development.

The goal of this new feature is to add a way to pseudonymize patron's
data, in a way they could not be personally identifiable.
https://en.wikipedia.org/wiki/Pseudonymization

There are different existing way to anonymize patron's information in
Koha, but we loose the ability to make useful report.
This development proposes to have 2 different tables:
  * 1 for transactions and patrons data (pseudonymized_transactions)
  * 1 for patrons' attributes (pseudonymized_borrower_attributes)
Entries to pseudonymized_transactions are added when a new transaction
(checkout, checkin, renew, on-site checkout) is done.
Also, anonymized_borrower_attributes is populated if patron's attributes are
marked as "keep for pseudonymization".

To make those informations not identifiable to a patron, we are having a
hashed_borrowernumber column in pseudonymized_transactions. This hash will be
generated (Blowfish-based crypt) using a key stored in the Koha
configuration.

To make things configurable, we are adding 3 sysprefs and 1 new DB
column:
  * syspref Pseudonymization to turn on/off the whole feature
  * syspref PseudonymizationPatronFields to list the informations of the
  patrons to sync
  * syspref PseudonymizationTransactionFields to list the informations
  of the transactions to copy
  * DB column borrower_attribute_types.keep_for_pseudonymization that is a
  boolean to enable/disable the copy of a given patron's attribute type.

Test plan:
1/ Turn on Pseudonymization
2/ Define in PseudonymizationPatronFields and
PseudonymizationTransactionFields the different fields you want to copy
3/ Go to the about page
=> You will see a warning about a missing config entry
4/ You need to generate a key and put it in the koha-conf.xml file. The
following command will generate one:
  % htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/'
Then edit $KOHA_CONF and add it before of the end of the config section (</config)
  it should be something like:
    <key>$2a$10$PfdrEBdRcL2MZlEtKueyLegxI6zg735jD07GRnc1bt.N/ZYMvBAB2</key>
5/ Restart memcached then plack (alias restart_all)
=> Everything is setup!
6/ Create a new transaction (checkin for instance)
=> Confirm that a new entry has been added to pseudonymized_transaction with the data
you expect to be copied
7/ Edit some patron attribute types and tick "Keep for pseudonymization"
8/ Create a new transaction
=> Confirm that new entries have been added to pseudonymized_borrower_attributes
11/ Delete the patrons
=> Confirm that the entries still exist in the pseudonymized_* tables
12/ Purge the patrons (ie. use cleanup_database.pl to remove them from
the deleted_borrowers table)
=> Confirm that the entries still exist in the pseudonymized_* tables

See bug 24152 to remove data from the anonymized_* tables

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: DBIC changes
Jonathan Druart [Sat, 11 Jan 2020 15:56:10 +0000]
Bug 24151: DBIC changes

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 24151: DB changes
Jonathan Druart [Fri, 22 Nov 2019 14:38:34 +0000]
Bug 24151: DB changes

1 new table:
 * pseudonymized_transactions

3 new sysprefs:
 * Pseudonymization
 * PseudonymizationPatronFields
 * PseudonymizationTransactionFields

Sponsored-by: Association KohaLa - https://koha-fr.org/

Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 26005: OPAC cart display fails with error
Owen Leonard [Fri, 17 Jul 2020 13:57:34 +0000]
Bug 26005: OPAC cart display fails with error

This patch removes the "opac_option" parameter from opac-basket.pl. It
was included in Bug 25402 because the bug was dependent on 5087.

To test, apply the patch and add some items to the Cart in the OPAC.
Click the Cart button to show the cart. The pop-up window should load
correctly without errors.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

3 years agoBug 24379: Fix failing tests
Jonathan Druart [Mon, 20 Jul 2020 13:16:29 +0000]
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>

3 years agoBug 25293: Don't call escapeHtml on null
Didier Gautheron [Tue, 28 Apr 2020 05:43:46 +0000]
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>

3 years agoBug 25896: Add missing closing </td> tag
Slava Shishkin [Mon, 29 Jun 2020 19:26:42 +0000]
Bug 25896: Add missing closing </td> tag

File koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt had
one lost closing </td> tag in "daysmode" block. Added.

Mentored-by: Andrew Nugged <nugged@gmail.com>

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

3 years agoBug 25974: Remove inline style from table settings administration page
Owen Leonard [Fri, 10 Jul 2020 14:30:09 +0000]
Bug 25974: Remove inline style from table settings administration page

This patch removes an inline style attribute from the table settings
administration template. A different style is added to the page's
<style> block to try to accomplish a similar effect of expressing the
hierarchy of the page.

To test, apply the patch and go to Administration -> Table settings.

The individual tables of settings should be offset from the headings
above them.

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>

3 years agoBug 25987: Fix alignment of fields in label batch creation form
Owen Leonard [Tue, 14 Jul 2020 21:30:39 +0000]
Bug 25987: Fix alignment of fields in label batch creation form

This patch makes minor markup changes to the template for the label
batch creation process so that form fields line up correctly.

Unrelated change: A hint has been moved out of the label area to below
the textarea in order to conform with established patterns.

To test, apply the patch and go to Tools > Label creator > New > Label
batch.

 - In the batch creation form the "Enter by itemnumber" and "Enter by
   barcode" should be aligned correctly with each other.
 - The "One number per line..." hint should appear below the textarea.
 - Test that the form fields are still correctly aligned after adding
   some items to the batch and the "description" field is shown in the
   form.

Works for me!

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

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

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

3 years agoBug 24473: Add $raw filter for Syndetics content
Lucas Gass [Tue, 21 Jan 2020 17:53:09 +0000]
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>

3 years agoBug 25862: Prevent TinyMCE to mangle local url links
Didier Gautheron [Wed, 24 Jun 2020 14:03:16 +0000]
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>

3 years agoBug 24379: DBIC schema changes
Jonathan Druart [Mon, 20 Jul 2020 10:57:00 +0000]
Bug 24379: DBIC schema changes

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

3 years agoBug 24379: DBRev 20.06.00.005
Jonathan Druart [Mon, 20 Jul 2020 10:53:43 +0000]
Bug 24379: DBRev 20.06.00.005

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

3 years agoBug 24379: Make login_attempts not nullable
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +0000]
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>

3 years agoBug 25868: Fix transfers page to show effective itemtype
Fridolin Somers [Wed, 24 Jun 2020 15:05:30 +0000]
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>

3 years agoBug 25869: Fix Coce display for lists
Nick Clemens [Wed, 24 Jun 2020 16:17:19 +0000]
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>

3 years agoBug 25950: Remove <client> in X-Forwarded-For from proxy tests
David Cook [Wed, 8 Jul 2020 07:10:50 +0000]
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>

3 years agoBug 25726: make holds to pull ignore holds where found is not null and itemnumber...
Andrew Fuerste-Henry [Fri, 12 Jun 2020 13:51:16 +0000]
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>

3 years agoBug 25909: Recent change to datatables JS in the OPAC causes errors
Owen Leonard [Thu, 2 Jul 2020 12:50:17 +0000]
Bug 25909: Recent change to datatables JS in the OPAC causes errors

This patch reverts some changes made by Bug 25287 which prematurely
introduced the double-underscore i18n function. The i18n features
haven't been fully implemented in the OPAC.

Some lines are reverts to the previous version, and some are additions,
for instance where Bug 25287 introduced new DataTables features and a
new string translation is required.

In addition to i18n changes, the patch also reverts the default
configuration of DataTables in the OPAC so that the "dom" configuration
option is set back to "t." This turns off features like pagination
buttons, filters, etc. which were previously disabled by default.

Enabling these features requires revision to the OPAC CSS in order for
them to display well.

To test, apply the patch and view a page in the OPAC which includes a
DataTable. For instance: checkouts on the "your summary" page, serial
issues on the "full subscription history" page.

Tables should display correctly and sorting should work correctly. There
should be no other DataTables controls visible.

To test translatability:

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
      the templates  e.g.  misc/translator/po/fr-FR-opac-bootstrap.po
    - Locate strings pulled from bootstrap/en/includes/datatables.inc
      for translation, e.g.:

      #. SCRIPT
      #: opac-tmpl/bootstrap/en/includes/datatables.inc:4
      msgid "Copy to clipboard"
      msgstr ""

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

      > perl translate install fr-FR

Open the translated copy of datatables.inc and confirm that the
translated string appears.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25944: Schema fix for illrequests route
Martin Renvoize [Tue, 7 Jul 2020 08:27:48 +0000]
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>

3 years agoBug 25566: Add option to ignore found holds and use it when checking high holds
Nick Clemens [Thu, 21 May 2020 13:41:23 +0000]
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>

3 years agoBug 25850: (QA follow-up) use dt_from_string
Nick Clemens [Tue, 7 Jul 2020 12:05:42 +0000]
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>

3 years agoBug 25850: (QA follow-up) Match logic in is_holiday
Martin Renvoize [Mon, 29 Jun 2020 08:54:58 +0000]
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>

3 years agoBug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being...
Andreas Jonsson [Tue, 23 Jun 2020 13:57:29 +0000]
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>

3 years agoBug 25850: Regression Test
Martin Renvoize [Fri, 26 Jun 2020 15:52:50 +0000]
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>

3 years agoBug 25850: Add tests for weekday holidays
Martin Renvoize [Fri, 26 Jun 2020 15:24:00 +0000]
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>

3 years agoBug 25992: Make SIP2 logger subroutines exportable to prevent crash
Joonas Kylmälä [Wed, 15 Jul 2020 11:08:32 +0000]
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash

If the subroutines are not exportable we get the following crash:

> Undefined subroutine &C4::SIP::SIPServer::set_logger

To test:
 In kohadevbox run for example:
 $ ps -aux # check that no existing sip server is running, kill the process if exists
 $ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
 $ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information

 After applying this patch the Undefined subroutine error should be gone.
 Note: when using the sip_cli_emulator.pl the credentials can be anything.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25851: DBRev 20.06.00.004
Martin Renvoize [Thu, 16 Jul 2020 14:16:41 +0000]
Bug 25851: DBRev 20.06.00.004

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

3 years agoBug 25964: Prevent data loss when editing items from a MARC record
Jonathan Druart [Thu, 9 Jul 2020 08:52:11 +0000]
Bug 25964: Prevent data loss when editing items from a MARC record

Coming from:
  Bug 23463: Use new method Koha::Object->set_or_blank

We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly.

In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

3 years agoBug 25443: (follow-up) surround strings with <span>
Bernardo Gonzalez Kriegel [Sun, 24 May 2020 11:51:27 +0000]
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>