]> git.koha-community.org Git - koha.git/log
koha.git
5 years agoBug 21625: Fix wording and typo in SMSSendDriver system preference description
Katrin Fischer [Sun, 21 Oct 2018 02:34:25 +0000 (02:34 +0000)]
Bug 21625: Fix wording and typo in SMSSendDriver system preference description

SMSSendDriver was missing an S.
Koha is sending not receiving messages, so I think switching
that will be a little more clear.

To test:
Verify that the system preference description reads correctly.

Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9d0fc26c4335fc9be7a01e3069c458e9397fc94f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 883672e7740d955aa2f29b1eb69036145582ec63)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21005: Address QA tool failures on tabs
Mark Tompsett [Wed, 17 Oct 2018 01:39:41 +0000 (01:39 +0000)]
Bug 21005: Address QA tool failures on tabs

Only whitespace changes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b2070ef98b74908860556872cc08c0b2ce74b8b1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0f719ee1b0d87ef7243c0824a1555c9399000cf8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21005: Missing row/column defaults cause unexpected results in report wizards
David Cook [Fri, 10 Aug 2018 08:08:13 +0000 (18:08 +1000)]
Bug 21005: Missing row/column defaults cause unexpected results in report wizards

Some report wizards are missing row/column defaults, which sometimes return blank
pages (borrowers_stats.pl) or results always equalling 0, which a non-discerning
user may interpret incorrectly.

If the DEBUG environmental variable is enabled, missing row/column choices will
actually cause fatal software errors as well, which is also undesirable for users.

This patch adds default choices for row and column on
report wizards that had no radio buttons selected, so that a user
can't submit the form without choosing a row and column. This
prevents errors.

To test:
1) Apply patch
2) Visit /cgi-bin/koha/reports/issues_avg_stats.pl
3) Visit /cgi-bin/koha/reports/borrowers_stats.pl
4) Visit /cgi-bin/koha/reports/catalogue_stats.pl
5) Visit /cgi-bin/koha/reports/issues_stats.pl
6) Observe that default choices for row/column are there

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6a451360b8fd0a56dd07be050cdecf538d890612)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4edef313918d8930de54d532089ed66c981bbb6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20592: Return early in ModItem if nothing to update
Mark Tompsett [Tue, 17 Apr 2018 23:59:58 +0000 (23:59 +0000)]
Bug 20592: Return early in ModItem if nothing to update

Two lines of code and move them earlier.
Add a check to make sure there are changes.

Followed the test plan, both the _BEFORE_ and after do as described.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1f0064bbddb9d00529d5eac1c096e669732eb551)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 75d6195c0ef36c4da244c4e2e2341696c94642c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20592: Add tests
Jonathan Druart [Tue, 24 Apr 2018 18:53:02 +0000 (15:53 -0300)]
Bug 20592: Add tests

NOTE: It isn't really a test, but it does trigger
      the return line which was added to ModItem.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 619eca1c7aaebf4db6ed170a3cbd14065da79c9d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 02860425d9ed9229664dc1d977f1d45ce83bcb50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21497: [17.11.x] Correctly format dates for ILL requests in OPAC
Owen Leonard [Fri, 5 Oct 2018 12:50:26 +0000 (12:50 +0000)]
Bug 21497: [17.11.x] Correctly format dates for ILL requests in OPAC

This patch updates the opac ILL template to use the $KohaDates plugin
for displaying dates. Also updated:

- Added "title-string" sorting to allow for correct sorting of dates in
  the table of requests.

To test, apply the patch and log in to the OPAC as a user who has
multiple outstanding ILL requests.

 - In the table of ILL requests, the "Request placed" and "Last updated"
   dates should be formatted according to your system's dateformat
   preference.
 - Sorting of those columns should work correctly.
 - View a request and confirm that "Request placed" and "Last updated"
   dates in this view are also formatted correctly.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a2418f743ce1e14d32229b5dd8d05aeb13f9e664)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e68d3d988497289656bcf12b7f260cdc91cbc176)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 18959: Skip xt/author/Text_CSV_Various.t if Text::CSV::Unicode missing
Tomas Cohen Arazi [Sat, 13 Oct 2018 12:17:00 +0000 (09:17 -0300)]
Bug 18959: Skip xt/author/Text_CSV_Various.t if Text::CSV::Unicode missing

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: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca9a1b76d8d729b1c09dbedbd90bd3f748351c4b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 882e18500c0ace2a1df7ad7ad3e38ece865a2953)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 18959: Text::CSV::Unicode missing from dependencies
Tomas Cohen Arazi [Sat, 13 Oct 2018 12:15:52 +0000 (09:15 -0300)]
Bug 18959: Text::CSV::Unicode missing from dependencies

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit eb3f78f82e8139739a17c11cc89f58865d7536b0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7d4756c89741958e22714730793cc200e276686f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoUpdate release notes for 17.11.12 release v17.11.12
Fridolin Somers [Mon, 26 Nov 2018 15:25:41 +0000 (16:25 +0100)]
Update release notes for 17.11.12 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoIncrement version for 17.11.12 release
Fridolin Somers [Mon, 26 Nov 2018 15:11:57 +0000 (16:11 +0100)]
Increment version for 17.11.12 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoMerge remote-tracking branch 'translate/17.11.12-translate-20181126' into 17.11.x
Fridolin Somers [Mon, 26 Nov 2018 15:08:37 +0000 (16:08 +0100)]
Merge remote-tracking branch 'translate/17.11.12-translate-20181126' into 17.11.x

5 years agoTranslation updates for Koha 17.11.12
Koha translators [Mon, 26 Nov 2018 14:30:51 +0000 (11:30 -0300)]
Translation updates for Koha 17.11.12

5 years agoBug 21766: Correct filtering on AUDIO_ALERT_PATH js
Martin Renvoize [Mon, 5 Nov 2018 16:34:00 +0000 (16:34 +0000)]
Bug 21766: Correct filtering on AUDIO_ALERT_PATH js

I managed to introduce a bad filter whilst backporting bug 15734 to the
18.05.x series. This patch attempts to correct that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f3c27b99796bd2eea82c405cfc102d0141299806)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21641: (follow-up) Address wrong call method
Andrew Isherwood [Thu, 25 Oct 2018 13:17:59 +0000 (14:17 +0100)]
Bug 21641: (follow-up) Address wrong call method

This patch substitutes C4::Accounts->getnextacctno for
C4::Accounts::getnextacctno since getnextacctno is only expecting to be
passed a borrowernumber

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4858c4f736d366701fa6a3f1def2727dd85c70ce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ff2de8e181e864cd121e39e314fe6be4dbe8eb0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21641: (follow-up) Address additional call
Andrew Isherwood [Thu, 25 Oct 2018 12:23:31 +0000 (13:23 +0100)]
Bug 21641: (follow-up) Address additional call

This patch makes the same change as the main patch, just for an
additional occurance of getnextacctno

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6fba062d291e065b4a6d7ffebdf82db9d6935971)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e79fac32c8ca7ef01b516feea461a07c7e8e3570)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21641: Added C4::Accounts to getnextacctno() call
Alex Buckley [Wed, 24 Oct 2018 03:37:57 +0000 (03:37 +0000)]
Bug 21641: Added C4::Accounts to getnextacctno() call

Test plan:
1. Fetch and checkout the master branch
2. Checkout an item with a rental charge associated with it to a user
and notice an error is thrown
3. Apply patch
4. Restart memcached and plack
5. Repeat steps 1 and 2 and notice the checkout happens successfully

Sponsored-By: Catalyst IT
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 344dba2fb84a743603c1c51294be4e378e6e5dc7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5c62543310c94b179dd3c8c93f4f79a414be5980)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21476: Fix HTML5 media from playing in the OPAC - incorrect filters
Nick Clemens [Tue, 23 Oct 2018 12:30:25 +0000 (12:30 +0000)]
Bug 21476: Fix HTML5 media from playing in the OPAC - incorrect filters

This patch makes a correction to a template filter to prevent
incorrectly-encoded HTML in media source links which were preventing
media from embedding correctly in the OPAC.

To test, apply the patch and enable the HTML5MediaEnabled and
HTML5MediaYouTube system preferences.

- Edit a record to include links to videos in 856$u. For example:
  - https://www.youtube.com/watch?v=grTwH6Evdfc
    - https://archive.org/download/POPEYEMeetsSindbadTheSailor1936/POPEYE%20meets%20Sindbad%20The%20Sailor%20%281936%29.ogv

    View the record in the OPAC and confirm that the videos display in
    the
    "Play media" tab and that they play correctly.

Tested and works as described, also matches the intranet code.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7736b5c2e32975502fa6198b5f7ec64feb7b8ffc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 18bb4d5e66f4bfc74144bce2f730359b55526b08)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21742: Fix YouTube variable propagation
Nick Clemens [Wed, 31 Oct 2018 12:18:58 +0000 (12:18 +0000)]
Bug 21742: Fix YouTube variable propagation

The loop to find all media has an $isyoutube variable. This was declared
outside the loop and never reset. Once a YouTube video was encountered
all subsequent videos were considered as YouTube. This patch reduces the
scope of the variable and resets per loop.

To test:
1 - Enable HTML5Media and HTML5MediaYouTube
2 - Add 856$u to record for a youtube vido and a pdf (sample record
        attached to bug)
3 - View the record, the Play media tab has two video boxes
4 - Play the second, it fails
5 - Apply patch
6 - View record, Play media should include only one video link

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8ceba54c8dcfd9b598375b8af432c0111ec63d04)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ec7e569d55575f26ba481684ff157c8ec3985002)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21311: (follow-up) Adjust wording of failed login message
Marcel de Rooy [Thu, 25 Oct 2018 09:37:42 +0000 (11:37 +0200)]
Bug 21311: (follow-up) Adjust wording of failed login message

Based on the feedback of Jonathan, Katrin, Mark and Martin (thx), adding
the general remark that if lockout is enabled, an account may be locked
out after x attempts. This does not say that the account on hand is
locked or not.

Adding a <p> tag between 'Log in'-button and 'Forgot your password' for
presentation.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e64650216f568e7d7ad26e25ae59493202d871a3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 14e9eb67b9e86b025eeddc9426c490280a4c022f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21311: Remove locked message from opac-auth.tt
Marcel de Rooy [Wed, 10 Oct 2018 14:04:38 +0000 (16:04 +0200)]
Bug 21311: Remove locked message from opac-auth.tt

We should not expose more information than needed when someone tries
to login with invalid credentials. Saying that an account is locked
reveals that the account exists (or perhaps an email address).

Trivial fix. Keeping the var too_many_login_attempts for staff.
Note: We do not remove this distinction for the staff client here (in the
assumption that a library may well have additional security measures in
place for staff client). But it could be done too (on another report).

Test plan:
Enable lockout feature.
Enter invalid credentials until account locks out (on OPAC !!)
Note that message does no longer change to 'Account is locked'.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 716301d6f5bb149e963c5547d69d4019c20953db)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 55d687f3a7002439c6d27fb35af83333b8dfcdc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21587: don't drop patrons to notify in order creation
Victor Grousset [Thu, 18 Oct 2018 09:54:58 +0000 (11:54 +0200)]
Bug 21587: don't drop patrons to notify in order creation

It only worked on modification.

== Test plan ==
1. have/create a active budget
2. have/create a fund
3. have/create a vendor with minimal info
4. create a basket with minimal info
5. add an order line to the basket
     Add a user in "To notify on receiving"
6. Modify the order
7. The patrons isn't here. This is the bug
8. Add a user in "To notify on receiving"
9. Save
10. Modify the order
11. The patron is here now
12. Apply this patch
13. Retry step 5 to 11 and patron should be saved on order creation
14. Celebrate! :D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bf8b4e773c089a4094b18c62af91711b8af99f82)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cb7db6fcd45d956d28596d86de312ee5502333a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21771: (follow-up) Revert the shift statement
Marcel de Rooy [Tue, 6 Nov 2018 14:02:47 +0000 (15:02 +0100)]
Bug 21771: (follow-up) Revert the shift statement

Obviously you should never shift an items from an array if you need that
item later on :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with entering userid as well as entering email..

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1885e6a2146dfab4784e3d9560161d5f097cfcae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 28d1eda94a3d1658fadecfbb9861641f42c80cf9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21599: Fix item type creation by defining default values
Jonathan Druart [Thu, 18 Oct 2018 11:32:59 +0000 (08:32 -0300)]
Bug 21599: Fix item type creation by defining default values

Same as what we have in Koha::Patron->new, empty strings should not be
inserted in integer or date column type

DBD::mysql::st execute failed: Incorrect decimal value: '' for column 'defaultreplacecost' at row 1 [for Statement "INSERT INTO `itemtypes` ( `checkinmsg`, `checkinmsgtype`, `defaultreplacecost`, `description`, `hideinopac`, `imageurl`, `itemtype`, `notforloan`, `processfee`, `rentalcharge`, `searchcategory`, `sip_media_type`, `summary`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="", 1="message", 2="", 3="xx", 4=0, 5='', 6="XX", 7=0, 8="", 9="", 10="", 11=undef, 12=""] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.

Test plan:
Create a new itemtype

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 33c142ba3b7cfd37dd90569de2a5802849b09ef5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c2eeaa43443e0591eebbf00f48dacfff005b647)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21513: Add a 'Cancel' button to the authority editor and remove duplicate 'Save...
Andreas Roussos [Sun, 7 Oct 2018 18:00:09 +0000 (21:00 +0300)]
Bug 21513: Add a 'Cancel' button to the authority editor and remove duplicate 'Save' button

The authority editor (authorities/authorities.pl) does not have
a 'Cancel' button. Also, it has two 'Save' buttons.

This patch fixes that by:
a) adding a 'Cancel' button to the floating toolbar at the top
b) removing the 'Save' button from the bottom of the page

Test plan:
1) Go to Home > Authorities and launch the authority editor by
   clicking on 'New authority'. Notice how the editor doesn't
   have a 'Cancel' button. Also notice the two 'Save' buttons.
2) Apply the patch.
3) Re-launch the authority editor, and hit cancel; you should
   be taken back to Home > Authorities.
4) Edit an existing authority, and hit cancel; you should be
   taken back to the details page for the authority you chose.
5) Edit an authority as new (duplicate), and hit cancel; you
   should be taken back to Home > Authorities (this behaviour
   is mimicking the bibliographic editor: when duplicating a
   biblio the 'Cancel' button will take you back to Home >
   Cataloging).

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2cffe3a574e14d5f35ce7b1d9ffe28a153dcb37e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 81ceef6b8410988dbf14ae0db3dfac64ae084fc9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21456: (QA follow-up) Catch missed case in authorities merge
Martin Renvoize [Mon, 8 Oct 2018 14:25:50 +0000 (15:25 +0100)]
Bug 21456: (QA follow-up) Catch missed case in authorities merge

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 796e4e5d2be5ec87970f8b586f940e4abddb687d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b9f85edd14aa4fc89b1a20457066980b4e7d4b15)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21456: The 'New authority' button lists authority types inconsistently
Andreas Roussos [Sun, 30 Sep 2018 10:06:28 +0000 (13:06 +0300)]
Bug 21456: The 'New authority' button lists authority types inconsistently

The 'New authority' button does not always list the available
authority types in A-Z order based on their description.

This patch fixes that.

Test plan:
1) Go to Home > Authorities in the staff client; notice how the
   'New authority' button lists auth types sorted by description.
2) Go to an authority's detail page; notice how the same 'New
   authority' button will list auth types sorted by their code.
3) Apply the patch.
4) In an authority's detail page, the 'New authority' button will
   now list the available authority types sorted by description.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bf7c8303ca7f9e4955f25fc4d1f30d65d8c52dc9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1f8356d2df19a704a5a12597a9443eb459941aad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19181: [17.11.x] pick opac_base_url
Fridolin Somers [Fri, 9 Nov 2018 14:47:30 +0000 (15:47 +0100)]
Bug 19181: [17.11.x] pick opac_base_url

5 years agoBug 21490: Disambiguation of 'Order' part 2
Caroline Cyr La Rose [Thu, 4 Oct 2018 18:52:53 +0000 (14:52 -0400)]
Bug 21490: Disambiguation of 'Order' part 2

This patch changes the 'Order' term in neworderbiblio.tt,
newordersubscription.tt, newordersuggestion.tt, and
z3950_search.tt for 'Place order'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 706d21ee53dd5072eec2234415fc5c8ff4b1ea17)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 50166e670b38f40ae0503c4c6eb6f95fd2ce0d16)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21490: Disambiguation of 'Order'
Caroline Cyr La Rose [Thu, 4 Oct 2018 18:38:25 +0000 (14:38 -0400)]
Bug 21490: Disambiguation of 'Order'

This patch changes the 'Order' term in marc_modification_template.tt
for 'Rank'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5ca776d6e171de1b093163ab83ba589d5ae4d7cc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b3f1bb0693ba9ac6a5e5f6143558505ddd00d586)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21579: Make showdiffmarc.pl work for authorities and biblios
Nick Clemens [Tue, 16 Oct 2018 14:00:59 +0000 (14:00 +0000)]
Bug 21579: Make showdiffmarc.pl work for authorities and biblios

To test:
 1 - Have or make some authority records
 2 - Have or make an authority matching rule
 3 - Export your authrotities
 4 - Import them using the matching rule
 5 - On the 'Manage staged records' page view some diffs
 6 - The import record is correct, but the existing records pull form
 bibs
 7 - Apply patch
 8 - Repeat
 9 - Confirm you see the expected authority matches

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marjorie Vila <marjorie.barry-vila@collecto.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7f0207d2ad162a86cf5e09e437565b66b91c5004)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ab630ab84f2f40145c24664a72da8bc0817cac66)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19802: Add stack trace to ease debugging
Jonathan Druart [Tue, 26 Dec 2017 17:41:50 +0000 (14:41 -0300)]
Bug 19802: Add stack trace to ease debugging

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f6f95808d815c6ef5376a5e9d5e238387010dd6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19802: Move Selenium code to t::lib::Selenium
Jonathan Druart [Tue, 12 Dec 2017 18:42:56 +0000 (15:42 -0300)]
Bug 19802: Move Selenium code to t::lib::Selenium

To make it reusable easily.

Test plan:
The basic_workflow.t tests should still pass after this change.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d482aef2e420cc2466a6e645eebea9c0c8d4a19d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21155: Prevent SwitchOnSiteCheckouts.t to fail randomly
Jonathan Druart [Tue, 16 Oct 2018 13:27:37 +0000 (10:27 -0300)]
Bug 21155: Prevent SwitchOnSiteCheckouts.t to fail randomly

 #   Failed test 'The date_due should have been set depending on the circ
 rules when the on-site checkout has been switched'
 #   at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 126.
 #          got: '2018-10-16T23:59:00'
 #     expected: '2018-10-21T23:59:00'

TestBuilder set date to today, so issuingrules.harduedate will be set to
today.
issuingrules.hardduedatecompare will be set to an integer.
If set to 0, $datedue will be reset to the hard due date

The call stack is: AddIssue > CalcDateDue > GetHardDueDate

In GetHardDueDate:
3509         if ( $hardduedatecompare == 0 || $hardduedatecompare == $cmp ) {
3510             $datedue = $hardduedate->clone;
3511         }

To fix this random failure we need to set issuingrules.harduedate to undef.

Test plan:
0. Do not apply this patch
1. Modify the test to set hardduedatecompare to 0 (search 'my $issuingrule = ')
2. Execute the test and confirm the failure
3. Apply this patch
4. Execute the test and confirm the it is no longer failing

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4e6d9defc180204461f80477be287ade7fcfc11b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c82207ebb5487660e70c7091195d67be4b434139)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21351: Rename the Taiwanese language pack to use correct file name
Martin Renvoize [Fri, 26 Oct 2018 11:32:20 +0000 (12:32 +0100)]
Bug 21351: Rename the Taiwanese language pack to use correct file name

The words "Han (Simplified variant)" is appearing in the language name
because the file is titled "zh-Hans-TW" when it should be titled
"zh-Hant-TW". The database is set up to use "Hant" but it just
incorrectly named.

Test plan
1. Apply patch.
2. Install zh-Hant-TW on your Koha server.
3. Navagate to I18N/L10N preferences and confirm that the english text description states (Traditional variant).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Files on translate.kc.org have already been fixed by Bernardo.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fd0df2ad55f9a5ff180dc0dfa22fede5f0ad37cd)
Converted to removal of files rather than rename as translation merges
had already created the new files as expected.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2cae3d86bd64ed39d4963b549583c7f514b3f9ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21115: Add multi_param call and add divider in cache key in svc/report and opac...
Marcel de Rooy [Wed, 25 Jul 2018 12:37:59 +0000 (14:37 +0200)]
Bug 21115: Add multi_param call and add divider in cache key in svc/report and opac counterpart

Resolve things like:
CGI::param called in list context from package CGI::Compile::ROOT::usr_share_koha_prodclone_opac_svc_report line 42, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

The cache key in both script looks like:
    opac:report:id:602018
but should for consistency be:
    opac:report:id:60:2018
Note: The 2018 here is part of the sql_params and should not be
concatenated to the report id.

Test plan:
Do not yet apply this patch.
Make a report public, set cache to 300 secs.
Check its output with opac/svc/report.
Check for the warn in your log.
Apply the patch, restart Plack and flush cache.
Check opac/svc/report.
Modify your report; e.g. add a simple string to the SELECT.
Check opac/svc/report. You should still see cached output.
Flush the cache.
Check opac/svc/report. You should now see the added text.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested also by clearing individual keys with $cache->clear_from_cache.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bfbbe52ff7ff0ec93825684e4728db705b4100d1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2ea99b19988a3fed348d574cb06a50c8f6206f34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21279: Fix &nbsp; in transport cost matrix
Marcel de Rooy [Wed, 10 Oct 2018 11:43:40 +0000 (13:43 +0200)]
Bug 21279: Fix &nbsp; in transport cost matrix

Test plan:
On Home â€º Administration â€º Transport cost matrix you should no longer
see "&nbsp;".
Fill some values and save, you should see the correct values.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1fddd295b8e83b60f2b838f09f3175c5acfeec28)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4092461ec990882f204d1431e69fd6d6a70d0d1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21479: "Mock" SearchEngine to use Zebra
Jonathan Druart [Mon, 15 Oct 2018 17:53:35 +0000 (14:53 -0300)]
Bug 21479: "Mock" SearchEngine to use Zebra

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit dc6bea7860aba7933f7e979cbe7c53e9cb15ba05)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 517bf773553ef941198898d5489b04c8859ded63)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21479: Zebra index can return different result
Jonathan Druart [Mon, 15 Oct 2018 14:42:34 +0000 (11:42 -0300)]
Bug 21479: Zebra index can return different result

If the zebra index has been rebuilt by previous tests, the order/results
will be different, and we will not have biblionumber 1, 3, 5

Let make this more flexible

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e7574481b19addd2747baf5917e772d28cd38bc5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 351dfa737bc0f4b46f4aab47dfa635943065df48)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21479: Remove the trace if the node does not exist
Jonathan Druart [Fri, 12 Oct 2018 18:37:44 +0000 (15:37 -0300)]
Bug 21479: Remove the trace if the node does not exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit be4f22f5a0745ef64c6bf20b89bd9f4fcbe40403)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ccb364a667745eadf52e76f894ec9dff2a15a060)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21479: Add regression tests
Jonathan Druart [Tue, 9 Oct 2018 16:30:54 +0000 (13:30 -0300)]
Bug 21479: Add regression tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 45fbd36e1f2e1aa622eec1ba588424cc50243fb3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bbf6d87d56e63a7c17ce91b7ea4b599fae95a881)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21320: Holds to pull should honor syspref AllowHoldsOnDamagedItems
Dobrica Pavlinusic [Thu, 6 Sep 2018 11:21:53 +0000 (13:21 +0200)]
Bug 21320: Holds to pull should honor syspref AllowHoldsOnDamagedItems

Test plan:

1. Set syspref AllowHoldsOnDamagedItems to Allow
2. Create a hold on record with item which is damaged
3. Verify that it doesn't appear in report
4. Apply patch and verify that it's now visible

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b23fe0b0b8d468fe80d40aef1a12296421cc1d37)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 42e8d66369c6b38caeab85ddd5a1021623ca4628)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 15734: Use To.json to filter audio alerts
Jonathan Druart [Tue, 9 Oct 2018 13:47:11 +0000 (10:47 -0300)]
Bug 15734: Use To.json to filter audio alerts

Test Plan:
1) Enable audio alerts
2) Note audio alerts don't work
3) Apply this patch
4) Note audio alerts now work

Use complex selectors to test:
  #circ_returns p.problem:contains('Not checked out.')
  #doc3 > #bd

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 58314233f70fd9fd2f2830250ff0362e369b6ff1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e635b63e94c0dd09f20c936039d518c3e494252c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21389: Correct Javascript error on article requests page
Fridolin Somers [Fri, 21 Sep 2018 09:17:25 +0000 (11:17 +0200)]
Bug 21389: Correct Javascript error on article requests page

Bug 21076 fixed a Javascript error on article requests page when patron is found.

There is also an error when patron is not found, with message :
  Patron not found
  No patron with this name, please, try another

This patch fixes by replacing TT condition by a JS condition testing the existance of the patron input.

Test plan:
1 - Do not apply patch
2 - Enable article requests
3 - Search on staff client and click 'Request article'
4 - Search for a patron that does not exist
5 - You get a yellow message "Patron not found"
6 - View error in console
7 - Apply patch
8 - Reload
9 - Not error is gone
10 - Search for a patron that does exist
11 - Check there is no error in console
12 - Check that autocompletion works

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b27db0fbfc0b715df1b63c57228a9945d4834f29)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b0f3bc8c134c195e3d943a0f7f9d5ff6a064da79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 16420: Buttons inconsistent between "Hold found" and "Hold found (waiting)" dialo...
Owen Leonard [Fri, 5 Oct 2018 17:05:19 +0000 (17:05 +0000)]
Bug 16420: Buttons inconsistent between "Hold found" and "Hold found (waiting)" dialogs in checkin

This patch makes minor changes to the text of hold confirmation buttons
in the checkin process in order to make them more consistent.

Also changed: Removed the "danger" class from the "Ignore" button for
readability and consistency's sake.

To test, apply the patch and check in an item which is on hold for a
patron at your logged-in library. The hold confirmation dialog's buttons
should read "Confirm hold," "Print slip and confirm," and "Ignore."

Confirm the hold, then check in the same item again.

In the dialog, the buttons should read "Confirm hold," "Print slip and
confirm," and "Cancel hold."

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 96c2df5804ce3ac84e5963d6b9764553a97a6978)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ee4fbd587f97768106367aab9b9746f9b09dffbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21500: Remove warnings in rotating collections
Tomas Cohen Arazi [Thu, 4 Oct 2018 17:08:32 +0000 (14:08 -0300)]
Bug 21500: Remove warnings in rotating collections

To test:
- Go to Tools > Rotating collections
=> FAIL: Some warinings on the logs
- Apply this patch
- Reload page
=> SUCCESS: No warinings
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 40803d30359f347417999429b612fcece9fc96f9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4b139ba1954b5c1451f842996ae42511c9369c05)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21550: DataTables four button pagination uses the wrong icon for disabled buttons
Owen Leonard [Thu, 11 Oct 2018 15:59:13 +0000 (15:59 +0000)]
Bug 21550: DataTables four button pagination uses the wrong icon for disabled buttons

This patch modifies the DataTables CSS which styles "full_nubmers"
controls which are disabled: First and Previous buttons on the first
page of results, Next and Last buttons on the last page of results.
These buttons should have gray icons instead of blue.

To test, apply the patch and clear your browser cache if necessary. View
a page which uses a "full_numbers" DataTables configuration, e.g.

- Administration -> Cities
- ILL requests -> List requests
- Circulation -> Holds to pull

Confirm that buttons in their disabled state have a gray icon and text
instead of blue.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d9b922f46f8d551949f337f29edef6985130c8ba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 417e28f14ebccdef073491b94bbbad8a80a0630d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21506: DataTables four button pagination uses the wrong icon for First and Last...
Andreas Roussos [Sat, 6 Oct 2018 07:15:26 +0000 (10:15 +0300)]
Bug 21506: DataTables four button pagination uses the wrong icon for First and Last buttons

Pages with DataTables' four button pagination use the wrong
icon for 'First' and 'Last'. Also, the icons for all four
buttons are truncated at the bottom.

This patch fixes that.

Test plan:
1) Go to a page that uses four button pagination (e.g. Home >
   Administration > MARC frameworks) and notice how the
   pagination icons for First/Previous and Next/Last are the
   same. Also notice all four icons are clipped at the bottom.
2) Apply the patch.
3) Refresh the page; the First and Last buttons' icons now
   include a vertical bar, and there is no clipping visible.
4) For completeness, check other affected pages as well.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 074c329774adb7b23f85293a7f6d146c0d989f99)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8802d32b7f4e9f4642d3b0f7f7f8a871b85662ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21417: DBRev 17.11.11.002
Nick Clemens [Tue, 9 Oct 2018 11:30:23 +0000 (11:30 +0000)]
Bug 21417: DBRev 17.11.11.002

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cf8890465d32d780e4177438d9b6ae807b1df36d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 18d04888b2264ab85a24290c51eed01c051418ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21417: (QA follow-up) Display default EAN as such in admin display
Colin Campbell [Thu, 27 Sep 2018 15:07:37 +0000 (16:07 +0100)]
Bug 21417: (QA follow-up) Display default EAN as such in admin display

A branch value of null is interpreted as the default
Add text 'All libraries' to this case in the display
rather than blank so that its function is clear to the
user

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d70daacebae50fde8449f4cec2bb4578747610fc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f0937049f376d829d6baad81c66c298e93587acf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21417: EDI ordering fails when basket and EAN libraries do not match
Kyle M Hall [Thu, 27 Sep 2018 10:51:27 +0000 (06:51 -0400)]
Bug 21417: EDI ordering fails when basket and EAN libraries do not match

When clicking Create EDIFACT Order on /acqui/basket.pl, an EDIFACT message will not be generated if aqbasket.branch does not match edifact_ean.branchcode. This failure does not generate any sort of error message, it just fails to produce a message.

We should allow ean's to not require a branch to be set, then if we don't find a branch specific each, we can look for the default version of the ean.

Test Plan:
1) Apply this patch set
2) Run updatedatabase
3) Verify you can create a Library EAN without setting a branchcode for it
4) Verify you can use this EAN to send an EDI order where the basket has a branchcode set

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 18674cfde322c52fafb3114b397bb1ebe7941b97)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c2537558e0ed79cc00a71d7405b7e738835372a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21455: Authority search options get shuffled around when you click on 'Search'
Andreas Roussos [Sat, 29 Sep 2018 16:51:45 +0000 (19:51 +0300)]
Bug 21455: Authority search options get shuffled around when you click on 'Search'

In the staff client, when you perform an authority search the
selected values for the 'Search all headings:' and 'Search
entire record:' options get shuffled around when you click on
the 'Search' button.

This patch fixes that.

Test plan:
1) Perform an authority search and set the 'Search all headings:'
   option to 'starts with'.
2) Click on the 'Search' button.
3) Notice how the 'Search all headings:' option is now 'contains',
   and 'starts with' has moved down to the 'Search entire record:'
   option.
4) Apply the patch.
5) Hit 'Search' again. This time the selected search options do
   not move around.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6cee98c04fce2129de21c65c9e0c407a508df9bd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d0db6f69bbc38b943dd723eca05f181de1a60cf8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20910: Display 773$g when $0 is present too
Tomas Cohen Arazi [Mon, 11 Jun 2018 14:34:22 +0000 (11:34 -0300)]
Bug 20910: Display 773$g when $0 is present too

This patch makes the XSLT logic add the $g subfield in the 773 display
in both the OPAC and staff interface MARC21 record detail pages.

The XSLT chooses between different ways to create the link for the
related content, but then it only adds the $g in two of the cases.
There's no obvious reason for a different display.

To test:
- Have  a record with:

=773   $tHost title $gp4.

=> SUCCESS: Notice the Detail view shows:
  In: Host title p4.

- Have another record with:

=773   $tHost title $gp4. $w100
- Enable UseControlNumber (only to cover the case):
=> SUCCESS: Notice the detail view shows
  In: Host title p4.

- Have another record with:

=773   $tHost title $gp4. $0456

=> FAIL: The Detail view doesn't show p4.
- Apply this patch
- Reload
=> SUCCESS: The Detail view displays p4.!
- Sign off :-D

Sponsored-by: Escuela de Orientacion Lacaniana
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f161d4e823aa84d7c602089eacacbdf2bfc502ce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8a7b508cf4bfb9ed03259139c8819a7011995bf5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 9968: Fix wrong index for Standard number in advanced and label search
Katrin Fischer [Wed, 16 May 2018 01:05:07 +0000 (01:05 +0000)]
Bug 9968: Fix wrong index for Standard number in advanced and label search

'Standard number' indicates that you can search ISBN, ISSN and other
standard numbers, but we are using the wrong index and only get a
very limited search for biblionumber instead.

This patch changes the index from sn to ident.

To test:
- Check both staff and OPAC advanced search:
  - Search for Standard number = ISBN
  - Search for Standard number = ISSN
  Both should work.
  Toggle [Intranet|OPAC]NumbersPreferPhrase system preferences
- Check the label creator
  - Add a new batch
  - Use 'add items' option and search for Standard number

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 09a7d37d53a87e35f2151e00200995ab3dfa3896)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d341326362656853d0f8d371bd7d685b9c4266d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 17237: Remove CREATE USER 'user'@'%' line
Mark Tompsett [Wed, 25 Apr 2018 16:44:03 +0000 (16:44 +0000)]
Bug 17237: Remove CREATE USER 'user'@'%' line

Having a 'user'@'%' line decreases database security.
Bug 16690 closes the need for such a line, and this
bug removes the use of it.

TEST PLAN
---------
While this depends on 16690, it is not required for testing.

On a kohadev box:
sudo koha-create --create-db test_17237_a
git bz apply 17237
sudo perl ~/misc4dev/cp_debian_files.pl
restart_all
sudo systemctl daemon-reload
sudo koha-create --create_db test_17237_b
sudo mysql -u root
SELECT user,host from mysql.user;
-- test_17237_a will have two entries, one being '%'
-- test_17237_b will only have one entry, not '%'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1e856e7e7316749f59cb4e721e352b0a60237def)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 291c250dcfe23c046f3b5df419b8819fb92cbcf3)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21617: DBRev 17.11.11.001
Nick Clemens [Fri, 19 Oct 2018 16:50:40 +0000 (16:50 +0000)]
Bug 21617: DBRev 17.11.11.001

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8150058b387b39469b64853a07d512bcc0a3741d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5bc9139097327a05f411935cec08ded322a46032)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21617: statistics.ccode is not long enough (see also DBRev 18.05.04.001)
Marcel de Rooy [Fri, 19 Oct 2018 08:51:05 +0000 (10:51 +0200)]
Bug 21617: statistics.ccode is not long enough (see also DBRev 18.05.04.001)

Warn from a test:
DBD::mysql::st execute failed: Data too long for column 'ccode' at row 1 [for Statement "INSERT INTO statistics
        (datetime,
         branch,          type,        value,
         other,           itemnumber,  itemtype, location,
         borrowernumber,  proccode,    ccode)
         VALUES (now(),?,?,?,?,?,?,?,?,?,?)" with ParamValues: 0="z8LIyIV", 1='issue', 2=undef, 3='', 4='2584', 5='E_QkzaV5Ay', 6='oDnFRZyog2CS2_XoUB_MB2sBxyI3elbFPC_AekxLPrduGTXKnlNoLKEdQrXzpAw5zD1pGbZshV9ydZup', 7='2000005168', 8='', 9='j9ZDn74omZAoZrTOdC4a05SpWRSHPR2apfss7y5V6QJuQnBEk32XWXCfMp7'] at C4/Stats.pm line 138.

The dbrev 18.05.04.001 did not change it from 10 to 80 as in other tables.

We should either truncate to 10 chars in Stats.pm or increase to varchar(80). Since it is varchar and not char, we should not be afraid about size. I choose for the latter here.

Test plan:
Run db rev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ad20a30a831c5f3482f2eed80cc36269ebbef05f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 08ece37ccabb739ff2ae7f34ccd8ea2e88827e18)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoRevert "Bug 21396: Add 2 missing use statements in Koha::Account"
Fridolin Somers [Tue, 6 Nov 2018 08:15:06 +0000 (09:15 +0100)]
Revert "Bug 21396: Add 2 missing use statements in Koha::Account"

This reverts commit b0ce47f6d8890be5534ed5b08d7582065f536c3b.

5 years agoBug 21396: Add 2 missing use statements in Koha::Account
Jonathan Druart [Fri, 21 Sep 2018 20:55:40 +0000 (17:55 -0300)]
Bug 21396: Add 2 missing use statements in Koha::Account

1. require C4::Letters must be use C4::Letters (from bug 19191)

2. There is call to C4::Circulation::ReturnLostItem, but no use of
C4::Circulation (from bug 20631)

Test plan:
finger crossed, I ran the tests from t/db_dependent/Koha and they all
passed

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1b56e446ed64cad9d4dd42a8cb3f1953f424e0aa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 362c9331a241bedb3efcab57c0e1287c5ed1c18a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years ago[17.11.x] correct duplicat keys in definitions.json
Fridolin Somers [Fri, 2 Nov 2018 14:18:20 +0000 (15:18 +0100)]
[17.11.x] correct duplicat keys in definitions.json

6 years agoUpdate release notes for 17.11.11 release v17.11.11
Fridolin Somers [Wed, 24 Oct 2018 09:37:09 +0000 (11:37 +0200)]
Update release notes for 17.11.11 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoIncrement version for 17.11.11 release
Fridolin Somers [Wed, 24 Oct 2018 09:30:04 +0000 (11:30 +0200)]
Increment version for 17.11.11 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoTranslation updates for Koha 17.11.11
Koha translators [Wed, 24 Oct 2018 09:20:52 +0000 (06:20 -0300)]
Translation updates for Koha 17.11.11

6 years agoBug 21479: Fix remove from cart links at the OPAC (should remove only 1)
Owen Leonard [Wed, 3 Oct 2018 14:13:49 +0000 (14:13 +0000)]
Bug 21479: Fix remove from cart links at the OPAC (should remove only 1)

This patch changes the way biblionumbers are passed to the cart script
for adding and removing single items. The title's biblionumber is now
stored in a data-attribute on the links for adding and removing. This
should be a more robust, unified way to handle these single-item
operations.

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

Test adding and removing items from the cart from various pages using
various methods:

 - By clicking an "Add to your cart" / "Remove" link in search results
 - By clicking an "Add to your cart" / "Remove" link on a detail page
 - By checking boxes in search results and adding via the dropdown

Each operation should work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2cd49034c43a16c7497f05e94c18396532fceddc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2d078a18e5e090bcafa64262bb5f8dceed796169)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format
Andreas Roussos [Thu, 27 Sep 2018 16:05:48 +0000 (19:05 +0300)]
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format

koha-create contains a call to `zcat` which fails if the file passed
as an argument is not in gzip format.

This patch fixes the issue by adding the -f flag to the zcat call in
koha-create, as per the top-voted answers in the following SE URLs:
https://unix.stackexchange.com/a/77309
https://unix.stackexchange.com/a/131944

Test plan:
1) in /etc/koha/koha-sites.conf, set the DEFAULTSQL variable to point
   to an _uncompressed_ SQL database dump
2) run `koha-create --create-db instance` and notice how it fails with:
   gzip: /path/to/dump.sql: not in gzip format
3) apply the patch
4) notice the extra line of information "The SQL file can be optionally
   compressed with gzip" in koha-sites.conf
5) run the `koha-create` command again, this time it should work
6) repeat with DEFAULTSQL pointing to a gzip'd dump, it should work too

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f12dabe6ccd9400a4ae744a5d74bbddcd9f7ac95)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 89f0452ba17c54045656ee2654a162fd4a96a744)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 10382: Course reserves: handle empty values
Alex Arnaud [Wed, 21 Feb 2018 13:10:50 +0000 (13:10 +0000)]
Bug 10382: Course reserves: handle empty values

Test Plan:
1) Create an item, do not set a collection code
2) Add the item to a course, and choose to set a collection code
3) Ensure the course is enabled, and the collection code is now visible
4) Disable the course, ensure the collection code is no longer visible

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9c6025ccbfd0c57d45fec444ee57e72c3aad512b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e9c0c2263057d7e72013d8a62438803733d2a67f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 10382: Add unit tests for course items
Alex Arnaud [Thu, 9 Mar 2017 13:42:04 +0000 (13:42 +0000)]
Bug 10382: Add unit tests for course items

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3e6f9b8a1d5b293cfe5a00732e2b6f1371046855)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 84bf7c9468a1be39de54a488f41e5c579be86072)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 10382: collection not returning to null when removed from course reserves
Kyle M Hall [Wed, 5 Jun 2013 14:01:17 +0000 (10:01 -0400)]
Bug 10382: collection not returning to null when removed from course reserves

Test Plan:
1) Create an item, do not set a collection code
2) Add the item to a course, and choose to set a collection code
3) Ensure the course is enabled, and the collection code is now visible
4) Disable the course, ensure the collection code is no longer visible

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b1bb9f9e6b028dce0109755180100e4033424227)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9b428ec7ed43c3926483aa692315efdebb545f7b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21352: [17.11.x] remove html filter
Fridolin Somers [Fri, 19 Oct 2018 08:33:28 +0000 (10:33 +0200)]
Bug 21352: [17.11.x] remove html filter

Replaces commit in master :
commit 47c7f7c64c723ee2944d4c77a71d2f2d0ab0851c
Author: Kyle M Hall <kyle@bywatersolutiosn.com>
Date:   Thu Sep 20 15:30:49 2018 -0400

    Bug 21352: Use the raw filter for plugin hooks, both opac and staff side

6 years agoBug 21352: (qa followup) - correction to testplan
Martin Renvoize [Mon, 8 Oct 2018 12:46:15 +0000 (13:46 +0100)]
Bug 21352: (qa followup) - correction to testplan

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b34946b01740ed584571a1acbd3b9de7c0ada7ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21352: Add missing USE statements
Kyle M Hall [Mon, 1 Oct 2018 18:05:40 +0000 (14:05 -0400)]
Bug 21352: Add missing USE statements

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ff1b0ba7cae7ee72d1fc4ab0c2d1a1e1b40ac7fe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c6f2599b974e5c168da4f551021543e2e46dda29)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21352: Allow plugins to add CSS and Javascript to Staff interface
Kyle M Hall [Sat, 15 Sep 2018 16:48:49 +0000 (09:48 -0700)]
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface

We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.19 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the staff intranet, notice you get an console error log message and the background
   for your staff intranet is now orange ( assuming you've not customized the
   staff intranet in any way )

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a37637e30357258885e9d0c1c7a30366869dcb08)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ee19e31ce05c927cff3505171eb9d7e68bfdd7bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: Fix Plugins.t
Jonathan Druart [Mon, 14 May 2018 16:09:16 +0000 (13:09 -0300)]
Bug 20764: Fix Plugins.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3422a0d93eb2ac607b9deee57f9e5c034907c839)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: (follow-up) Rename the test file
Jonathan Druart [Mon, 14 May 2018 15:33:48 +0000 (12:33 -0300)]
Bug 20764: (follow-up) Rename the test file

There is something wrong here...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bdad7aec0e34c81c7eb02a2de7552c4a03998a62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: Rename the test file
Jonathan Druart [Mon, 14 May 2018 15:14:33 +0000 (12:14 -0300)]
Bug 20764: Rename the test file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3a125dfb9144ae4165d9790121db1ed3b7129dc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: (QA follow-up) Fix path to sample plugins
Tomas Cohen Arazi [Mon, 14 May 2018 15:03:32 +0000 (12:03 -0300)]
Bug 20764: (QA follow-up) Fix path to sample plugins

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3523a01a07381a701375b81d540e325559449aae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: Koha_Template_Plugin_KohaPlugins.t is db dependent
Mirko Tietgen [Mon, 14 May 2018 12:46:20 +0000 (14:46 +0200)]
Bug 20764: Koha_Template_Plugin_KohaPlugins.t is db dependent

t/Koha_Template_Plugin_KohaPlugins.t is DB dependent.
This patch moves it to t/db_dependent/

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 831e6fac4d84cf5cbc63354dcd1baa5100cfaba7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: (QA follow-up) Remove double check
Kyle M Hall [Thu, 29 Mar 2018 11:11:40 +0000 (07:11 -0400)]
Bug 20181: (QA follow-up) Remove double check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 14c702bee5362654c8779b8b4a33a0d679ee6a6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: Add POD for new plugin
Kyle M Hall [Tue, 13 Feb 2018 19:08:25 +0000 (14:08 -0500)]
Bug 20181: Add POD for new plugin

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f50a6ece8386058a5778d46458821064412c5f01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: (follow-up) Ensure test runs
Mark Tompsett [Tue, 13 Feb 2018 18:50:02 +0000 (18:50 +0000)]
Bug 20181: (follow-up) Ensure test runs

If EnablePlugins was 0, this test before this patch fails.
After this patch, it passes.

TEST PLAN
---------
1) Apply all but this patch
2) Run the following commands
    kshell
    prove t/Koha_Template_Plugin_KohaPlugins.t
   -- two tests fail, if you have the conf or syspref set to 0.
3) Apply this patch
4) Repeat step 2.
   -- all tests pass, including the positive and negative case checks.
5) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9755c34938c42411e4a7e5d897af7335eca6bc13)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: Unit tests
Kyle M Hall [Mon, 12 Feb 2018 16:15:47 +0000 (11:15 -0500)]
Bug 20181: Unit tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 98164dc43209af9964b84e83f2ee8f0ff7491a35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: Allow plugins to add css and javascript to OPAC
Kyle M Hall [Mon, 12 Feb 2018 14:09:20 +0000 (09:09 -0500)]
Bug 20181: Allow plugins to add css and javascript to OPAC

A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.12 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the opac, notice you get an alert message and the background
   for your opac is now orange ( assuming you've not customized the
   opac in any way )

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e8fbe51ff33760b0446339b44047229be9e9f1a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21480: misc/translator/translate does not work with perl 5.26
Olli-Antti Kivilahti [Wed, 3 Oct 2018 08:24:38 +0000 (11:24 +0300)]
Bug 21480: misc/translator/translate does not work with perl 5.26

Perl 5.26 (or earlier) introduced a security feature, where implicitly
including the program directory as a Perl library directory no longer
happens (perl -I. ).

This causes translate to fail because it cannot find the *.pm -files in
it's own directory.

This patch adds the familiar mantra
    use lib $FindBin::Bin;
to the relevant scripts.

To test:

1. Install Ubuntu18.04 or something else with Perl 5.26
2. Install Koha (we use the dev-install)
3. cd $KOHA_PATH/misc/translator/
4. perl translate create fi-FI
5. Observe problems with missing modules.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Cannot recreate the issue right now but the changes make sense.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8aa86cdf2d5e0dbda7d21394e52f37ba17a8064c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 24e2d2d9c46772804ee1904ec7ab3e80a8bf9d28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20131: Inventory optional filters correct "For loan" addition
Fridolin Somers [Fri, 2 Feb 2018 13:34:34 +0000 (14:34 +0100)]
Bug 20131: Inventory optional filters correct "For loan" addition

In inventory, optional filters are build from authorize values categories used for items.notforloan, items.itemlost, items.withdrawn and items.damaged.

The bug is that description of value 0 is always "For loan".
This seems to be only for "notforloan".

Second bug is that if a description exists for "notforloan" value 0, it is not used.

This patch corrects by adding "For loan" only for "notforloan" authorized values and if there is no 0 value.
It changes the description added by code from "ignore" to a more unlikly user defined "__IGNORE__".

Test plan:
1) Make sure you have authorized values defined on items.notforloan, say "NFL" category, with at least a value and description but no 0 value
2) Make sure you have authorized values defined on items.itemlost, say "LOST" category, with 0 = "Not lost" and 1 = "Lost"
3) Go to inventory /cgi-bin/koha/tools/inventory.pl
4) Without patch you see "For loan" on both items.notforloan and items.itemlost
5) With patch you see "For loan" only in items.notforloan, you see for items.itemlost : "Not lost" and "Lost"
6) Create in authorized values category "NFL" a value 0 with description "Available"
7) Go to inventory /cgi-bin/koha/tools/inventory.pl
8) Without patch you see "For loan" in items.notforloan for value 0
9) With patch you see "Available" in items.notforloan for value 0

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8d9284668c6de2d5fbfc4079a8b0516ba1645876)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a9aa1bd1e43a871a813de1e2e97005567afa589c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18655: Correct the choose link in unimarc_field_210c value builder
Baptiste Wojtkowski [Tue, 23 May 2017 08:54:00 +0000 (08:54 +0000)]
Bug 18655: Correct the choose link in unimarc_field_210c value builder

- Link 'choose' is now a button.
- It doesn't call directly javascript anymore (use of listener).
- field to load stored in html on the page (less escaping needed).

Test plan :
1) Use UNIMARC catalog
2) Define unimarc_field_210c value builder on 210$c
3) Define an autority type EDITORS with heading on 200$b
4) Create an autority of this type with a single quote in heading, ie : l'avenir
5) Index this new autority
6) Edit a biblio record and launch 210$c value builder
7) Search for new autority
8) Click on 'Choose'
=> Heading should be pasted in 210$c

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9965aa43e15aaa63fd8999daa98618d20698e89b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b8ad6a6532c236e473d548ad910d920ef1516ecf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20151: always use current language for stemming
Fridolin Somers [Wed, 7 Feb 2018 14:06:56 +0000 (15:06 +0100)]
Bug 20151: always use current language for stemming

When stemming is enabled, in catalog searching "C4::Search::_build_stemmed_operand" will transform query operand into stemmed operand using stemmer Lingua::Stem::Snowball with a specified language.
This stemmer returns undef stemmed operand if no language is defined.

In main catalog search (catalogue/search.pl) current language is used.
But in other pages "acqui/neworderbiblio.pl" and "cataloguing/addbooks.pl" no language is defined so stemmed operand is empty and so stemming is not applied.

This patch corrects by returning in "C4::Search::_build_stemmed_operand" operand without change if no langage is defined.
And uses current langage in pages "acqui/neworderbiblio.pl" and "cataloguing/addbooks.pl" so all catalog search uses stemming.

Test plan :
1) Enable system preferences QueryStemming and QueryWeightFields
2) Disable system preferences QueryAutoTruncate, QueryFuzzy and UseQueryParser
3) Go to intranet main page and click on "Search the catalog" tab
4) Perform a search (without index) that uses the stemming, for example searching for "years" will also match "year"
5) Note how many results you get, for example "year" gets 24 results and "years" gets 24 results
6) Go to "Cataloging" module
7) Perform a search on same word in "Cataloging search" tab
8) Note how many results you get
9) Without patch you get fewer results than first search (step 5) because stemming is not applied, for example "year" gets 11 results and "years" gets 15 results
10) With patch you get the same results as first search (step 5) because stemming is applied, for example "year" and "years" gets 24 results
11) Same tests in aquisition module
12) On a basket, click "Add to basket" and perform a search in "From an existing record"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 78a692dee4523d04986ec394442c3a6d80ea0771)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2170698ab9da24d306286991b55257c4c3317e65)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21322: process_message_queue.pl --type should take an argument
Magnus Enger [Thu, 6 Sep 2018 13:23:17 +0000 (13:23 +0000)]
Bug 21322: process_message_queue.pl --type should take an argument

The help for this script says:
-t --type: If supplied, only processes this type of message ( email, sms )

Currently, the type argument is set up wrong, so it does not look
for an argument. This patch fixes that.

To test, run this command (should work in kohadevbox) or something
similar:

$ sudo koha-shell -c "perl \
/home/vagrant/kohaclone/misc/cronjobs/process_message_queue.pl -v \
--type=sms" kohadev

This should give the following error: "Option type does not take an argument".
Apply the patch and run the same command again. This should not give an
error.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d74a05d4fe81a599c030024f7944d2bdcca43d12)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a3f097958cae68e4f3f16c8eb5aa5411d2488bc2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21176: Fix due date calculation when high holds and TimeFormat is 12hr
Jonathan Druart [Mon, 13 Aug 2018 16:23:00 +0000 (13:23 -0300)]
Bug 21176: Fix due date calculation when high holds and TimeFormat is 12hr

What we were doing was wrong and is still wrong. The output_pref should not be done
in modules or script, only template side.
Much more work would be needed to clean the situation. This patch provides less changes
as possible to, hopefully, not introduce side-effects.

To recreate:
1 - Enable decreaseLoanHighHolds, set to 1 day and more than 0 holds
2 - Set TimeFormat to 12 hour
3 - Find or create a record with two items
4 - Place a hold on one of them
5 - Checkout the other to a different patron
6 - Note the warning message display correct time
7 - Confirm the checkout
8 - Note the item is due at 11:59AM

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 11885e75c04fa53cd88daae1ec0dc4a2a8ecd1f7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d8a66ad010247c90a8930f4d2b48f96bbfe3b7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19271: Show vendor name on ordered/spent lists
Katrin Fischer [Thu, 27 Sep 2018 11:29:08 +0000 (12:29 +0100)]
Bug 19271: Show vendor name on ordered/spent lists

 Improvements to the display of lists of ordered and received orders:
 - Show the vendor's name instead of the internal number

 To test:
 - Make sure you have some pending and received orders
 - Access the Spent and Ordered pages by clicking on the
   amount ordered or spent on the acq start page
   - Verify that
     - Vendor name shows

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8b1bda9ed8507745b4002199d9aae95c2cbb31fb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3e77e7a4d6c90e6a14d152af19c46cda6486e7ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 15971: Add biblioitems to available fields for serial claim notices and fix notic...
Katrin Fischer [Fri, 10 Aug 2018 03:21:56 +0000 (05:21 +0200)]
Bug 15971: Add biblioitems to available fields for serial claim notices and fix notices editor display

This fixes 2 related problems:

1) The editor only offered 3 entries from biblio for adding to the notice:
title, author, serial
It was not clear that actually all fields from biblio can be used.

2) It was not possible to use fields from biblioitems in the notices
which left out important fields like the ISSN.

The patch adds the biblioitems table and changes the editor to show
all entries from biblio and biblioitems table are shown on the left.

To test:
- Create a subscription
- Generate next issue a few times to get late issues
- Create a new notice in the "Claim serial issue" module
  - Use fields from different/all tables
- Make sure an email address is set for
  - the vendor (also check for 'receives claims for late issues')
  - your staff user
- Go to serials > claims
- Claim multiple issues
- Verify the email is generated and contains the correct information

Example notice:

Title: <<biblio.title>>
Author: <<biblio.author>>
ISSN: <<biblioitems.issn>>
ISBN: <<biblioitems.isbn>>
Issue: <<serial.serialseq>>
--

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a002d12888c1e56910a32f28514a59d9a1d9363d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 00422bf33f48c95aac0dc639e42fe958d0de133b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21425: Display basketno correctly in Order error msg
Colin Campbell [Thu, 27 Sep 2018 11:25:28 +0000 (12:25 +0100)]
Bug 21425: Display basketno correctly in Order error msg

carp will display the hash value instead of the desired basketno
in the error message unless we change its behaviour

Use the simpler but effective option of concatenating
the errormessage with the basketno. Error is shown if no
sender or receipient ean is passed in instantiating
an Koha::Edifact::Order object

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e81756b317da848a6e6346a7c0db8f3b986f7058)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f7088ecf4b752f3e61e94ff4738fb04b97d574d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: (follow-up) add missing type="text"
Mark Tompsett [Wed, 26 Sep 2018 22:57:32 +0000 (22:57 +0000)]
Bug 13272: (follow-up) add missing type="text"

This addresses comment #13.
This also applies cleanly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 623f1db90ac8d0361a879813c66a4bccbf0ea23e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 721cefdb95ba6d3f8fb59f6b02255cd76d8a3fbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: (follow-up) Replace tabs with spaces
Mark Tompsett [Wed, 19 Sep 2018 18:49:02 +0000 (18:49 +0000)]
Bug 13272: (follow-up) Replace tabs with spaces

Cleaned up whitespace issues tab vs. space in template.
After applying all patches:
    git diff -w origin/master
For the koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
only the changed type="text" lines will show, but without the
-w, there will be more whitespace changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5edd363a1f2e3b1ea34f3f2aa7ace86cbf467df8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 73b197df9ed8e038684e1821ab4d9090d7af225a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: (follow-up) fix concerns from comment #5
Mark Tompsett [Wed, 19 Sep 2018 16:48:13 +0000 (16:48 +0000)]
Bug 13272: (follow-up) fix concerns from comment #5

Correct the two issues I pointed out.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 77871b408c9a8e120f8415cc0b32683ee8f57e7d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 49158f3369617b9a4ad8d247308f2a4aea653cde)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: Adds type="text" to inputs missing it
Christopher Brannon [Sun, 16 Sep 2018 22:06:10 +0000 (22:06 +0000)]
Bug 13272: Adds type="text" to inputs missing it

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 92a2d74c1c134674b9798981208b9ad5863a6b42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5fbbdb915f9a41070ff71aac902622f0a7bb5ef7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21289: Fix "isa" bug during partner request
Andrew Isherwood [Thu, 30 Aug 2018 09:52:43 +0000 (10:52 +0100)]
Bug 21289: Fix "isa" bug during partner request

We cannot call 'handle_commit_maybe' inside a 'try' block.
handle_commit_maybe redirects the client then calls 'exit', this is
interpreted as an error and the 'catch' block is erroneously called.

This patch moves the calling of 'handle_commit_maybe' outside the try
block, it will only be reached if everything inside the try block
suceeds.

To test:
1) Enable ILL and have the FreeForm backend available
2) Create a patron category to hold ILL "partners" to whom requests can
be sent. The category can be called anything, you should note the code
you assign
3) Create a patron that belongs to your new category, the patron must
have a primary email defined.
4) In your <interlibrary_loans> block in koha-conf.xml, ensure you have
a <partner_code> element, it should contain the code you assigned in
step 2
5) Create an ILL request using the FreeForm backend
6) Once the request is created, select the "Place request with partners"
button
7) Select your "partner" from the "Select partner libraries" box
8) Click "Send email"
9) TEST: Observe no errors are displayed in the UI

Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fca5a1cb3dba5d6561eaf5f30dfd4d996a4042cc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6bf50445b151ef94e6100da482e5826458a5136b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 16690: Simplify SHOW GRANTS to work when connected
Mark Tompsett [Wed, 8 Jun 2016 02:48:57 +0000 (22:48 -0400)]
Bug 16690: Simplify SHOW GRANTS to work when connected

If the DB is on a remote machine, the web server and the
db server are different, but the SHOW GRANTS code in
installer/install.pl is trying to use the SAME machine.
And even if the permissions were allowed accessing from
both the web and db servers, MySQL won't return the
SHOW GRANTS without access to the mysql.user table. To
install *.* permissions became easiest to get working.
Unless the DB is set up with 'user'@'%', which is also a
potential security issue.

MySQL / MariaDB allow the current connected user to
check their own grants with CURRENT_USER.
There is no need for the installer to know the
IP address of the webserver.

This also removes the need to have permissions for
'koha_kohadev'@'%', because the only process to be
accessing the koha DB is from a known host/ip.
This tightens security too.

TEST PLAN
---------
Install 2 fresh VMs from a Debian ISO.
Make sure they are on the same network (192.168.50.x) as
the kohadevbox. You will need to remember one as DB_IPADDRESS.

On the DB VM & Third VM:
sudo apt-get install mariadb-server mariadb-client net-tools
-- the third vm just needs to be able to run mysql to access
   the DB VM.

On DB VM:
sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf
-- make sure the bind-address line is commented out with a #
sudo service mariadb restart
-- congratulations, your DB server is listening to remote
   calls now.

sudo mysql -u root
CREATE DATABASE koha_kohadev;
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
-- now you have an empty DB ready to run a web install on.
   However, because only koha_kohadev from localhost is
   allowed, we expect failure when we try to run the web
   installation step when we get there.

Let's confirm that everything is working as expected
before trying.  It will also demonstrate the reason why
this patch is superior to the existing code.

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should be denied

On DB VM:
DROP USER 'koha_kohadev'@'localhost';
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should give an access denied error.
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should show two lines based on 'koha_kohadev'@'%';
QUIT
-- This case requires the unless code currently in place,
   because we aren't checking CURRENT_USER.

On DB VM:
DROP USER 'koha_kohadev'@'%';
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'192.168.50.10' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should show two lines based on 'koha_kohadev'@'192.168.50.10';
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should give an access denied error.
QUIT
-- This case demonstrates that we have two failure points:
       1) The GRANT command by the DB Admin and
       2) The koha-conf.xml setting.
   This is why CURRENT_USER is superior: only (2) is the
   failure point.

On DB VM:
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
SELECT host,user FROM mysql.user;
-- Should see both koha_kohadev for 192.168.50.10 and %.

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'192.168.50.10';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should show two lines based on 'koha_kohadev'@'192.168.50.10';
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should give an access denied error.
QUIT
-- This case doesn't need the unless. CURRENT_USER still
   just works.

On an third VM on the same network:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should give an access denied error.
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should show two lines based on 'koha_kohadev'@'%';
QUIT
-- This case demonstrates that it may be more open than a DB
   administrator would prefer. And notice, CURRENT_USER still
   just works.

On DB VM:
DROP USER 'koha_kohadev'@'192.168.50.10';
DROP USER 'koha_kohadev'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'koha_kohadev'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
-- This basically give koha_kohadev free reign to do pretty
   dangerous stuff.

On an third VM on the same network:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show a line based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should give a no such grant error.
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should show two lines based on 'koha_kohadev'@'%';
QUIT
-- This case demonstrates that it may be more open than a DB
   administrator would prefer. And notice, CURRENT_USER still
   just works.

In the old code, both cases were literally checked.
This tweak is an optimization which doesn't require
setting permissions to the mysql.user table. Without it,
the code says the user doesn't have permissions to check
the show grants.  This issue is not visible to the user,
because both cases are checked.

On DB VM:
SELECT host,user FROM mysql.user;
-- for each one do an appropriate DROP USER 'user'@'host';
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'192.168.50.10' IDENTIFIED BY 'password';

On kohadevbox:
-- Make sure the /etc/koha/sites/kohadev/koha-conf.xml
   points to the DB VM.
-- Make sure a web install runs correctly

On third VM:
-- Make sure unable to connect as koha_kohadev/password.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I have not followed the whole test plan but trusting author and SO
Changes make sense to me

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 013c116d59b14681bff1c18c9225ea4e31627a28)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 67a491a73f0dea1182c937aa424491210a0d0d8b)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21416: 'gr' option missing from ZEBRA_LANGUAGE options in koha-sites.conf
Andreas Roussos [Thu, 27 Sep 2018 04:54:27 +0000 (07:54 +0300)]
Bug 21416: 'gr' option missing from ZEBRA_LANGUAGE options in koha-sites.conf

'gr' (as in 'Greek') is missing from the ZEBRA_LANGUAGE options
in debian/templates/koha-sites.conf. This patch fixes that.

Test plan:
1) view koha-sites.conf and notice how 'gr' is missing from the
   ZEBRA_LANGUAGE options
2) apply the patch
3) observe that koha-sites.conf now includes 'gr' as an option

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 705571a2b870fbb652ca210e32ee3e7ca050e75f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 93b7683780ba6c79ce22307c8c8cbd31f3c73a56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21133: [17.11] RMaint fixup
Fridolin Somers [Wed, 10 Oct 2018 12:22:01 +0000 (14:22 +0200)]
Bug 21133: [17.11] RMaint fixup

6 years agoBug 21133: [18.05.x] Fix use statements order
Jonathan Druart [Tue, 31 Jul 2018 18:24:10 +0000 (15:24 -0300)]
Bug 21133: [18.05.x] Fix use statements order

Basically the idea is:
1. Undefined subroutine &C4::Items::ModZebra called at /home/vagrant/kohaclone/C4/Items.pm line 302.

=> Then use C4::Items before C4::Biblio

2. Undefined subroutine &C4::Circulation::GetItem called at /home/vagrant/kohaclone/C4/Circulation.pm line 1290

=> Then use C4::Circulation before C4::Items

And sometimes these 2 rules do not work...

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6427906fcccea22327db3c1d78847fed5ba9e7fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20785: Advanced Editor does not honor MarcFieldDocURL
Pasi Kallinen [Fri, 24 Aug 2018 08:05:04 +0000 (11:05 +0300)]
Bug 20785: Advanced Editor does not honor MarcFieldDocURL

The advanced MARC editor, Rancor, doesn't obey MarcFieldDocURL.
Make it do so.

Test plan:

1) Enable EnableAdvancedCatalogingEditor
2) Set MarcFieldDocURL to eg. http://{MARC}.example.com/{LANG}/{FIELD}
3) Go to Cataloging -> Advanced editor
4) Go to any field and press Ctrl-H
5) Marc field documentation on www.loc.gov or ifla.org should open
6) Apply patch
7) Repeat 3 and 4. The Marc field docs should open on the URL you set

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca839922fd4bf3c455454f6dd9182203b1481831)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0f2d80328d74c661ecd318f603a18743e3c699bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>