]> git.koha-community.org Git - koha.git/log
koha.git
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>
5 years agoBug 15184: Prepare the ground - Move funds and sort fields autoupdate
Jonathan Druart [Fri, 27 Jul 2018 18:47:06 +0000 (15:47 -0300)]
Bug 15184: Prepare the ground - Move funds and sort fields autoupdate

We are going to reuse the same logic: when a fund is selected the
statistic values are automatically updated.
Let move it to make it reusable more easily and isolate the code.

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: Prepare the ground - Move order search filters
Jonathan Druart [Fri, 27 Jul 2018 18:46:32 +0000 (15:46 -0300)]
Bug 15184: Prepare the ground - Move order search filters

We are going to reuse these filters so we move it to a separate include
file.

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 20312: DBRev 18.06.00.057
Nick Clemens [Thu, 8 Nov 2018 15:42:53 +0000 (15:42 +0000)]
Bug 20312: DBRev 18.06.00.057

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20312: Add missing filters
Nick Clemens [Thu, 8 Nov 2018 15:51:37 +0000 (15:51 +0000)]
Bug 20312: Add missing filters

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20312: Compiled CSS
Nick Clemens [Thu, 8 Nov 2018 15:41:18 +0000 (15:41 +0000)]
Bug 20312: Compiled CSS

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20312: (QA follow-up) Make display syspref driven
Martin Renvoize [Wed, 31 Oct 2018 13:53:16 +0000 (13:53 +0000)]
Bug 20312: (QA follow-up) Make display syspref driven

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20312: Add a link to last consulted patron
Pierre-Luc Lapointe [Fri, 17 Aug 2018 20:45:23 +0000 (16:45 -0400)]
Bug 20312: Add a link to last consulted patron

This new feature adds a link to the last patron consulted
in the staff site. It uses cookies to save this information.
When a staff site user accesses a patron record, the ID, name
and card number of the patron will be saved in the cookie.

To test:
1- Apply the patch
2- Go to a patron details' page
4- Go to another page
4- Verify that the link "Last patron" appears on the top-right
   corner of the screen
5- Click on the link
6- Verify that you are at the patron's checkout page
7- Click on the "X" button next to the "Last patron" link
8- The link should be gone
9- Go to another page
10- The link shouldn't appear (until the next patron detail's
    page)

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 12365: Fix GetHardDueDate.t test
Jonathan Druart [Thu, 8 Nov 2018 14:15:04 +0000 (11:15 -0300)]
Bug 12365: Fix GetHardDueDate.t test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21079: DBRev 18.06.00.056
Nick Clemens [Thu, 8 Nov 2018 15:35:50 +0000 (15:35 +0000)]
Bug 21079: DBRev 18.06.00.056

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21079: (follow-up) Move from Try::Tiny to eval
Andrew Isherwood [Thu, 8 Nov 2018 14:28:48 +0000 (14:28 +0000)]
Bug 21079: (follow-up) Move from Try::Tiny to eval

In line with similar examples already in Koha, we now eval the
transaction, instead of putting it in a try/catch block.

This patch also addressed the other comments made in
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21079#c10

- AutoCommit & RaiseError are now reset
- Don't set the version if the update fails

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21079: Unify metadata schema across backends
Andrew Isherwood [Tue, 17 Jul 2018 13:49:47 +0000 (14:49 +0100)]
Bug 21079: Unify metadata schema across backends

This patch contains a database upgrade that takes appropriate metadata
properties relating to articles in the FreeForm backend and creates
metadata that corresponds with the metadata being created by the BLDSS
backend. This enables us to create templates that can display metadata
equally across any backends that contain this metadata;

To test:
- Ensure you have at least one article request created with the FreeForm backend
- Check the metadata for the request:
  => TEST: You should have properties such as 'article_title', 'article_author' populated
  => TEST: You should NOT have properties such as 'container_title' &
  'pages'
- Run the upgrade
  => TEST: For the same requests you should now have the following
  properties (if their values were originally populated):
    - container_title (this should correspond with what *was* 'title')
    - title (this should correspond with 'article_title')
    - pages (this should correspond with 'article_pages')
    - author (this should correspond with 'article_author')

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21413: Fix condition to avoid operator bnding isssues
Tomas Cohen Arazi [Wed, 7 Nov 2018 16:43:52 +0000 (13:43 -0300)]
Bug 21413: Fix condition to avoid operator bnding isssues

The original WHERE condition wasn't enclosed in parenthesis, and hence
was subject to binding precedence issues in some situations.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21413: (QA follow-up) Rename new option
Katrin Fischer [Sat, 27 Oct 2018 13:08:18 +0000 (13:08 +0000)]
Bug 21413: (QA follow-up) Rename new option

Trying to make the terminology a little more consistent
as we already use items instead of copies directly
above and leaning on the description of the page it
refers to.

Old:
Skip copies marked as waiting holds

New:
Skip items on hold awaiting pickup

Skip items on hold awaiting pickup

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21413: Inventory - Skip items with waiting holds
Kyle M Hall [Wed, 26 Sep 2018 14:41:14 +0000 (11:41 -0300)]
Bug 21413: Inventory - Skip items with waiting holds

This patch enables items to be skipped for inventory stocktaking
if the item is currently a waiting hold. The intention is to skip
items that should be on the holds waiting shelf in the library.

Test Plan:
1) Apply this patch
2) Generate a list of barcodes ordered by callnumber
3) Select one of those items and place it on hold, then confirm the hold
4) Remove that barcode from the list of barcodes
5) Browse to the inventory tool, choose your barcodes file
6) Run the inventory tool with that barcode file.
7) Note the tool says that item should have been scanned
8) Click the browsers back button to return to the previous page
9) Check the checkbox for "Skip copies marked as waiting holds"
10) Run the tool again, not it does not flag that item as previously

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21413: Unit tests
Tomas Cohen Arazi [Wed, 26 Sep 2018 14:08:59 +0000 (11:08 -0300)]
Bug 21413: Unit tests

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Items/GetItemsForInventory.t
=> FAIL: Tests fail!
- Apply the next patches on the bug
- Run:
 k$ prove t/db_dependent/Items/GetItemsForInventory.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12365: DBRev 18.06.00.055
Nick Clemens [Thu, 8 Nov 2018 12:09:37 +0000 (12:09 +0000)]
Bug 12365: DBRev 18.06.00.055

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12365: (follow-up) Fixing broken circ rules table
Aleisha Amohia [Mon, 22 Oct 2018 23:31:29 +0000 (23:31 +0000)]
Bug 12365: (follow-up) Fixing broken circ rules table

Adding filters to note to satisfy qa test tools

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12365: (follow-up) Putting backticks in atomicupdate
Aleisha Amohia [Thu, 18 Oct 2018 02:36:35 +0000 (02:36 +0000)]
Bug 12365: (follow-up) Putting backticks in atomicupdate

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12365: (follow-up) Adding maxlength attribute and popover
Aleisha Amohia [Wed, 4 Jul 2018 00:12:21 +0000 (00:12 +0000)]
Bug 12365: (follow-up) Adding maxlength attribute and popover

Test that you can't add a note of more than 100 characters.
Test notes with rules, notes are hidden by 'View note' and the
popover correctly displays note.
View the note by hovering over the link
I've moved the Note column so the popover displays nicely and doesn't
cover the buttons. I've also changed the placement so that it doesn't
cover information in the row.

Update: Test that you can edit the note when clicking 'Edit' and that
behaviour is the same for editing all other fields

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12365: Notes for rules
Aleisha Amohia [Mon, 19 Jun 2017 19:47:52 +0000 (19:47 +0000)]
Bug 12365: Notes for rules

This patch adds a note column to the circ and fine rules to act as a
description line for the rule.

To test:
1) Apply patch, update database (may have to also update schema)
2) Go to Admin -> Circ and fine rules
3) Scroll to the right, notice new Note column
4) Confirm it works to create a brand new rule with a Note
5) Confirm it works to modify an existing rule with a Note

Sponsored-by: Catalyst IT
Lee Jamison <ldjamison@marywood.edu> rescued this patch.
It is a clean re-build of attachments 61865 and 63902
to fix the merge conflict introduced during application of both
attachments.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: macon lauren KohaCon17 <caballeromaricon@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21770: Allow html_entity for href
Jonathan Druart [Tue, 6 Nov 2018 14:03:28 +0000 (11:03 -0300)]
Bug 21770: Allow html_entity for href

We certainly should not expect this filter to be used much for href, but
we have one occurrence that needs it.

Test plan:
t/template_filters.t and xt/find-missing-filters.t must return green

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21770: Add tests for html_entity
Jonathan Druart [Tue, 6 Nov 2018 13:55:50 +0000 (10:55 -0300)]
Bug 21770: Add tests for html_entity

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20486: Add --marc_conditions option to export_records.pl
David Gustafsson [Fri, 23 Mar 2018 16:32:30 +0000 (17:32 +0100)]
Bug 20486: Add --marc_conditions option to export_records.pl

Add --marc_conditions option to export_records.pl script, for
excluding records based on conditions applied to MARC-record
data.

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

Sponsored-by: Gothenburg University Library
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21755: Show patron updated date in circ menu
Fridolin Somers [Fri, 2 Nov 2018 08:58:06 +0000 (09:58 +0100)]
Bug 21755: Show patron updated date in circ menu

In borrowers table the column updated_on stores the last updated date and time.
Display this in the circ menu.

Test plan:
1) Go to a patron details page /cgi-bin/koha/members/moremember.pl
2) Look at left menu, you see "Updated on" and a date and time
3) Edit this patron and save
4) Check that "Updated on" changed
5) Click on each tab of menu to check this date is displayed

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21015: Remove unecessary 'use Koha::Schema' statements in t/
Jonathan Druart [Wed, 17 Oct 2018 18:47:29 +0000 (15:47 -0300)]
Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21015: fix performance issue with C4::Members
Joonas Kylmälä [Fri, 29 Jun 2018 08:09:41 +0000 (11:09 +0300)]
Bug 21015: fix performance issue with C4::Members

loading Koha::Schema ("use Koha::Schema;") takes significantly time as
it loads almost a couple hundred classes. Koha::Database has done that
already once and we can use it to get the ResultSet "Borrower" as
well, so let's use that. This also make the code more unified because
Koha::Database is used throughout the code instead of Koha::Schema.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 12258: (QA follow-up) Add some missing rrrrrrs
Katrin Fischer [Thu, 1 Nov 2018 12:11:35 +0000 (13:11 +0100)]
Bug 12258: (QA follow-up) Add some missing rrrrrrs

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=21158

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21158: Add cronjob references to the system preference descriptions if a cronjob...
Caroline Cyr La Rose [Fri, 3 Aug 2018 20:03:10 +0000 (16:03 -0400)]
Bug 21158: Add cronjob references to the system preference descriptions if a cronjob is required

This patch adds references to cronjobs in the description of some system preferences.

The following system preference description were modified:
- StaticHoldsQueueWeight
- ExpireReservesMaxPickUpDelay
- AutoResumeSuspendedHolds
- finesMode
- DefaultLongOverdueLostValue
- DefaultLongOverdueChargeValue
- PatronSelfRegistrationExpireTemporaryAccountsDelay
- PatronSelfRegistrationVerifyByEmail
- EnhancedMessagingPreferences
- NewItemsDefaultLocation
- InProcessingToShelvingCart
- ReturnToShelvingCart
- ReturnToShelvingCart
- AuthorityMergeLimit
- OpacBrowser
- OpacCloud
- UsageStats
- PurgeSuggestionsOlderThan
- MembershipExpiryDaysNotice

To test, check the above mentioned system preferences to make sure the sentence is there and it is correct.

Followed test plan and patch is as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=12258

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21628: (follow-up) Indentation and filter corrections
Owen Leonard [Mon, 29 Oct 2018 12:32:58 +0000 (12:32 +0000)]
Bug 21628: (follow-up) Indentation and filter corrections

This patch modifies the new waiting_holds.inc to fix the indentation. A
template variable filter has been added to quiet QA tool warnings.
Buttons are now styled as Bootstrap buttons.

To test, apply the patch and view the holds report. Confirm that
everything looks correct. Validate the HTML and confirm that there are
no errors in the HTML of the body of the page.

Followed test plan, everything looked correct and no HTML errors on
waitingreserves.tt found by HTML validator

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21628: Simplify holds awating pickup report
Nick Clemens [Mon, 22 Oct 2018 15:20:45 +0000 (15:20 +0000)]
Bug 21628: Simplify holds awating pickup report

To test:
1 - Place a number of holds
2 - Check in the items and confirm the holds
3 - Visit /cgi-bin/koha/circ/waitingreserves.pl
4 - View the report
5 - Apply patch
6 - Confirm that the report looks the same
7 - Confirm cancelling holds works as before

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Followed test plan, patch worked as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21715: Ease translation of account and account offset type descriptions
Tomas Cohen Arazi [Mon, 29 Oct 2018 15:15:19 +0000 (12:15 -0300)]
Bug 21715: Ease translation of account and account offset type descriptions

This patch moves accounts-related descriptions into a single file to
ease finding them, and also encloses descriptions inside <span> tags to
make it easier to translate.

To test:
- Apply this patch
- Verify the templates work as expected
=> SUCCESS: No behaviour change
- Sign off :-D

Bonus: there were two cases in which the INCLUDE line used 'accountline'
as parameter, making it fail to pick the right account type!

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>
5 years agoBug 21719: Fix typos
Josef Moravec [Mon, 29 Oct 2018 23:36:11 +0000 (23:36 +0000)]
Bug 21719: Fix typos

This patch was generated using codespell

Test plan:
Read through changes and confirm they make sense

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=21706

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21433: Update two-column templates with Bootstrap grid: Tools part 1
Owen Leonard [Thu, 3 May 2018 16:06:37 +0000 (16:06 +0000)]
Bug 21433: Update two-column templates with Bootstrap grid: Tools part 1

This patch modifies several tools templates to use the
Bootstrap grid instead of YUI.

This patch also removes obsolete "text/javascript" attributes from
<script> tags in the modified templates.

To test, apply the patch and view the following pages, confirming that
they look correct at various browser widths:

 - Tools -> Automatic item modifications by age
   - View and edit rules
 - Tools -> Batch item modification start page
 - Tools -> Batch delete records
   - Starting page
   - Confirmation page
   - Completion page
 - Tools -> Batch record modification
   - Starting page
   - Confirmation page
   - Completion page
 - Tools -> Batch patron deletion/anonymization
   - Starting page
   - Confirmation page
   - Completion page
 - Tools -> CSV profiles
   - View and edit CSV profiles

Signed-off-by: “Lucas Gass” <lucas@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 21666: Replace unsupported use attribute with more widely supported attribute
David Cook [Thu, 25 Oct 2018 23:52:45 +0000 (10:52 +1100)]
Bug 21666: Replace unsupported use attribute with more widely supported attribute

search.js uses the 1=1004
author personal attribute which isn't supported by libraries like
Seattle Public Library.

This patch aligns search.js
with C4/Breeding.pm which uses the more widely supported 1=1003
author attribute.

To test:
1. Set up Seattle Public Library as a Z39.50 target
2. Try to search author using the Advanced Editor advanced search
3. Observe failure
4. Apply the patch
5. Try to search again
6. Observe successful retrieval of records

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
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>
5 years agoBug 18316: (follow-up) Don't let 'fields' be undef and adjust tests
Nick Clemens [Thu, 8 Nov 2018 01:50:34 +0000 (01:50 +0000)]
Bug 18316: (follow-up) Don't let 'fields' be undef and adjust tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 20602: Use weighted fields in OPAC simple search
Alex Arnaud [Wed, 18 Apr 2018 14:19:34 +0000 (14:19 +0000)]
Bug 20602: Use weighted fields in OPAC simple search

Test plan (having Koha working with Elasticsearch):
  - apply this patch,
  - try searches with and without weight defined on search fields

https://bugs.koha-community.org/show_bug.cgi?id=20262
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>
5 years agoBug 18316: DBRev 18.06.00.054
Nick Clemens [Wed, 7 Nov 2018 23:08:03 +0000 (23:08 +0000)]
Bug 18316: DBRev 18.06.00.054

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 18316: (QA follow-up) Add final missing filter
Martin Renvoize [Mon, 29 Oct 2018 14:40:06 +0000 (14:40 +0000)]
Bug 18316: (QA follow-up) Add final missing filter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 18316: (follow-up) remove use_dis_max
Alex Arnaud [Tue, 9 Oct 2018 14:27:20 +0000 (14:27 +0000)]
Bug 18316: (follow-up) remove use_dis_max

It is true by default on ES 5 and has been removed on ES 6

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 18316: (follow-up) Fix tests and update statement
Nick Clemens [Tue, 4 Sep 2018 12:46:30 +0000 (12:46 +0000)]
Bug 18316: (follow-up) Fix tests and update statement

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 18316: Fix field weight validation/deletion bug
David Gustafsson [Fri, 1 Jun 2018 09:39:45 +0000 (11:39 +0200)]
Bug 18316: Fix field weight validation/deletion bug

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 18316: Change search field weight field to decimal
David Gustafsson [Mon, 21 May 2018 12:24:36 +0000 (14:24 +0200)]
Bug 18316: Change search field weight field to decimal

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 18316: (follow-up) Koha::SearchField::search_marc_maps return a result set -...
Alex Arnaud [Mon, 23 Apr 2018 10:25:14 +0000 (10:25 +0000)]
Bug 18316: (follow-up) Koha::SearchField::search_marc_maps return a result set - code refactoring for gettings weighted fields - Koha::SearchFields::weighted_fields return a result set

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com>
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 18316: String changes
Alex Arnaud [Thu, 12 Apr 2018 16:13:29 +0000 (16:13 +0000)]
Bug 18316: String changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com>
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 18316: Add weighting/relevancy options to ES query on simple search
Nick Clemens [Wed, 21 Mar 2018 13:27:12 +0000 (13:27 +0000)]
Bug 18316: Add weighting/relevancy options to ES query on simple search

The idea is the following: if some search field(s) are weighted in
search engine config page, Koha will query ES on all fields plus those with
the coresponding weights. Else, search is done on the entire record with
no weighting. The advanced search page is unaffected by these changes

Test plan (having Koha working with Elasticsearch):
  - apply this patch
  - have some weights defined for various fields
  - try searches from the search bar and from the advanced search page
  - confirm weighting affects the relevancy (in expected ways)
      e.g.
      1. search for 'a' from advanced search, note results
      2. give 'title' a weight
      3. search for 'a' using the simple search bar
      4. results with 'a' in the title should now be more relevant
  - confirm search results on advanced search page are unaffected

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com>
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 18316: Ability to weight search fields
Alex Arnaud [Thu, 29 Mar 2018 14:20:59 +0000 (14:20 +0000)]
Bug 18316: Ability to weight search fields

Weight can be defined between 1 and 99.
only search fields mapped with biblios can be weighted

Test plan:
  - apply this patch,
  - update schema file (perl misc/devel/update_dbix_class_files.pl),
  - go to Administration > Search engine configuration,
  - in search fields tab, define weights for some fields and save,
  - check weights has been saved,
  - reset some weights (empty) and save,
  - check weights has been reset

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com>
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 21299: (QA follow-up) Rename module and subroutine
Marcel de Rooy [Thu, 13 Sep 2018 06:41:10 +0000 (08:41 +0200)]
Bug 21299: (QA follow-up) Rename module and subroutine

See QA request at comment7.
Removing camelcase from subroutinename.
Renaming module to Koha::Util::Navigation (after cmty feedback).

Test plan:
Run t/Koha/Util/Navigation.t.

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>
5 years agoBug 21299: Introduce localReferer in [opac-]changelanguage.pl
Marcel de Rooy [Mon, 30 Jul 2018 10:57:58 +0000 (12:57 +0200)]
Bug 21299: Introduce localReferer in [opac-]changelanguage.pl

With the work from the former patch, we now have a nice and easy replace..

NOTE: The additional logic in opac-changelanguage.pl is now also applied
to the intranet counterpart (changelanguage.pl). This effectively makes
changelanguage.pl no longer refer to external URLs (as the opac already
did by testing the referer). Might be just theoretical, but consistent.

Test plan:
Test changing language from various OPAC and staff locations.
Include language=[some_language] in the URL before changing language.
[Bonus] Test calling changelanguage.pl from another server. You should no
longer be referred back to the calling server. (See below.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Added link <a href="[mystaffserver]/cgi-bin/koha/changelanguage.pl?language=en">link</a> somewhere on external server.
Verified that without this patch, it hits the staff server and refers back to the caller. But with this patch, it refers to staff homepage.
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>
5 years agoBug 21299: Add localReferer function to Util module, add test
Marcel de Rooy [Mon, 30 Jul 2018 10:18:31 +0000 (12:18 +0200)]
Bug 21299: Add localReferer function to Util module, add test

Before implementing the change in [opac-]changelanguage, we define a new
function (in Koha/Util.pm) and add tests.

Test plan:
Run t/Koha/Util/localReferer.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
5 years agoBug 15494: DBRev 18.06.00.053
Nick Clemens [Wed, 7 Nov 2018 21:49:07 +0000 (21:49 +0000)]
Bug 15494: DBRev 18.06.00.053

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
5 years agoBug 15494: (follow-up) Update tests to generate their own data (no delete)
Nick Clemens [Mon, 24 Sep 2018 11:06:47 +0000 (11:06 +0000)]
Bug 15494: (follow-up) Update tests to generate their own data (no delete)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>