koha.git
4 years agoBug 24827: Standardise on 'UTF-8' as the encoding name
Andreas Roussos [Sun, 15 Mar 2020 07:34:52 +0000]
Bug 24827: Standardise on 'UTF-8' as the encoding name

This patch standardises the encoding name used in direct calls
to new_from_xml() to 'UTF-8' instead of 'utf8' or 'utf-8'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24862: Handle annonymous sessions gracefuly
Tomas Cohen Arazi [Fri, 13 Mar 2020 15:03:03 +0000]
Bug 24862: Handle annonymous sessions gracefuly

This patch introduces code to detect (cookie) annonymous sessions and
act as expected.

Right now, as check_cookie_auth is not passed the required permissions
(because there aren't always required permissions, and the code to check
permissions is shared with other authentication mechanisms) it returns
'ok' and the session id. This use case was overlooked when this was
coded, and yeilds unexpected error codes (500) when the user logs out
and the annonymous session cookie is used to hit the API. The end result
doesn't pose any security issue (i.e. the resource access is rejected)
but the returned error code is not correct and should be fixed.

This patch verifies for an anonymous session (and avoids querying the
corresponding patron) and then verifies if there is an authorization
config on the route and if the patron object is defined.

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail, 500 instead of the expected 401
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Repeat the original 'steps to reproduce' from the bug report using
   the browser
=> SUCCESS: Problem solved!
6. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24862: Regression tests
Tomas Cohen Arazi [Fri, 13 Mar 2020 14:44:03 +0000]
Bug 24862: Regression tests

This patch introduces tests for the expected behaviour on API routes
that expect a logged in user, but the request is made with an anonymous
session cookie.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail because the situation is not handled correctly in
the code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24789: Remove ITS macro format
Nick Clemens [Tue, 3 Mar 2020 13:26:02 +0000]
Bug 24789: Remove ITS macro format

To test:
1 - Apply patches
2 - Confirm you can save, load, and run macros
3 - Confirm you have no choice of format

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24402: About template corrections
Martin Renvoize [Sun, 8 Mar 2020 08:39:40 +0000]
Bug 24402: About template corrections

With the 20.05 team we introduced and expanded some roles.  This patch
adds support for:

* removal of the release maintainer for development releases
* a list of documentation managers
* a list of packaging manager

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22943: Remove unused line from Auth.t
Katrin Fischer [Fri, 13 Mar 2020 08:47:53 +0000]
Bug 22943: Remove unused line from Auth.t

Removes an unnecessary variable declaration from Auth.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22943: (QA follow-up) Add new cases
Martin Renvoize [Mon, 9 Mar 2020 09:17:50 +0000]
Bug 22943: (QA follow-up) Add new cases

A few additional cases were introduced since the original bug was
authored. This patch simply catches those cases and makes the same
change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 22943: Renames the in_ipset function to in_iprange in C4::Auth
Hayley Mapley [Mon, 27 May 2019 01:57:05 +0000]
Bug 22943: Renames the in_ipset function to in_iprange in C4::Auth

Bug 14407 introduced a new system preference to allow limiting the
online self checkout system to an IP or IP Range. The function that
handles this is called in_ipset, which is the name of a linux tool. To
stop confusion, this patch renames the function to 'in_iprange', and the
variable 'ipset' within it to 'iprange'.

To test, follow the test plans outlined in Bug 14407 and confirm that
everything works as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24627: Correct style of clubs search results during hold process
Owen Leonard [Tue, 11 Feb 2020 15:10:48 +0000]
Bug 24627: Correct style of clubs search results during hold process

This patch updates some markup and CSS so that the process of selecting
a club from search results during the hold process looks the same as
when selecting a patron: Club names should be links (like patron
names are) and the table row should have a hover color to help indicate
that it is clickable.

This patch also changes the markup of the Patrons/Clubs tabs a little
bit to make the information clearer: Superfluous Bootstrap-related tab
markup has been removed, and the patron and club search results have
been moved into their respective tab containers. This means that if you
search for a patron but then switch to the clubs tab the patron list
doesn't still display.

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

 - You should have more than one patron club defined.
 - Begin the process of placing a hold on a title.
 - Test the process of searching for both patrons and clubs.
   - In each case the name (patron or club) should be an active link.
   - Hovering your mouse over the table rows should change the row
     background to yellow.
   - Clicking the other tab at this stage should hide the search results
     from your last search.
   - Whether you click the linked name or elsewhere in the table row
     you should be correctly redirected to the next step in the holds
     process.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24858: Correct labels on wording in ExcludeHolidaysFromMaxPickUpDelay
Lucas Gass [Thu, 12 Mar 2020 22:38:47 +0000]
Bug 24858: Correct labels on wording in ExcludeHolidaysFromMaxPickUpDelay

TO TEST:
- Apply patch
- mark your library closed today and tomorrow
- set ReservesMaxPickUpDelay to 1 day
- set ExcludeHolidaysFromMaxPickUpDelay to "Ignore the calendar"
- place hold, capture hold
- hold expiration date is set to tomorrow (doesn't skip closed days)

- Set ExcludeHolidaysFromMaxPickUpDelay to "Use the calendar"
- Place hold, capture hold
- hold expiration date is set to the day after tomorrow (skips closed days)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24767: Hide the "Claim returned" tab if the feature is turned off
Kyle M Hall [Thu, 12 Mar 2020 11:07:48 +0000]
Bug 24767: Hide the "Claim returned" tab if the feature is turned off

The ability to claim an item "claim returned" is not there if the syspref is empty, however, the Claim Returned tab is stil present on the patrons detail page.

Test Plan:
1) Ensure ClaimReturnedLostValue is not set
2) Note the claims tabs on the circulation and patron details pages
3) Apply this patch
4) Refresh those pages
5) The claims tabs should be gone!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 5103: Refactor the code to avoid repetition
Jonathan Druart [Thu, 12 Mar 2020 14:09:02 +0000]
Bug 5103: Refactor the code to avoid repetition

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 5103: (follow-up) Using mapped item fields instead of hardcoding subfields
Aleisha Amohia [Wed, 11 Mar 2020 03:08:12 +0000]
Bug 5103: (follow-up) Using mapped item fields instead of hardcoding subfields

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 5103: Format dates in MARC detail using dateformat syspref
Aleisha Amohia [Wed, 26 Feb 2020 02:52:24 +0000]
Bug 5103: Format dates in MARC detail using dateformat syspref

This patch fixes the formatting of dates on the following pages:
- catalogue/MARCdetail.pl (staff)
- cataloguing/additem.pl (staff)
- opac-MARCdetail.pl (opac)

To test:
1) Ensure that the following fields are visible in the opac, intranet
and editor. You may need to edit the subfields in your default
bibliographic framework
952$d date accessioned
952$q date due/on loan
952$r date last seen
952$s date last borrowed
952$w replacement price date

Also ensure you have dateformat system preference set

2) Go to cataloguing/additem.pl for a biblio. Fill in the fields above
if required. Save
3) Remain on cataloguing/additem.pl. Notice the items table at the top
of the page, the dates are in the generic yyyy-mm-dd format
4) Go to catalogue/MARCdetail.pl for that biblio. Notice dates in wrong
format
5) View this biblio in the opac opac-MARCdetail.pl. Scroll to bottom to
items table. Notice dates in wrong format.
6) Apply patch, restart memcached and plack and refresh pages
7) Dates should now be formatted according to dateformat preference
8) Confirm that changing the preference changes the format of the dates

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 19288: Don't show patron info for item level holds on details.pl unless hold...
Nick Clemens [Mon, 9 Mar 2020 09:41:26 +0000]
Bug 19288: Don't show patron info for item level holds on details.pl unless hold is waiting

This persists after bug 20948 - we can still display patron information even if this patron is not the one
who will receive the item upon checkin. The holds tab can give an overview of holds and information - I think
on the details page the only info we need is whether there might be a item level hold, not who it is for

To test:
1 - Place an item level hold for delivery at a branch not matching home branch of item
2 - Place a record level hold for delivery at homebranch of item placed on hold above
3 - Enable LocalHoldsPriority with 'pickup library' matches the item's 'home library'
4 - View the details for the page, it says the item has a hold for the patron with an item level hold
5 - Check in the item, the hold triggered is for the next available patron, ignore the hold
6 - Apply patch
7 - Check details page, 'There is an item-level hold (priority=1)' with no patron info
8 - Check in, next available hold is still the one triggered

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23383: fix IdRef syspref test in XSLT
Fridolin Somers [Fri, 26 Jul 2019 13:43:02 +0000]
Bug 23383: fix IdRef syspref test in XSLT

IdRef link is displayed via XSLT.
There is a test of syspref with just if value is defined.
But in installer/data/mysql/sysprefs.sql you see this pref will be 0 by default, which is true in XPATH.
We should test that pref is 1.

Test plan :
1) Create a fresh UNIMARC database
2) You have pref IdRef disabled
3) Simulate a SUDOC record:
  Fill a 7..$3 field with a ppn (032581270 for example).
  Fill the 009 field with an integer
4) Go to the opac detail page of the record => You don't see IdRef link
5) Enable IdRef syspref
6) Go to the opac detail page of the record => You see IdRef link
7) Disable IdRef syspref
8) Go to the opac detail page of the record => You don't see IdRef link

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24838: Fix help link for patron categories
Andrew Fuerste-Henry [Wed, 11 Mar 2020 00:54:03 +0000]
Bug 24838: Fix help link for patron categories

To test:
- go to admin/categories.pl
- click Help, confirm it takes you to manual main page
- apply patch
- restart all
- click Help, confirm it takes you to patron categories in manual

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23521: (follow-up) Add quotes
Nick Clemens [Fri, 25 Oct 2019 13:49:05 +0000]
Bug 23521: (follow-up) Add quotes

Not only should terms from facets/limits be grouped, but order should probably matter
We build a different facet for "Dillinger Girl" or "Girl Dillinger"

The parens are possibly overkill now, but I think it makes it very clear and does not hurt

To test:
1 - Follow original plan
2 - Create a new record with 'Girl Dillinger' as author
3 - Search for 'Dill*'
4 - You get all three records (and maybe others that match)
5 - Limit by 'Girl Dillinger' - you get two records
6 - Same for 'Dillinger Girl'
7 - Apply patch
8 - Limits/facets for 'Dillinger Girl' and 'Girl Dillinger' now match a isngle record

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23521: Put parentheses arround limit terms
Alex Arnaud [Thu, 29 Aug 2019 15:06:14 +0000]
Bug 23521: Put parentheses arround limit terms

Test plan:
  - Use Elasticsearch 6 (you'll need Bug 18969),
  - create a biblio (#1) with "Dillinger Girl" in author and what you
    want in title,
  - create another biblio (#2) with the word "girl" in the title and
    "Dillinger Escaplan" as author
  - reindex
  - search * and refine on "Dillinger Girl"
  - Ko => Biblio #1 and #2 appear
  - Apply this patch,
  - search * and refine on "Dillinger Girl"
  - Ok => anly biblio #1 appears
  - use Elasticsearch 5 again
  - check for no search regression

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24662: Remove global variables MSG_* from datatables.inc
Julian Maurice [Fri, 14 Feb 2020 09:44:39 +0000]
Bug 24662: Remove global variables MSG_* from datatables.inc

Now that bug 21156 is pushed, we don't need to have global variables in
.inc or .tt files for translation in .js file. We can simply declare our
translatable strings where they are used.

This patch removes all global variables used in DataTables configuration

Test plan:
1. cd misc/translator && ./translate update fr-FR
2. Translate strings in misc/tranlator/po/fr-FR-messages-js.po
3. cd misc/translator && ./translate install fr-FR
4. Go to the staff interface, in english, and check that DataTables
tables are still working. You should check at least the following pages:
    - catalogue/detail.pl
    - circ/circulation.pl
    - tools/quotes.pl
    - tools/letter.pl
5. Switch to french and check again DataTables tables, and verify that
   strings are translated

This patch depends on bug 24661

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24812: (bug 24081 follow-up) Add permission description
Martin Renvoize [Thu, 5 Mar 2020 14:32:23 +0000]
Bug 24812: (bug 24081 follow-up) Add permission description

Bug 24081 added a discount permission to the accounts system but during
subsequent rebases, the description of that new permission got lot.

This patch restores the description.

Test plan
0/ Check that a checkbox without a description appears in the 'Manage
patrons patrons fines and fees' section of the 'Set permissions' page.
1/ Apply the patch
2/ Reload the page and note that the checkbox now preceeds a suitable
description.
3/ Signoff.

Bonus points: Check the permission works as described and hides the
'Discount' action button for staff who do not have the permission
enabled.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24565: Add patron profile to ILL list pages
Andrew Isherwood [Mon, 3 Feb 2020 11:14:50 +0000]
Bug 24565: Add patron profile to ILL list pages

We need the API call to get ILL requests on the patron profile page,
this commit allows this.

Test plan:
- Do not apply the patch.
- Go to the "Ill requests history" page for a patron who has made ILL
  requests
- TEST: Observe that no requests are displayed
- Apply the patch
- Refresh the page
- TEST: Observe that requests are displayed
- Go to the main "ILL requests" page
- TEST: Observe that requests are displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24839: (QA follow-up) Remove unused variables
Martin Renvoize [Wed, 11 Mar 2020 11:27:38 +0000]
Bug 24839: (QA follow-up) Remove unused variables

Whilst QAing I spotted a couple of unused variables in the test.. no
harm in removing them ;)

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

4 years agoBug 24839: Return hold info to transfer script and set borrowernumber
Nick Clemens [Tue, 10 Mar 2020 13:37:56 +0000]
Bug 24839: Return hold info to transfer script and set borrowernumber

To test:
1 - Place a hold on an item
2 - Go to Circulation->Transfers
3 - Attempt to transfer item to a branch it is not expected at
4 - No warning
5 - Apply patches
6 - Repeate
7 - You get a notice that there is a hold and must deal with the hold (or ignore)

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

4 years agoBug 24839: Unit tests
Nick Clemens [Tue, 10 Mar 2020 13:59:16 +0000]
Bug 24839: Unit tests

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

4 years agoBug 17845: (RM follow-up) Remove Printer DBIC Class
Martin Renvoize [Tue, 10 Mar 2020 18:48:49 +0000]
Bug 17845: (RM follow-up) Remove Printer DBIC Class

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

4 years agoBug 17845: (RM follow-up) Restore a removed test
Martin Renvoize [Tue, 10 Mar 2020 18:41:48 +0000]
Bug 17845: (RM follow-up) Restore a removed test

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

4 years agoBug 24777: Use patron.is_debarred instead of patron.debarred in return.tt
Fridolin Somers [Mon, 2 Mar 2020 15:03:54 +0000]
Bug 24777: Use patron.is_debarred instead of patron.debarred in return.tt

In return page return.tt, when there is an hold message, patron is said as restricted even if restriction end date is in the past.

Test plan :
1) For a patron Jon Doe create a manual restriction with end date in the past
2) Create an hold for this patron on an item
3) Check in this item => You don't see message "Patron is RESTRICTED"
4) For a patron Kevin Doe create a manual restriction with end date in the future
5) Create an hold for this patron on an item
6) Check in this item => You see message "Patron is RESTRICTED"
7) Repeate 1-6 with system preference HoldsAutoFill enabled
8) Repeate 1-6 with a waiting hold

Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23268: Make "Suspend all holds" calendar select a date from tomorrow
Emmi [Fri, 5 Jul 2019 08:46:15 +0000]
Bug 23268: Make "Suspend all holds" calendar select a date from tomorrow

This patch removes "circulation" and moremember" templates functions
for Datepicker plugin. They now use options common for all inputs with
"datepicker" class and get "minDate" option from class "futuredate" assigned
function in "calender.inc".

To test:
- Apply patch
- Add holds for patron
- Use "Suspend all holds" calendar
=>Calendar greys out dates past from today

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 18127: Add missing html filters
Jonathan Druart [Tue, 10 Mar 2020 11:19:54 +0000]
Bug 18127: Add missing html filters

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 18127: Add batch modified records to an existing list
Aleisha Amohia [Wed, 5 Feb 2020 04:33:50 +0000]
Bug 18127: Add batch modified records to an existing list

To test:
1) Start by having no (zero) lists
2) Go to Tools -> Batch record modification
3) Go through the batch record modification process, confirm everything
works as normal and there is a link to do a new batch record
modification at the end
4) In another tab, go to Lists and create a new list
5) Go back to the first tab and start a new batch modification process
6) At the end of the process, there should be a new option to add
modified records to an existing list
7) Select a list from the dropdown and confirm you are able to save your
modified records to the list as expected
8) Start a new batch modification process, this time for authorities
records
9) At the end confirm there is no option to add modified records to a
list, because authorities cannot be added to lists

Sponsored-by: Catalyst IT
Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17374: DBRev 19.12.040
Martin Renvoize [Tue, 10 Mar 2020 15:19:34 +0000]
Bug 17374: DBRev 19.12.040

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

4 years agoBug 17374: (QA follow-up) Make search labels match with patron record
Katrin Fischer [Thu, 30 Jan 2020 07:31:28 +0000]
Bug 17374: (QA follow-up) Make search labels match with patron record

Makes some small changes to the patronfields.inc to make sure the
search labels match with the labels in the patron record.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17374: (follow-up) Unit tests
Nick [Wed, 30 Oct 2019 14:07:02 +0000]
Bug 17374: (follow-up) Unit tests

Signed-off-by: Maxime Dufresne <maxime.dufresne@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17374: (follow-up) Remove spaces from include file
Nick Clemens [Tue, 24 Apr 2018 19:03:26 +0000]
Bug 17374: (follow-up) Remove spaces from include file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17374: Make use of fields from syspref 'DefaultPatronSearchFields' in patron...
Nick Clemens [Thu, 27 Oct 2016 14:21:02 +0000]
Bug 17374: Make use of fields from syspref 'DefaultPatronSearchFields' in patron search fields dropdown

This patch preserves the current dropdown choices for patron search and adds fields from
the DefaultPatronSearchFields system preference

To test:
1 - View the regular patron search and note fields in dropdown
2 - Apply patch, ensure dropdown has not changed
3 - Add fields to DefaultPatronSearchFields, note they are available in
dropdown
4 - Ensure existing and new fields search properly

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Maxime Dufresne <maxime.dufresne@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: DBRev 19.12.00.039
Martin Renvoize [Tue, 10 Mar 2020 15:09:07 +0000]
Bug 17845: DBRev 19.12.00.039

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

4 years agoBug 17845: Schema changes
Jonathan Druart [Tue, 10 Mar 2020 10:12:12 +0000]
Bug 17845: Schema changes

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

4 years agoBug 17845: Remove the column if it exists
Jonathan Druart [Tue, 10 Mar 2020 09:56:08 +0000]
Bug 17845: Remove the column if it exists

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: Adjust few other occurrences
Jonathan Druart [Tue, 10 Mar 2020 09:39:49 +0000]
Bug 17845: Adjust few other occurrences

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: Remove some missed references to branchprinter
Martin Renvoize [Mon, 9 Mar 2020 16:51:28 +0000]
Bug 17845: Remove some missed references to branchprinter

Remove a few last references to branchprinter, mostly from tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: (QA follow-up) Remove hidden print input
Martin Renvoize [Mon, 9 Mar 2020 16:44:57 +0000]
Bug 17845: (QA follow-up) Remove hidden print input

As highlighted by Jonathan, the hidden 'print' form field is no longer
read and thus no longer required in the template.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: (QA follow-up) Remove commented line
Martin Renvoize [Mon, 9 Mar 2020 16:42:34 +0000]
Bug 17845: (QA follow-up) Remove commented line

A commented line still refered to the removed page from the
admin-menu.inc

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: Update atomic update for new format
Martin Renvoize [Mon, 9 Mar 2020 16:41:27 +0000]
Bug 17845: Update atomic update for new format

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 17845: Remove unused code related to printers
Katrin Fischer [Sun, 16 Sep 2018 21:25:37 +0000]
Bug 17845: Remove unused code related to printers

There is some quite old and unused code in Koha related
to printer configuration and network printing. These code
hasn't been functional in a long time and should be removed.

This patch:

- Removes printcirculationslips system preference
- Removes table printers
- Removes branchprinter column from branches

Check that:
- Go to administration
- Open any age there, but change the last bit to: printers.pl
- Apply patch, run the database update
- Verify the hidden page no longer exists
- Verify that logging in and out still works correctly
- Verify that checkout and returns work correctly
- Switch to another branch using the "Set library" option

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23926: Limit GIR segment to 5 pieces of info
Colin Campbell [Wed, 30 Oct 2019 12:34:45 +0000]
Bug 23926: Limit GIR segment to 5 pieces of info

Strictly if a GIR segment contains more than 5 pieces
of information the it should be encoded in repeated
segments each of 5 elements or less each sharing the same
copy sequence number

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23112: Compiled CSS
Martin Renvoize [Tue, 10 Mar 2020 11:39:44 +0000]
Bug 23112: Compiled CSS

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

4 years agoBug 23112: DBRev 19.12.00.038
Martin Renvoize [Tue, 10 Mar 2020 11:38:48 +0000]
Bug 23112: DBRev 19.12.00.038

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

4 years agoBug 23112: (QA follow-up) Clean up tests, catch warnings
Nick Clemens [Fri, 6 Mar 2020 11:35:05 +0000]
Bug 23112: (QA follow-up) Clean up tests, catch warnings

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

4 years agoBug 23112: (follow-up) Unit test fixes
Andrew Isherwood [Fri, 6 Mar 2020 09:33:16 +0000]
Bug 23112: (follow-up) Unit test fixes

As requested by Nick, fixes unit tests and added a test for the new
Koha::Illrequest::biblio method

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

4 years agoBug 23112: (follow-up) Conditionally prevent checkout
Andrew Isherwood [Thu, 5 Mar 2020 09:27:32 +0000]
Bug 23112: (follow-up) Conditionally prevent checkout

As mentioned by Nick in comment #69, the checkout button displays even
for requests without a biblio attached (such as chapters). This patch
fixes that.

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

4 years agoBug 23112: (QA follow-up) Fix database update, add filters, remove tabs
Nick Clemens [Wed, 4 Mar 2020 11:52:11 +0000]
Bug 23112: (QA follow-up) Fix database update, add filters, remove tabs

Looks like the atomicupdate and sysprefs.sql changes were lost at some point.

Don't forget to run QA tools on your patches before submitting

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

4 years agoBug 23112: (follow-up) Fix test as per feedback
Andrew Isherwood [Tue, 7 Jan 2020 10:16:58 +0000]
Bug 23112: (follow-up) Fix test as per feedback

As per comment #48

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

4 years agoBug 23112: (follow-up) Address QA feedback
Andrew Isherwood [Mon, 6 Jan 2020 12:04:53 +0000]
Bug 23112: (follow-up) Address QA feedback

As per comment #46

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

4 years agoBug 23112: (follow-up) Call C4::Koha::GetAuthorisedValues
Andrew Isherwood [Thu, 10 Oct 2019 14:41:58 +0000]
Bug 23112: (follow-up) Call C4::Koha::GetAuthorisedValues

In response to the problem Magnus was experiencing in comment #28 & #29
we now call GetAuthorisedValues by it's full path

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

4 years agoBug 23112: Add unit tests
Andrew Isherwood [Tue, 30 Jul 2019 13:54:53 +0000]
Bug 23112: Add unit tests

This patch adds unit test for the new Koha::Illrequest::check_out method

Sponsored-by: Loughborough University
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23112: Update request status on return
Andrew Isherwood [Mon, 29 Jul 2019 08:10:04 +0000]
Bug 23112: Update request status on return

This patch updates a request's status to RET upon return

Sponsored-by: Loughborough University
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23112: Add permission checks
Andrew Isherwood [Mon, 29 Jul 2019 08:08:41 +0000]
Bug 23112: Add permission checks

We only want the ILL circulation functionality to be available if the
appropriate syspref and perm are available, this patch adds those
checks.

Sponsored-by: Loughborough University
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23112: Add circulation to ILL requests
Andrew Isherwood [Thu, 25 Jul 2019 12:46:12 +0000]
Bug 23112: Add circulation to ILL requests

This patch adds the ability to circulate ILL requests. Once a request has a suitable status, a "Check out" button is displayed on the "Manage request" toolbar. Clicking this will enable the user to check out the item either to the user who made the request or an in-house statistical  user. A due date can be specified, but if not circ rules are used.

Prior to the check out, an item is created which is attached to the biblio record that was created when the request was added

This development has been carried out according to the originally stated requirements of the customer that sponsored it, detailed here: https://wiki.koha-community.org/wiki/ILL_Circulation_RFC

Test plan:

1. Ensure the FreeForm ILL backend is available
2. Enable the "CirculateILL" syspref
3. Ensure you have a statistical patron category defined (patron category type "Statistical")
4. Ensure you have at least one patron in your statistical patron category
5. Create a new FreeForm request (make a note of the library you select when creating it)
6. Mark the new request as confirmed by clicking the "Confirm request" button on the "Manage ILL request" page
7. TEST: Observe that a "Check out" button is now displayed in the request toolbar
8. Click the "Check out" button in the "Manage ILL request" page
9. In the "Issue requested item to..." screen:
  a. Do not select a statistical patron at this time
  b. You can at this point choose an item type, this will determine the type of the item that will be created for this request
  c. TEST: Observe that the default selected "Library" matches that that was defined when creating the request
  d. Do not select a due date at this time
10. Click "Submit"
11. TEST: Observe that the "Item checked out" screen displays, issued to the requesting patron with a due date corresponding to appropriate circ rules
12. Click "Return to request"
13. TEST: Observe that the request's status is now "Checked out"
14. Click the "Bibliographic record ID" link
15. TEST: Observe that the bibliographic record now has one item attached to it which is checked out
16. TEST: Observe that the item barcode is "ILL-" + the ILL request ID
17. Return to step 5., however, this time select a statistical patron and test that the item use is recorded and the item is not issued
18. Return to step 5., however, this time manually select a due date and test that the item's due date is set correctly on check out
19. Check in the item
20. TEST: Observe that the request's status is updated to "Returned to library"
21. Now implement a restriction on the patron (perhaps a fine) which would prevent them from checking out an item
22. Return to step 5. follow the instructions to step 10.
23. TEST: Observe that a banner is displayed at the top of the screen informing you that there was a problem checking the item out, containing a link to the patron's account page
24. Resolve the problem with the patron's account
25. Return to step 8.
26. TEST: Observe that the item is now successfully checked out
27. Disable the "CirculateILL" syspref
28. Return to step 5. at step 7. Observe that the "Check out" button is NOT displayed

Sponsored-by: Loughborough University
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23112: Add CirculateILL syspref
Andrew Isherwood [Fri, 26 Jul 2019 09:42:32 +0000]
Bug 23112: Add CirculateILL syspref

Sponsored-by: Loughborough University
Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: adjust xt/sample_notices.t
Jonathan Druart [Mon, 9 Mar 2020 15:14:58 +0000]
Bug 24583: adjust xt/sample_notices.t

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

4 years agoBug 24594: Fix license statements
Jonathan Druart [Mon, 9 Mar 2020 15:09:50 +0000]
Bug 24594: Fix license statements

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

4 years agoBug 24545: Cannot return outside of sub
Jonathan Druart [Mon, 9 Mar 2020 14:59:41 +0000]
Bug 24545: Cannot return outside of sub

We must die instead

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

4 years agoBug 24594: Rewrite marc21_framework_DEFAULT to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 14:53:04 +0000]
Bug 24594: Rewrite marc21_framework_DEFAULT to YAML

YAML version of marc21 mandatory marc21_framework_DEFAULT.

To test:
1) Do a clean install with mandatory data,
   dump table marc_tag_structure and
   marc_subfield_structure, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No major differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler-MARC21.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

NOTE: This patch fails with qa tools!
Reason is that qa tools use YAML.pm module to
check files, but Installer.pm or LangInstaller.pm
are using YAML::Syck, using that module gives
no error, check for example:

perl -e 'use YAML::Syck qw( LoadFile ); $y = LoadFile("marc21_framework_DEFAULT.yml");'
No error!

perl -e 'use YAML qw( LoadFile ); $y = LoadFile("marc21_framework_DEFAULT.yml");'
Error!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24594: Rewrite authorities_normal_marc21 to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 14:55:45 +0000]
Bug 24594: Rewrite authorities_normal_marc21 to YAML

YAML version of marc21 mandatory authorities_normal_marc21.

To test:
1) Do a clean install with mandatory data,
   dump table auth_types, auth_tag_structure and
   auth_subfield_structure, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No major differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler-MARC21.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

NOTE: This patch fails with qa tools!
Reason is that qa tools use YAML.pm module to
check files, but Installer.pm or LangInstaller.pm
are using YAML::Syck, using that module gives
no error, check for example:

perl -e 'use YAML::Syck qw( LoadFile ); $y = LoadFile("authorities_normal_marc21.yml");'
No error!

perl -e 'use YAML qw( LoadFile ); $y = LoadFile("authorities_normal_marc21.yml");'
Error!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24593: (follow-up) fix sql statements
Bernardo Gonzalez Kriegel [Wed, 4 Mar 2020 14:31:29 +0000]
Bug 24593: (follow-up) fix sql statements

Original inserted values depends on the order of insertion.
This patch rewrites the sql statements to make them order
independent

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24593: Rewrite marc21_simple_bib_frameworks to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 14:12:27 +0000]
Bug 24593: Rewrite marc21_simple_bib_frameworks to YAML

YAML version of marc21_simple_bib_frameworks

To test:
1) Same test plan of first patch

NOTE: Same problem as first patch with qa tools
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24593: Rewrite marc21_sample_fastadd_framework to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 14:08:37 +0000]
Bug 24593: Rewrite marc21_sample_fastadd_framework to YAML

YAML version of marc21_sample_fastadd_framework

To test:
1) Same test plan of first patch

NOTE: Same problem as first patch with qa tools
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24593: Rewrite marc21_default_matching_rules to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 13:11:16 +0000]
Bug 24593: Rewrite marc21_default_matching_rules to YAML

YAML version of marc21 optional marc21_default_matching_rules.

To test:
1) Do a clean install with optional data,
   dump table marc_matchers, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No major differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler-MARC21.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

NOTE: This patch fails with qa tools!
Reason is that qa tools use YAML.pm module to
check files, but Installer.pm or LangInstaller.pm
are using YAML::Syck, using that module gives
no error, check for example:

perl -e 'use YAML::Syck qw( LoadFile ); $y = LoadFile("marc21_default_matching_rules.yml");'
No error!

perl -e 'use YAML qw( LoadFile ); $y = LoadFile("marc21_default_matching_rules.yml");'
Error!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_z3950_servers to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:53:12 +0000]
Bug 24584: Rewrite optional/sample_z3950_servers to YAML

YAML version of optional sample_z3950_servers

To test:
1) Same test plan of first patch, only check table
   z3950servers

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_quotes to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:51:16 +0000]
Bug 24584: Rewrite optional/sample_quotes to YAML

YAML version of optional sample_quotes

To test:
1) Same test plan of first patch, only check table
   quotes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_patrons to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:49:14 +0000]
Bug 24584: Rewrite optional/sample_patrons to YAML

YAML version of optional sample_patrons

To test:
1) Same test plan of first patch, only check table
   borrowers

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_news to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:46:28 +0000]
Bug 24584: Rewrite optional/sample_news to YAML

YAML version of optional sample_news

To test:
1) Same test plan of first patch, only check table
   opac_news

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_libraries_holidays to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:44:28 +0000]
Bug 24584: Rewrite optional/sample_libraries_holidays to YAML

YAML version of optional sample_libraries_holidays

To test:
1) Same test plan of first patch, only check table
   repeatable_holidays

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_libraries to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:42:17 +0000]
Bug 24584: Rewrite optional/sample_libraries to YAML

YAML version of optional sample_libraries

To test:
1) Same test plan of first patch, only check table
   branches

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_itemtypes to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:39:52 +0000]
Bug 24584: Rewrite optional/sample_itemtypes to YAML

YAML version of optional sample_itemtypes

To test:
1) Same test plan of first patch, only check table
   itemtypes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/sample_creator_data to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:35:53 +0000]
Bug 24584: Rewrite optional/sample_creator_data to YAML

YAML version of optional sample_creator_data

To test:
1) Same test plan of first patch, only check tables
   creator_layouts, creator_templates and printers_profile

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/patron_categories to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 12:32:10 +0000]
Bug 24584: Rewrite optional/patron_categories to YAML

YAML version of optional patron_categories

To test:
1) Same test plan of first patch, only check table
   categories

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/patron_atributes to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 00:27:01 +0000]
Bug 24584: Rewrite optional/patron_atributes to YAML

YAML version of optional patron_atributes

To test:
1) Same test plan of first patch, only check table
   borrower_attribute_types

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/parameters to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 00:01:27 +0000]
Bug 24584: Rewrite optional/parameters to YAML

YAML version of optional parameters

To test:
1) Same test plan of first patch, only check table
   currency

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/marc21_relatorterms to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 00:17:00 +0000]
Bug 24584: Rewrite optional/marc21_relatorterms to YAML

YAML version of optional marc21_relatorterms

To test:
1) Same test plan of first patch, only check table
   authorised_values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/marc21_holdings_coded_values to YAML
Bernardo Gonzalez Kriegel [Wed, 5 Feb 2020 00:07:44 +0000]
Bug 24584: Rewrite optional/marc21_holdings_coded_values to YAML

YAML version of optional marc21_holdings_coded_values

To test:
1) Same test plan of first patch, only check table
   authorised_values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24584: Rewrite optional/csv_profiles to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:56:30 +0000]
Bug 24584: Rewrite optional/csv_profiles to YAML

YAML version of optional csv_profiles.

To test:
1) Do a clean install with optional data,
   dump table export_format, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No major differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: (follow-up) restore null values to labels
Bernardo Gonzalez Kriegel [Thu, 5 Mar 2020 13:21:55 +0000]
Bug 24583: (follow-up) restore null values to labels

This patch adds null values to selected label2/3 in
sample numberpatterns

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: Rewrite mandatory/sample_numberpatterns to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:34:54 +0000]
Bug 24583: Rewrite mandatory/sample_numberpatterns to YAML

YAML version of mandatory sample_numberpatterns

To test:
1) Same test plan of first patch, only check table
   subscription_numberpatterns

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: Rewrite mandatory/sample_notices to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:07:43 +0000]
Bug 24583: Rewrite mandatory/sample_notices to YAML

YAML version of mandatory sample_notices

To test:
1) Same test plan of first patch, only check table
   letter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: Rewrite mandatory/sample_frequencies to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 23:05:31 +0000]
Bug 24583: Rewrite mandatory/sample_frequencies to YAML

YAML version of mandatory sample_frequencies

To test:
1) Same test plan of first patch, only check table
   subscription_frequencies

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: Rewrite mandatory/class_sources to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 22:58:09 +0000]
Bug 24583: Rewrite mandatory/class_sources to YAML

YAML version of mandatory class_sources

To test:
1) Same test plan of first patch, only check tables
   class_sort_rules, class_split_rules and class_sources

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24583: Rewrite mandatory/auth_values to YAML
Bernardo Gonzalez Kriegel [Tue, 4 Feb 2020 22:45:07 +0000]
Bug 24583: Rewrite mandatory/auth_values to YAML

YAML version of mandatory auth_values.

To test:
1) Do a clean install, dump auth_values, reserve.

2) Apply this patch and it's dependencies

3) Do a clean install, dump again and compare
   No differences expected

4) Try translation
  a) Go to misc/translator
  b) create files for a new language
     ./translate create xx-YY
  c) Check new file po/xx-YY-instaler.po
     Verify strings from this file.
  d) Install new language
     ./translate install xx-YY
  e) Try clean install with new files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24262: (follow-up) admit null values on labels
Bernardo Gonzalez Kriegel [Thu, 5 Mar 2020 13:23:53 +0000]
Bug 24262: (follow-up) admit null values on labels

This patch adds handling of null values on translatable
labels.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24262: Translate installer data in YAML format
Bernardo Gonzalez Kriegel [Fri, 20 Dec 2019 13:53:11 +0000]
Bug 24262: Translate installer data in YAML format

This patch adds the ability to:
1) Create new translation files from yaml installer files
2) Create installer directory for a given language

It will not create a installer directory if it already exists.

New (possible) translation files:
  xx-YY-installer.po
  xx-YY-installer-MARC21.po
  xx-YY-installer-UNIMARC.po

Needs Bug 13897 (for yaml files)

NOTE: updated version adding ability to process multiline
fields, discard small ( < 2) strings, and discard strings
with pure html, TT or punctuation.

To test:
1) Apply patches from Bug 13897
2) Apply this patch
3) Go to misc/translation
4) Create translation files for a NEW language
   $ ./translate create xx-YY

   check new file 'xx-YY-installer.po'

5) Copy ../../installer/data/mysql/en/optional/auth_val.yml
   into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/
   and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/

   remove po/xx-YY*, then repeat creation

   check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po'
   and 'xx-YY-installer-UNIMARC.po'

   remove all new files

6) Create for xx-YY again and try update
   $ ./translate create xx-YY
   edit ../../installer/data/mysql/en/optional/auth_val.yml
   and change one char in one of the translatable values,
   also edit 'xx-YY-installer.po', translate the same
   string (in msgstr).

   Do an update
   $ ./translate update xx-YY

   check in 'xx-YY-installer.po' a fuzzy value for the
   translated value and the preservation of the translation
   Fix the translation, or add a new one.

7) Create an install dir for xx-YY
   ./translate install xx-YY

    Check new dir '../../installer/data/mysql/xx-YY/'
    Check files on it
    $ tree ../../installer/data/mysql/xx-YY/
    and compare with ../../installer/data/mysql/en/

    All installation files must be present

8) Try a new Koha install using this language in the
   usual way.
   Check in authorised_values table for the translated string.

9) Try create an install dir for an existing language
   (eg. es-ES, de-DE or fr-FR ), eg.
   ./translate install de-DE

   Install dir is detected and not changed, a note is printed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13897: Surround columns with backticks
Jonathan Druart [Wed, 12 Feb 2020 10:27:39 +0000]
Bug 13897: Surround columns with backticks

We have some column's names that need to be surrounded by ` as they are
protected keywords ('rows' for instance)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13897: Process description, multiline values and SQL statements in YAML files
Bernardo Gonzalez Kriegel [Thu, 30 Jan 2020 14:30:30 +0000]
Bug 13897: Process description, multiline values and SQL statements in YAML files

This patch adds 3 features:
1) Display description of YAML files at install time
   for frameworks, and fixes it's encoding.
2) Enable use of multiline values, field required
3) Process SQL statements declared in YAML files

With this features we can process files with the
following generic YAML strucure:

  ---
  description:
    - "File description"

  tables:
    - table_name:
        translatable: [ title, content ]
        multiline: [ content ]
        rows:
          - title: "Example title"
            content:
              - "Content:"
              - ""
              - "This is the content."
            id: 1
            value: ~

  sql_statements:
    - "UPDATE table_name SET value ='empty' WHERE value IS NULL"
  ...

* file description is now inside the YAML, can have multiple
  lines.
  This attribute is expected in all YAML files.
* translatable attribute in table declare fields that can be
  translated
* multiline attribute in table declare fields that can have
  multiple lines of content, they are joined using '\r\n'
  before insert into database.
  This is useful to express fields like 'news' content, and
  to simplify it's translation.
  '\r\n' is used for correct display in Windows clients.
* sql_statements allows to add multiple SQL sentences, not
  insertions normally, that are executed in order.

This features are not needed for the example file of this patch,
but will be used in new bugs.

To test:
1) Use the same test plan of first patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13897: Catch the error and warn it
Jonathan Druart [Wed, 18 Dec 2019 08:27:59 +0000]
Bug 13897: Catch the error and warn it

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 13897: Use YAML files for installer data
Bernardo Gonzalez Kriegel [Thu, 28 Nov 2019 22:06:35 +0000]
Bug 13897: Use YAML files for installer data

This patch modifies C4/Installer.pm to add support
for loading YAML files into database.

As an example of the functionality, optional
auth_val.sql file is replaced by auth_val.yml

The rationale behind this feature is to enable the
translation of the data that is loaded into the
database. That will be addressed in another bug.

But taking into account that goal, translatable
values are declared in the YAML files, to ease
identification by translate script.

Also file description is moved into the yaml
file.

To test:
0) Do a clean install with all optional data,
   then dump authorised_values table, reserve.
1) Apply the patch
2) Do a clean install in English (marc21/unimarc)
3) On optional data check for description of auth_val
   "Some basic default authorised values for ..."
4) Select all optional data
5) Finish installation
6) Dump again authorised_values table and compare with that
   of point '0'.
   No differences should be found.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24817: Replace sleep calls with date setting in test data
Martin Renvoize [Fri, 6 Mar 2020 14:47:00 +0000]
Bug 24817: Replace sleep calls with date setting in test data

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24817: Add sleep between db create actions
Martin Renvoize [Fri, 6 Mar 2020 08:25:39 +0000]
Bug 24817: Add sleep between db create actions

We need to allow some time to pass between calls that add cash register
lines to accountlines or cash_register_actions. We use database level
triggers to maintain the timestamp fields, so cannot use Time::Fake, and
the methods we are testing assume that, as human interactions, there
will be at least a second between the last 'sale' on a cash register and
the 'cashup' of that same cash register.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24066: Add missing POD for has_permission
Martin Renvoize [Tue, 19 Nov 2019 14:03:37 +0000]
Bug 24066: Add missing POD for has_permission

To test:
1) do perldoc Koha/Patron.pm
   search has_permission

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fixed (removed) space before 'my $permission' to make it similar to
other entries.
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 24219: Preserve sort order when returning to result list
Jonathan Druart [Tue, 17 Dec 2019 09:45:11 +0000]
Bug 24219: Preserve sort order when returning to result list

There is a mismatch between sort_cgi, sort and sort_by variables.

 * sort_cgi
I did not find relevant occurrences of sort_cgi in the git log of both
search.pl and results.tt. So it seems that it never worked correctly.
 * sort
It is the JS variable use in browser.js
 * sort_by is the search.pl parameter to set the sort_by option

Test plan:
1. Perform a search in the staff client
2. Change the sort order to something different (try Author A-Z)
3. Click on a result to view the record
4. Click on "Results" button on left side to return to result list
=> Without this patch the result list is sorted by relevancy
=> With this patch applied the Author A-Z is kept

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

4 years agoBug 23384: Fix use statement order for ArticleRequest::Status
Jonathan Druart [Tue, 18 Feb 2020 15:13:11 +0000]
Bug 23384: Fix use statement order for ArticleRequest::Status

Koha::ArticleRequest is used by Koha::ArticleRequests so
Koha::ArticleRequest::Status should not be needed in
Koha::ArticleRequest.
Also Koha::ArticleRequest::Status must be loaded before
Koha::ArticleRequest

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