]> git.koha-community.org Git - koha.git/log
koha.git
5 years agoBug 22052: Unit tests
Nick Clemens [Fri, 28 Dec 2018 18:48:15 +0000 (18:48 +0000)]
Bug 22052: Unit tests

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f44e37b201d0a8b95b1eee0ac0766bed9c386fc2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22030: DBRev 18.11.01.001
Nick Clemens [Tue, 8 Jan 2019 14:01:45 +0000 (14:01 +0000)]
Bug 22030: DBRev 18.11.01.001

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 70abd7698f02a7da791490607f43df9f781390d2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22030: Use preference to determine username sent to overdrive
Nick Clemens [Wed, 19 Dec 2018 17:53:08 +0000 (17:53 +0000)]
Bug 22030: Use preference to determine username sent to overdrive

Overdrive configuration generally defaults to cardnumber, however, they
have confirmed that some libraries use usernames. We need to allow for
both scenarios.

To test:
1 - Have an OverDrive account setup with SIP authentication
    Note: You can apply for a testing account at developer.overdrive.com
    and setup an environment
2 - Fill in all your OverDrive system preferences
3 - Test with a patron whose username is their cardnumber
4 - Confirm their overdrive account tab on opac loads
5 - Change the username to be another value like "borked_wont_work"
6 - Note the overdrive account tab won't load
7 - Apply patch, update database, not new system preference
OverDriveUsername (default to 'cardnumber)
8 - Note the OD account loads successfully
9 - Change the system preference to 'user name' - the account load fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 96adab7af8999da7f351169e1265d4be5e59742f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21605: (follow-up) Simple ternary boolean to number conversion
Marcel de Rooy [Thu, 13 Dec 2018 13:59:38 +0000 (14:59 +0100)]
Bug 21605: (follow-up) Simple ternary boolean to number conversion

Imo it is much easier to do just "$a ? 1 : 0" than testing defined($a) etc.
in the additional loop.
Less code, more readable?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 482b323da1e18324941963359b9a1bd96f297c44)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21605: Ensure EDI acct fields set to boolean val
Colin Campbell [Fri, 26 Oct 2018 09:42:13 +0000 (10:42 +0100)]
Bug 21605: Ensure EDI acct fields set to boolean val

Validate the input to the fields indicating account
functionality. The only valid values are 1 and 0
non-integer (or integers other than 0/1) are invalid

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c9c3fc4368ee9d37a45c48167d25d5cee511898b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22059: Fix exception params in Koha::Patron->set_password
Tomas Cohen Arazi [Wed, 2 Jan 2019 12:56:52 +0000 (09:56 -0300)]
Bug 22059: Fix exception params in Koha::Patron->set_password

This simple patch fixes a wrong call to ->throw. Parameters shouldn't be
enclosed in curly brackets.

To test:
- Apply the tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> FAIL: Tests fail because the throw call is wrong
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
-Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4d671103f420f1c0b80bcbf13be613b69e2aa4f9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22059: regression tests
Tomas Cohen Arazi [Wed, 2 Jan 2019 12:56:21 +0000 (09:56 -0300)]
Bug 22059: regression tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3ef3ecfe99e219fda854ca57c652e3c52a7f47d7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21802: Compiled CSS
Martin Renvoize [Mon, 7 Jan 2019 15:41:32 +0000 (15:41 +0000)]
Bug 21802: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21802: Align fieldset with accordion headers when editing notice's template
Jonathan Druart [Sun, 16 Dec 2018 15:58:14 +0000 (12:58 -0300)]
Bug 21802: Align fieldset with accordion headers when editing notice's template

Test plan:
Regenerate the css using `yarn css`
Edit a notice's template and confirm that the fieldsets are aligned with
the accordion headers

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0a68a662ee4b7b2aebdb313ee33f9d9ca54e2c22)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21990: Replace dialog .error with .alert
Jonathan Druart [Wed, 12 Dec 2018 15:22:47 +0000 (12:22 -0300)]
Bug 21990: Replace dialog .error with .alert

<div class="dialog error"> will display a div without background color, the correct class is "dialog alert".

https://wiki.koha-community.org/wiki/Interface_patterns#Error_messages

Test plan:
Hit /cgi-bin/koha/acqui/parcel.pl
Notice the background color change with and without this patch

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 d44a42e417b563f501f038cc5226eda0f5fb3ca5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22034: Handle default framework for MARC view with framework
Jonathan Druart [Thu, 20 Dec 2018 22:55:46 +0000 (19:55 -0300)]
Bug 22034: Handle default framework for MARC view with framework

To test:

- Create a record in any framework that is not default
- Search for the record in your catalog
- Switch to the MARC tab
- Change framework pull down to default on top
- Note the page reloads and the framework stay default
- Verify it works for other frameworks

Also test the "labeled MARC" view (you will need the pref viewLabeledMARC turned on)

Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 54e295e4c14e3d2b3959e3185a54447a9b90d945)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22007: Generated with add_missing_filters.pl
Jonathan Druart [Fri, 14 Dec 2018 20:34:59 +0000 (17:34 -0300)]
Bug 22007: Generated with add_missing_filters.pl

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 464bf007d60bb647ce3dda183134363962c76209)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22007: Also handle Price and HtmlTags
Jonathan Druart [Fri, 14 Dec 2018 20:34:52 +0000 (17:34 -0300)]
Bug 22007: Also handle Price and HtmlTags

Those 2 filters should return safe output as well

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 a8fa74ab02d037d059e4bf78b74232aeba219212)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22007: Handle safe filtered output (KohaDates)
Jonathan Druart [Fri, 14 Dec 2018 20:29:18 +0000 (17:29 -0300)]
Bug 22007: Handle safe filtered output (KohaDates)

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 912fb42458a422248986c74fd8a1fd92df531fb5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22007: Remove html filters when KohaDates called with a parameter
Jonathan Druart [Fri, 14 Dec 2018 20:20:52 +0000 (17:20 -0300)]
Bug 22007: Remove html filters when KohaDates called with a parameter

Bug 13618 took care of the KohaDates output but not if it is called
with a parameter (eg. [% var | $KohaDates with_hours => 1 %]).

We could avoid unnecessary processing by removing the extra html filter.

Patch generated with the following command:
  % perl -p -i -e 's/KohaDates([^%\|]*)\s?\|\s?html\s?/KohaDates $1/g' **/*.inc **/*.tt

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 5d49ea039c981ee73085c70b326ea47c29bee0ba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21928: (bug 18789 follow-up) Fix CircAutoPrintQuickSlip=clear
Jonathan Druart [Wed, 5 Dec 2018 21:17:14 +0000 (18:17 -0300)]
Bug 21928: (bug 18789 follow-up) Fix CircAutoPrintQuickSlip=clear

caused by commit 105b3e10e8b31b7de6d733e676c3e661a39b1280

bug 18789

To recreate:
1 - Set CircAutoPrintQuickSlip to 'clear'
2 - Bring up a patron in circulation
3 - Click in checkout box and hit enter to submit empty
4 - Patron is partially loaded
5 - Apply patch
6 - Restart all the things
7 - Test again
8 - Patron is cleared correctly

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 a440f6a4102f73073c76a31ad2d015be2af8ef48)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21909: Add return type explanation to POD
Tomas Cohen Arazi [Thu, 29 Nov 2018 15:15:33 +0000 (12:15 -0300)]
Bug 21909: Add return type explanation to POD

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 94bdfc2beee9da1ed3b8159e211272a42d01e4fa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21909: Make Koha::Account::outstanding_* preserve context
Tomas Cohen Arazi [Thu, 29 Nov 2018 15:10:21 +0000 (12:10 -0300)]
Bug 21909: Make Koha::Account::outstanding_* preserve context

This patch modifies the methods so they preserve the caller's context
(list and scalar).

To test:
- Apply the first patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Account.t
=> FAIL: outstanding_credits and outstanding_debits tests fail
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Account.t
=> SUCCESS: We are so happy now :-D
- Sign off :-D

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 d3ff671f215398ad51a6ce550c33c0c6ca3aa30a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21909: Unit tests
Tomas Cohen Arazi [Thu, 29 Nov 2018 15:08:03 +0000 (12:08 -0300)]
Bug 21909: Unit tests

This patch introduces regression tests for the behaviour to be
introduced. Both outstanding_credits and outstanding_debits methods
should return a Koha::Account::Lines object in scalar context, and a
list of Koha::Account::Line objects in list context.

To test:
- Apply this patch
- Run
  $ kshell
 k$ prove t/db_dependent/Koha/Account.t
=> FAIL: The current behaviour doesn't match the described

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 85c474e59761e2bb27d9921180752249b5edca9e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21817: Fix 2 failing tests
Jonathan Druart [Tue, 11 Dec 2018 15:28:53 +0000 (12:28 -0300)]
Bug 21817: Fix 2 failing tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8748d801099e1c4e4f8f845a69d1cdba4a21e7aa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21817: Centralize the mock of userenv from tests
Jonathan Druart [Mon, 12 Nov 2018 21:21:58 +0000 (18:21 -0300)]
Bug 21817: Centralize the mock of userenv from tests

This patch adds a new method mock_userenv from t::lib::Mocks in order to
simplify the mock of the userenv.

Test plan:
prove all the test files modified by this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca124b5c14a3f0a34fafe307fec9ade4008eaa41)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21547: (follow-up) Rely on Koha::Patron->set_password checks
Tomas Cohen Arazi [Wed, 26 Dec 2018 15:25:54 +0000 (12:25 -0300)]
Bug 21547: (follow-up) Rely on Koha::Patron->set_password checks

This patch makes the controller just call $patron->set_password and use
the exceptions it might raise instead of manually checking the passwor
strength.

No behaviour change should be expected. It also removes some leftovers.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3f734900f0a86e5478afc22cb77b493500e998e9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21547: Use set_password in opac-passwd and remove sub goodkey
Marcel de Rooy [Thu, 11 Oct 2018 10:00:31 +0000 (12:00 +0200)]
Bug 21547: Use set_password in opac-passwd and remove sub goodkey

Remove sql statement to change password by calling set_password.
Remove sub goodkey by calling C4::Auth::checkpw_hash.
Adding the scalar before param Oldkey (from bug 21036).

Rebased on top of 21178 (using set_password instead of update_password).

Test plan:
Try to change password in OPAC with good and bad pw.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 085cfc6bca30718a6d719d645709097cf86f01db)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21929: Typo in orderreceive.tt
Andrew Isherwood [Sat, 1 Dec 2018 10:05:38 +0000 (10:05 +0000)]
Bug 21929: Typo in orderreceive.tt

lass -> class

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3c14a0d3526351fde4d785b5f60117f62edea5a9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21571: Make ACCTDETAILS translatable
Jonathan Druart [Tue, 16 Oct 2018 14:51:40 +0000 (11:51 -0300)]
Bug 21571: Make ACCTDETAILS translatable

This patch makes the notice "ACCTDETAILS" translatable.

Test plan:
1. Switch on TranslateNotices and AutoEmailOpacUser
2. Define templates for different languages for ACCTDETAILS
3. Create a new patron, define an email address, userid and password.
Also pick a different "preferred language" then the default value
4. You should receive the email with the correct, translated, email.

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a200aafd3b181b736dc288e208730a50372fbfd8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21789: Example usage of I18N Template::Toolkit plugin
Julian Maurice [Wed, 16 Dec 2015 00:25:44 +0000 (01:25 +0100)]
Bug 21789: Example usage of I18N Template::Toolkit plugin

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 727f33d858e50d26dfb60cec516533d0c4107d2a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22033: Remove related_resultset from the list of available methods
Jonathan Druart [Thu, 20 Dec 2018 21:55:34 +0000 (18:55 -0300)]
Bug 22033: Remove related_resultset from the list of available methods

It is not covered by tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ccbed38e213de6a6b9331fc34d2f872bf5ab5fc7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17108: Automatic debian/control updates (stable/18.11.x)
Nightly Build Bot [Thu, 13 Dec 2018 00:24:37 +0000 (01:24 +0100)]
Bug 17108: Automatic debian/control updates (stable/18.11.x)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoUpdate release notes for 18.11.01 release v18.11.01
Martin Renvoize [Thu, 20 Dec 2018 12:20:17 +0000 (12:20 +0000)]
Update release notes for 18.11.01 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoIncrement version for 18.11.01 release
Martin Renvoize [Thu, 20 Dec 2018 11:57:05 +0000 (11:57 +0000)]
Increment version for 18.11.01 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoTranslation updates for Koha 18.11.01
Koha translators [Thu, 20 Dec 2018 11:50:00 +0000 (08:50 -0300)]
Translation updates for Koha 18.11.01

(cherry picked from commit 90fefba069472ddf827bfec820c0860f4917eb45)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21848: Remove Text::Unaccent from C4::Members
Marcel de Rooy [Fri, 16 Nov 2018 08:41:04 +0000 (09:41 +0100)]
Bug 21848: Remove Text::Unaccent from C4::Members

At refactoring time the unac_string call was moved to Koha::Patron.

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 5e17032700790032088fe3f2209c3d173e77d540)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21848: Resolve unac_string warning from Circulation.t
Marcel de Rooy [Thu, 13 Dec 2018 12:07:48 +0000 (13:07 +0100)]
Bug 21848: Resolve unac_string warning from Circulation.t

Just add "use utf8".

Test plan:
Run Circulation.t; verify there are no warnings.

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 3e731ce09433cf2121332f5356b27f90ccb34654)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22022: Correct ordering for authorised values
Nick Clemens [Tue, 18 Dec 2018 18:30:28 +0000 (18:30 +0000)]
Bug 22022: Correct ordering for authorised values

To test:
1 - Add a shelving location with code "ZZZZ" and lib "Awake"
2 - Load some items in batch modification
3 - Note shelving location dropdown is wrong
4 - Apply patch
5 - Reload page
6 - Note order is correct

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 e6cec898e078fc04d87e2faf26badba10fa6f348)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22024: DBRev 18.11.00.003
Nick Clemens [Wed, 19 Dec 2018 16:31:25 +0000 (16:31 +0000)]
Bug 22024: DBRev 18.11.00.003

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f56dd2e829569cf40157347640fdcb203890e757)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22024: Fix number of fields in uk-UA
Jonathan Druart [Wed, 19 Dec 2018 16:43:32 +0000 (13:43 -0300)]
Bug 22024: Fix number of fields in uk-UA

ERROR 1136 (21S01) at line 23: Column count doesn't match value count at row 22

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fe147e9df64fab7cbe1fdbc859b72a4c396fae52)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22024: Correct new installations with missing data
Katrin Fischer [Tue, 18 Dec 2018 21:43:05 +0000 (22:43 +0100)]
Bug 22024: Correct new installations with missing data

For a new installation the data in the class_* will be
missing as class_sources.sql couldn't be executed. It will
fail with:

DBD::mysql::st execute failed: Cannot add or update a child row:
a foreign key constraint fails (`koha_kohadev`.`class_sources`,
CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`)
REFERENCES `class_split_rules` (`class_split_rule`)) at /usr/share/perl5/DBIx/RunSQL.pm line 273.

As this might have been missed and the web installer can still
be completed, this patch checks for the tables being empty and
adds the default data if they are.

To test:
- Without the patch
- Run the de-DE or another translated installer
- Verify the error is shown
- Complete the installer
- Verify class_sources table is empty
- Apply patches
- Run the database update
- Verify data classification sources, filing rules, and
  slitting rules are now complete

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c904db832ec4ee70bfb58ff918564a2502a53937)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22024: Update translated web installer files with new class splitting rules
Katrin Fischer [Tue, 18 Dec 2018 21:22:12 +0000 (22:22 +0100)]
Bug 22024: Update translated web installer files with new class splitting rules

When adding the new splitting rules for classification sources
with bug 15836, we missed updating the translated installers.

This has the danger of data missing for new installations already
set up with 18.11.

This patch corrects the installer files.

To test:
- Verify the class_sources.sql installs correctly for all languages

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3e7fc75f50a46d03983db3763ad37aaf5b49983c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21956: (bug 21775 follow-up) Use set_preference to reset the value
Jonathan Druart [Wed, 5 Dec 2018 19:23:24 +0000 (16:23 -0300)]
Bug 21956: (bug 21775 follow-up) Use set_preference to reset the value

Test plan:
Set AudioAlerts to 0
Prove t/db_dependent/selenium/regressions.t
=> Without this patch the value of the pref is not reset to 0

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 674a34471f6eddfc849c480c557f6576f8572516)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21984: Pass param_name in pagination URL
Nick Clemens [Tue, 11 Dec 2018 15:15:57 +0000 (15:15 +0000)]
Bug 21984: Pass param_name in pagination URL

To test:
 1 - Create a report like:
    SELECT <<cat>>,<<dog>>,<<cat>> FROM items
 2 - Run the report, enter 'CATS' and 'DOGS'
 3 - Get results LIKE "CAT | DOG | CAT"
 4 - Try to go to page 2
 5 - FAIL! (last column is blank)
 6 - Apply patch
 7 - Run the repot, enter 'CATS' and 'DOGS'
 8 - Verify first page looks right
 9 - Go to page 2
10 - Results are correct!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: “Lucas Gass” <lucas@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 f28a97034dd06b0f2b0e2e5fc56bea3878ffc717)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21065: DBRev 18.11.00.002
Nick Clemens [Wed, 19 Dec 2018 16:12:52 +0000 (16:12 +0000)]
Bug 21065: DBRev 18.11.00.002

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5ea668056a6222c88c37a8ba5ee638ad827ec284)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21065: (QA follow-up) Make the update idempotent
Martin Renvoize [Tue, 18 Dec 2018 13:52:15 +0000 (13:52 +0000)]
Bug 21065: (QA follow-up) Make the update idempotent

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=21065

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6d44f9dac8235dfe0259ea5b935c5a8908d2e441)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21065: Set ON DELETE SET NULL on accountlines.borrowernumber
Jonathan Druart [Fri, 14 Dec 2018 15:49:44 +0000 (12:49 -0300)]
Bug 21065: Set ON DELETE SET NULL on accountlines.borrowernumber

Note: Why do we have ON UPDATE SET NULL on accountlines.itemnumber?
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7f322d7ff87285cd0bc1370a0438f2bc8bb7c084)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21065: Add koha_object(s)_class methods to accountline
Jonathan Druart [Fri, 14 Dec 2018 15:48:09 +0000 (12:48 -0300)]
Bug 21065: Add koha_object(s)_class methods to accountline

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 457e560a06e00d861ec88bc7354969aac7ab9099)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21065: Add tests
Jonathan Druart [Fri, 14 Dec 2018 15:47:11 +0000 (12:47 -0300)]
Bug 21065: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 09ef91653bc8e0349d4e8613482251d7e3c165b5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 14334: Remove AutoCommit from tests
Jonathan Druart [Fri, 7 Dec 2018 17:14:06 +0000 (14:14 -0300)]
Bug 14334: Remove AutoCommit from tests

And use a DBIx transaction instead.

Test plan:
prove that the test files modified by this patch are passing

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 64242cabea21e9ee7673666cad88eb403d1053d6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21880: (follow-up) Add some uri filters
Marcel de Rooy [Thu, 13 Dec 2018 14:35:59 +0000 (15:35 +0100)]
Bug 21880: (follow-up) Add some uri filters

Theoretically, source needs a filter.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1e09fefcb05abf6496c89fe8115f0437a26b9490)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21880: "Relationship information" disappears when accessing paginated results...
Andreas Roussos [Fri, 23 Nov 2018 17:30:23 +0000 (19:30 +0200)]
Bug 21880: "Relationship information" disappears when accessing paginated results in authority searches

When linking authorities with authorities, if you perform a
search that returns >20 results, the "Relationship information"
section disappears when you click on the pagination hyperlinks.

This patch fixes that.

Test plan:
1) In the Authorities module, edit an authority (or create a new
   one) and try to link it with another authority (via UNIMARC
   500$a, for example).
2) When the authority finder comes up, search for something that
   will yield more than 20 results, then click on the pagination
   links -- notice how the "Relationship information" section is
   no longer visible.
3) Apply the patch (and restart Plack/memcached, if necessary).
4) Repeat step 2) -- "Relationship information" is now persistent.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8bf032f512687cfe7ddc3748675c54f18b08c010)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21986: Do not escape quotation marks when cataloguing
Jonathan Druart [Wed, 12 Dec 2018 14:05:19 +0000 (11:05 -0300)]
Bug 21986: Do not escape quotation marks when cataloguing

In several places we escape quotation marks using
  $value =~ s/"/&quot;/g;
All the occurrences are wrong and must be removed.
Most of them are leftover of bug 11638 (Remove HTML from
addbiblio.pl), which removes the construction of html from pl scripts.

The problem has been highlighted by bug 13618, I did not track down why
the issue did not exist before (?)

Test plan:
0/ Use strings with quotation marks, like:
'Fiddle tune history : "bad" tunes'
You can also use other html characters to make the tests more complete,
like 'Fiddle tune history : <"bad" tunes>'
1/ authorities/authorities.pl
a. Edit an authority filling different fields with quotation marks
b. Edit it again
=> The display (inputs' values) is wrong, if you save the escaped quotes
will be inserted
2/ cataloguing/addbiblio.pl
Same editing a bibliographic record
3/ cataloguing/additem.pl
Same editing items
4/ members/memberentry.pl
Edit a patron's record and fill some fields with quotation marks
+ fields borrowernotes and opacnotes
=> The quotes are inserted directly in DB (escape is done before the
insert!)
5/ opac/opac-review.pl
For QA only: $js_ok_review is never used
6/ tools/batchMod.pl
For QA only: $value is always undefined at that point

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d561273ef84f4bc2534ac63d0f8793c9eb2a7fb9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21973: Do not url escape casServerUrl
Jonathan Druart [Fri, 7 Dec 2018 13:26:02 +0000 (10:26 -0300)]
Bug 21973: Do not url escape casServerUrl

It is already escaped correctly in
C4::Auth_with_cas::_url_with_get_params using URI::Escape::uri_escape

Note that shibbolethLoginUrl is not and must be url escaped in template
("be consistent, they said")

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cade3103ecd4008ccb0bb82e1fd77497894f68f5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21931: Do not reset the ES mapping on 3.23.00.050
Jonathan Druart [Fri, 7 Dec 2018 19:49:00 +0000 (16:49 -0300)]
Bug 21931: Do not reset the ES mapping on 3.23.00.050

This update DB entry uses DBIx schema which does not make it crashes if
the table structure is changed.
Which happens on 18.06.00.054, that added search_field.weight

The entry 3.23.00.050 fails with
  Unknown column 'me.weight' in 'field list'

This patch removes the reset of the mapping and display a warning to
tell the administrator the mapping must be reset/inserted

Test plan:
Use a 3.22 dump and upgrade it

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e29f0bce403d5d7c1f292d57b105e0a2ab31e01d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21991: Pass param names to report limit tool
Nick Clemens [Wed, 12 Dec 2018 16:16:50 +0000 (16:16 +0000)]
Bug 21991: Pass param names to report limit tool

To test:
1 - Define a report like:
SELECT barcode, itemnumber
FROM items
WHERE (homebranch = <<Branch|branches>> AND 0 ) OR
<<Branch|branches>>=<<Branch|branches>>
2 - Run it, you get results
3 - Select 'Rows to display' 50
4 - No results
5 - Apply patch
6 - Run report
7 - Change display rows
8 - Results remain!

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 702c727470d332615fb1428c55f503183935f29d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21950: Remove filtering for query_cgi and limit_cgi
Jonathan Druart [Thu, 6 Dec 2018 13:07:18 +0000 (10:07 -0300)]
Bug 21950: Remove filtering for query_cgi and limit_cgi

We must not escape query_cgi and limit_cgi template-side, they are already
escape properly from build_query_compat using uri_escape_utf8.

To fix further problems we should replace all occurrences to make things
clear (I decided to keep the html filter so far, which did not hurt, but uri or url do)

Same patch as the following commit will be provided
commit 2fc599c0893620c395ca0492c9d9e3c860c8f951
    Bug 21526: Fix search result pages (url vs uri vs raw)

    query_cgi is uri_escaped from the pl, so we should displayed as raw

    Test plan:
    Use wide characters ❤
    Search, filter, facets, search history, rss (both interfaces)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3a7053346c760144a8d7fe595d52806f739ead64)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological...
Tomas Cohen Arazi [Thu, 6 Dec 2018 18:59:10 +0000 (15:59 -0300)]
Bug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological cases

This patch makes outstanding_* methods be safe regarding pathological
account lines that get converted into another type because of the value
of amountoutstanding

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Account.t
=> FAIL: Tests fail because pathological account lines are wrongly
picked.
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Account.t
=>SUCCESS: All green!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit dbff938c7ff7eb277c6b94b56b5f03d3348f0017)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21969: Regression tests
Tomas Cohen Arazi [Thu, 6 Dec 2018 18:37:37 +0000 (15:37 -0300)]
Bug 21969: Regression tests

This patch introduces regression tests for Koha::Account::outstanding_*
methods so they don't pick wrong lines when amountoutstanding matches
what we are looking for (i.e. negative for credits and positive for
debits).

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Account.t
=> FAIL: Tests fail because pathological account lines are wrongly
picked.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ce160066a2b06742e348011324620c8e58b26f40)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21947: Address other misordered FILTER lines
Mark Tompsett [Wed, 5 Dec 2018 03:44:25 +0000 (03:44 +0000)]
Bug 21947: Address other misordered FILTER lines

As per comment #3, this patch changes the order for all
the filters found with the recommended git grep.

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 30874dea519d379134174cf9c5fd5051588a8629)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21947: Swap the filter order
Mark Tompsett [Tue, 4 Dec 2018 18:58:17 +0000 (18:58 +0000)]
Bug 21947: Swap the filter order

TEST PLAN
----------
1) start your kohadevbox
2) cd kohaclone
3) git checkout -b bug_21947 origin/master
4) git bz apply 21947
5) reset_all
6) log in to staff client and add a 500$a with lots
   of blank lines between strings with some HTML.
7) look at the opac record Title notes tab.
   -- does it have <br>-mess? Should not.
8) repeat steps 5-7 on master, and you'll see
   a <br>-mess.
9) run qa test tools

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 d90d5d2254d55752bf1e524885284ba8e3e86f60)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21759: Avoid manually setting amountoutstanding in _FixAccountForLostAndReturned
Tomas Cohen Arazi [Mon, 10 Dec 2018 19:45:00 +0000 (16:45 -0300)]
Bug 21759: Avoid manually setting amountoutstanding in _FixAccountForLostAndReturned

This patch changes the behaviour in the _FixAccountForLostAndFound
method.

The method will now add the amountoutstanding value for the lost item
fee to the CR credit to be generated. This means that:
- If there's some remaining debt, the same amount  will be added to the
  CR credit and used to cancel that debt. The final amountoutstanding
  will be the same as before, but an offset will be generated as
  required.
- If the line was written off, the behaviour remains unchanged, so no
  offset.
- If the line was payed and/or written off in full only the payments are
  refund, preserving the current behaviour.

To test:
- Apply the regression tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation.t
=> FAIL: Tests fail because the behaviour is not correct
- Apply this patch
- Run:
 k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests now pass!
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e75c869785d09e6a2b1eb8dbe47cca868fb86105)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21759: Regression tests
Tomas Cohen Arazi [Mon, 10 Dec 2018 19:38:05 +0000 (16:38 -0300)]
Bug 21759: Regression tests

This patch tests for a new behaviour in the _FixAccountForLostAndFound
method.

The method will now add the amountoutstanding value for the lost item
fee to the CR credit to be generated. This means that:
- If there's some remaining debt, the same amount  will be added to the
  CR credit and used to cancel that debt. The final amountoutstanding
  will be the same as before, but an offset will be generated as
  required.
- If the line was written off, the behaviour remains unchanged, so no
  offset.
- If the line was payed and/or written off in full only the payments are
  refund, preserving the current behaviour.

Only changes to the 'remaining debt' use cases on this tests are
expected.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation.t
=> FAIL: Tests fail because the behaviour is not correct.

Note: some tests order changes are introduced to avoid calling
discard_changes twice

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1622f0f609fbf7862c481eeec98cd1668b09b145)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21465: Don't throw duplicate userid error if userid belongs to the matched patron
Nick Clemens [Tue, 2 Oct 2018 19:48:02 +0000 (19:48 +0000)]
Bug 21465: Don't throw duplicate userid error if userid belongs to the matched patron

To test:
 1 - Export your patrons
    a - Create a report 'SELECT * FROM borrowers'
    b - Run and save the report as csv (check your delimiter)
    c - Delete the borrowernumebr column
 2 - Use the Patron Import tool to import the csv from above
 3 - Set matching to 'cardnumber'
 4 - Set 'If matching record is already in the borrowers table:' to
Overwrite
 5 - Import
 6 - None are import because of matchign userid (their own)
 7 - Apply patch
 8 - Repeat
 9 - Patrons are successfully overwritten
10 - prove -v t/db_dependent/Koha/Patrons/Import.t
11 - prove -v t/db_dependent/Koha/Patrons.t

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 9a2bd027e5d2380b39776059066d8f06b42d68dd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21961: DBRev 18.11.00.001
Nick Clemens [Tue, 11 Dec 2018 20:31:19 +0000 (20:31 +0000)]
Bug 21961: DBRev 18.11.00.001

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a02b322fe7f6a35c0613a33a2e266bb79a721260)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21961: Fix typo in manage_didyoumean permission
Katrin Fischer [Thu, 6 Dec 2018 11:42:12 +0000 (12:42 +0100)]
Bug 21961: Fix typo in manage_didyoumean permission

The typo in the installer files will cause problems on new
installations as the code for the permission is wrong.

This means that on new installations the Did you mean? section
on the administration page won't show up.

In order to fix this, we need to correct the code in
permissions, but also the permissions for users who
this permission has been given to.

To test:
- Start without the patch
- Use a new installation with the permission typo
- Log in as superlibrarian
- Verify that the "did you mean?" configuration page
  is not visible
- Create another staff user with permission to access
  staff and manage_didyoumean checked
- Verify configuration page remains invisible
- Apply patch and run database update
- Check both users again, the config page should now sohw

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit da5e41f6def8a5cbafc9303b0fff35cb13e50e72)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21908: (QA follow-up) Remove useless parentheses in query
Julian Maurice [Fri, 7 Dec 2018 09:19:44 +0000 (10:19 +0100)]
Bug 21908: (QA follow-up) Remove useless parentheses in query

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 875f3162c8008ef288adfcd18ada490cf06ecc15)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Fridolin Somers [Thu, 29 Nov 2018 09:50:06 +0000 (10:50 +0100)]
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.

Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a1b08269a7031417312e6265ace9ef5b995933fa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Fridolin Somers [Thu, 29 Nov 2018 09:15:00 +0000 (10:15 +0100)]
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c36597bc0c72cc31249c02af5aaaf1c1f977ee50)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21849: Two useless Koha::Account::Offset->new calls need attention
Kyle M Hall [Fri, 16 Nov 2018 12:01:39 +0000 (07:01 -0500)]
Bug 21849: Two useless Koha::Account::Offset->new calls need attention

Came across those calls in bug 20598 in _FixOverduesOnReturn

        Koha::Account::Offset->new(
            {
                debit_id => $accountline->id,
                type => 'Forgiven',
                amount => $amountoutstanding * -1,
            }
        );

This does nothing if you don't store data.

Test Plan:
1) Apply this patch
2) Set up 2 items with overdue fines
3) Return one with dropbox mode
4) Note the dropbox account offset is created
5) Return one with full fine forgiveness
6) Note the forgiven account offset is created

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a2b5407ba5c74f826c1665c1a2ef1ff6d52689fd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21849: Add unit tests
Kyle M Hall [Fri, 16 Nov 2018 14:54:39 +0000 (09:54 -0500)]
Bug 21849: Add unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2dbaaa300877ff6d96ae84b5a703753d97b6c340)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21962: Fix authority search using 'all'
Nick Clemens [Thu, 6 Dec 2018 12:42:45 +0000 (12:42 +0000)]
Bug 21962: Fix authority search using 'all'

To test:
1 - Set search engine to Zebra
2 - Have some authorities and indexes up to date
3 - Search authorities with option 'search entire record'
4 - No results
5 - Apply patch
6 - Run unit tests, they pass!
7 - Repeat search
8 - Results!

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3adf7708d544338250703165fe7e87f2690d8639)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21962: Unit tests
Nick Clemens [Thu, 6 Dec 2018 12:41:41 +0000 (12:41 +0000)]
Bug 21962: Unit tests

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 39c93e87f648978ec7907220710efaf64e556ea0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21405: Fix authorities pagination for Zebra and ES
Nick Clemens [Mon, 3 Dec 2018 13:05:49 +0000 (13:05 +0000)]
Bug 21405: Fix authorities pagination for Zebra and ES

Bug 20261 introduced an error because search_auth_compat responded
differently for ES and Zebra, now bug 19365 fixed the underlying
difference. This patch restores previous code to fix pagination.

Additionally we add a fix for 10000+ results in ES and remove a double
import of C4::Auth

To test:
 1 - Perform an authorities search with 1+ pages using Zebra
 2 - Page through results, note you are only offseeting by 1 each time
 3 - Perform an authorities search with 10,000+ results in ES
 4 - Click on the last page and get an error
 5 - Apply patch
 6 - Retry Zebra search
 7 - Results should paginate correctly
 8 - Clicking on last page should return last results
 9 - Retry ES results
10 - Results should paginate correct
11 - Clicking on last page should return last results

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 06e6378899631da162d57d477381782f3764ec89)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21608: (QA follow-up) Rename revert button
Marcel de Rooy [Fri, 7 Dec 2018 08:43:58 +0000 (09:43 +0100)]
Bug 21608: (QA follow-up) Rename revert button

The label 'Revert found status' is replaced by 'Revert waiting status'
or 'Revert transit status' depending on hold.found/hold.intransit.
Note that hold comes from reserveloop in request.pl. The columns/keys
found and intransit are just booleans.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 842a4befd342e46a0abda8300c339bb37f943c09)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21608: Add value for 'rank-request' when dropdwn disabled
Nick Clemens [Mon, 26 Nov 2018 18:19:03 +0000 (18:19 +0000)]
Bug 21608: Add value for 'rank-request' when dropdwn disabled

When a field is disabled no value is submitted in the form - this was
causing found holds to be reverted

To test:
1 - Apply all patches except this one
2 - PLace several holds on one bib
3 - Set at least one waiting or intransit
4 - Making no adjustments hit "Update holds"
5 - Waiting/intransit holds are all reset
6 - Mark them waiting/intransit again
7 - Apply this patch
8 - Click 'update holds'
9 - Found status is not accidentally reverted

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0295fc2fc6062d9bb43e70bce5f5504b418f3629)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21608: Add ID and fix filters
Nick Clemens [Tue, 13 Nov 2018 19:22:48 +0000 (19:22 +0000)]
Bug 21608: Add ID and fix filters

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 65ff39f6a56e3bf252883b484f8892d6efcbeb9e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21608: Disable dropdown for found holds - add button to revert
Nick Clemens [Thu, 25 Oct 2018 11:45:25 +0000 (11:45 +0000)]
Bug 21608: Disable dropdown for found holds - add button to revert

This patch disables the dropdown for found holds, and adds a new button
to revert the waiting status, setting the hold to priority 1

Additionally we remove some changes from 19469 and update the JS to skip
found holds when updating priority

To test:
1 - Find a record with multiple items
2 - Place 4 holds (or more)
3 - Capture one ohld as waiting, one as in transit
4 - View the holds on the record - switch the last to priority one
5 - Waiting and transit statuses get confused
6 - Apply patch
7 - Observe dropdown is now disabled for waiting holds
8 - Confirm other holds operate as expected
9 - Confirm 'Revert found status' resets hold

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 21608: (follow-up) Use RevertWaitingStatus and do not alter _FixPriority

[EDIT]
Completely removed the changes to Reserves.pm by adding module prefix in
the request.pl script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3c50245cfe272dc105033ff2e59f8e2689f7dd26)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21911: Regression test
Josef Moravec [Fri, 30 Nov 2018 07:09:23 +0000 (07:09 +0000)]
Bug 21911: Regression test

This tests usuall cases, but note, that administrator could make a
branch with code "%%%" or so, which this test does not cover, and some
functionalities will not work in that case: opac limit override,
                holdinbranch facet

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e5585a10d5f2ee24cad94b2cf17df1ce13e8a01a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21911: Fix OPAC scoping to work with new group system
Nick Clemens [Thu, 29 Nov 2018 14:17:37 +0000 (14:17 +0000)]
Bug 21911: Fix OPAC scoping to work with new group system

To test:

0 - Apply patch
1 - Create a library group enabled for opac search limits and add some
libraries
2 - Check the DB (or advanced search dropdown) to get the id of the
group (using 7 as example below)
3 - Add to apache configuration (OPAC virtualhost)
   SetEnv OPAC_SEARCH_LIMIT branch:multibranchlimit-7
   SetEnv OPAC_LIMIT_OVERRIDE 1
   RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT
   branch:multibranchlimit-7"
   RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
4 - Ensure OpacAddMastheadLibraryPulldown is disabled
5 - Restart all the things
6 - Visit the opac
7 - Perform a search, confirm it is scoped to the branches in the group

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4c0682f5598d53992b6966a217b10f71a9cdaebb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21910: Does not deal with call context, ->search does already
Jonathan Druart [Thu, 6 Dec 2018 15:53:24 +0000 (12:53 -0300)]
Bug 21910: Does not deal with call context, ->search does already

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 21372f78f825c0ec439ea4a7cfe7dff6656467b9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21910: Remove duplicated lines in tests
Jonathan Druart [Thu, 6 Dec 2018 15:52:54 +0000 (12:52 -0300)]
Bug 21910: Remove duplicated lines in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ee96d18b2cee07aa64d5e68078bc898d36e22146)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21910: Koha::Library::Groups->get_search_groups should return the groups
Nick Clemens [Thu, 29 Nov 2018 14:11:36 +0000 (14:11 +0000)]
Bug 21910: Koha::Library::Groups->get_search_groups should return the groups

To test:
 1 - Add a library group (Admin->Library groups)
 2 - Enable use as an opac and staff search limit
 3 - Add some libraries to the group
 4 - Visit advanced search on staff and opac
 5 - Note the dropdown has as many empty rows as there are libraries
  in the group
 6 - Apply patch, restart all the things
 7 - Visit staff and opac advanced search
 8 - Confirm the group dropdowns are correct
 9 - Enable OpacMastheadLibraryPulldown
10 - Ensure the dropdown on opac shows groups correctly
11 - Confirm earchign groups works from all three locations
12 - prove -v t/db_dependent/LibraryGroups.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@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 f3b8c66392098d69bca48bbf04b7e93fa2100280)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21778: Sort user list by surname,firstname unless user cannot manage patron lists...
Nick Clemens [Wed, 7 Nov 2018 01:32:26 +0000 (01:32 +0000)]
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons

To test:
1 - Create four users:
    1 superlibrarian (or with both edit patrons and manage patron
            lists)
    1 with only edit patrons and catalogue
    1 with only add to list and catalogue
    1 with catalogue but neither edit patrons or manage patron lists
2 - Search patrons signed in as each user
3 - Note different sorting
4 - Apply patch
5 - Try searching with each patron
6 - Results should always be sorted by surname, firstname
7 - Only in the case of neither extra permission should the checkboxes
be absent

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 96b3889390f8efe9851aaa9c2cafa9e20bda3f43)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21955: Remove Cache::Memory as fallback for L2 cache
Jonathan Druart [Wed, 5 Dec 2018 19:39:02 +0000 (16:39 -0300)]
Bug 21955: Remove Cache::Memory as fallback for L2 cache

If Plack is running with several workers we must not use Cache::Memory
as L2 cache.

If a value is set from a worker, it will not be available from other
workers as the Cache::Memory instance is not shared (of course!)

Moreover we now have Koha::Cache::Memory::Lite that does the same job,
so we should not expect performance regressions by removing it.

See also the email sent to koha-devel for more info
http://lists.koha-community.org/pipermail/koha-devel/2018-December/045004.html

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4bf033c6d6b2a8bf4d5597b3fdf6355fb7060b60)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18805: Add ability to use up account credits
Tomas Cohen Arazi [Tue, 27 Nov 2018 23:28:29 +0000 (20:28 -0300)]
Bug 18805: Add ability to use up account credits

This patch introduces a new button in the 'Pay fines' tab  on the
patron's account page. This button, labeled 'Normalize account' is only
displayed when outstanding credits are available, that could be used to
pay up existing debts.

When clicking the button, the Koha::Account::normalize_balance method
(bug 21896) is used for the purpose.

To test:
- Apply this patch (on top of 21896)
- On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than
  one)
- Go to the 'Pay fines' tab
=> SUCCESS: No 'Apply credits' button is displayed.
- On the 'create manual credit' tab, create a couple credits.
- Go to the 'Pay fines'
=> SUCCESS: 'Apply credits' button is displayed
- Click on 'Apply credits'
=> SUCCESS: Outstanding credits have been used to pay up debts.
- Play with different options (credit excedes debts and vice-versa, they
        match, etc)
=> SUCCESS: They all work as expected
- Sign off :-D

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a3036b4760d80dd3d2188f5f95c6f4279ecef74b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21896: RM follow-up - fix tests
Nick Clemens [Fri, 30 Nov 2018 21:27:44 +0000 (21:27 +0000)]
Bug 21896: RM follow-up - fix tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b4580bff5ba7753f9db2513c3b87ecb9bba5258c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21896: (QA follow-up) Document and Test for FIFO behaviour
Martin Renvoize [Thu, 29 Nov 2018 13:49:27 +0000 (13:49 +0000)]
Bug 21896: (QA follow-up) Document and Test for FIFO behaviour

A short dicussion lead to the decision to make it explictly clear that
this method will implicitly apply credits against debits in a 'First In
First Out' manor, meaning oldest outstanding debits will be paid off
first.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 99535e0fda491d2e1d704dd80f6613c0a7b8d06b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21896: (QA follow-up) Add tests for FIFO behaviour
Tomas Cohen Arazi [Thu, 29 Nov 2018 13:55:51 +0000 (10:55 -0300)]
Bug 21896: (QA follow-up) Add tests for FIFO behaviour

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4302bdda5c1c348e63003589795af3d37249c167)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21896: (QA follow-up) normalize_balance -> reconcile_balance rename
Tomas Cohen Arazi [Wed, 28 Nov 2018 13:24:36 +0000 (10:24 -0300)]
Bug 21896: (QA follow-up) normalize_balance -> reconcile_balance rename

This was requested on the QA review and I agree.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5fc2ccd7332ca53dfe07bd079cc446d1df923496)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21896: Add Koha::Account::normalize_balance
Tomas Cohen Arazi [Tue, 27 Nov 2018 22:34:29 +0000 (19:34 -0300)]
Bug 21896: Add Koha::Account::normalize_balance

This patch adds the normalize_balance() method to Koha::Account. Its
purpose is to apply outstanding credits (i.e. manual ones ore remaining
amounts like in the case of refunds) to outstanding debts.

To test:
- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Account.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1176947b42342ca725020455361fe092255e4d04)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21896: Add unit tests for Koha::Account::normalize_balance
Tomas Cohen Arazi [Tue, 27 Nov 2018 20:06:20 +0000 (17:06 -0300)]
Bug 21896: Add unit tests for Koha::Account::normalize_balance

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 98bfe5d93cb6715b3095309082b241aaafe869da)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 7143: Update about page for Nazlı
Nazlı Çetin [Thu, 29 Nov 2018 14:50:29 +0000 (14:50 +0000)]
Bug 7143: Update about page for Nazlı

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 52b52ab896be2831309a6c3f3401a4118c7b0f33)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 7143: Update OpenHub link for Fridolin Somers in about page
Fridolin Somers [Wed, 28 Nov 2018 15:07:57 +0000 (16:07 +0100)]
Bug 7143: Update OpenHub link for Fridolin Somers in about page

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d0e72b437332b1ef0b3bcee98616ac8fef3f1e7a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21736: Allow translating the localization widget messages
Pasi Kallinen [Wed, 31 Oct 2018 12:04:33 +0000 (14:04 +0200)]
Bug 21736: Allow translating the localization widget messages

The widget used to translate the item type names to other
languages has few javascript messages that cannot be translated.
Add the mechanism to enable their translation.

Test plan:

1) Install and update a language
2) Check the po-files, there's no msgid for
   "A translation already exists for this language."
3) Apply the patch
4) Install and update a language
5) There should be a msgid for the one in 2, and
   couple other messages from localization.tt
6) Translate those messages, update the translated templates
7) Go to Administration -> Item types -> Modify item type ->
   Translate into other languages
   Add a new translation, check that the message given by the widget
   was in correct language.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5cacb502392aaebaef84339233227eb261d45277)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21905: Plugin hook intranet_catalog_biblio_enhancements_toolbar_button incorrectl...
Kyle M Hall [Wed, 28 Nov 2018 18:41:53 +0000 (13:41 -0500)]
Bug 21905: Plugin hook intranet_catalog_biblio_enhancements_toolbar_button incorrectly filtered

The new plugin hook intranet_catalog_biblio_enhancements_toolbar_button is rendered useless due to the outputted html being escaped using the html filter. It should be using the raw filter instead.

Test Plan:
1) Enable plugins
2) Download and install the latest version of the Kitchen Sink plugin
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.21/koha-plugin-kitchen-sink-v2.1.21.kpz
3) Browse to catalogue/detail.pl for a record
4) Note you see the raw html of the plugin output in the toolbar
5) Apply this patch
6) Restart all the things
7) Reload the page
8) Note the html is now correctly rendered as a button

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ed22c5fc0f65cc3736a8dbabb159b6b4b9b2f7c4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21861: (follow-up) replace onchange() with jQuery equivalent
Andreas Roussos [Thu, 22 Nov 2018 13:55:25 +0000 (15:55 +0200)]
Bug 21861: (follow-up) replace onchange() with jQuery equivalent

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f44a4f1d2a13735c52948df29e773728d04ab991)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21861: The MARC modification template actions editor does not always validate...
Andreas Roussos [Sat, 17 Nov 2018 18:03:36 +0000 (20:03 +0200)]
Bug 21861: The MARC modification template actions editor does not always validate user input

The MARC modification template actions editor does not validate
user input when adding a conditional clause, making it possible
to save a modification action without filling in all necessary
fields.

This patch fixes that.

Test plan:
1) Create a MARC modification template and add a new action,
   e.g. "Copy All field(s) 200$a to field 600$a".
   Add a condition ("if" or "unless") but leave the relevant
   field and subfield textboxes empty.
   Add "matches" or "doesn't match" as a comparison operator.
   Check the "RegEx" checkbox, leave the regex textbox empty.
2) Click on "Add action" and notice how it accepts your input.
   Also notice the extra space in the Action column RegEx.
3) Edit your modification action and notice the missing "m/"
   before the conditional RegEx.

4) Apply the patch and hit CTRL-F5 to reload the relevant JS.

5) Edit the modification action you added previously (or add
   a new one). Try leaving the textboxes mentioned above empty
   and then submit your changes. You should get pop-up windows
   informing you about missing fields.
6) Now try typing a value in the conditional regex textbox and
   Update your action. In the Action column, there should be
   no spaces between the delimiters of the matching operator
   and the value you just entered.
7) Edit your action: notice how the "m/" before the regular
   expression and the "/" after it are now showing correctly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3e1e1448e9132dce81571a4c3f31eb67816f14f9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21897: Typo in postinst
Mirko Tietgen [Wed, 28 Nov 2018 10:18:09 +0000 (11:18 +0100)]
Bug 21897: Typo in postinst

Small typo (missing space)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f99b9b5b3d88d8ed2eed0f64da0f5ef2a1483f3e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21895: Fix path to POT file
Julian Maurice [Wed, 28 Nov 2018 09:05:19 +0000 (10:05 +0100)]
Bug 21895: Fix path to POT file

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d8531b8fcbfc8fe09540ddb940149a7d7dbb4fb9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21895: Fix translation for package install
Julian Maurice [Tue, 27 Nov 2018 23:51:45 +0000 (00:51 +0100)]
Bug 21895: Fix translation for package install

The string extraction process was not taking into account the fact that
standard/package install have a completely different directory structure
than the dev install

This patch tries to keep the exact same behaviour for dev installs,
while making it work for standard install by using opachtdocs,
intrahtdocs, opacdir and intranetdir from $KOHA_CONF

Test plan:
1. Follow test plan in
https://gitlab.com/koha-community/Koha/commit/d708255c7a4d981c7c7bdd0644a75202ec43b297
2. Do a standard install and repeat step 1 on this new install
3. If you know how to build the Debian package, build it, install it and
verify that koha-translate works as expected
4. prove t/LangInstaller.t

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bd81f0418c14af82cdd9f4858c32b18d76a90b49)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoCorrect release notes encoding issues v18.11.00
Nick Clemens [Tue, 27 Nov 2018 12:04:15 +0000 (12:04 +0000)]
Correct release notes encoding issues

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoUpdate version in Koha.pm
Nick Clemens [Tue, 27 Nov 2018 11:43:45 +0000 (11:43 +0000)]
Update version in Koha.pm

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoUpdate release notes for 18.11.00 release
Nick Clemens [Tue, 27 Nov 2018 02:00:58 +0000 (02:00 +0000)]
Update release notes for 18.11.00 release

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>