]> git.koha-community.org Git - koha.git/log
koha.git
5 years agoBug 20244: Add alt script indexing and fix sort field indexing
Ere Maijala [Mon, 2 Jul 2018 13:04:05 +0000 (16:04 +0300)]
Bug 20244: Add alt script indexing and fix sort field indexing

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

Test plan:

1. Add a record with alternate script fields in 880 (sample attached in the bug).
2. Make sure the the record can be found e.g. with the alternate script title.
3. Add a record with multiple authors.
4. Check that in the index there is only a single author__sort field.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20244: Improve Elasticsearch ISBN indexing
Ere Maijala [Mon, 2 Jul 2018 12:55:10 +0000 (15:55 +0300)]
Bug 20244: Improve Elasticsearch ISBN indexing

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

Test plan:

1. Add a record with an ISBN-10 or ISBN-13 that can be converted to ISBN-10 (e.g. 1-56619-909-3).
2. Verify that the record can be found by searching for "1-56619-909-3", "1566199093", "978-1-56619-909-4" and "9781566199094".

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: (QA follow-up) Convert atomicupdate to .perl
Martin Renvoize [Tue, 13 Nov 2018 11:23:11 +0000 (11:23 +0000)]
Bug 19893: (QA follow-up) Convert atomicupdate to .perl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: (QA follow-up) Spelling correction in POD
Martin Renvoize [Tue, 13 Nov 2018 11:11:04 +0000 (11:11 +0000)]
Bug 19893: (QA follow-up) Spelling correction in POD

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Increase test coverage
David Gustafsson [Mon, 5 Nov 2018 14:00:21 +0000 (15:00 +0100)]
Bug 19893: Increase test coverage

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Add code review fixes
David Gustafsson [Thu, 1 Nov 2018 14:47:12 +0000 (15:47 +0100)]
Bug 19893: Add code review fixes

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Add pods, remove syspref, add tests for serialization format
David Gustafsson [Mon, 22 Oct 2018 09:30:17 +0000 (11:30 +0200)]
Bug 19893: Add pods, remove syspref, add tests for serialization format

Add missing pods, remove obsolete syspref and add test for serialization format for records exceeding max record size

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Fix tests and add tests for joined subfields
David Gustafsson [Wed, 12 Sep 2018 14:50:01 +0000 (16:50 +0200)]
Bug 19893: Fix tests and add tests for joined subfields

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Support for joined subfields in mappings
David Gustafsson [Tue, 11 Sep 2018 15:56:44 +0000 (17:56 +0200)]
Bug 19893: Support for joined subfields in mappings

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Restore and fix removed tests
David Gustafsson [Fri, 7 Sep 2018 13:18:00 +0000 (15:18 +0200)]
Bug 19893: Restore and fix removed tests

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Fix Elasticsearch tests.
Ere Maijala [Mon, 2 Jul 2018 12:23:51 +0000 (15:23 +0300)]
Bug 19893: Fix Elasticsearch tests.

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

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Add index status
David Gustafsson [Tue, 29 May 2018 15:57:31 +0000 (17:57 +0200)]
Bug 19893: Add index status

Add persistent per index "index status" state to provide useful
user feedback when update of Elasticsearch server mappings fails

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Remove serialization format setting
David Gustafsson [Mon, 28 May 2018 14:03:32 +0000 (16:03 +0200)]
Bug 19893: Remove serialization format setting

Default to base64 encoded binary MARC with MARCXML
fallback if record exceeds maximum size

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19893: Alternative optimized indexing for Elasticsearch
David Gustafsson [Tue, 12 Dec 2017 17:26:13 +0000 (18:26 +0100)]
Bug 19893: Alternative optimized indexing for Elasticsearch

Implement optimized indexing for Elasticsearch

How to test:
1) Time a full elasticsearch re-index without this patch by running the
   rebuild_elastic_search.pl with the -d flag:
   `koha-shell <instance_name> -c "time rebuild_elastic_search.pl -d"`.
2) Apply this patch.
3) Time a full re-index again, it should be about twice at fast (for a
   couple of thousand biblios, with fewer biblios results may be more
   unpredictable).

Sponsored-by: Gothenburg University Library
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 7143: Update about page for new dev Thatcher Leoonard
Nick Clemens [Thu, 15 Nov 2018 12:37:22 +0000 (12:37 +0000)]
Bug 7143: Update about page for new dev Thatcher Leoonard

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21749: (QA follow-up) Add more tests for ImportFramework
Tomas Cohen Arazi [Mon, 12 Nov 2018 18:03:34 +0000 (15:03 -0300)]
Bug 21749: (QA follow-up) Add more tests for ImportFramework

This patch adds tests for:
- Output of ImportFramework on fields removal and error conditions (file
  not found)
- Different file format behaviour (csv, xml and ods are tested).

To test:
- Run
  $ kshell
 k$ prove t/db_dependent/ImportExportFramework.t
=> SUCCESS: All green :-D
- Sign off :-D

Note: the biblio_framework* files are based on the original one on the
patchset, and exported in 17.11 with different formats.

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>
5 years agoBug 21749: Fix import of CSV biblio framework
Jonathan Druart [Mon, 12 Nov 2018 16:14:19 +0000 (13:14 -0300)]
Bug 21749: Fix import of CSV biblio framework

Bug 9701 added 2 new columns to the table marc_tag_structure which broke
the import of biblio frameworks if the CSV file was generated with a
previous version.

Test plan:
- Export a biblio framework from 17.11
- Import it into 18.05+

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=21740

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21749: Add tests for ImportFramework
Jonathan Druart [Mon, 12 Nov 2018 16:11:42 +0000 (13:11 -0300)]
Bug 21749: Add tests for ImportFramework

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>
5 years agoBug 21805: Duplicate include file in search results template causes JS error
Owen Leonard [Fri, 9 Nov 2018 19:02:25 +0000 (19:02 +0000)]
Bug 21805: Duplicate include file in search results template causes JS error

This patch removes a redundant include file, browser-strings.inc, from
the top of the staff client search results template. The
correctly-placed include is in the JavaScript block at the bottom of the
template. The duplication causes a JavaScript error which can be seen in
the browser console.

To test, apply the patch and peform a catalog search in the staff
client. Open the browser console and confirm that there are no errors.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 18584: Our legacy code contains trailing-spaces
Thatcher Leonard [Tue, 6 Nov 2018 14:39:28 +0000 (14:39 +0000)]
Bug 18584: Our legacy code contains trailing-spaces

This patch removes trailing spaces from acquisitions-search.inc

Mentored-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 17084: Automatic debian/control updates (unstable/master)
Nightly Build Bot [Wed, 14 Nov 2018 23:25:09 +0000 (00:25 +0100)]
Bug 17084: Automatic debian/control updates (unstable/master)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21799: Change wording for quantity input field on order receive page
Katrin Fischer [Thu, 1 Nov 2018 13:38:35 +0000 (13:38 +0000)]
Bug 21799: Change wording for quantity input field on order receive page

Changes the label from "Quantity to receive" to "Quantity ordered".
The label below reads "Quantity received".

To test:
- Order something in acquisition
- Add a new shipment and create an invoice
- Receive an order line
- On the order receive form, check for the labels mentioned above

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>
5 years agoBug 17597: Outdated translation credits
Dimitris Antonakis [Sat, 10 Nov 2018 11:24:27 +0000 (13:24 +0200)]
Bug 17597: Outdated translation credits

Updated translation credits for the Greek language.

Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Works as expected, hyperlink to openhub tested OK.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 9775: Unitprice should be hidden when creating an order
Martin Renvoize [Fri, 21 Sep 2018 10:40:16 +0000 (11:40 +0100)]
Bug 9775: Unitprice should be hidden when creating an order

The actual cost box is effectively hidden from the order page.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21282: Sync ordered and spent values with acqui home
Jonathan Druart [Wed, 29 Aug 2018 20:26:14 +0000 (17:26 -0300)]
Bug 21282: Sync ordered and spent values with acqui home

The order list for each fund calculates using the ecost tax excl., but
it should be tax incl.
At the moment this means that the sum on the start page table and the
order list don't match up.

Test plan:
- Create and receive orders
- Values on acqui home and ordered/spent should be the same

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21777: (QA follow-up) Fix colspan in the footer
Tomas Cohen Arazi [Tue, 13 Nov 2018 18:17:09 +0000 (15:17 -0300)]
Bug 21777: (QA follow-up) Fix colspan in the footer

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21777: Fix circulation table alignment
Nick Clemens [Wed, 7 Nov 2018 12:16:08 +0000 (12:16 +0000)]
Bug 21777: Fix circulation table alignment

TO test:
1 - Check out an item to a patron
2 - Note the columns are misaligned
3 - Apply patch
4 - Updatedatabase
5 - Reload the patron
6 - Note the table is fixed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21777: Add a regression test
Jonathan Druart [Wed, 7 Nov 2018 17:23:27 +0000 (14:23 -0300)]
Bug 21777: Add a regression test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: (follow-up) Display a summary line per parent_ordernumber
Jonathan Druart [Thu, 1 Nov 2018 13:03:18 +0000 (10:03 -0300)]
Bug 21467: (follow-up) Display a summary line per parent_ordernumber

Wrong resolution conflict

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: (QA follow-up) Move hint a little bit
Katrin Fischer [Mon, 29 Oct 2018 20:54:32 +0000 (20:54 +0000)]
Bug 21467: (QA follow-up) Move hint a little bit

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Prevent tests to fail
Jonathan Druart [Thu, 1 Nov 2018 12:51:23 +0000 (09:51 -0300)]
Bug 21467: Prevent tests to fail

The following error is raised if TestBuilder generates too big numbers:
 Out of range value for column 'tax_value_on_ordering'

     UPDATE aqorders
     SET
         tax_value_on_ordering = quantity * ecost_tax_excluded * tax_rate_on_ordering,
         tax_value_on_receiving = quantity * unitprice_tax_excluded * tax_rate_on_receiving
     WHERE ordernumber = ?
 "] at /home/vagrant/kohaclone/C4/Acquisition.pm line 1484.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: (QA follow-up) Fix filter and variable declaration in .t
Koha instance kohadev-koha [Sun, 28 Oct 2018 15:17:25 +0000 (15:17 +0000)]
Bug 21467: (QA follow-up) Fix filter and variable declaration in .t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Display a summary line per parent_ordernumber
Jonathan Druart [Fri, 12 Oct 2018 18:19:28 +0000 (15:19 -0300)]
Bug 21467: Display a summary line per parent_ordernumber

This will help to keep track of the different orders for a given
subscription.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Fix default sort
Jonathan Druart [Fri, 12 Oct 2018 17:26:44 +0000 (14:26 -0300)]
Bug 21467: Fix default sort

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Display the quantity and adjust the amounts
Jonathan Druart [Tue, 2 Oct 2018 16:42:58 +0000 (13:42 -0300)]
Bug 21467: Display the quantity and adjust the amounts

On the subscription detail view we should display the amounts depending
on the quantity (can be different than 0 now!)

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Do not erase the internal note of the first order
Jonathan Druart [Tue, 2 Oct 2018 16:31:20 +0000 (13:31 -0300)]
Bug 21467: Do not erase the internal note of the first order

For the subscription we would like to keep the original internal note
(from the first order), to display it unmodified each time we receive
issues.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Add subscription's info when ordering
Jonathan Druart [Tue, 2 Oct 2018 15:39:38 +0000 (12:39 -0300)]
Bug 21467: Add subscription's info when ordering

When ordering from a subscription, there is now a "hint" to display the
number of issues and the frequency. It will be easier to estimate the
quantity to receive.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Add treetable to subscription detail to group orders by parent ordernumber
Jonathan Druart [Mon, 1 Oct 2018 23:44:29 +0000 (20:44 -0300)]
Bug 21467: Add treetable to subscription detail to group orders by parent ordernumber

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21467: Allow several receipts for a given subscription
Jonathan Druart [Mon, 1 Oct 2018 22:41:17 +0000 (19:41 -0300)]
Bug 21467: Allow several receipts for a given subscription

When a new order is created from a subscription the quantity is set to 1
and cannot be modified.
The idea was to order 1 subscription.
This behavior leads to a limitation: it is not possible to mark a
receipt as partially received. However it is how it works in real life,
the vendors send invoices throughout the year. The number of items can
also be changed.

The idea is be to rethink the "quantity" value for an order created
from a subscription and use it to track the number of invoices already
paid.

FIXME: This approach will not cohabit with standing orders.
This patch is a first draft to get feedback on the idea.

FIXME: What about cancelled orders?

Test plan:
- Create a new order from a subscription
- Enter the number of items you think you will receive for this
subscription (for instance 1 per month: 12)
- Close the basket
- Receive 3 items (a trimester) and create a specific invoice for this
receipt. Note that the price are per unit.
If you want to receive items with different prices you should make
split the receipt
- Receive more items. This time you will notice that the previous order
will be displayed on the "order receive" under a new block "Receipt
history for this subscription"
- Note that the "Quantity to receive" has been decrease by the number of
items you previously received
- Also you can notice that this "Quantity to receive" can be modified.
Indeed it can happen that the number of items to receive changed during
the year
- Go to the detail of the subscription and notice that the orders have
been grouped by "parent ordernumber"
- Continue to receive items until all have been received

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Remove deprecated subroutines
Jonathan Druart [Tue, 13 Nov 2018 17:38:27 +0000 (14:38 -0300)]
Bug 15836: Remove deprecated subroutines

It will take too much time to fix the failures here, given the
simplicity of the subroutines I would be in favor of deleting them and
continue the move on a separate bug report to use Koha::Object-objects

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I've checked that everything removed is no longer in use.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Fix failing tests
Jonathan Druart [Tue, 13 Nov 2018 17:32:16 +0000 (14:32 -0300)]
Bug 15836: Fix failing tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21782: Release team 18.11 in About
Marcel de Rooy [Thu, 8 Nov 2018 08:47:48 +0000 (09:47 +0100)]
Bug 21782: Release team 18.11 in About

[1] Moved the (usual) 18.05 positions to the Dev section.
[2] Added the 18.11 positions to the Release team section.

Test plan:
[1] Look at About/Koha team.
[2] Compare with roles 18.05 and roles 18.11.

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: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20966: (follow-up) Add template variable filter; Fix table export
Owen Leonard [Mon, 29 Oct 2018 13:40:20 +0000 (13:40 +0000)]
Bug 20966: (follow-up) Add template variable filter; Fix table export

This patch makes to corrections:

1. The "$raw" filter has been added to the column configuration
2. The columns configuration now specifies which columns are exported in
   Copy, Excel, etc. operations.

To test, apply the patch and test the various table export buttons on a
both a closed and open basket. Confirm that the 'Modify' and 'Cancel'
columns are not exported.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=20996

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20966: Add column configuration to table of orders in a basket
Owen Leonard [Tue, 19 Jun 2018 17:02:14 +0000 (17:02 +0000)]
Bug 20966: Add column configuration to table of orders in a basket

This patch adds column configuration to the table of orders in a basket.
It replaces the "Show all details" checkbox which previously was used to
show the hidden "tax included" columns. Now those columns are hidden by
default in the columns configuration file.

To test, apply the patch and view a basket with multiple orders. Test
all DataTables functionality (paging, sorting, filtering) including
showing and hiding columns.

Test with both an open and a closed basket.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=20996

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: DBRev 18.06.00.060
Nick Clemens [Tue, 13 Nov 2018 16:21:22 +0000 (16:21 +0000)]
Bug 15836: DBRev 18.06.00.060

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: (follow-up) Fix display input in any situations
Jonathan Druart [Tue, 13 Nov 2018 15:04:22 +0000 (12:04 -0300)]
Bug 15836: (follow-up) Fix display input in any situations

Koha::ClassSplitRule->regexs returns an array

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Remove debug statement
Jonathan Druart [Tue, 13 Nov 2018 14:51:44 +0000 (11:51 -0300)]
Bug 15836: Remove debug statement

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Fix deletion of class sources
Jonathan Druart [Tue, 13 Nov 2018 14:51:04 +0000 (11:51 -0300)]
Bug 15836: Fix deletion of class sources

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: (follow-up) Fix filters
Katrin Fischer [Thu, 1 Nov 2018 11:58:33 +0000 (11:58 +0000)]
Bug 15836: (follow-up) Fix filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Fix DB structure
Jonathan Druart [Thu, 8 Nov 2018 19:22:32 +0000 (16:22 -0300)]
Bug 15836: Fix DB structure

That was a leftover from the first approach, this table must not be
modified!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Fix display input in any situations
Jonathan Druart [Sun, 16 Sep 2018 23:25:24 +0000 (16:25 -0700)]
Bug 15836: Fix display input in any situations

Fix when switching an existing rule to RegEx

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Handle non-existent regexs
Jonathan Druart [Fri, 27 Jul 2018 12:59:02 +0000 (09:59 -0300)]
Bug 15836: Handle non-existent regexs

For other types of split rules

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Add missing svc script
Jonathan Druart [Wed, 18 Jul 2018 15:48:08 +0000 (12:48 -0300)]
Bug 15836: Add missing svc script

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Add tests
Jonathan Druart [Tue, 17 Jul 2018 18:55:16 +0000 (15:55 -0300)]
Bug 15836: Add tests

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Mark C4::ClassSource subs DEPRECATED
Jonathan Druart [Fri, 22 Jun 2018 15:21:01 +0000 (12:21 -0300)]
Bug 15836: Mark C4::ClassSource subs DEPRECATED

These subs are no longer used from scripts and should be removed. It
should be done on a separate bug report given that additional work is
needed

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: Add the ability to defined custom methods to split call number in labels
Jonathan Druart [Thu, 21 Jun 2018 21:19:36 +0000 (18:19 -0300)]
Bug 15836: Add the ability to defined custom methods to split call number in labels

Currently the call number splitting seems to be mostly implemented for
DDC and LC classifications.
Those are both not very common in some countries.
A lot of libraries use their own custom classification schemes so the call number
plitting is something that should be individually configurable.

This enhancement adds the ability to define custom splitting rules based
on regular expressions.

How does it work so far?
From C4/Labels/Label.pm there are 3 differents splitting methods defined, depending on items.cn_source.
  if cn_source is "lcc' or 'nlm' we split using Library::CallNumber::LC
  if cn_source is 'ddc' we split using a in-house method
Finally there is a fallback method to split on space
And nothing else is done for other cn_source

The idea of this patch is to mimick what was done for the "filing rules" and add
the ability to define "splitting rules" that will be used by the "Classification sources".
A classification source will then have:
  * a filing rule used to sort items by callnumbers
  * a splitting rule used to print labels

To acchieve this goal this enhancement will do the following
modifications at DB level:
* New table class_split_rules
* New column class_sources.class_split_rule

Test plan:
* Execute the update database entry to create the new table and
column.
I. UI Changes
a) Create/modify/delete a filing rule
b) Create/modify/delete a splitting rule
c) Create/modify/delete a classification source
=> A filing rule or splitting rule cannot be removed if used by a
classification source

II. Splitting rule using regular expressions
a) Create a splitting rule using the "Splitting routine" "RegEx"
b) Define several regular expressions, they will be applied one after
the other in the same order you define them.
Something like:
  s/\s/\n/g         # Break on spaces
  s/(\s?=)/\n=/g    # Break on = (unless it's done already)
  s/^(J|K)\n/$1 /   # Remove the first break if callnumber starts with J or K
c) You can test the regular expressions using filling the textarea with
a list of callnumbers. Then click "Test" and confirm the callnumbers are
split how you expected.
d) Finally create a new classification source that will use this new
splitting rule.

III. Print the label!
a) Create a layout. It should have the "Split call numbers" checkbox
ticked, and display itemcallnumber
b) Use this layout to export labels, use items with different
classification source ('lcc', 'ddc', but also the new one you have
create)
=> The callnumbers should have been split according to the regex you
defined earlier!

Notes:
* The update database entry fill the class_sources.class_split_rule
with the value of class_sources.class_sort_rule
If default rules exist it will not work, we should add a note in the
release notes (would be enough?)
* C4::ClassSplitRoutine::* should be moved to Koha::ClassSplitRule,
but it sounded better to keep the same pattern as ClassSortRoutines
* Should not we use a LONGTEXT for class_split_rules.split_regex instead
of VARCHAR(255)?

* class_sources.sql should be filled for other languages before pushed
to master!

IMPORTANT NOTES: The regular expressions are stored as it, and eval is
used to evaluate it (perlcritic raises a warning about it (Expression
form of "eval"). It can lead to serious security issues (execution of
arbitrary code on the server), especially if the modifier 'e' is used.
We could then remedy the situation with one of these following points:
- Assume that this DB data is safe (We can add a new permission?)
- Assume that the data is not safe and deal with possible attack
Cons: how be sure we are exhaustive? Making sure it matches ^s///[^e/]*$
would be enough?
- Use Template Toolkit syntax instead (Really safer?)
  [% callnumber.replace('\s', '\n').replace ... %]
- Cut the regex parts: find, replace, modifiers
like we already do for Marc modification template. Cons: we are going to
have escape problems, the "find" and "replace" parts should not be
handle the same way (think "\n", "\\n", "\1", "\s", etc.)
I did not manage to implement this one easily.

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: UI changes
Jonathan Druart [Thu, 21 Jun 2018 16:43:55 +0000 (13:43 -0300)]
Bug 15836: UI changes

The script admin/classsources.pl has been adjusted to follow usual
patterns used in other Koha scripts.
$op can be add_source, add_source_validate, etc.
Deletion steps have been removed (there is a JS confirmation box) to
simplify both script and template.

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15836: DB changes
Jonathan Druart [Thu, 21 Jun 2018 15:57:09 +0000 (12:57 -0300)]
Bug 15836: DB changes

Sponsored-by: Goethe-Institut
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20356: DBRev 18.06.00.059
Nick Clemens [Tue, 13 Nov 2018 14:42:43 +0000 (14:42 +0000)]
Bug 20356: DBRev 18.06.00.059

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20356: Add EmailSMSSendDriverFromAddress system preference
David Gustafsson [Wed, 7 Mar 2018 15:40:07 +0000 (16:40 +0100)]
Bug 20356: Add EmailSMSSendDriverFromAddress system preference

Add EmailSMSSendDriverFromAddress system preference for overriding Email
SMS send driver from address.

How to test:
1) Run tests in t/db_dependent/Letters.t
2) All tests should pass

Sponsored-by: Gothenburg University Library
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21775: Logout before trying to login
Jonathan Druart [Mon, 12 Nov 2018 20:05:29 +0000 (17:05 -0300)]
Bug 21775: Logout before trying to login

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21706: (QA follow-up) Fix tabs
Tomas Cohen Arazi [Wed, 31 Oct 2018 14:25:40 +0000 (11:25 -0300)]
Bug 21706: (QA follow-up) Fix tabs

Not all href's should have parameters URI encoded. Because sometimes
they are just where for use by JavaScript libraries which fail in that
situations. For fixed-lenght fields we use @ as the subfield code and it
breaks the bootstrap tabs if we URI encode the '@'.

This fixes the tabs issues on fixed-lenght fields in the authority type
editing pages.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
5 years agoBug 21706: (follow-up) Fix subfield delete button
Tomas Cohen Arazi [Mon, 29 Oct 2018 14:25:58 +0000 (11:25 -0300)]
Bug 21706: (follow-up) Fix subfield delete button

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
5 years agoBug 21706: (follow-up) remove unused template params
Tomas Cohen Arazi [Mon, 29 Oct 2018 13:51:39 +0000 (10:51 -0300)]
Bug 21706: (follow-up) remove unused template params

The original patch removed the need to add URLs to the template
variables. This patch removes that in the controller.

Bonus: fixes 'html' filter in URL replacing it by 'uri'.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
5 years agoBug 21706: Make authority framework subfield links work (TT filter)
Tomas Cohen Arazi [Mon, 29 Oct 2018 13:44:46 +0000 (10:44 -0300)]
Bug 21706: Make authority framework subfield links work (TT filter)

This patch removes URL building from the controller
and does it on the templates, using the
right 'uri' filter for the query parameters.

To test:
- Go to Home > Administration > Athority types
- On any of the listed frameworks, pick the 'MARC structure' action in
the dropdown
- On any subfield, hover on the actions dropdown
=> FAIL: The URLs are wrongly formed
- Click on the links
=> FAIL: You get errors because of the bad URL
- Apply this patch
- Reload the 'MARC structure' page
- On any subfield, hover on the actions dropdown
=> SUCCESS: LInks look correct
- Click on any of them
=> SUCCESS: They work!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21526: Fix search result pages (url vs uri vs raw)
Jonathan Druart [Wed, 31 Oct 2018 16:48:47 +0000 (13:48 -0300)]
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)

Please test deeply!

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21526: (follow-up) Use the 'url' filter when needed
Jonathan Druart [Wed, 31 Oct 2018 17:31:36 +0000 (14:31 -0300)]
Bug 21526: (follow-up) Use the 'url' filter when needed

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21526: Use the 'url' filter when needed
Jonathan Druart [Mon, 29 Oct 2018 19:16:17 +0000 (16:16 -0300)]
Bug 21526: Use the 'url' filter when needed

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21787: Remove unecessary test from GetHardDueDate.t
Jonathan Druart [Thu, 8 Nov 2018 14:21:59 +0000 (11:21 -0300)]
Bug 21787: Remove unecessary test from GetHardDueDate.t

See description on the bug report for more info.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21804: Remove C4::Accounts::getcharges again
Josef Moravec [Fri, 9 Nov 2018 16:54:34 +0000 (16:54 +0000)]
Bug 21804: Remove C4::Accounts::getcharges again

Test plan:
1) git grep getcharges
  -> should return no occurences
2) prove t/db_dependent/Accounts.t
  -> should pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21775: Add selenium tests for audio alerts
Jonathan Druart [Tue, 6 Nov 2018 18:12:32 +0000 (15:12 -0300)]
Bug 21775: Add selenium tests for audio alerts

To prevent future regressions

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 21413: (QA follow-up) Fix tests
Tomas Cohen Arazi [Fri, 9 Nov 2018 13:54:12 +0000 (10:54 -0300)]
Bug 21413: (QA follow-up) Fix tests

No assumption on the order in which restults are returned should be made
(we don't control existing data on the tests). So it should only check
existence of expected records in the results, and absense.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
5 years agoBug 19349: DBRev 18.06.00.058
Nick Clemens [Thu, 8 Nov 2018 21:05:49 +0000 (21:05 +0000)]
Bug 19349: DBRev 18.06.00.058

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19349: (QA follow-up) Cosmetic changes
Marcel de Rooy [Fri, 2 Nov 2018 10:17:46 +0000 (11:17 +0100)]
Bug 19349: (QA follow-up) Cosmetic changes

[1] Construction with a // b instead of a; unless( a ) b;
[2] Error checking on subfieldCode
[3] Add explanation how to fill preference

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 19349: Store record's creator and last modifier in record
Julian Maurice [Wed, 20 Sep 2017 12:58:07 +0000 (14:58 +0200)]
Bug 19349: Store record's creator and last modifier in record

Test plan:
1. Run updatedatabase.pl
2. Set sysprefs MarcFieldForCreatorId, MarcFieldForCreatorName,
   MarcFieldForModifierId, MarcFieldForModifierName
3. Create a new biblio
4. Verify that the fields are correctly filled
5. Logout and login as another user
6. Modify the same biblio
7. Verify that only the fields for last modifier have been modified

Works perfectly.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21205: (follow-up) Fix column name - itemnumbers -> itemnumber
Josef Moravec [Tue, 21 Aug 2018 13:16:02 +0000 (13:16 +0000)]
Bug 21205: (follow-up) Fix column name - itemnumbers -> itemnumber

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>
5 years agoBug 21205: Replace C4::Items::GetOrderFromItemnumber calls
Jonathan Druart [Mon, 6 Aug 2018 21:48:29 +0000 (18:48 -0300)]
Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls

This is done to ease the move of C4::Items (bug 18252) to Koha::Items

  my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
will become
  my @itemnumbers = $order_object->items->get_column('itemnumbers');

Test plan:
- Create an order with several items
- Receive some items

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>
5 years agoBug 18507: Shibboleth auto-provisioning - Sync
Matthias Meusburger [Tue, 28 Nov 2017 16:01:09 +0000 (16:01 +0000)]
Bug 18507: Shibboleth auto-provisioning - Sync

This patch allows to update borrowers informations with Shibboleth attributes
upon login.

Test plan:
1. In $KOHA_CONF, check that //shibboleth/sync is set to 1
2. Find an existing user and change one of the values mapped with a Shibboleth attribute
3. Log in using Shibboleth
4. Check that the value has been updated with the Shibboleth attribute.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comments posted on Bugzilla.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21413: Call AddBiblio in list context
Tomas Cohen Arazi [Thu, 8 Nov 2018 19:40:06 +0000 (16:40 -0300)]
Bug 21413: Call AddBiblio in list context

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12365: (RM follow-up) Fix schema files
Nick Clemens [Thu, 8 Nov 2018 18:00:13 +0000 (18:00 +0000)]
Bug 12365: (RM follow-up) Fix schema files

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Fix QA failure - filter not found
Jonathan Druart [Wed, 31 Oct 2018 14:13:49 +0000 (11:13 -0300)]
Bug 15395: Fix QA failure - filter not found

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Use POSIX::setlocale
Jonathan Druart [Wed, 31 Oct 2018 14:02:56 +0000 (11:02 -0300)]
Bug 15395: Use POSIX::setlocale

To keep compatibility with jessie (that have Message::Locales 1.23, so
without setlocale)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Do not process template files that do not use i18n.inc
Julian Maurice [Thu, 25 Oct 2018 13:04:46 +0000 (15:04 +0200)]
Bug 15395: Do not process template files that do not use i18n.inc

It should make the string extraction process a little faster

For the record, I timed some parts of the process to see why it was so
slow, and without surprises the most time-consuming task is the Perl
code analysis by PPI with an average time of 50ms by "template block" on
my machine.
Multiply that by the number of template blocks (approximatively 900),
that gives us 45 seconds just for this task.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Make QA test script happy
Julian Maurice [Thu, 25 Oct 2018 12:06:03 +0000 (14:06 +0200)]
Bug 15395: Make QA test script happy

It is not totally happy because of the template file used in tests.
It has line breaks inside TT directives and QA test script complains
because line breaks in TT directives confuse the current translatable
strings extractor.
However this patchset (along with bug 20988) will hopefully make the
current extractor obsolete and thus make the 'no-line-breaks' rule
useless

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Add unit tests for extract_messages_from_templates
Julian Maurice [Thu, 25 Oct 2018 11:44:43 +0000 (13:44 +0200)]
Bug 15395: Add unit tests for extract_messages_from_templates

Because LangInstaller use FindBin to define some paths, the test
produces warnings about a missing directory. I'm not sure how we can
avoid that.

Test plan:
  1. prove t/LangInstaller.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Do not use nl_putenv, use $ENV instead
Julian Maurice [Thu, 25 Oct 2018 09:22:24 +0000 (11:22 +0200)]
Bug 15395: Do not use nl_putenv, use $ENV instead

nl_putenv is only useful on Windows systems

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Make msgmerge quiet
Julian Maurice [Thu, 25 Oct 2018 08:48:23 +0000 (10:48 +0200)]
Bug 15395: Make msgmerge quiet

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15395: Allow correct handling of plural translation
Julian Maurice [Tue, 15 Dec 2015 01:31:03 +0000 (02:31 +0100)]
Bug 15395: Allow correct handling of plural translation

Locale::Maketext does not allow correct handling of plural translation
for languages that have more than one plural forms.
Locale::Messages does.

So Koha::I18N is now a wrapper around Locale::Messages, just like
Locale::TextDomain, and export the same symbols as Locale::TextDomain.
You can refer to documentation of Locale::TextDomain to know how to use
exported subroutines.

Example usage:
  __("Hi")
  __x("Hi {name}", name => 'Bob')
  __n("item", "items", $num_items)
  __nx("one item", "{count} items", $num_items, count => $num_items)
  __p("Bibliographic record", "item")

This patch also brings Koha::I18N power to Template::Toolkit templates
by adding a TT plugin.
This plugin can be used like this:

[%# USE the plugin and define some macros %]
[% PROCESS 'i18n.inc' %]

[%# tn is the equivalent of __n %]
[%# macro names can't start with underscore, t is for "translate" %]
[% tn('item', 'items', num_items) %]
Extraction of strings from templates is a bit complicated and use
Template::Parser and PPI. Template is compiled into Perl code and then
analyzed by PPI. It is slow, but should be correct even with complex
constructions.

Remove dependency to Locale::Maketext and Locale::Maketext::Lexicon
Add dependency to Locale::Messages and PPI

Test plan for translation in Perl code:
1. Open a .pl script or .pm module with your favorite text editor
2. Add 'use Koha::I18N;' in the beginning of file
3. Use one of the subroutines exported by Koha::I18N and be sure to have
   a way to visualize the result (pass result to the template for
   example, or simply warn and watch the log file)
4. cd misc/translator && ./translate update fr-FR # try other languages
5. Open misc/translator/po/fr-FR-messages.po and translate your
   string(s)
   You may need to change the "Plural-Forms" header. See
   https://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html
6. ./translate install fr-FR
7. Use your web browser to go to the page that should display the
   translation, change language and verify the translation is correct
8. prove t/Koha/I18N.t

Test plan for translation in templates:
1. Open a template file (.tt or .inc) with your favorite text editor
2. Add the PROCESS directive mentioned above in the beginning of file
3. Use one of the t* macros defined in i18n.inc. They are used like
   their "__" equivalent, with one difference: the 'x' variants take a
   hashref instead of a hash as last parameter
4. cd misc/translator && ./translate update fr-FR
5. Open misc/translator/po/fr-FR-messages.po and translate your
   string(s)
6. ./translate install fr-FR
7. Use your web browser to go to the page that should display the
   translation, change language and verify the translation is
   correct

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>
5 years agoBug 15184: Fix bad merge conflict with created_by
Jonathan Druart [Thu, 8 Nov 2018 14:03:15 +0000 (11:03 -0300)]
Bug 15184: Fix bad merge conflict with created_by

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Fix TT filter
Katrin Fischer [Sun, 28 Oct 2018 16:35:09 +0000 (16:35 +0000)]
Bug 15184: Fix TT filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Add missing html filters
Jonathan Druart [Mon, 15 Oct 2018 19:52:41 +0000 (16:52 -0300)]
Bug 15184: Add missing html filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Improve styling
Jonathan Druart [Sun, 16 Sep 2018 16:25:16 +0000 (09:25 -0700)]
Bug 15184: Improve styling

- Move "Show inactive" checkbox closer to the "Show inactive" text.
- Put more space between the "Show inactive" checkbox and the "The
original..." text
- Add "Check boxes to duplicate the original values" at the top of the
fieldset

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Change permission (+x) on .pl
Jonathan Druart [Sat, 15 Sep 2018 21:00:31 +0000 (14:00 -0700)]
Bug 15184: Change permission (+x) on .pl

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Set created_by to the logged in user
Jonathan Druart [Fri, 7 Sep 2018 16:46:12 +0000 (13:46 -0300)]
Bug 15184: Set created_by to the logged in user

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Do copy items for not a serial OR if items are created on ordering
Jonathan Druart [Fri, 7 Sep 2018 16:43:15 +0000 (13:43 -0300)]
Bug 15184: Do copy items for not a serial OR if items are created on ordering

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Remove the checkboxes on the last step
Jonathan Druart [Fri, 31 Aug 2018 16:40:08 +0000 (13:40 -0300)]
Bug 15184: Remove the checkboxes on the last step

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: add missing filters
Jonathan Druart [Wed, 29 Aug 2018 18:17:40 +0000 (15:17 -0300)]
Bug 15184: add missing filters

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Add POD
Jonathan Druart [Wed, 29 Aug 2018 18:06:42 +0000 (15:06 -0300)]
Bug 15184: Add POD

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Add the ability to duplicate existing order lines
Jonathan Druart [Fri, 27 Jul 2018 18:48:31 +0000 (15:48 -0300)]
Bug 15184: Add the ability to duplicate existing order lines

This patchset adds the ability to duplicate existing order lines to a
given basket. It will help acquisitions of serials of when the same
publication is ordered frequently.

The workflow will be:
- Create a new basket
- Use the "Add to basket" button
- Select the new entry "From existing orders (copy)"
- Search and select the order you want to duplicate
- Define some default values for these orders
- Duplicate!

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15184: Add the ordernumbers filters to GetHistory
Jonathan Druart [Fri, 27 Jul 2018 18:48:23 +0000 (15:48 -0300)]
Bug 15184: Add the ordernumbers filters to GetHistory

It adds the ability to return the result of GetHistory given a list a
ordernumbers

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>