koha.git
5 years agoBug 13895: (QA follow-up) Adjust OpenAPI definitions for checkouts
Tomas Cohen Arazi [Fri, 10 Nov 2017 19:16:49 +0000 (16:16 -0300)]
Bug 13895: (QA follow-up) Adjust OpenAPI definitions for checkouts

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b63fd774c181b96e514122c0d693f222b99b1cdd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 13895: Add API routes for checkouts retrieval and renewal
Julian Maurice [Mon, 23 Mar 2015 12:10:46 +0000 (13:10 +0100)]
Bug 13895: Add API routes for checkouts retrieval and renewal

GET /checkouts?borrowernumber={borrowernumber}
GET /checkouts/{checkout_id}
PUT /checkouts/{checkout_id}

+ unit tests in t/db_dependent/api/v1/checkouts.t

Test plan:
1. Open a browser tab on Koha staff and log in (to create CGISESSID
   cookie). You should have permission circulate_remaining_permissions.
2. Go to http://yourlibrary/api/v1/checkouts?borrowernumber=XXX (replace
   XXX with a borrowernumber that has checkouts) and check you receive
   correct data
3. Go to http://yourlibrary/api/v1/checkouts/YYY (replace YYY with an
   existing checkout id) and check you receive correct data
4. Send PUT requests to http://yourlibrary/api/v1/checkouts/YYY until
   the maximum number of renewals is reached (you should have a 403
   error)
5. Run unit tests in t/db_dependent/api/v1/checkouts.t

Depends on bugs 16699 and 14868

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Lari Taskula <larit@student.uef.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e3f2e346f884e2ba6e4a8f43709955f776a259de)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21049: Set 007/00 when selecting material type (Rancor)
Julian Maurice [Fri, 8 Mar 2019 09:12:50 +0000 (10:12 +0100)]
Bug 21049: Set 007/00 when selecting material type (Rancor)

There is a 1-1 relationship between the material type values and the
position 00 of 007 field. Selecting a material type should set this
position's value.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 856425db1e156ee4faf1aae70b0a78845711ba43)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21049: Fix value of material select for Rancor 007 widget
Julian Maurice [Wed, 6 Mar 2019 07:43:18 +0000 (08:43 +0100)]
Bug 21049: Fix value of material select for Rancor 007 widget

The material type is selected in accordance with position 0 of 007

Test plan:
1. Create a new record using the advanced editor
2. Select a material type for field 007 and set at least the position 0
   of this field
3. Save the record and reload the page
4. The material type should remain selected
5. Try with all available material types

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e85294a738da7cce2a4897998ffa795f977b4cd7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22536: Display problem in Holds to Pull report
Owen Leonard [Tue, 19 Mar 2019 12:41:26 +0000 (12:41 +0000)]
Bug 22536: Display problem in Holds to Pull report

This patch modifies the display of several values in the holds to pull
report so that they can be displayed as lists instead of as chunks of
HTML generated in SQL.

This patch modifies the SQL in pendingreserves.pl so that values can be
formatted in the same way that holding branch is. The better long-term
solution is to remove SQL from pendingreserves.pl altogether, but this
is a quick fix.

This patch also makes a couple of minor markup changes to fix
validation.

To test, apply the patch and go to Circulation -> Holds to pull. To see
the changes the patch makes your holds to pull list should have titles
with multiple items at multiple branches, with call number, copy number,
and enumeration data. These values should all be displayed in bulleted
lists.

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9a321c128fed457bf6d11d2ce7ee7edf7dd28004)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22560: Forgotten password "token expired" page still shows boxes to reset password
Owen Leonard [Fri, 22 Mar 2019 13:19:51 +0000 (13:19 +0000)]
Bug 22560: Forgotten password "token expired" page still shows boxes to reset password

This patch modifies the OPAC password recovery template so that the new
password entry form doesn't appear if the patron has followed an invalid
or expired link.

This patch also corrects the markup in the page title.

To test, apply the patch and follow the process for resetting a
forgotten password. When you follow the password recovery link, modify
the URL so that the "uniqueKey" parameter is different.

The page should show an error message. The password entry form should
not appear.

Check the page title in the browser's title bar. It should look correct.

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

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7ac1457ffc27cf6ec5a3a7bab6abc8a010e02b6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22561: Forgotten password requirements hint doesn't list all rules for new passwords
Owen Leonard [Fri, 22 Mar 2019 12:57:31 +0000 (12:57 +0000)]
Bug 22561: Forgotten password requirements hint doesn't list all rules for new passwords

This patch modifies a few templates in the OPAC so that all available
information on password requirements is displayed for each case where
the patron is setting a password:

 - If the RequireStrongPassword system preference is set, a message
   should appear listing strong password requirements and minimum
   password length.
 - If RequireStrongPassword is not set, the message should only ask for
   a minimum password length.

To test, apply the patch and enable the PatronSelfRegistration and
OpacResetPassword preferences.

On the following pages, test with RequireStrongPassword both on and
off. The correct messages should appear.

 - OPAC -> Forgot password. Follow the process to reset your password
   until you reach the step where you are entering the new password.
 - OPAC -> Register here. Check the password section of the registration
   form.
 - OPAC -> Log in -> Change your password.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 50be1c4006e0a1d7e3b537bd849bc77f7a6bb56f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17746: (QA follow-up) Make set_password.pl generate a password if required
Tomas Cohen Arazi [Wed, 20 Feb 2019 14:26:40 +0000 (11:26 -0300)]
Bug 17746: (QA follow-up) Make set_password.pl generate a password if required

This patch makes the set_password.pl script generate the password if it
is not passed as an argument.

It also changes the behaviour of set_password.pl: it will now print the
userid and password (generated or not) to mimick the behaviour from
koha-reset-passwd.

The koha-reset-passwd gets simplified as it doesn't generate the random
password anymore, it passes the responsability to set_password.pl

To test:
- Follow the steps from the original platch
- Verify all behaves as expected

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3ef48c8708736e9d5b16e462e520302c007cb4c1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17746: Add misc/admin/set_password.pl script
Tomas Cohen Arazi [Mon, 4 Feb 2019 18:09:34 +0000 (15:09 -0300)]
Bug 17746: Add misc/admin/set_password.pl script

This patch introduces a script that allows changing a patron's password.
The change overrides the defined password enforcement policy.

If multiple conditions are passed to match on the patron, they all need
to match. Otherwise an error message is printed.

Attributes to search the patron on:
- cardnumber
- patron_id (a.k.a. borrowernumber)
- userid

we usually know some of them, but if we specify more than one, they need
to match a patron, together.

To test:
1) Apply this patch
2) Have a known patron (i.e. you know the cardnumber, the borrowernumber
   and the userid).
3) Run:
  $ kshell
 k$ perl misc/admin/set_password.pl --cardnumber <the_card_number> \
                                    --password a_password
4) Verify you can login with the new password
5) Repeat 3) through 5) with --patron_id and --userid
=> SUCCESS: You can login in all cases
6) Try combining some or all the parameters
=> SUCCESS: It fails when it should, it succeeds when it should
7) Sign off :-D

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e2f6542e1ebbd15977b47c86d2a9ef55fa0c5e9b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17746: Make koha-reset-passwd user set_password.pl
Tomas Cohen Arazi [Tue, 5 Feb 2019 17:04:12 +0000 (14:04 -0300)]
Bug 17746: Make koha-reset-passwd user set_password.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0cd4ca289bd2e1bd11fdbd015225a909971ce213)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22550: OPAC suggestion form doesn't require mandatory fields
Owen Leonard [Wed, 20 Mar 2019 16:24:42 +0000 (16:24 +0000)]
Bug 22550: OPAC suggestion form doesn't require mandatory fields

Test plan:
1. OPAC->login->your purchase suggestions->New purchase suggestion
2. Click button "Submit your suggestion" directly without filling in any field.
   Empty suggestion record was added succeffully.
3. Apply the patch.
4. Click button "Submit your suggestion" directly without filling in any field.
   The required fields should be labeled in red.
   (you can change the mandatory fields by preference 'OPACSuggestionMandatoryFields')

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com>
Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 28e7f1d4e7a114b04d6940463f47351466a638dd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22495: Restore Elasticsearch mapping for su-geo
Ere Maijala [Tue, 12 Mar 2019 09:29:33 +0000 (11:29 +0200)]
Bug 22495: Restore Elasticsearch mapping for su-geo

Test plan:
1. Reset mappings
2. Run perl misc/search_tools/rebuild_elastic_search.pl -d -b -v
3. Do a search and verify that the Places facet works

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 53b059afbb5731373a92a3ebaaceea4e1d656363)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21974: Make Elasticsearch connection settings configurable
Ere Maijala [Mon, 17 Dec 2018 14:22:58 +0000 (16:22 +0200)]
Bug 21974: Make Elasticsearch connection settings configurable

Default settings are appended in get_elasticsearch_params so that there's a central place for them. Defaults can be overridden in koha-conf.xml.

Test plan:

1. Verify that searches still work with the patch applied.
2. Verify that search fails after adding the following under <elasticsearch> in koha-conf.xml:
<cxn_pool>Static</cxn_pool>
3. Verify that search fails after adding the following under <elasticsearch> in koha-conf.xml:
<cxn_pool>FOO</cxn_pool>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 65f35447e93008810cec3eba63a286b9940d5824)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21622: (RM follow-up) adjust for changes from bug 21282
Nick Clemens [Mon, 25 Mar 2019 12:58:39 +0000 (12:58 +0000)]
Bug 21622: (RM follow-up) adjust for changes from bug 21282

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 18f9c3eb514f5733c55d92b16bd0f38d29161290)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21998: Silent tests
Jonathan Druart [Wed, 27 Feb 2019 17:49:35 +0000 (14:49 -0300)]
Bug 21998: Silent tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e9fa69ca64e78cc9ea540e3fed1e9ffb1b3488fe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21998: Throw exception on bad pattern
Josef Moravec [Tue, 18 Dec 2018 11:53:21 +0000 (11:53 +0000)]
Bug 21998: Throw exception on bad pattern

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
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 ee73d577ed564d98e77cf25fcdadcbc594f7217c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21998: Add pattern parameter in Koha::Token
Marcel de Rooy [Wed, 19 Sep 2018 13:36:36 +0000 (15:36 +0200)]
Bug 21998: Add pattern parameter in Koha::Token

Allow a pattern too in Koha::Token->generate. Only supported length.
Does not affect CSRF calls. So tiny change without further impact.

Test plan:
Run  t/Token.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b794643bb075c0aa5de81f2481ae1df56f674309)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19661: (follow-up) Use Basic auth in tests
Josef Moravec [Tue, 26 Feb 2019 09:16:05 +0000 (09:16 +0000)]
Bug 19661: (follow-up) Use Basic auth in tests

Test plan:

prove t/db_dependent/api/v1/acquisitions_funds.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 48484173e26bf9859984860a17089f09de5c8b6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19661: Add and change properties and parameters to conform to the funds RFC.
Matthias Meusburger [Tue, 15 Jan 2019 09:46:04 +0000 (10:46 +0100)]
Bug 19661: Add and change properties and parameters to conform to the funds RFC.

Also, perform an exact search when searching on the fund owner id.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6e98cc4503cedba411371d4005be41b5822569c8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19661: Use Koha::Acquisition::Funds instead of C4::Budgets
Matthias Meusburger [Wed, 17 Jan 2018 10:49:14 +0000 (11:49 +0100)]
Bug 19661: Use Koha::Acquisition::Funds instead of C4::Budgets

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b6be4024196c9e62363eabf0d2ad0b9f9141d15c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19661: REST API - Funds Endpoint
Matthias Meusburger [Thu, 12 Oct 2017 07:55:12 +0000 (07:55 +0000)]
Bug 19661: REST API - Funds Endpoint

This patch adds a new route to the REST api:

/api/v1/acquisitions/funds/

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 717975abebe938a5e79ffc07055ed6190b43f206)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21948: Compiled CSS
Nick Clemens [Fri, 22 Mar 2019 19:20:55 +0000 (19:20 +0000)]
Bug 21948: Compiled CSS

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7a9a8f2f08e4b74af712d59e1f1f9f0a7b3205a0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21948: Clean up style of item detail page
Owen Leonard [Tue, 4 Dec 2018 19:53:29 +0000 (19:53 +0000)]
Bug 21948: Clean up style of item detail page

This patch removes some page-specific style from the item detail page in
the staff client and adds some markup in order to trigger a more
generally-used style.

This patch also adds a font-awesome icon to the "Edit item" link on the
page.

To test, apply the patch and regenerate the staff client CSS. Open a
bibliographic record and view the "Items tab."

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 32020105e8494ba82a8a505711c5047560c9d304)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoUpdate release notes for 18.11.04 release v18.11.04
Martin Renvoize [Mon, 25 Mar 2019 17:16:50 +0000 (17:16 +0000)]
Update release notes for 18.11.04 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoIncrement version for 18.11.04 release
Martin Renvoize [Mon, 25 Mar 2019 16:36:38 +0000 (16:36 +0000)]
Increment version for 18.11.04 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoTranslation updates for Koha 18.11.04
Koha translators [Mon, 25 Mar 2019 16:08:08 +0000 (13:08 -0300)]
Translation updates for Koha 18.11.04

(cherry picked from commit 40211e2a2a4939ee379fde2e2c10f2b7c89849ac)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22565: (QA follow-up) Fix test Acquisition.t
Josef Moravec [Mon, 25 Mar 2019 11:21:45 +0000 (11:21 +0000)]
Bug 22565: (QA follow-up) Fix test Acquisition.t

Test plan:
prove t/db_dependent/Acquisition.t
should pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 607eb83bc06410d59aefb6907070865f9f272115)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22565: Add test for ModReceiveOrder regression
Martin Renvoize [Mon, 25 Mar 2019 11:04:37 +0000 (11:04 +0000)]
Bug 22565: Add test for ModReceiveOrder regression

This test checks that order_internalnote is only updated for the given
orderline in ModReceiveOrder.

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 9bf2b27df5c0b403feea9f78962244d6cbf8a7c8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22565: Do NOT replace all internalnote's on receive
Martin Renvoize [Mon, 25 Mar 2019 10:49:15 +0000 (10:49 +0000)]
Bug 22565: Do NOT replace all internalnote's on receive

Bug 21467 introduced a but whereby setting any order_internalnote on
receive one would end up setting all orders to have that internalnote.

This patch adds the missing WHERE clause to the database query which was
likely lost during a rebase?

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 9acf69f7a690a78bd09af7afbb28e4b32c493903)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 13735: Update PrepareItemrecordDisplay to use maxlength
Katrin Fischer [Wed, 6 Feb 2019 02:02:11 +0000 (02:02 +0000)]
Bug 13735: Update PrepareItemrecordDisplay to use maxlength

The PrepareItemrecordDisplay method used to generate the item
display on receiving serials was using a hardcoded maxlength
of 255 on input fields. This patch updates it to use the
maxlength defined in the frameworks instead as the normal
item form does.

To test:
- Create or reuse an existing subscription
- Make note of the framework the record uses
- Add an item on receive
- Check the maxlength on the various fields is set to 255
  (check source code or use developer tools)
- You can also verify that by adding a long note to
  one of the note fields
- Apply patch
- Repeat tests, the maxlength should now be 9999
- In your framework settings, change the length of one
  of the subfields to another value
- Verify that the item form reflects the change

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 0429aadc217f05a98bbaa51f955b835ac552fd7a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21130: (Follow up OPAC Results) Prevent HTML class from being translated
Blou [Tue, 11 Sep 2018 18:42:03 +0000 (14:42 -0400)]
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated

This fixes the same issue where "title" is being translated (in fr-CA at least) and thus
break the javascript impacting the result display in the OPAC

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5334e0f32a8b93c407c2bfc931397a0ae70b8d64)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21130: Prevent HTML class from being translated
David Bourgault [Fri, 27 Jul 2018 21:13:42 +0000 (17:13 -0400)]
Bug 21130: Prevent HTML class from being translated

Adds a xsl:value-of tag to prevent the value from being translated.

TEST PLAN
0) Apply patch
1) Translate
2) In the opac, div.record has not changed

NOTE:
I don't know if this bug affects all translations, I noticed it when translating to fr-CA.
The fix will work for all languages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e64fb90311a9f2b37b49fc670962089cbb3d32de)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 13763: (follow-up) Strip leading whitespace characters from input barcode
Josef Moravec [Wed, 20 Mar 2019 15:52:07 +0000 (15:52 +0000)]
Bug 13763: (follow-up) Strip leading whitespace characters from input barcode

this makes the work with barcodes from input consistant on checking out,
     checking in and renewing

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 28ff4f6393e65ebfca60c05611fafc926f1fb239)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 13763: Added check for filter syspref in renew.pl
Hayley Mapley [Thu, 14 Mar 2019 04:58:31 +0000 (04:58 +0000)]
Bug 13763: Added check for filter syspref in renew.pl

In Circulation->Renew, the renew feature does not check the system
preference itemBarcodeFilter to see whether the barcode needs to be
converted. This patch fixes this, adding a check for the system pref and
applying it accordingly to convert the barcode if it is needed.

Test plan:
1) In Circulation->Renew, enter a barcode that you know exists in the
catalogue but add extra spaces, breaking up the barcode. Note that this
fails with a warning that says 'No item matches this barcode'

2) In system Preferences, set the itemBarcodeInputFilter pref to Remove
spaces and repeat step1. Note that the result is the same as in step 1

3) Apply the patch

4) Repeat step 1, and note that the filter removes the spaces and the
item is renewed (or gives an error that indicates it recognises the
barcode)

Sponsored-by: Catalyst IT
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 48e9082043115416063e66217db60f0054b68088)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: DBRev 18.11.03.004
Nick Clemens [Thu, 21 Mar 2019 18:11:29 +0000 (18:11 +0000)]
Bug 18736: DBRev 18.11.03.004

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bc36d8e06b3b43b09b655718f7fad5a1780b246a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: Calculate tax depending on rounding
Nick Clemens [Tue, 15 Jan 2019 15:06:06 +0000 (15:06 +0000)]
Bug 18736: Calculate tax depending on rounding

Marcel's comments pointed out that while I tried to avoid storing
rounded values it is required for tax generation.

This patch makes that change and adds test coverage and POD for
populate_order_with_prices

To test:
Follow plan on other patches, ensure that orders and totals match on the
basket, invoice, and budget pages

prove -v t/db_dependent/Acquisition/populate_order_with_prices.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0aeae50229c6a381fe112644b72eefd6848fb655)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (QA follow-up) Resolve uninitialized warn from Biblio.pm L3334
Marcel de Rooy [Fri, 14 Dec 2018 09:46:56 +0000 (10:46 +0100)]
Bug 18736: (QA follow-up) Resolve uninitialized warn from Biblio.pm L3334

Running t/db/Budgets.t:
Use of uninitialized value in join or string at C4/Biblio.pm line 3334.

Test plan:
Run again. Verify no warnings left.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 876323cf5bb5185834a875f3da29ac33f7760ef4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (QA follow-up) Change to signed, add large int test
Marcel de Rooy [Fri, 28 Sep 2018 09:20:49 +0000 (11:20 +0200)]
Bug 18736: (QA follow-up) Change to signed, add large int test

[1] Add trivial subtest in t/Number/Price.t
Checking a negative number and a large number for the MAX_INT change.
Note: Confusing to have t/Prices.t too.

[2] Change UNSIGNED to SIGNED in get_rounding_sql. Although I did not spot
problems with negative prices, we theoretically could while casting.
cast(-2 as unsigned) == 18446744073709551614

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2f5e839bf780955d228c9672abce9d6e5ad1aedf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (QA follow-up) Cosmetic changes
Marcel de Rooy [Fri, 28 Sep 2018 08:09:01 +0000 (10:09 +0200)]
Bug 18736: (QA follow-up) Cosmetic changes

[1] Resolve warnings like:
Use of uninitialized value $rounding_pref in string eq at /usr/share/koha/devclone/C4/Acquisition.pm line 2040.

[2] Fixing unusual use of whitespace too.

[3] Remove list operator from get_rounding_sql return. Only used in scalar
context.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9922d2bf40e2b7429f300d4d73134f9fef3b8c65)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (follow-up) Remove duplicate code and adjust tests
Nick Clemens [Thu, 20 Sep 2018 19:34:10 +0000 (19:34 +0000)]
Bug 18736: (follow-up) Remove duplicate code and adjust tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca28c83abbd449c7e5f1d7b86760b7fb53741988)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (follow-up) cast as UNSIGNED instead of INTEGER
Nick Clemens [Sun, 16 Sep 2018 01:21:16 +0000 (01:21 +0000)]
Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER

More recent MySql versions require the use of SIGNED or UNSIGNED rather
than INTEGER. UNSIGNED will still work in older installs

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ab4cf23286219b473820b61bca82c884de274e80)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: Unit tests for GetBudgetHierarchy
Nick Clemens [Fri, 24 Aug 2018 11:11:19 +0000 (11:11 +0000)]
Bug 18736: Unit tests for GetBudgetHierarchy

prove -v t/db_dependent/Budgets.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d9b3d0fa36869a40b9db65375dba4972913697d8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (follow-up) Fix missing rounding and bad formatting
Nick Clemens [Fri, 24 Aug 2018 01:22:35 +0000 (01:22 +0000)]
Bug 18736: (follow-up) Fix missing rounding and bad formatting

This patch:
Adds a missing use
Uses 'Koha::Number::Price->round()' instead of 'format()' to ensure numeric
returns
Ensures too big numbers don't crash round()
Uses syspref in 'GetBudgetHierarchy'

To test:
Follow previous test plan
Check values on admin/aqbudgets.pl are affected by syspref
Ensure values throughout acquisitions are correctly calculated/displayed
(even when greater than 1,000)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4ccbae8879a386a1846bb48c18b3722f936dc983)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (follow-up) Add missing test cases
Mark Tompsett [Tue, 17 Apr 2018 23:39:57 +0000 (23:39 +0000)]
Bug 18736: (follow-up) Add missing test cases

We now fully cover GetBudgetsPlanCell in these tests

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b17ca2b701fab5307330b6196590e5d3048978e1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell
Nick Clemens [Tue, 17 Apr 2018 14:37:11 +0000 (14:37 +0000)]
Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell

prove t/db_dependent/Budgets.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 00cf699c82aeea46ef5a72bf344fd306430c5aba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: Unit tests for rounding
Nick Clemens [Tue, 6 Jun 2017 14:37:17 +0000 (10:37 -0400)]
Bug 18736: Unit tests for rounding

Unit tests to highlight the issue

To test:
Prove t/db_dependent/Budgets.t
prove t/Acquisition.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bf0882252f242efa8cc9f08625c0abe305d205a6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: Use rounding syspref to determine correct prices in calculations
Nick Clemens [Thu, 28 Dec 2017 15:15:47 +0000 (15:15 +0000)]
Bug 18736: Use rounding syspref to determine correct prices in calculations

To test:
Place an order (no tax just for simplicity)
 listprice/rrp = 16.99
 discount = 42%
 quantity = 8
 estimated calculated at 9.85
 but order total is 78.83, but 8 times 9.85 = 78.80
Apply patches, set OrderPriceRounding syspref to 'Nearest cent'
Not order total is now as expected
View ordered.pl and confirm values are correct
Complete order, view invoice and confirm values
View spent.pl and confirm values
Go through acquisitions module and confirm prices throughout are
correct.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7fe5f8cd2c2d1eddd2a835fb644c262cffcbd34c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 18736: Add OrderPriceRounding syspref
Nick Clemens [Thu, 28 Dec 2017 15:11:11 +0000 (15:11 +0000)]
Bug 18736: Add OrderPriceRounding syspref

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit aea90223d6f250d6f74e00244abbb3e0334107b5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22206: (RMaint follow-up) Fix for bad test plan
Martin Renvoize [Tue, 19 Mar 2019 12:08:21 +0000 (12:08 +0000)]
Bug 22206: (RMaint follow-up) Fix for bad test plan

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21832: add is_expired to ILS-DI example
Fridolin Somers [Thu, 7 Mar 2019 13:46:29 +0000 (14:46 +0100)]
Bug 21832: add is_expired to ILS-DI example

Test plan :
1) Apply patch
2) Enable ILS-DI
3) Go to <opac URL>/cgi-bin/koha/ilsdi.pl?service=Describe&verb=GetPatronInfo
4) Check you see is_expired in example response

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c0df2d0e8612e1ca428f51462fcfb99fbc3f0009)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21832: add unit test
Fridolin Somers [Tue, 12 Feb 2019 14:52:22 +0000 (15:52 +0100)]
Bug 21832: add unit test

Adds a check that is_expired exists in service GetPatronInfo.

Test plan :
Run : prove t/db_dependent/ILSDI_Services.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: remove ref to bug number, we have git for that

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 20ce110f5c656f51bad262708d4b577568c1a52a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21832: Restore is_expired in ILS-DI GetPatronInfo service
Fridolin Somers [Wed, 14 Nov 2018 10:18:58 +0000 (11:18 +0100)]
Bug 21832: Restore is_expired in ILS-DI GetPatronInfo service

Since Bug 17578 removed C4::Member::GetMemberDetails, the information "is_expired" disappeared from ILS-DI service GetPatronInfo.

I propose to restore in by adding the code that exisited in C4::Member::GetMemberDetails directly in C4::ILSDI::Services.

Test plan :
1) Enable ILS-DI webservice
2) Choose a patron not expired
3) Call web-service (replace X with patron's borrowernumber) :
   /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X
4) You see : <is_expired>0</is_expired>
5) Choose a patron expired
6) Call web-service (replace X with patron's borrowernumber) :
   /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X
7) You see : <is_expired>1</is_expired>

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 0748911eb26f2a35d8ba881dcb92e37a979fc9a9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20658: (follow-up) Fix for QA: Add missing html filters
Owen Leonard [Mon, 24 Sep 2018 12:10:47 +0000 (12:10 +0000)]
Bug 20658: (follow-up) Fix for QA: Add missing html filters

This patch adds missing filters to the installer header and footer
include files.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ef231b41119237952ce8a445c953c3957c987734)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20658: Move template JavaScript to the footer: Installer and onboarding
Owen Leonard [Wed, 25 Apr 2018 16:28:18 +0000 (16:28 +0000)]
Bug 20658: Move template JavaScript to the footer: Installer and onboarding

This patch updates the installer and onboarding templates so that
JavaScript is included in the footer instead of the header. A new
include file is added, installer-intranet-bottom.inc, so that only
required JS is being loaded.

Some markup changes are included to improve validity.

To test, apply the patch and start with a blank Koha database. Run
through the installer and onboarding processes and confirm that there
are no problems. Check especially JS-related interactions like
datepickers and fields which are validated via JS, like the password
inputs.

NOTE: The qa tool will flag this patch for not using the Asset plugin,
but it doesn't work correctly for installer files.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ceb745fb2f9c226ffab40a32137c8d43d10ad74)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20782: Fix link from edifactmessages to invoices
Martin Renvoize [Mon, 21 May 2018 11:15:37 +0000 (12:15 +0100)]
Bug 20782: Fix link from edifactmessages to invoices

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 57cfc3bab7d76c3a382f8111f5d5c9490eb2eb91)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22206: (follow-up) Voted RFC changes
Tomas Cohen Arazi [Thu, 28 Feb 2019 13:00:27 +0000 (10:00 -0300)]
Bug 22206: (follow-up) Voted RFC changes

This patch changes expiration_date for end_date as voted when the RFC
was approved.

It also adds a test for the Location header being added correctly when
suspending a hold (SWAGGER3.4.1)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6ebcc255d3def898c491333bc8702c56b09e4537)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22206: (QA follow-up) Fix tests for hold suspension api
Josef Moravec [Thu, 21 Feb 2019 00:59:22 +0000 (00:59 +0000)]
Bug 22206: (QA follow-up) Fix tests for hold suspension api

Test plan:

prove t/db_dependent/api/v1/holds.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1db9598e81abf009b80aa44699061e845c9e87e0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22206: Add routes to suspend/resume holds
Tomas Cohen Arazi [Mon, 28 Jan 2019 10:40:15 +0000 (07:40 -0300)]
Bug 22206: Add routes to suspend/resume holds

This patch introduces:

- POST   /holds/{hold_id}/suspension { "expiration_date": "2019-01-30" }
- DELETE /holds/{hold_id}/suspension

to suspend a hold or resume a suspended hold, respectively.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
- 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 6067d2d49f790ab9ffead1381c571c14b0ba43ff)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22206: Unit tests
Tomas Cohen Arazi [Mon, 28 Jan 2019 10:39:47 +0000 (07:39 -0300)]
Bug 22206: Unit tests

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 bcc150a9c05c1de4fe2fc5e07a5469f90d48953c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22206: OpenAPI spec
Tomas Cohen Arazi [Mon, 28 Jan 2019 10:39:27 +0000 (07:39 -0300)]
Bug 22206: OpenAPI spec

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 51a887a81d75c5ae561c17143ae9f70651449f04)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20006: (follow-up) Plural class name
Tomas Cohen Arazi [Thu, 24 Jan 2019 19:13:25 +0000 (16:13 -0300)]
Bug 20006: (follow-up) Plural class name

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 41f394f4eedc152627080c0b4a89630034706121)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20006: (follow-up) Fix holds.js
Tomas Cohen Arazi [Thu, 24 Jan 2019 18:11:21 +0000 (15:11 -0300)]
Bug 20006: (follow-up) Fix holds.js

This patch makes holds.js call the endpoint with 'pickup_library_id'
instead of the old 'branchcode' property.

To test:
- Place a hold
- Go to the patron's detail page
- Go to the Holds tab
- Change the pickup location
=> SUCCESS: It works!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f6b3d9979dc996dff7bf29fd5747e91695f93d0f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20006: Adapt /holds to the RFC
Tomas Cohen Arazi [Thu, 24 Jan 2019 17:53:30 +0000 (14:53 -0300)]
Bug 20006: Adapt /holds to the RFC

This patch makes the /holds endpoint respect the voted RFC. Some
behaviours are changed as well:

- As we voted to introduce a /public namespace for unprivileged access to
endpoints, this endpoint gets the ability for owners and guarantors to
manipulate holds through the API.

- GET /holds now uses the objects->search helper, so it now has
pagination.

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fc0d64506d75bde53afa3a3385a7f7f42bd566bc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20006: Unit tests fixes
Tomas Cohen Arazi [Thu, 24 Jan 2019 17:51:03 +0000 (14:51 -0300)]
Bug 20006: Unit tests fixes

This patch makes the holds endpoint tests pass and expect data structures that match the voted RFC.

As we voted to introduce a /public namespace for unprivileged access to
endpoints, this endpoint gets the ability for owners and guarantors to
manipulate holds through the API.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 52bb9802dda6f6bb3619cc6d8e921ecd8175c8ce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20006: Spec changes
Tomas Cohen Arazi [Thu, 24 Jan 2019 17:48:26 +0000 (14:48 -0300)]
Bug 20006: Spec changes

This patch makes the spec match the voted RFC.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 62f1b2df68f16dcd7eec324d487963f737cbe450)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: Update Schema
Nick Clemens [Fri, 15 Mar 2019 13:33:11 +0000 (13:33 +0000)]
Bug 21846: Update Schema

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6757591297a148744ca714502271a11ee4b737e6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20823: UNIMARC XSLT add subfield t for subjects
Fridolin Somers [Fri, 25 May 2018 14:51:15 +0000 (16:51 +0200)]
Bug 20823: UNIMARC XSLT add subfield t for subjects

In UNIMARC, 604 contains subfield t, see http://multimedia.bnf.fr/unimarcb_trad/B604-6-2011.pdf.
Actual XSLT files use template tag_subject for 604, it does not use t subfield.

This patch adds subfield t to tag_subject and tag_onesubject templates in intranet and OPAC XSLT files.

Test plan :
1) In UNIMARC catalog edit a biblio record to add 604$t
2) Use default XSLT files in sysprefs
2) Go to catalogue details page of this record using default XSLT files
3) Check $t is displayed at OPAC and intranet

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 0c4bf00c30ce25165a5243bced7b7e19746a7e0b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22219: Remove duplicated items in inventory (when skipping waiting holds)
Jonathan Druart [Mon, 4 Mar 2019 19:57:26 +0000 (16:57 -0300)]
Bug 22219: Remove duplicated items in inventory (when skipping waiting holds)

Test plan:
0/ Do not apply this patch
1/ Place several holds on a given item
2/ Use the inventory with the "skip waiting holds" option to list this item.
It will be displayed several times
3/ Apply this patch and confirm that the item is now only displayed once

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 08ea70c109ce3432b5dd1a781d126c7353fca3da)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22219: Add tests
Jonathan Druart [Mon, 4 Mar 2019 19:52:30 +0000 (16:52 -0300)]
Bug 22219: Add tests

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2be9fd23d2e9aa91e2e1f38a2817a54a5cdc5d21)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22477: Missing DataTables configuration when searching patrons for holds
Owen Leonard [Thu, 7 Mar 2019 17:28:34 +0000 (17:28 +0000)]
Bug 22477: Missing DataTables configuration when searching patrons for holds

This patch adds columns configuration to the holds request page to fix a
JavaScript error in the console and to allow the patron search results
table to be enabled as a DataTable.

To reproduce: Place a hold on a title in the staff client. When prompted
for a patron, perform a search which will return multiple results. The
patron search results will appear in an unsortable table. A JS error can
be seen in the browser console.

To test, apply the patch and repeat the steps above. The patron search
results table should be sortable and there should be no JS error.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3e7620cf46d2e7079ff5494070ff6933fb9650af)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: DBRev 18.11.03.003
Nick Clemens [Fri, 15 Mar 2019 12:32:49 +0000 (12:32 +0000)]
Bug 21846: DBRev 18.11.03.003

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3d462af21f3c13312b0ffb8496e55d277f703ebd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: Simplify ugly double for loops
Jonathan Druart [Tue, 26 Feb 2019 20:01:41 +0000 (17:01 -0300)]
Bug 21846: Simplify ugly double for loops

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 180781f4748d689674a9f91f546d8e76324e7291)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: Fix pod2usage return values
Jonathan Druart [Tue, 26 Feb 2019 19:32:44 +0000 (16:32 -0300)]
Bug 21846: Fix pod2usage return values

According to existing pattern.
However I am not sure it makes sense to return an errno (and print to STDERR)
if --help is passed.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d7c0547bd20bd266ea8cd023ac4be22c2a9644d0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: (QA follow-up) Fix maintenance script path
Tomas Cohen Arazi [Tue, 26 Feb 2019 18:41:02 +0000 (15:41 -0300)]
Bug 21846: (QA follow-up) Fix maintenance script path

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fa4aeaa87e957298874263ec7c3f8478fcaf8b49)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: (follow-up) Add maintenance script
Tomas Cohen Arazi [Tue, 8 Jan 2019 16:13:46 +0000 (13:13 -0300)]
Bug 21846: (follow-up) Add maintenance script

This patch adds a maintenance script that generates the missing
tags_approval entries based on the tags_all table, and then recalculates
the weights for both tags_approval and tags_index tables.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 293eee9959925397e4fdc84ae0d4baea2cf7d94c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: Make 'term' use utf8mb_bin collation on tags tables
Tomas Cohen Arazi [Fri, 23 Nov 2018 19:47:05 +0000 (16:47 -0300)]
Bug 21846: Make 'term' use utf8mb_bin collation on tags tables

This patch makes the utf8mb4_bin collation preferred for comparing tags.
Otherwise suppolemental unicode characters all match.

To test:

- Enable tags and disable moderation (or plan to moderate and accept tags)
- Tag 3 records:
   a - with 🐋
   b - with 🌮
   c - with 👍
- Note the weight on each says '3'
- Click the tag to search, you get back all the records
- Apply the previous patches from this bug report
- Run:
  $ kshell
 k$ prove t/db_dependent/Tags.t
=> FAIL: Tests fail, related to counting stuffs
- Apply this patch and
(a) Run updatedatabase to upgrade the schema
- Run:
 k$ prove t/db_dependent/Tags.t
=> SUCCESS: Tests pass!
(b) reset_all to get a fresh DB using kohastructure.sql
- Run:
 k$ prove t/db_dependent/Tags.t
=> SUCCESS: Tests pass too!
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 04f1b0ca950a5a133f6afe6785787d1982414a1e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: Regression tests for add_tag_approval
Tomas Cohen Arazi [Fri, 23 Nov 2018 18:30:52 +0000 (15:30 -0300)]
Bug 21846: Regression tests for add_tag_approval

Due to collation issues, add_tag_approval wrongly calculates
the weight for strings including extended UNICODE characters.

This patch introduces a test for this situation.

To test:
- Apply this patch on master
- Run:
  $ kshell
 k$ prove t/db_dependent/Tags.t
=> FAIL: Tests fail because all extended characters match the same

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 865f9a165d5d5e025737324843eccb5c39a74efb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21846: Add Koha::Tags::Approval(s) and Koha::Tags::Index(es)
Tomas Cohen Arazi [Fri, 23 Nov 2018 18:44:04 +0000 (15:44 -0300)]
Bug 21846: Add Koha::Tags::Approval(s) and Koha::Tags::Index(es)

In order to avoid writing the tests using plain DBIC which would later
need to be replaced by a Koha::Object-based counterpart, I introduce
this stub classes.

Stub tests are added as well.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Tags.t \
          t/db_dependent/Koha/Tags/Approvals.t \
          t/db_dependent/Koha/Tags/Indexes.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6c86de628d5873b88a7d6d2d676ecd7b98345aa7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21987: (RM follow-up) Add text for simple tests
Nick Clemens [Fri, 15 Mar 2019 12:22:32 +0000 (12:22 +0000)]
Bug 21987: (RM follow-up) Add text for simple tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1464328718619a673f233406fdb238f0391b0785)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21987: Do not generate true color thumbnails if not needed
Jonathan Druart [Tue, 18 Dec 2018 17:02:19 +0000 (14:02 -0300)]
Bug 21987: Do not generate true color thumbnails if not needed

If the original image is not a true color image we should not generate a
true color thumbnail.

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 5c41d584cb654efbfd8c854bac0d30d87a054ab5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21987: Add tests
Jonathan Druart [Tue, 18 Dec 2018 17:02:14 +0000 (14:02 -0300)]
Bug 21987: Add tests

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 afb39b132b10b74efec31cd8191cdcd72a61d8d3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22493: Clean up DecreaseLoanHighHolds.t
Nick Clemens [Mon, 11 Mar 2019 14:47:01 +0000 (14:47 +0000)]
Bug 22493: Clean up DecreaseLoanHighHolds.t

To test:

1 - prove -v t/db_dependent/DecreaseLoanHighHolds.t
2 - should pass
3 - read code, confirm changes make sense

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ed5b7e4575917f07a3e895be754abc2bacc37337)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22476: Correct default for MarkLostItemsAsReturned
Nick Clemens [Thu, 7 Mar 2019 16:49:11 +0000 (16:49 +0000)]
Bug 22476: Correct default for MarkLostItemsAsReturned

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9682cc7d21645a673bd274b24aeab323f61f28aa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21560: (follow-up) move use at the top
Fridolin Somers [Tue, 5 Mar 2019 14:51:15 +0000 (15:51 +0100)]
Bug 21560: (follow-up) move use at the top

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 639ad97d844f2774f49881174b559293edd6baa4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21560: Unit test for Koha::Util::OpenDocument
Fridolin Somers [Tue, 19 Feb 2019 11:01:16 +0000 (12:01 +0100)]
Bug 21560: Unit test for Koha::Util::OpenDocument

Run prove t/Koha/Util/OpenDocument.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 99ea714345a6278d68e2abb0d182d8b495cf2950)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21560: create Koha::Util::OpenDocument with subroutine for ODS generation
Fridolin Somers [Mon, 18 Feb 2019 16:33:37 +0000 (17:33 +0100)]
Bug 21560: create Koha::Util::OpenDocument with subroutine for ODS generation

There is nearly the same code in misc/cronjobs/gather_print_notices.pl and reports/guided_reports.pl.
This patch creates a new module with subroutine called by both scripts.

If file path or content is undefined, subroutine will just return undef.
If content is an empty arrayref, empty ods file is still generated.

Unicode encoding is kept outisde because it may not be necessary.

Note that for print notices the first line of message is always the column names so it is extracted only from first message.

Test plan :
Run previous patches test plans and check ODS files are the same.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ffb40290f88380418635a951dbb0788bf7b7e3ce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21560: Optimize ODS export of gather_print_notices.pl
Fridolin Somers [Fri, 7 Dec 2018 09:30:30 +0000 (10:30 +0100)]
Bug 21560: Optimize ODS export of gather_print_notices.pl

Like previous patch, the call on OpenOffice-OODoc lib can be optimized.
Based on https://grep.metacpan.org/search?qci=&q=expandTable&qft=&qd=OpenOffice-OODoc&f=examples%2Ftext2table

Test plan inspired from Bug 11679.

Test plan:
- define your ODUE notice for the print template as:
cardnumber:patron:email:item
<<borrowers.cardnumber>>:<<borrowers.firstname>> <<borrowers.surname>>:<<borrowers.email>>:<item><<items.barcode>></item>
- define overdues rules for a patron category
- check-out 2 items using a due date in order to generate the overdue notices
- check-in these 2 items
- launch the script /misc/cronjobs/overdue_notices.pl
- the 'message_queue' table should now contain 2 new entries
- launch the gather_print_notices cronjob :
  perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=:
- A ods file should be generated in your /tmp/test directory
- Compare times with and without patch

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 5d4f80feac811a9d6e177975b50c57ba85e3434d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21560: report ODS export optimization
Fridolin Somers [Fri, 12 Oct 2018 12:09:54 +0000 (14:09 +0200)]
Bug 21560: report ODS export optimization

SQL reports can be exported with CSV, TSV of ODS format.
When report has thousands of rows, using ODS format is around 10 times longer than other formats.
It also loads CPU and RAM a lot.

The longest call is expandTable().
I found that the call on OpenOffice-OODoc lib can be optimized.
Based on https://grep.metacpan.org/search?qci=&q=expandTable&qft=&qd=OpenOffice-OODoc&f=examples%2Ftext2table

Test plan :
1) Don't apply patch yet
2) Create a new SQL report : Home > Reports > Create from SQL
3) Enter a SQL that will return thousands of results
4) Run report
5) Click Download > Semicolon separated text (.csv), look execution time
6) Click Download > Open Document Spreadsheet, look execution time
7) Apply patch
8) Redo 5) and 6) and compare times, CSV export should be the same but ODS export should be better

My tests shows 1,5 seconds for CSV export.
And for ODS export : 18 seconds without patch and 8 seconds with patch.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
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 28edd8848320fd0f0f284245f2f0567a5907619a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22429: Infinite loop in patron card printing
David Cook [Mon, 4 Mar 2019 06:43:29 +0000 (17:43 +1100)]
Bug 22429: Infinite loop in patron card printing

Text fields in Patron Card Text Layouts can contain regular
expression metacharacters, which - instead of being treated as
literal values - are interpreted and prevent line wrapping. This
causes the process to get stuck in an infinite loop, which keeps
running even after the web server has timed out (at least when
using CGI).

This patch escapes the relevant input from the text field so the
regular expression substitution treats characters as literals
instead of as metacharacters.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3bd900496690375b2b711743ffaa57371388f687)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22296: Add Invoice Adjustments to GetBudgetHierarchy
Nick Clemens [Fri, 8 Feb 2019 20:24:05 +0000 (20:24 +0000)]
Bug 22296: Add Invoice Adjustments to GetBudgetHierarchy

To test:
1 - prove -v t/db_dependent/Budgets.t
2 - Create some invoices on a single budget
    Invoice 1:
      add a non-encumbered adjustment for 1
      add an encumbered adjustment 2
      leave open
    Invoice 2:
      add a non-encumbered adjustment for 4
      add an encumbered adjustment for 8
3 - View acq home page, should see 2 order and 12 spent for the budget
4 - View the spent and ordered pages, they should show the correct amounts
5 - Add more orders etc and confirm things total correctly

https://bugs.koha-community.org/show_bug.cgi?id=22296
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit deb968ea45276e56826b592026617a96398b61da)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22498: Rename variable for budgets loop for invoice adjustments
Nick Clemens [Tue, 12 Mar 2019 13:15:34 +0000 (13:15 +0000)]
Bug 22498: Rename variable for budgets loop for invoice adjustments

To test:
1 - Try to add some adjustments to an invoice (receive shipments, create invoice, click 'finish receiving')
2 - Note the fund dropdown has only 'No fund'
3 - Apply patch
4 - Refresh page
5 - Note you can now select funds, hooray!

Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 19aebacf7c6162e5628cba1078b2c0f2ec9751a6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 17496: Remove undocumented/maintained install-CPAN.pl file
Katrin Fischer [Sun, 10 Feb 2019 02:09:45 +0000 (03:09 +0100)]
Bug 17496: Remove undocumented/maintained install-CPAN.pl file

The install-CPAN.pl file was added in 2007 and hasn't been
updated or documented since.

This patch removed it from Koha.

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 cab238755a69ca7e52b3822b390b31484abb5c72)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22422: Compiled CSS
Martin Renvoize [Tue, 12 Mar 2019 09:21:24 +0000 (09:21 +0000)]
Bug 22422: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22422: improve item location display with class "shelvingloc"
Fridolin Somers [Thu, 28 Feb 2019 12:37:40 +0000 (13:37 +0100)]
Bug 22422: improve item location display with class "shelvingloc"

In record detail page, item location is displayed with CSS using class "shelvingloc".
Many many places at intranet and OPAC can use this class.
It allows to change display in all places using CSS customisation.

This patch removes the CSS "display:block" for class "shelvingloc".
Some places where using "inline" to correct the display.
I think the display should not be managed in template.
So it will be inline by default and it can be changed by custom CSS, on all places or depending on a selctor.

Test plan :
1) Compile SCSS to CSS
2) Add to preferences IntranetUserCSS and OPACUserCSS : .shelvingloc { color:red }
3) Go to pages impacted by patch, be sure to look at cart with "more details"
4) You see item location italic and red

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 bc2d9f869ad0bde3e97e3773e0e050503d8083f4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21030: Date widget on suspend modal not working correctly
Owen Leonard [Tue, 5 Mar 2019 18:22:12 +0000 (18:22 +0000)]
Bug 21030: Date widget on suspend modal not working correctly

This patch makes a change to the suspend hold modal markup in order to
allow the datepicker <selects> to work properly.

To test, apply the patch and locate a patron in the staff client who has
holds.

 - On the checkout or patron detail page, open the holds tab.
 - Click the "Suspend" button for one of the holds.
 - In the modal, trigger the date picker and confirm that the dropdowns
   for selecting month and year work correctly.

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 c91c1a69a23ff8d826a077c61059953bcc51940b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19046: (QA follow-up) Remove doubled up 'Title as phrase'
Katrin Fischer [Thu, 7 Mar 2019 03:10:28 +0000 (03:10 +0000)]
Bug 19046: (QA follow-up) Remove doubled up 'Title as phrase'

One search option was doubled up by accident.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ae2caab54f53bd9b7fbe8e5c1575f38e97002bf2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19046: Make seach pulldown to retain index selection
Jonathan Druart [Mon, 4 Mar 2019 18:39:29 +0000 (15:39 -0300)]
Bug 19046: Make seach pulldown to retain index selection

This patch also fixes add the term in the search input

Test plan:
Enable IntranetCatalogSearchPulldown
Search for a term using the search input in the header (simple search)
Re-do selecting different indices

The selection must retain on the search result page.

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 74ac15800bbf358e3f1133a1f212400797640112)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22442: (bug 13618 follow-up) Fix item search CSV export
Jonathan Druart [Mon, 4 Mar 2019 17:50:36 +0000 (14:50 -0300)]
Bug 22442: (bug 13618 follow-up) Fix item search CSV export

We must not filter assignements statements.

Test plan:
Export item search result as CSV
Without this patch the biblio and biblioitem values are not displayed.
With this patch applied everything is displayed correctly

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bb730c1b05c91ee92db09d117293a0ddb87dace1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt
Fridolin Somers [Mon, 11 Feb 2019 08:54:43 +0000 (09:54 +0100)]
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt

In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.

This patch moved bottom include to last line and uses popup-bottom.inc.

Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 255af719e65956d84d62ea52fea12619bb851f70)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22246: Fix indexing of large fields with Elasticsearch
Ere Maijala [Fri, 1 Feb 2019 11:18:11 +0000 (13:18 +0200)]
Bug 22246: Fix indexing of large fields with Elasticsearch

Deduplicate multivalued fields and make sure sort fields are not excessively long. Also updates default mappings so that sort fields are not created for item fields where it doesn't make sense.

Test plan:
1. Reset ES mappings in administration
2. Check that sort is '0' for local-classification in biblio mappings.
3. Change sort back to '1' for local-classification for the next steps.
4. Create a record with 20 items, each with a 100 character long call number
5. Check that when indexed, the record in ES does not have duplicates in any of the item fields and local-classification__sort is truncated to 255 characters.

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