koha.git
4 years agoBug 23181: Unable to use payment library in ACCOUNT_PAYMENT or ACCOUNT_WRITEOFF notices
Kyle M Hall [Fri, 21 Jun 2019 12:51:15 +0000 (08:51 -0400)]
Bug 23181: Unable to use payment library in ACCOUNT_PAYMENT or ACCOUNT_WRITEOFF notices

Do to a simple semantic typo, the branches key will always be null for the tables key of the parameters for GetPreparedLetter.

Test Plan:
0) Activate UseEmailReceipts
1) Attempt to use [% branch.branchname %] in the ACCOUNT_PAYMENT notice
2) Note it produces no output
3) Apply this patch
4) Make another payment
5) You should now see the branche's name!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Also requires UseEmailReceipts to be activated.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23181: Extend unit tests
Katrin Fischer [Sat, 2 Nov 2019 01:05:06 +0000 (01:05 +0000)]
Bug 23181: Extend unit tests

Run t/db_dependent/Accounts.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23429: ilsdi.pl GetRecords documentation does not match output
Jon Knight [Wed, 21 Aug 2019 14:14:19 +0000 (15:14 +0100)]
Bug 23429: ilsdi.pl GetRecords documentation does not match output

Updated contents of Describe for GetRecords to match current behaviour.

To test, ensure ILSDI is configured and then compare the output of:

http://yourserver/cgi-bin/koha/ilsdi.pl?service=Describe&verb=GetRecords

before and after applying the patch. Note that afterwards it includes
things like <onloan> and has removed elements such as <date_due> that no
longer get returned.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23963: Revert bug 21987 to restore image quality
Martin Renvoize [Mon, 4 Nov 2019 13:25:19 +0000 (13:25 +0000)]
Bug 23963: Revert bug 21987 to restore image quality

Bug 21987 had unexpected effects upon image quality for thumbnails.
Currently, we are working to resolve those issues but have not managed
to correct them inside the release window for this cycle. As such, I
have chosen to revert the original bug whilst we work on a resolution.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoRevert "Bug 21987: Add tests"
Martin Renvoize [Mon, 4 Nov 2019 13:21:16 +0000 (13:21 +0000)]
Revert "Bug 21987: Add tests"

This reverts commit afb39b132b10b74efec31cd8191cdcd72a61d8d3.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoRevert "Bug 21987: Do not generate true color thumbnails if not needed"
Martin Renvoize [Mon, 4 Nov 2019 13:21:13 +0000 (13:21 +0000)]
Revert "Bug 21987: Do not generate true color thumbnails if not needed"

This reverts commit 5c41d584cb654efbfd8c854bac0d30d87a054ab5.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoRevert "Bug 21987: (RM follow-up) Add text for simple tests"
Martin Renvoize [Mon, 4 Nov 2019 13:21:09 +0000 (13:21 +0000)]
Revert "Bug 21987: (RM follow-up) Add text for simple tests"

This reverts commit 1464328718619a673f233406fdb238f0391b0785.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23903: (QA follow-up) Fix selenium tests
Jonathan Druart [Mon, 4 Nov 2019 11:01:21 +0000 (12:01 +0100)]
Bug 23903: (QA follow-up) Fix selenium tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22581: (RM follow-up) Add sysprefs to Search.t
Martin Renvoize [Mon, 4 Nov 2019 10:43:49 +0000 (10:43 +0000)]
Bug 22581: (RM follow-up) Add sysprefs to Search.t

This patch adds explicit disablement of the sysprefs introduced by this
bug to the Search.t test to silence warnings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23834: (RM follow-up) Add new file to Makefile.PL
Martin Renvoize [Mon, 4 Nov 2019 10:09:40 +0000 (10:09 +0000)]
Bug 23834: (RM follow-up) Add new file to Makefile.PL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22581: DBRev 19.06.00.048
Martin Renvoize [Sun, 3 Nov 2019 08:14:08 +0000 (08:14 +0000)]
Bug 22581: DBRev 19.06.00.048

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22581: (RM follow-up) Add License to about page.
Martin Renvoize [Sun, 3 Nov 2019 08:10:42 +0000 (08:10 +0000)]
Bug 22581: (RM follow-up) Add License to about page.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22581: Show and play musical inscripts
Agustin Moyano [Mon, 28 Oct 2019 21:15:22 +0000 (18:15 -0300)]
Bug 22581: Show and play musical inscripts

This patch adds musical inscripts to OPAC's detail page

To test:
1. run previous patch test plan
2. apply this patch
3. edit a the marc structure of a MARC bibliographic framework, and in tag 031 enable the following subfiels to be visible in editor: 2, g, n, o, p, u
4. search the catalog for a record that belongs to that framework, and edit tag 031 with the following:
   * 2:pe
   * g:G-2
   * n:xFCGD
   * o:3/8
   * p:'6B/{8B+(6B''E'B})({AFD})/{6.E3G},8B-/({6'EGF})({FAG})({GEB})/4F6-
   * u:http://nonexistent.org/url/of/a/midi
5. save and click in opac view
CHECK => even though you add a 031 tag there is no musical inscript shown in opac view
6. in admin module enable OPACShowMusicalInscripts preference
7. refresh opac view
SUCCESS => it takes a few seconds to load, but you see a link that says 'Audio file' pointing to the URL you placed in 'u' subfield, and below you see the musical inscript
8. in admin module enable OPACPlayMusicalInscripts preference
9. refresh opac view
SUCCESS => You see a play button below the musical inscript, and when you click, the song is played
10. sign off

Sponsored-by: Biblioteca Provincial Fr. Mamerto Esquiú (Provincia Franciscana de la Asunción)
Co-authored-by: Owen Leonard <oleonard@myacpl.org>
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 22581: Add new system preferences
Agustin Moyano [Mon, 28 Oct 2019 21:15:22 +0000 (18:15 -0300)]
Bug 22581: Add new system preferences

This patch adds 2 new system preferences:
1. OPACShowMusicalInscripts - to toggle musical inscripts to appear in opac's detail page
2. OPACPlayMusicalInscripts - to toggle musical inscripts to be transformed and payed in midi. Depends on OPACShowMusicalInscripts to be enabled.

To test:
1. apply this patch
2. perl installer/data/mysql/updatedatabase.pl
3. search for this new preferences in admin module
SUCCESS => they appear in OPAC section.
4. sign off

Sponsored-by: Biblioteca Provincial Fr. Mamerto Esquiú (Provincia Franciscana de la Asunción)
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 23834: Add default ESLint configuration
Owen Leonard [Thu, 17 Oct 2019 13:46:42 +0000 (13:46 +0000)]
Bug 23834: Add default ESLint configuration

This patch adds a default ESLint configuration for use when editing
JavaScript, as recommended in the coding guidelines:

https://wiki.koha-community.org/wiki/Coding_Guidelines#JS8:_Follow_guidelines_set_by_ESLint

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22592: Add index scan emulation to Elasticsearch
Ere Maijala [Thu, 28 Mar 2019 11:37:13 +0000 (13:37 +0200)]
Bug 22592: Add index scan emulation to Elasticsearch

Adds support for using the "scan indexes" action in advanced search by using faceting with a prefix filter. Requires that the field be set as facetable for anything to be found.

Test plan:
1. Apply patch
2. Go to advanced search and click "More options"
3. Select author as the search field, enter a last name and check "Scan indexes"
4. Perform search and observe the result list resembling scan results

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20194: Display both biblioitems.itemtype and items.itype in circulation screens
Alex Arnaud [Thu, 25 Oct 2018 09:19:01 +0000 (11:19 +0200)]
Bug 20194: Display both biblioitems.itemtype and items.itype in circulation screens

Test plan:
1. Verify that biblioitems.itemtype, items.itype are
   mapped to a MARC field. Otherwise create those mappings.
2. Create a biblio with an itemtype
3. Create an item with a different itemtype for this biblio
4. Check out this item to a patron (P1)
5. Verify that both itemtypes are displayed in the
checkouts table (moremember.pl, circulation.pl, returns.pl)
6. Create a patron whose guarantor is P1 and verify that both itemtypes
and the ccode are displayed in the 'relatives checkouts' table

Followed test plan, patch worked as described, also passes QA test tool
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23841: Compiled CSS
Martin Renvoize [Sun, 3 Nov 2019 07:46:29 +0000 (07:46 +0000)]
Bug 23841: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23841: Add link to bibliographic details page in item details breadcrumbs
Owen Leonard [Mon, 21 Oct 2019 12:00:03 +0000 (12:00 +0000)]
Bug 23841: Add link to bibliographic details page in item details breadcrumbs

This patch adds a link to the default bibliographic details page from
the breadcrumbs menu on the item details page.

The patch also makes a minor update to staff client CSS to allow for use
of biblio-default-view.inc to generate the link and have it styled
correctly.

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

Locate an record in the catalog and view the item details page. Verify
that the breadcrumbs menu includes a link back to the bibliographic
details page as defined in the IntranetBiblioDefaultView system
preference.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23506: Display correct icon in staff client and OPAC
Lucas Gass [Tue, 29 Oct 2019 17:40:47 +0000 (17:40 +0000)]
Bug 23506: Display correct icon in staff client and OPAC

When the leader6 is set to 'i' the MARC21slim2intranetDetail.xsl
attempts to display 'SO.png' which does not exist.

TEST PLAN:
1. Find or create a record with an 'i' as the 6th position in the 000 leader.
2. Do to the OPAC detail page and staff detail for an item in that record.
3. Notice the material type icon does not display because SO.png does not exist.
4. Apply patch and restart_all
5. Look at the opac detail and staff detail page again after clearning the browser cache.
6. The material type icon now displays (MU.png), this is the same icon used on the OPAC results page.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23946: Remove Noun Project icons from the About page
Owen Leonard [Fri, 1 Nov 2019 15:38:49 +0000 (15:38 +0000)]
Bug 23946: Remove Noun Project icons from the About page

This patch removes the part of the About page which gives attribution
for Noun Project icons on the staff client home page.

To test, apply the patch and view the About page in the staff client.
There should be no reference to Noun Project icons.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22661: TinyMCE/WYSIWYG editor doesn't translate
Owen Leonard [Mon, 7 Oct 2019 14:57:32 +0000 (14:57 +0000)]
Bug 22661: TinyMCE/WYSIWYG editor doesn't translate

This patch updates the TinyMCE editor to the latest version (5.0.16) and
adds a translatable include file which will allow the TinyMCE interface
to show the same translation as Koha.

The configuration of the editor has been updated according to the new
version's requirements, keeping all the tools available we had before
and adding emoji support.

To test, apply the patch and enable the UseWYSIWYGinSystemPreferences
system preference.

TESTING THE UPGRADED EDITOR

 - Go to Administration -> System preferences -> OPAC.
 - Multiple instances of the TinyMCE editor should appear on the page:
   opaccredits, OpacCustomSearch, OpacLoginInstructions, etc.
 - Test adding and editing content to one or more of these editors.
   Confirm that the various editor tools work correctly.
 - Verify that changing the contents of any editor (including via paste)
   enables the corresponding "Save all X preferences" button.

 - Test the news editor under Tools -> News.

 - Test the library "OPAC info" editor in libraries administration:
   Administration -> Libraries -> Edit library -> OPAC info.

TESTING TRANSLATABILITY

 - Update a translation:

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

 - Open the corresponding .po file for the staff client, e.g.
   misc/translator/po/fr-FR-staff-prog.po
 - Locate strings pulled from includes/str/tinymce_i18n.inc for
   translation, e.g.:

   #. SCRIPT
   #: intranet-tmpl/prog/en/includes/str/tinymce_i18n.inc:1
   #, fuzzy
   msgid "File"
   msgstr "Fichier :"

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

   > perl translate install fr-FR

 - Go to Administration -> System preferences -> OPAC.
 - In each instance of the TinyMCE editor, the first menu item should
   have as its label the translation "msgstr" string you edited.

 - Check that the "About" page shows updated information about
   the TinyMCE version, 5.0.16.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@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 23862: add enumchron to holds-table
Lucas Gass [Fri, 18 Oct 2019 12:56:43 +0000 (12:56 +0000)]
Bug 23862: add enumchron to holds-table

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23938: Restore title display in last checked out box
Nick Clemens [Thu, 31 Oct 2019 19:03:59 +0000 (19:03 +0000)]
Bug 23938: Restore title display in last checked out box

To test:
1 - Check out to a patron
2 - Note the display under the checkotu box does not have title
3 - Apply patch
4 - Checkout another item
5 - Note the title displays

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23762: Editing is_html status of email template fails under multi-languages
Bin Wen [Mon, 7 Oct 2019 13:01:39 +0000 (09:01 -0400)]
Bug 23762: Editing is_html status of email template fails under multi-languages

To test:
1.Enable multi-languages
2.Set the preference 'TranslateNotices' on  'Allow'
3.Go to: tools==>Notices & slips==>Edit (one notice)
4.Click on the "Email" in the Default, uncheck the checkbox for 'HTML Messages'.
5.Save
6.Reopen the notice, nothing changed.
7.Apply the patch
8.Repeat the steps 4 and 5
9.Success.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23089: Fix QueryBuilder tests.
Ere Maijala [Thu, 24 Oct 2019 10:35:52 +0000 (13:35 +0300)]
Bug 23089: Fix QueryBuilder tests.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23089: Fix sorting on sum and regular fields
Nick [Thu, 10 Oct 2019 16:06:08 +0000 (16:06 +0000)]
Bug 23089: Fix sorting on sum and regular fields

As of bug 20589 we no longer analyze sort fields and so we no longer need to append ".phrase"
to our sort in searches.

Additionally, sort fields based on 'sum' should also use sum in building the value to sort on

To test:
0 - Be using ES
1 - Find the most circulated item in your collection
2 - Search for '*'
3 - Sort by popularity DESC
4 - Note that item is not first
5 - Try to sort by anything but relevancy, it fails
6 - Apply patch
7 - Redo searches and sorts
8 - Things should now work as expected

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23089: Unit tests
Nick [Thu, 10 Oct 2019 16:05:50 +0000 (16:05 +0000)]
Bug 23089: Unit tests

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23805: (RM follow-up) Remove CHECK constraints
Martin Renvoize [Fri, 1 Nov 2019 13:09:31 +0000 (13:09 +0000)]
Bug 23805: (RM follow-up) Remove CHECK constraints

MariaDB and MySQL support different syntaxes for CHECK constraints at
different versions. To remove complexities in the updatedatabase script
I have opted to remove all CHECK constraints entirely.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21824: Add tests
Jonathan Druart [Thu, 13 Dec 2018 21:24:32 +0000 (18:24 -0300)]
Bug 21824: Add tests

Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21824: Add KohaDates method 'output_preference' to make it easy to store formatte...
Kyle M Hall [Tue, 13 Nov 2018 17:36:17 +0000 (12:36 -0500)]
Bug 21824: Add KohaDates method 'output_preference' to make it easy to store formatted dates in TT variable

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21824: Add ability to format dates in various formats in templates
Kyle M Hall [Tue, 13 Nov 2018 16:09:05 +0000 (11:09 -0500)]
Bug 21824: Add ability to format dates in various formats in templates

This patch adds the ability to set a date format for the Template Toolkit filter KohaDates

Test plan:
1) Apply this patch
2) In a template, use the filter param "dateformat => 'iso'"
3) Note the output is in ISO format

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22814: Make patron names on holds modal consistent (second check-in)
Katrin Fischer [Thu, 10 Oct 2019 12:53:10 +0000 (12:53 +0000)]
Bug 22814: Make patron names on holds modal consistent (second check-in)

Bug 22203 changed the behavior on the hold-found2 modal
that pops up when a hold is found so that whether or not
the patron's name is displayed is now governed by the
HidePatronName system preference.

However, if a hold is confirmed and you check the item
in a second time, the modal that pops up is hold-found1
and whether or not the patron's name is displayed in
the hold-found1 modal is not governed by the HidePatronName
system preference.

For the sake of consistency, the display of the patron's
name on hold-found2 and hold-found1 should both be governed
by the HidePatronName system preference.

To test:
- Place a hold on an item
- Check in the item to trigger the hold modal
- Confirm hold
- Check the item in again - verify name of patron displays
- Apply patch
- Repeat
- Verify name display now matches between the two modals
- change HidePatronName pref
- Repeat
- Name display should still match

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23860: Update tests to new style
Tomas Cohen Arazi [Tue, 22 Oct 2019 16:56:15 +0000 (13:56 -0300)]
Bug 23860: Update tests to new style

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23860: Make the patrons endpoint add the Location header
Tomas Cohen Arazi [Mon, 21 Oct 2019 19:21:16 +0000 (16:21 -0300)]
Bug 23860: Make the patrons endpoint add the Location header

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23860: Regression tests
Tomas Cohen Arazi [Mon, 21 Oct 2019 19:20:54 +0000 (16:20 -0300)]
Bug 23860: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23859: Update tests to new style
Tomas Cohen Arazi [Mon, 21 Oct 2019 19:12:16 +0000 (16:12 -0300)]
Bug 23859: Update tests to new style

The /cities endpoint is refered in several places as the reference
implementation of a route for devs to pick it for copy and pasting. Yet,
it is outdated in terms of how the tests are written.

This patch rewrites some bits so it uses BASIC auth and the built-ins
Test::Mojo provides.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23859: Make POST add the Location header on cities endpoint
Tomas Cohen Arazi [Mon, 21 Oct 2019 17:42:28 +0000 (14:42 -0300)]
Bug 23859: Make POST add the Location header on cities endpoint

According to the coding guidelines, this endpoint should be adding the
Location header on POST actions.

To test:
1. Apply the tests patch
2. Run:
    $ kshell
    k$ prove t/db_dependent/api/v1/cities.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat (1)
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23859: Regression tests
Tomas Cohen Arazi [Mon, 21 Oct 2019 17:41:59 +0000 (14:41 -0300)]
Bug 23859: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17084: Automatic debian/control updates
Nightly Build Bot [Thu, 31 Oct 2019 23:28:04 +0000 (00:28 +0100)]
Bug 17084: Automatic debian/control updates

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23805: (QA follow-up) Corrections for cash_register_stats
Martin Renvoize [Thu, 31 Oct 2019 17:49:29 +0000 (17:49 +0000)]
Bug 23805: (QA follow-up) Corrections for cash_register_stats

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 17084: Automatic debian/control updates
Nightly Build Bot [Tue, 8 Oct 2019 22:26:59 +0000 (00:26 +0200)]
Bug 17084: Automatic debian/control updates

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23805: (RM follow-up) updatedatabase.pl mariadb support
Martin Renvoize [Mon, 28 Oct 2019 17:13:09 +0000 (17:13 +0000)]
Bug 23805: (RM follow-up) updatedatabase.pl mariadb support

MySQL and MariaDB have different syntax when it comes to dropping a
CHECK constraint.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR...
Kyle M Hall [Thu, 6 Jun 2019 19:35:10 +0000 (15:35 -0400)]
Bug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy

Koha has a number of features that rely on knowing the IP address of the connecting client. If that server is behind a proxy these features do not work.
This patch adds a module to automatically convert the X-Forwarded-For header into the REMOTE_ADDR environment variable for both CGI and Plack processes.

TEST PLAN:
1) Apply this patch set
2) Install Plack::Middleware::RealIP via cpanm or your favorite utility
3) Update your plack.psgi with the changes you find in this patch set ( this process differs based on your testing environment )
4) Restart plack
5) Tail the plack error log for your instance
6) Use curl to access the OPAC, adding an X-Forwarded-For header: curl --header "X-Forwarded-For: 32.32.32.32" http://127.0.0.1:8080
7) Note the logs output this address if you are unproxied
8) If you are proxied, restart plack using a command like below, where the ip you see in the logs ("REAL IP) is what you put in the koha conf:
    <koha_trusted_proxies>172.22.0.1 1.1.1.1</koha_trusted_proxies>
9) Restart all the things!
10) Repeat step 6
11) You should now see "REAL IP: 32.32.32.32" in the plack logs as the remote address in your plack-error.log logs!
12) Disable plack so you are running in cgi mode, repeat step 6 again
13) You should see "REAL IP: 32.32.32.32" as the remove address in your opac-error.log logs!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23903: Compiled CSS
Martin Renvoize [Thu, 31 Oct 2019 15:41:31 +0000 (15:41 +0000)]
Bug 23903: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23903: Replace OPAC icons with Font Awesome
Owen Leonard [Fri, 25 Oct 2019 18:41:34 +0000 (18:41 +0000)]
Bug 23903: Replace OPAC icons with Font Awesome

This patch replaces CSS-based background image icons with Font Awesome
icons. This will eliminate the use of sprite.png altogether.

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

Because JavaScript events are often triggered by class, the changes made
in this patch require testing of JavaScript-driven behavior as well as
visual confirmation of the changes.

Enable OPAC features to expose them for testing: Login, Holds, Article
requests, Tags, Cart, Search term highlighting.

 - Perform a search in the OPAC
   - In the header at the top of the search results, check the
     'Unhighlight/Highlight' link.
   - Select some search results and verify that the multi-item controls
     are enabled: Add to cart/Lists; Place hold; Tag. Check that these
     controls work correctly.
   - Verify that the following links look correct and work correctly:
     'Place hold,' 'Request article,' 'Log in to add tags,' 'Add to
     cart.'
   - Log in to the OPAC and return to the search results page. Check the
     'Add tag' and 'Save to lists' links.

 - View the lists page
   - Test the 'Edit' and 'Delete' controls.
   - View the contents of a list. Test the following:
      - Controls at the top of the table of results ('New list,'
        'Download list,' 'Send list,' 'Print list,' 'Edit list,' and
        'Delete list').
      - Multi-selection operations: 'Place hold,' 'Tag,' and 'Remove
        from list.'
      - Controls for each item on the list: 'Place hold,' 'Add tag,'
        'Save to another list,' 'Remove from this list,' and 'Add to
        cart.'

   - View the bibliographic detail page for any search result
     - In the right-hand sidebar menu, verify that these controls look
       correct and work correctly: 'Place hold,' 'Print,' 'Request
       article,' 'Save to your lists,' 'Add to your cart,'
      'Unhighlight,' 'Send to device,' 'Save record,' and 'More
      searches.'
     - Test the shelf browser by clicking 'Browse shelf' under the call
       number for any of the holdings.
       - Test the 'Next' and 'Previous' controls.
     - Check the tabs for switching between 'Normal,' 'MARC,' and 'ISBD'
       views and verify that they look correct on each of those pages.

 - Add some items to the Cart and open the Cart
   - Test the cart controls at the top: 'More details/Brief display,'
     'Send,' 'Download,' 'Empty and close,' 'Hide window,' 'Print.'
   - Test the multiple-selection controls: 'Remove,' 'Add to list,'
     'Place hold,' and 'Tag.'

 - Log in to the OPAC as a user who has items checked out which can be
   renewed. On the 'Your summary' page, on the 'Checked out' tab, test
   the 'Renew selected' and 'Renew all' links.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23903: Font Awesome upgrade
Owen Leonard [Fri, 25 Oct 2019 18:25:28 +0000 (18:25 +0000)]
Bug 23903: Font Awesome upgrade

The switch to Font Awesome for more icons in the OPAC doesn't require a
Font Awesome upgrade but this is a good chance to do it.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (RM follow-up) Add _type methods to ReturnClaim class
Martin Renvoize [Thu, 31 Oct 2019 14:38:10 +0000 (14:38 +0000)]
Bug 14697: (RM follow-up) Add _type methods to ReturnClaim class

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23630: (QA follow-up) Fix tests
Nick Clemens [Thu, 31 Oct 2019 13:19:24 +0000 (13:19 +0000)]
Bug 23630: (QA follow-up) Fix tests

marc_records_to_documents is now an arrayref of hashes, not an arrayref of arrays

_sanitise_records has been removed, we don't need those tests anymore

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22706: (RM follow-up) Add unit tests
Martin Renvoize [Thu, 31 Oct 2019 12:21:01 +0000 (12:21 +0000)]
Bug 22706: (RM follow-up) Add unit tests

Helps if one actually adds the new test file to the commit!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: DBRev 19.06.00.047
Martin Renvoize [Thu, 31 Oct 2019 12:16:46 +0000 (12:16 +0000)]
Bug 14697: DBRev 19.06.00.047

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (QA follow-up) Remove tab chars
Josef Moravec [Wed, 30 Oct 2019 18:00:53 +0000 (18:00 +0000)]
Bug 14697: (QA follow-up) Remove tab chars

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (follow-up) Add auth values to the sample data
Tomas Cohen Arazi [Wed, 30 Oct 2019 15:17:15 +0000 (12:17 -0300)]
Bug 14697: (follow-up) Add auth values to the sample data

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (QA follow-up) Restore FK on issue_id and adjust tests
Tomas Cohen Arazi [Tue, 29 Oct 2019 20:43:13 +0000 (17:43 -0300)]
Bug 14697: (QA follow-up) Restore FK on issue_id and adjust tests

This patch reintroduces the FK constraint on issue_id. The tests are
adjusted to reflect the UNIQUE constraint we also added.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (QA follow-up) Add missing AV category
Tomas Cohen Arazi [Tue, 29 Oct 2019 18:57:06 +0000 (15:57 -0300)]
Bug 14697: (QA follow-up) Add missing AV category

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (QA follow-up) Organize tests in subtests
Tomas Cohen Arazi [Tue, 29 Oct 2019 18:38:48 +0000 (15:38 -0300)]
Bug 14697: (QA follow-up) Organize tests in subtests

This patch organizes the tests better, and adds some more.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Make controller methods rely on the stashed user
Tomas Cohen Arazi [Tue, 29 Oct 2019 13:27:18 +0000 (10:27 -0300)]
Bug 14697: Make controller methods rely on the stashed user

This patch adjusts the return values and HTTP status codes, as well as
removing the use of C4::Context->userenv. It also makes the date
calculation happen on the DB engine in the case of resolving the claim.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: (follow-up) Rely on the UNIQUE constraint and return 409 for issue_id
Tomas Cohen Arazi [Mon, 28 Oct 2019 19:18:52 +0000 (16:18 -0300)]
Bug 14697: (follow-up) Rely on the UNIQUE constraint and return 409 for issue_id

This patch avoids querying the DB for an already existing
Koha::Checkouts::ReturnClaim with the same issue_id, now that there's a
UNIQUE constraint on it.

Also, 409 should be returned instead. Tests added for this changes.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Schema updates
Kyle M Hall [Tue, 29 Oct 2019 15:32:15 +0000 (12:32 -0300)]
Bug 14697: Schema updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Enhance the return claims feature
Kyle M Hall [Tue, 29 Oct 2019 15:29:54 +0000 (12:29 -0300)]
Bug 14697: Enhance the return claims feature

This adds a "Claims returned" feature that extends and enhances the claims returned lost status.
To use this feature, a new LOST status to represent an item claimed as returned needs to be created.
The value of this LOST authorised value should be set in the new syspref ClaimReturnedLostValue.
Setting this system preference turns on the feature.

Once the feature is enabled, you should be able to mark checked out items as return claims from the
checkout and patron details pages, and also modify them from the new claims tab on those pages.

Returning a claimed item will notify the librarian that the item in question has a claim on it.

Setting the ClaimReturnedWarningThreshold will add an alert to make librarians aware that this
patron has many return claims on the patron's record.

Test Plan:
1) Create a "Claims Returned" lost value
2) Create some RETURN_CLAIM_RESOLUTION authorized values
3) Set ClaimReturnedLostValue
4) Set ClaimReturnedChargeFee
5) Set ClaimReturnedWarningThreshold
6) Create some checkouts
7) Claim some returns
8) Verify ClaimReturnedChargeFee works with all 3 options
9) Verify ClaimReturnedWarningThreshold shows a warning once the threshold has been exceeded
10) Edit notes on a claim
11) Resolve a claim
12) Delete a claim

Sponsored-by: North Central Regional Library System
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Add routes to handle return claims
Kyle M Hall [Tue, 29 Oct 2019 15:29:37 +0000 (12:29 -0300)]
Bug 14697: Add routes to handle return claims

This patch adds the /return_claims route to add new return claims, and
then routes to updates notes and the resolution code.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Add Koha::Patron->return_claims
Kyle M Hall [Tue, 29 Oct 2019 15:28:53 +0000 (12:28 -0300)]
Bug 14697: Add Koha::Patron->return_claims

Adds the ability to get a list of a patron's return claims directly
from the Patron object.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Add Koha::Checkout->claim_returned
Kyle M Hall [Tue, 29 Oct 2019 15:28:36 +0000 (12:28 -0300)]
Bug 14697: Add Koha::Checkout->claim_returned

Adds the ability to generate a return claim from a Checkout object.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Add return claim handling to AddReturn
Kyle M Hall [Tue, 29 Oct 2019 15:28:24 +0000 (12:28 -0300)]
Bug 14697: Add return claim handling to AddReturn

This adds the ability to alert a librarian of an item claimed as returned is actually returned.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Introduce Koha::Checkouts::ReturnClaim(s)
Kyle M Hall [Tue, 29 Oct 2019 15:26:56 +0000 (12:26 -0300)]
Bug 14697: Introduce Koha::Checkouts::ReturnClaim(s)

This patch introduces the Koha::Object(s)-derived classes for handling
return claims. Tests are added to cover the overloaded ->store method,
and domain-specific exceptions are added as well.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Add new schema file
Kyle M Hall [Fri, 22 Feb 2019 14:40:35 +0000 (09:40 -0500)]
Bug 14697: Add new schema file

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14697: Update database
Kyle M Hall [Fri, 22 Feb 2019 13:46:34 +0000 (08:46 -0500)]
Bug 14697: Update database

This patch introduces the new table and related sysprefs.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: DBRev 19.06.00.046
Martin Renvoize [Thu, 31 Oct 2019 11:56:46 +0000 (11:56 +0000)]
Bug 15260: DBRev 19.06.00.046

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: (follow-up) Add missing POD
Andrew Isherwood [Fri, 17 May 2019 11:06:48 +0000 (12:06 +0100)]
Bug 15260: (follow-up) Add missing POD

As per comment #33

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: (QA follow-up) Fix updatedatabase message
Liz Rea [Mon, 6 May 2019 17:18:57 +0000 (17:18 +0000)]
Bug 15260: (QA follow-up) Fix updatedatabase message

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: (follow-up) Fix bug in subtraction
Andrew Isherwood [Wed, 1 May 2019 11:12:14 +0000 (12:12 +0100)]
Bug 15260: (follow-up) Fix bug in subtraction

prev_open_days can receive either positive or negative numbers and
then does the right thing with them. However, we weren't also doing this
with the number it receives back from get_push_amt

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: (follow-up) Fix misnamed variable
Andrew Isherwood [Fri, 12 Apr 2019 11:31:31 +0000 (12:31 +0100)]
Bug 15260: (follow-up) Fix misnamed variable

This was causing the amount to push by to be incorrectly calculated

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: Fix calculation of add amount
Andrew Isherwood [Tue, 26 Mar 2019 14:43:34 +0000 (14:43 +0000)]
Bug 15260: Fix calculation of add amount

In a sequence of closed days, we should take into account the nature
of each closed day as we encounter it in order to calculate the amount
to add to reach the next potential closed date. We are now doing this.

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: Add unit tests
Andrew Isherwood [Mon, 4 Feb 2019 15:11:34 +0000 (15:11 +0000)]
Bug 15260: Add unit tests

This patch adds unit tests of the CalcDueDate function to ensure that
the useDaysMode "Dayweek" mode works as expected

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: Implement weekly rollforward
Andrew Isherwood [Fri, 1 Feb 2019 14:07:01 +0000 (14:07 +0000)]
Bug 15260: Implement weekly rollforward

This patch will, when appropriate, roll due dates forward by full weeks,
rather than single days.

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: Modify next/prev_open_day
Andrew Isherwood [Fri, 1 Feb 2019 12:24:54 +0000 (12:24 +0000)]
Bug 15260: Modify next/prev_open_day

We require next_open_day & prev_open_day to be more flexible. We could
create a separate sub, but that's not very DRY given that they'll do
pretty much the same thing.

So next_open_day becomes next_open_days and prev_open_day becomes
prev_open_days and both functions accept an additional parameter which
determines how many days they add or subtract.

All calls of these two functions have been modified accordingly.

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: Modify description of Dayweek option
Andrew Isherwood [Fri, 1 Feb 2019 11:42:24 +0000 (11:42 +0000)]
Bug 15260: Modify description of Dayweek option

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15260: Add new useDaysMode option "Dayweek"
Andrew Isherwood [Thu, 31 Jan 2019 15:36:52 +0000 (15:36 +0000)]
Bug 15260: Add new useDaysMode option "Dayweek"

This patch adds a new "Dayweek" option to the useDaysMode syspref, it
has the description: "the calendar to push the due date to the next open
day on the same weekday".

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23866: DBRev 19.06.00.045
Martin Renvoize [Thu, 31 Oct 2019 11:37:33 +0000 (11:37 +0000)]
Bug 23866: DBRev 19.06.00.045

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23866: Prompt for HEA configuration
Martin Renvoize [Tue, 22 Oct 2019 12:57:42 +0000 (13:57 +0100)]
Bug 23866: Prompt for HEA configuration

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22706: (RM follow-up) Add unit tests
Martin Renvoize [Thu, 31 Oct 2019 11:22:09 +0000 (11:22 +0000)]
Bug 22706: (RM follow-up) Add unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22706: (RM follow-up) Restore ability to create disabled accounts
Martin Renvoize [Thu, 31 Oct 2019 10:50:07 +0000 (10:50 +0000)]
Bug 22706: (RM follow-up) Restore ability to create disabled accounts

The patchset inadvertantly disabled the ability to create disabled user
accounts when any check_password plugin was installed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22706: (RM follow-up) Remove use of Koha::Plugins::Handler
Martin Renvoize [Thu, 31 Oct 2019 10:11:07 +0000 (10:11 +0000)]
Bug 22706: (RM follow-up) Remove use of Koha::Plugins::Handler

Using both Koha::Plugins and Koha::Plugins::Handler inside the same
class causes issues for runtime module loading which in turn caused all
the plugins tests to fail.

This patch converts this patchset to use the direct call style used
elsewhere in Koha removing the need for Koha::Plugins::Handler.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23667: Add route to GET /items
Tomas Cohen Arazi [Mon, 23 Sep 2019 15:48:14 +0000 (12:48 -0300)]
Bug 23667: Add route to GET /items

This patchset introduces a route to fetch items. It relies on the
already implemented code/mappings to get a single item.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass!
- Try the endpoint with your favourite API tool (Postman?)
- Sign off :-D

Note: to do exact searching on barcode, you need to build the query like
this:

GET /api/v1/items?external_id=<your_barcode>&_match=exact

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23667: Add spec
Tomas Cohen Arazi [Mon, 23 Sep 2019 15:48:02 +0000 (12:48 -0300)]
Bug 23667: Add spec

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22706: (QA follow-up) Restore location of logaction
Martin Renvoize [Thu, 24 Oct 2019 13:41:19 +0000 (14:41 +0100)]
Bug 22706: (QA follow-up) Restore location of logaction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22706: Add plugin hooks for Norwegian national patron database
Magnus Enger [Wed, 24 Apr 2019 12:59:03 +0000 (14:59 +0200)]
Bug 22706: Add plugin hooks for Norwegian national patron database

The main point of this patch is to make it possible to integrate Koha
with the Norwegian national patron database (NNPDB). Code for this was
earlier introduced in Bug 11401 and removed again in Bug 21068.

To test this is mainly a question of spotting regressions, it should
still be possible to set and change a password in all possible ways:
- Setting a password for a new user
- Changing a password in the staff client
- Changing a password in the OPAC
If these work as expected, everything should be OK.

A nice side effect of this work is that it will allow for plugins that
validate passwords. I have created a tiny plugin that enforces PIN
codes of 4 digits. (Yeah, I know, those are the worst passwords, but
some libraries do require them.) It is published here:
https://github.com/Libriotech/koha-plugin-pin
To test this way, install the plugin and try to change the password
of an exsisting user to something that is not a 4 digit PIN. You
should get an error that says "The password was rejected by a plugin".

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Updated 2019-10-23:
- Moved the plugin checks to before the call to $self->SUPER::store to
  make sure patrons are not saved if the password fails a plugin check
- Made the plugin checks in set_password respect skip_validation while
  retaining the functionality for NNPDB

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23853: Typo in authorised_values.tt
caroline [Mon, 21 Oct 2019 14:25:55 +0000 (10:25 -0400)]
Bug 23853: Typo in authorised_values.tt

This patch corrects the Bsort1 typo in authorised_values.tt and changes the Bsort2 description to match Bsort1's.

To test:
1- Go to Administration > Authorised values
2- Make sure descriptions for Bsort1 and Bsort2 match their category and are the same (except for 1 and 2)

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23663: Only process itemtype summary if using non-xslt opac results
Nick [Sat, 21 Sep 2019 11:33:47 +0000 (11:33 +0000)]
Bug 23663: Only process itemtype summary if using non-xslt opac results

To test:
1 - Set OpacXSLTResultsDisplay to "" to use non-xslt view
2 - In Administration->Itemtypes define a summary for an itemtype:
    This is the summary for [245a]
3 - Perform a search on the opac that will return results with this itemtype
4 - Note "This is the summary" appears in results with the title
5 - Set OPACXSLTResultsDisplay to 'default'
6 - Refresh your search results, note the summary disappears
7 - Try search in other places and note that summary never appears
8 - Apply patch
9 - Repeat 1-7 and note nothing changed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18757: Problem when importing only items in MARC records
Fridolin Somers [Thu, 8 Jun 2017 14:22:55 +0000 (16:22 +0200)]
Bug 18757: Problem when importing only items in MARC records

When importing records with Stage MARC records for import, one can use matching rules to only import items into existing records.
Those imported items are stored as XML to be staged.

The bug is that when MARC Flavour is UNIMARC the XML serialization fails because its is looking in field 100$a which does not exist.
You see in logs the error : Unsupported UNIMARC character encoding [] for XML output for UNIMARC; 100$a

This patch adds the format "USMARC" to XML serialization, like in C4::Items::_get_unlinked_subfields_xml

Test plan :
- On a UNIMARC database
- Define a maching rule on title 200$a
- Select a record with items
- Export it using : Save as > MARC (Unicode/UTF-8)
- Delete all items
- Go to Tools > Stage MARC records for import
- Upload exported file
- Select title matching rule
- Select "Ingore incoming record" in "Action if matching record found :"
- Select Yes and "Always add items" in "Check for embedded item record data?"
- Click Stage for import
=> Without patch you get the error
=> With patch the import is staged
- Import into the catalog and check item is well recreated

Signed-off-by: Amandine Zocca <azocca@ville-montauban.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23630: Do not remove field 999 in Elasticsearch indexing
Fridolin Somers [Thu, 19 Sep 2019 14:55:51 +0000 (16:55 +0200)]
Bug 23630: Do not remove field 999 in Elasticsearch indexing

Elasticsearch indexing uses 999$c to store record id by deleting the all field first !
So you can not store anything in field 999, even in UNIMARC and even in authorities records.

Looks like it is quick fix code added to start Elasticsearch use.

This behavior is disturbing and very strange for UNIMARC flavour.

This patch corrects by defining record ids mandatory in Koha::SearchEngine::Elasticsearch::Indexer::update_index().
This ids array is actually always given (except in UT).
I think it is useless to allow adding a record without its id.

Test plan :
1) Use Elasticsearch as SearchEngine
2) Create a subfield 999$z in default framework
3) Create a record with default framework
4) Enter a random string (never used in catalog) like "tototata" in 999$z
5) In Search engine configuration, define search field "subject" for 999$z
6) Rebuild record : misc/search_tools/rebuild_elasticsearch.pl -b -bn <biblionumber> -v
7) Search for the random string => You get a result
8) Optionnaly look at records in ES : <es server>:9200/<es index name>/data/<biblionumber>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22826: Allow indexing of individual authorities in Elasticsearch
Nick Clemens [Thu, 2 May 2019 10:21:36 +0000 (10:21 +0000)]
Bug 22826: Allow indexing of individual authorities in Elasticsearch

To test:
1 - perl misc/search_tools/rebuild_elastic_search.pl -h
2 - Note it indicates the bn option can be passed to index individual authids
3 - perl misc/search_tools/rebuild_elastic_search.pl -a -bn 92 -v
4 - Note the error
5 - Apply patch
6 - perl misc/search_tools/rebuild_elastic_search.pl -h
7 - Note new option ai|authid for indexing individual authids
8 - Note updated text for bn|biblionumber option
9 - perl misc/search_tools/rebuild_elastic_search.pl -a -bn 92 -v
10 - No errors, but no records indexed
11 - perl misc/search_tools/rebuild_elastic_search.pl -a -ai 92 -v
12 - 1 record indexed
13 - perl misc/search_tools/rebuild_elastic_search.pl -ai 92 -bn 92 -v
14 - 1 authority record and 1 biblio record indexed

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22445: (RM follow-up) Build CSS
Martin Renvoize [Mon, 28 Oct 2019 12:43:02 +0000 (12:43 +0000)]
Bug 22445: (RM follow-up) Build CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23310: Reduce noise in Koha::Biblio
Mark Tompsett [Fri, 12 Jul 2019 01:30:47 +0000 (01:30 +0000)]
Bug 23310: Reduce noise in Koha::Biblio

The use of uninitialized value flooding plack-error
can get rather distracting and annoying.
By using "// q{}" after each of the subfield() calls
this eliminates the problem

TEST PLAN
---------
vertical break where you stop your cut-and-paste.
This test should be repeatable with cut-and-paste
easily.

restart_all
kshell

prove t/db_dependent/Koha/Biblio.t
-- may strangely be quiet.

prove t/db_dependent/Koha/Biblios.t t/db_dependent/Koha/Biblio.t
-- should be noisy.

prove t/db_dependent/Koha/Biblio.t
-- will always be noisy now.

exit
git bz apply 23310

restart_all
kshell

prove t/db_dependent/Koha/Biblio.t
-- will be quiet.

prove t/db_dependent/Koha/Biblios.t t/db_dependent/Koha/Biblio.t
-- will be quiet.

prove t/db_dependent/Koha/Biblio.t
-- will be quiet.

qa -v 2 -c 1

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23858: (follow-up) Return code fix
Tomas Cohen Arazi [Mon, 21 Oct 2019 17:32:25 +0000 (14:32 -0300)]
Bug 23858: (follow-up) Return code fix

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23858: Make POST add the Location header on vendors endpoint
Tomas Cohen Arazi [Mon, 21 Oct 2019 17:23:15 +0000 (14:23 -0300)]
Bug 23858: Make POST add the Location header on vendors endpoint

According to the coding guidelines, this endpoint should be adding the
Location header on POST actions.

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat (1)
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23858: Regression tests
Tomas Cohen Arazi [Mon, 21 Oct 2019 17:22:26 +0000 (14:22 -0300)]
Bug 23858: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22114: Untranslatable "Patron note:" in checkout.js
Owen Leonard [Fri, 4 Oct 2019 15:00:19 +0000 (15:00 +0000)]
Bug 22114: Untranslatable "Patron note:" in checkout.js

This patch modifies JavaScript used in circulation, replacing an
untranslatable English string in the script with a variable defined in
strings.inc which can be translated.

To test you should have the AllowCheckoutNotes system preference
enabled.

 - Apply the patch and log in to the OPAC as a user who has two or more
   items checked out.
 - From the list of checkouts on the "Your summary" page, add a note to
   two or more checked-out items.
 - Log in to the staff client and open the checkout page for that user.
   - In the table of checkouts, check the "Check in" checkbox next to
     one of the titles you added a note to.
   - Click "Renew or check in selected items."
   - A message should appear in that table row showing your note,
     prefixed with the text "Patron note:"

To test translation, update and install the de-DE template:

 > cd misc/translator
 > perl translate update de-DE
 > perl translate install de-DE

 - Go to Administration -> System preferences and enable the "Deutsch
   (de-DE)" language under I18N/L10N preferences -> language.
 - Switch to the "Deutsch" translation.
 - Go to Ausleihe (Circulation) and check out to the same patron.
   - In the table of checkouts, check the checkbox in the "Rückgabe"
     column next to another title you added a note to.
   - Click the "Markierte Exemplare zurückgeben oder verlängern" button.
   - A message should appear in that table row showing your note
     prefixed with the text "Benutzernotizen:"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22874: Use false instead of 0 value for limiting on availability
Alex Arnaud [Thu, 9 May 2019 12:39:51 +0000 (12:39 +0000)]
Bug 22874: Use false instead of 0 value for limiting on availability

Test plan

  - Set up a elasticsearch 6 instance to work with Koha,
  - you may need to make koha works with ES 6 (see bug 20589),
  - make a search and limit it to available items only,
  => no result

  - Apply this patch,
  - make a search and limit it to available items only,
  - you should get some results

  - Do the same with ES 5.x

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23525: (bug 19289 follow-up) Use biblio's framework not ACQ
Jonathan Druart [Mon, 14 Oct 2019 07:51:35 +0000 (09:51 +0200)]
Bug 23525: (bug 19289 follow-up) Use biblio's framework not ACQ

This patch restores the behavior prior to
  commit 84ce1fb5921cdddf2368f0c330dede0f602742d0
  Bug 19289: Use the ACQ framework to display bibliographic details

Test plan is hard to provide for such a simple and obvious change. I
would recommend you to read the previous commit and confirm that the
change did not make sense.

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