]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 26762: Modify template logic in opac-reserves.tt to avoid error
Owen Leonard [Wed, 21 Oct 2020 11:57:26 +0000 (11:57 +0000)]
Bug 26762: Modify template logic in opac-reserves.tt to avoid error

This patch makes a change to the OPAC hold template to prevent certain
cases where the output is invalid.

To reproduce, perform a search in the OPAC which will return some titles
which can be placed on hold and some which cannot.

 - Select all results (some holdable, some not)
 - Click the "Place hold" link
 - On the "Confirm holds" page the layout will be broken after the
   first instance of the message "There are no items that can be placed
   on hold."

To test, apply the patch and repeat the process above. After the patch
has been applied the "confirm holds" page should look correct.
Validating the HTML source should return no errors.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d10d24e42aaaf4b2e23b52b94aa14ab8745b396f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26756: Fix quotes showing behind some system preference descriptions
Owen Leonard [Tue, 20 Oct 2020 16:04:11 +0000 (16:04 +0000)]
Bug 26756: Fix quotes showing behind some system preference descriptions

This patch adds matching quotes to two OPAC preference descriptions
which were missing them.

To test, apply the patch and go to Administration -> System preferences.

- Open the "OPAC" tab.
- Check the descriptions of these preferences:
  - AllowPatronToSetCheckoutsVisibilityForGuarantor
  - AllowPatronToSetFinesVisibilityForGuarantor

There should be no trailing quotation mark.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2dab6ab31626970e3c9be841b610575060f8f344)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoRevert "Bug 26619: Cart - The "Print" button is only translated when you are in ...
Lucas Gass [Fri, 13 Nov 2020 21:36:34 +0000 (21:36 +0000)]
Revert "Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode"

This reverts commit e47f2132add2b132806caeeff1631059b0f1cba8.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26619: Cart - The "Print" button is only translated when you are in "More details...
Owen Leonard [Tue, 20 Oct 2020 11:22:07 +0000 (11:22 +0000)]
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode

This patch adds the "Print" string to datatables.js so that it can be
picked up for translation.

To test, apply the patch and add some items to the cart in the OPAC.

- Open the cart. You should see a button labeled "Print."
- The print button should work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings,
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/opac-tmpl/bootstrap/js/datatables.js for translation:

  msgid "Print"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

   > perl translate install fr-FR

- Switch to your newly translated language in the OPAC and
  repeat the test plan above. The translated strings should appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 599a6cb92e26e37857b344484d6c8b233555f0dc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25353: Correct eslint errors in additems.js
Owen Leonard [Mon, 19 Oct 2020 18:32:18 +0000 (18:32 +0000)]
Bug 25353: Correct eslint errors in additems.js

This patch makes minor changes to additem.js to correct errors
highlighted by eslint:

- Consistent indentation
- Notation of global and exported variables and functions
- Consistent use of the "var" declaration for all new variables
- Remove variables from function calls which aren't used

To test, apply the patch and use your preferred eslint-enabled tool to
check for errors. There should be none.

If you don't have eslint integrated in your development environment you
could use the online ESLint demo at https://eslint.org/demo.

The demo isn't configured to assume a browser environment with jQuery
present, so you'll have to modify the top line after pasting the
contents of additem.js:

/* global $ alert window __ */

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ebe08fb745b04899404bed5ceb00c891a518e89c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26526: Relabel checkout note column in OPAC
Katrin Fischer [Sat, 17 Oct 2020 15:08:59 +0000 (15:08 +0000)]
Bug 26526: Relabel checkout note column in OPAC

When checkout notes are active, there is currently a new
column labelled 'Note' in the checkouts table in OPAC.
When a note is added, this is sent to the library. For
the user it's not clear from the label, that these notes
are not personal, but for reporting to the library.
The new label "Report a problem" aims to make this clearer.

To test:
- Turn on AllowCheckoutNotes system preference
- Check out some items to your account
- Go to the OPAC
- Look at the list of checkouts
- Apply patch
- Reload the page and check the checkouts table again
- Verify the heading has changed from "Notes" to "Report a problem"
- Hover over the heading with your cursor to see some more info

Bonus: Patch adds an id "checkout-notes" to the header cell, that
will make it easier for libraries to change text or style if needed.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 70c64fad46a91f910a00d59149000b982705fd24)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18050: DBRev 20.05.05.002
Lucas Gass [Fri, 13 Nov 2020 21:20:24 +0000 (21:20 +0000)]
Bug 18050: DBRev 20.05.05.002

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18050: (QA follow-up) Adjust conditions and make use of message text
Katrin Fischer [Mon, 5 Oct 2020 06:17:34 +0000 (06:17 +0000)]
Bug 18050: (QA follow-up) Adjust conditions and make use of message text

- When we run into invalid data, we use Augustin's suggested solution
  and copy the data into a separate table, setting the budget_period_id to
  NULL.
- We amend the output using the new $message.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c8bef50a223e70fe3023222f5f940a2b1771b5d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18050: (follow-up) Force adding FK constraint
Agustin Moyano [Fri, 9 Oct 2020 18:14:26 +0000 (15:14 -0300)]
Bug 18050: (follow-up) Force adding FK constraint

When there are inconsistent budget_period_id in aqbudgets this patch
creates the table _bug_18050_aqbudgets with the original data, then sets
the column to null and warns the user that there is inconsistent data.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1193dddd8beb4a10a78e385b221c0f908d92dcf6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18050: Add relation alias to schema
Katrin Fischer [Sun, 13 Sep 2020 23:31:52 +0000 (23:31 +0000)]
Bug 18050: Add relation alias to schema

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2800b53bdd6df1e87f72673bc79ed4896f4e4e35)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18050: DBIC
Lucas Gass [Fri, 13 Nov 2020 21:15:16 +0000 (21:15 +0000)]
Bug 18050: DBIC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18050: Add FK constraint on aqbudgets.budget_period_id
Katrin Fischer [Sun, 13 Sep 2020 22:42:27 +0000 (22:42 +0000)]
Bug 18050: Add FK constraint on aqbudgets.budget_period_id

This adds a FK constraint on aqbudgets.budget_period_id so that
a fund cannot be added with an invalid aqbudget.budget_period_id.

We should not have funds that belong to no budget. In case we have, the
update will be skipped and a note displayed.

Part1:
- Before applying the patch
- Make sure you have a budget with some funds linked to it
- You will have to change one of the funds to link to an invalid
  budget with SQL:
  UPDATE aqbudgets SET budget_period_id = 999 WHERE budget_id = max(budget_id);
- Apply patch
- Run updatedatabase - verify that you see the hint about 1 existing fund with invalid budget.
- Repair your fund with SQL
  UPDATE aqbudgets SET budget_period_id = ... WHERE budget_id = max(budget_id);
  (... needs to be your existing budget_period_id)
- Run updatedatabase again - verify it runs successfully now.
- If you try to change the budget_period_id to a non-existing now with SQL, you will
  get a database error. The new FK doesn't permit it.
Part 2:
- Start fresh with the web installer, verify there are no errors on
  creating the database tables

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0ce62b29bf5ebe30125eb4c631de11391134f109)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26673: Fix perlcritic complains
Jonathan Druart [Mon, 2 Nov 2020 07:42:20 +0000 (08:42 +0100)]
Bug 26673: Fix perlcritic complains

This patch fixes the following perlcritic complain:
Package declaration must match filename at line 19, column 1.  Correct the filename or package statement.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 59588c3a3e3390c2796ac417696829fd26fcb4f0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26673: Remove #!/usr/bin/env perl from .pm modules too
David Cook [Wed, 14 Oct 2020 22:53:24 +0000 (22:53 +0000)]
Bug 26673: Remove #!/usr/bin/env perl from .pm modules too

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e692b40523839bda45a20e4cf1cac7cdfbf53a13)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26673: Remove shebangs from Perl modules
Jonathan Druart [Wed, 14 Oct 2020 09:24:33 +0000 (11:24 +0200)]
Bug 26673: Remove shebangs from Perl modules

It's not needed.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9f47b4ffd72211a216df67ef912b5eddb2b954db)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26784: Silence warns about comparing undefined values for MARC modification templates
Nick Clemens [Thu, 22 Oct 2020 12:36:13 +0000 (12:36 +0000)]
Bug 26784: Silence warns about comparing undefined values for MARC modification templates

This patch simply checks if conditionals are defined before comparing

We don't need to check actions because you cannot save an action without an action :-)

To test:
1 - Define several actions for a MARC modification template
2 - Ensure you have actions with no conditionals
3 - Tail the intranet logs
4 - Browse to Tools->MARC modification templates
5 - Click 'Edit actions' for the template you setup above
6 - Note warns like:
    [2020/10/22 12:30:18] [WARN] Use of uninitialized value in string eq at /kohadevbox/koha/tools/marc_modification_templates.pl line 127.
7 - Apply patch
8 - Restart all the things
9 - Edit actions again and note no more warns

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2dd19840449beadd1f1752bd8cc18f0163f7f8a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26781: (follow-up) Adjust tests as fields are no longer completely removed
Nick Clemens [Mon, 2 Nov 2020 11:24:02 +0000 (11:24 +0000)]
Bug 26781: (follow-up) Adjust tests as fields are no longer completely removed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03742a1e246e68fa62c2f2fff963beba28f35c80)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26781: Check for subfield defined rather than truth
Nick Clemens [Thu, 22 Oct 2020 10:59:17 +0000 (10:59 +0000)]
Bug 26781: Check for subfield defined rather than truth

To recreate:
 1 - Have a record with 100$0 defined
 2 - Define a Marc Modification template:
    Delete field 100$0
 3 - Perform Batch record modification, enter the record above in the list of records
 4 - Preview the MARC
 5 - Note the entire 100 field has been deleted, don't modify the record
 6 - Apply patch
 7 - Restart all the things
 8 - Test the modification again
 9 - This time the preview confirms only the subfield 0 deleted
10 - Modify the record
11 - Confirm the record is correctly updated

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD amended patch: Fix typo ony vs only

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit be4f0c7639a679b1ec808e6e9cf9af0fc9576e79)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26627: (QA follow-up) Remove barcode input by id
Kyle M Hall [Thu, 5 Nov 2020 11:40:42 +0000 (06:40 -0500)]
Bug 26627: (QA follow-up) Remove barcode input by id

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ebb437349ebbadf90599c23a46126e5d8eda72da)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26627: Print and confirming a hold can cause an infinite loop
Kyle M Hall [Wed, 7 Oct 2020 15:01:02 +0000 (11:01 -0400)]
Bug 26627: Print and confirming a hold can cause an infinite loop

Test plan:
1) Place a hold for pickup at library A
2) Confirm the hold and print slip
3) Checkin the item again
4) Confirm the hold and print slip
5) The modal returns, do it again
6) Apply this patch
7) Reload the page
8) Repeat steps 1-3
9) No loop!

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a71596fb395d449a62f5a6417780ed23948755c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26601: Add utf8 encoding to text output of overdue_notices.pl
Mark Hofstetter [Mon, 19 Oct 2020 17:28:19 +0000 (17:28 +0000)]
Bug 26601: Add utf8 encoding to text output of overdue_notices.pl

This patch sets the UTF8 encoding for output of overdue_notices.pl when
outputting to txt.

To test:
0/ Check out an item with due date yesterday (use specify due date)
1/ Create ODUE text with utf8 encoded characters, chinese characters, umlauts etc
   <url>/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation&code=ODUE
2/ Run
   perl overdue_notices.pl -text ./
3/ Verify encoding in the generated text file is incorrect
4/ Apply patch and repeat 2/
3/ Confirm text now inludes properly encoded characters

Sponsored-by: Styrian State Library
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
With German umlauts on my system the editor still showed the
characters correctly (probably guessing the right encoding).
Using Chinese made the problem visible.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 28d20b92be91ae509a7f71586ada2535d3c2007d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26686: Fix sorting of "updated on" and "time created" on notices tab
Katrin Fischer [Tue, 20 Oct 2020 16:55:37 +0000 (16:55 +0000)]
Bug 26686: Fix sorting of "updated on" and "time created" on notices tab

In the patron's account in the staff interface there is a tab
'Notices' that shows all notices sent out to a patron. The
updated on column would not sort at all, but there was also some
markup missing for the time created column.

To test:
- Make sure you have a patron account with some notices, ideally
  with different times and dates
- Verify that the updated on column doesn't sort at all
- Apply patch
- Verify both date columns now sort correctly for different
  DateFormat settings

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b3be51d4ef2145b7db7b48c9ee32f86ddd34a964)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26445: Fix "back to result" link of the search result browser
Jonathan Druart [Thu, 15 Oct 2020 08:47:55 +0000 (10:47 +0200)]
Bug 26445: Fix "back to result" link of the search result browser

Not sure what was the expected behaviour, I am suggesting the following
one:
If you are browsing and you click "back to result", you will be
redirected to the page where the record appear on the search result
list.

Say you search for "something" that returns 10 page (20 results per
page)
Click on first result first page
Click back to result
=> You see the first page with the first result at the top

Click on second page, 3rd result
Click back to result
=> You see the second page with the biblio you clicked at the 3rd
position

Click on second page, 3rd result
Click next/previous
Click back to result
=> You see the page where you last result were.

I think the existing expected behaviour was to have the result you
clicked at the first position of the result page, but I am not sure it
really makes sense.

Hope this makes sense however!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3edbe7d7dc9358e55b4ecc9da5b292a32cadcce9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26613: Fix it-IT unimarc_framework.sql installer file
John Fawcett [Mon, 12 Oct 2020 09:18:30 +0000 (11:18 +0200)]
Bug 26613: Fix it-IT unimarc_framework.sql installer file

This is really an installation issue, though at the
time of installation it did not result in any error.

During cataloguing in the items menu the "Type of item or material"
is not constrained by the itemtypes authorised_values (as it is for 942c records).

I have added the itemtypes to the installer sql in unimarc_framework.sql
as well as adding the description of this field for OPAC, which had been left empty.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3bd23a3287345167de50d994d737351174c04936)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26612: Error during web install for it-IT translation
John Fawcett [Mon, 12 Oct 2020 11:06:40 +0000 (13:06 +0200)]
Bug 26612: Error during web install for it-IT translation

Patch changes some of the values in the sql statement that inserts 307a
unimarc row into the marc_subfield_structure which created an SQL error
on installation.

The fields changed are:
- isurl now 0 instead of NULL,
- hidden now -5 instead of NULL,
- seealso empty string instead of NULL,
- link empty string instead of NULL.

These field values are now similar to the ones inserted for 306a or 308a.
The value that caused the SQL error was using NULL for hidden (due to
the NOT NULL constraint in the table definition).

I have tested the install with this change and found no issues.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c74c6636f779bbbaceee74f8704df9ec625815d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26569: DBRev 20.05.05.001
Lucas Gass [Fri, 13 Nov 2020 18:43:14 +0000 (18:43 +0000)]
Bug 26569: DBRev 20.05.05.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26569: Use gender neutral pronouns in system prefernece explanations
Andrew Fuerste-Henry [Wed, 30 Sep 2020 13:14:12 +0000 (13:14 +0000)]
Bug 26569: Use gender neutral pronouns in system prefernece explanations

To test:
1 - perform query "select variable,explanation from systempreferences where explanation like '% his %';"
2 - find 6 sysprefs with gendered pronouns used in explanations
3 - apply patch, reset_all
4 - repeat query
5 - no more gendered pronouns!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a96f5deef04bb74fbd826449b4d82f651a67512c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 8437: Exclude export.pl from plack
Nick Clemens [Thu, 3 Sep 2020 16:23:04 +0000 (16:23 +0000)]
Bug 8437: Exclude export.pl from plack

When attempting to download large files from Koha plack can timeout

Excluding the script from plack is a simple fix until we have a more permanent fix for this
issue.

To test:
1 - Try to export your entire DB from Tools->Export
2 - If big enough, it fails
3 - Apply patch, copy changes to /etc/koha/apache-shared-intranet-plack.conf
4 - Restart all the things
5 - Repeat export, it succeeds

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 564ade93cce9231b01db1c4ebfc8f4e5b31e1acd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 23432: (QA follow-up) Add a unit test
Nick Clemens [Sat, 24 Oct 2020 23:53:21 +0000 (23:53 +0000)]
Bug 23432: (QA follow-up) Add a unit test

prove -v t/db_dependent/StockRotationItems.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 23292b53a8bc672f66ae95b1cfb7db5994d1eea5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 23432: Replace 'die' with 'warn'
Martin Renvoize [Wed, 23 Sep 2020 11:28:22 +0000 (12:28 +0100)]
Bug 23432: Replace 'die' with 'warn'

This patch simply replaced the die statement with a warn such that the
cron script may continue to rotate other items even if this item cannot
be properly rotated due to corrupt data.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6adb1891d2bf602b0434eb87508568e73faa763e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26232: Empty smart rule fine grace period
Didier Gautheron [Tue, 18 Aug 2020 05:40:50 +0000 (07:40 +0200)]
Bug 26232: Empty smart rule fine grace period

Staff can create smart rules with empty (undefined) fine grace period.
In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm.

To test:
1. Apply these patches
2. Run:
   kshell
   prove t/db_dependent/Circulation.t

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7e66d6d190af4bd27739bdfe88049899f927c123)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26232: Test for empty smart rule fine grace period
Didier Gautheron [Tue, 18 Aug 2020 05:39:53 +0000 (07:39 +0200)]
Bug 26232: Test for empty smart rule fine grace period

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f6d614d4596728a3a2808eac2539754023e42262)

3 years agoBug 26750: Deleted items not indexed
Björn Nylén [Tue, 20 Oct 2020 12:11:16 +0000 (14:11 +0200)]
Bug 26750: Deleted items not indexed

After deleting an item it is still searchable in the index. Similar to bug 26507 where record is reindexed before the database is changed.

To test:
1. Delete an item
2. Search the barcode in the main search box. You'll find the original record but wiht hte deleted item missing.
3. Apply patch.
4. Repeat steps 1-2 (with another item). No record should be found.

Note to test you have to have the indexer running, not the cron job, and it
needs to be running fast so that the index is updated before the delete
takes place

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 395bb760394e6947303de7e342882148944e9026)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26751: Fix fatal exception if only one repo defined
Tomas Cohen Arazi [Tue, 20 Oct 2020 17:40:50 +0000 (14:40 -0300)]
Bug 26751: Fix fatal exception if only one repo defined

This patch fixes this nasty problem with how XML is parsed: if more than
one entry is found, repo => [] is generated. If only one, repo => {}.

To test:
1. Have more than one entries in the plugins_repo entry:

<plugin_repos>
    <repo>
        <name>ByWater Solutions</name>
        <org_name>bywatersolutions</org_name>
        <service>github</service>
    </repo>
    <repo>
        <name>Theke Solutions</name>
        <org_name>thekesolutions</org_name>
        <service>github</service>
    </repo>
    <repo>
        <name>PTFS Europe</name>
        <org_name>ptfs-europe</org_name>
        <service>github</service>
    </repo>
 </plugin_repos>

2. Search for plugins
=> SUCCESS: Searching works!
3. Leave only one entry
4. Restart all to refresh things
5. Try searching for plugins
=> FAIL: Fatal error
6. Apply this patch
7. Repeat 5
=> SUCCESS: It doesn't explode anymore!
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9e5ea4f5ab81cb500f112a5858130f82a6b4fd65)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25549: Add error reporting to plugins-home
Martin Renvoize [Wed, 7 Oct 2020 15:37:06 +0000 (16:37 +0100)]
Bug 25549: Add error reporting to plugins-home

This patch adds handling for the newly introduced 'errors' option in
GetPlugins and reports erroroneos plugins to the user.

To test:
1 - Enable plugins in the koha-conf
2 - Install the kitchen sink plugin
3 - Your staff client should be orange now :-)
4 - The plugin should display as installed in the table at
    tools/plugins.
5 - edit the plugin module
    /var/lib/koha/kohadev/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm
6 - Add a line to break compilation, like:
    this won't compile
7 - Restart all
8 - Your Koha is not broken, but is no longer orange (The plugin is not
    loading).
9 - The plugin should display as unable to load in the table at
    tools/plugins.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 759ff4519961d0c256eb05a4797fb21c3b2c22d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25549: Remove plugin methods for broken plugins
Nick Clemens [Wed, 20 May 2020 11:12:12 +0000 (11:12 +0000)]
Bug 25549: Remove plugin methods for broken plugins

To test:
 1 - Enable plugins in the koha-conf
 2 - Install the kitchen sink plugin
 3 - Your staff client should be orange now :-)
 4 - edit the plugin module
     /var/lib/koha/kohadev/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm
 5 - Add a line to break compilation, like:
     this won't compile
 6 - Restart all
 7 - Your koha is now broken
 8 - kshell
 9 - perl misc/devel/install_plugins.pl
10 - Restart all
11 - Koha remains broken
12 - Apply patch
13 - kshell
14 - perl misc/devel/install_plugins.pl
15 - Koha now works!
16 - Koha is not orange because the plugin methods are removed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0eae966d257fa2ecc6a6506e2515691e092a701c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 23828: Elasticsearch - Preserve record order when combining subfield in mappings
Nick Clemens [Wed, 16 Sep 2020 11:31:54 +0000 (11:31 +0000)]
Bug 23828: Elasticsearch - Preserve record order when combining subfield in mappings

Currently if you combine subfields in the marc mappings the subfields are indexed in the order
listed in the mapping.

i.e. 650(avxyz) in mapping

and in record:
650 $aHeading $zGeosubdiv $vFormsubdiv

is indexed as:
Heading Formsubdiv Geosubdiv

We should preserve the order and index as:
Heading Geosubdiv Formsubdiv

We can use built in function in Marc::Field to achieve this

To test:
 1 - It is easy to find examples of this using authorities
 2 - Find or create a record with subfields order azv
     e.g. 150$aActresses$zUnited states$vBiography
 3 - Add or have a second authority
     e.g. 150$aActresses$vPortraits
 4 - Set an authorities mapping for 'Heading' to 150(abgvxyz)
     find at:
     Administration->Search engine configuration (Elasticsearch)->Authorities tab
 5 - Index the records in Elasticsearch
     perl misc/search_tools/rebuild_elaticsearch.pl -a -ai 1691 -ai 1692
 6 - View the first record in the ES index
     curl es:9200/koha_kohadev_authorities/data/1692?pretty
 7 - Note 'Heading' field is ordered as in the mapping
 8 - Search authorities for 'contains' "act"
 9 - Note the records sort incorrectly
10 - Apply patches
11 - perl misc/search_tools/rebuild_elaticsearch.pl -a -ai 1692
12 - curl es:9200/koha_kohadev_authorities/data/1692?pretty
13 - Note the order is now preserved
14 - Search authorities for 'contains' "act"
15 - Note the records sort correctly

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD amended patch: Fix
   FAIL   spelling
     combind ==> combined

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 890fd6ff068f58da4c72194ebc14be2cf479040b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 23828: Unit tests
Nick Clemens [Wed, 16 Sep 2020 11:31:48 +0000 (11:31 +0000)]
Bug 23828: Unit tests

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Bug 23828: (follow-up) fix unit test merge

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 23828: (QA follow-up) Fix number of tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0cb4300675405d37230ee427137daff2d6bdb4d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26496: Add op field to Budget Planning
David Cook [Mon, 21 Sep 2020 02:02:27 +0000 (02:02 +0000)]
Bug 26496: Add op field to Budget Planning

Without this patch, it's impossible to save a budget plan.

With this patch, it is possible to save a budget plan.

Test:
1. Apply patch
2. Modify a budget (e.g. http://localhost:8081/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form&budget_period_id=1)
3. Unlock the budget if necessary by unticking "Lock budget" and click "Save"
4. Go to a budget (e.g. http://localhost:8081/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=1)
5. Click "Planning" and "Plan by libraries"
6. Click "Auto-fill row" on the first line
7. Click "Save"
8. Note that results are saved and shown on the newly loaded page

To verify this patch is necessary, do the test plan without applying the patch.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fd35df346f73a00b643e675853ba2c8ef321cf66)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26647: Add translation context to cancel hold button in OPAC
Timothy Alexis Vass [Fri, 9 Oct 2020 14:54:01 +0000 (14:54 +0000)]
Bug 26647: Add translation context to cancel hold button in OPAC

0) Apply the patch and add a hold on an item.
1) Install Swedish language, sv-SE and change interface language to
   Swedish
2) Modify sv-SE-opac-bootstrap.po and add this:
   msgctxt "Cancel hold button"
   msgid "Cancel"
   msgstr "Ta bort"
3) Go to the Holds table at /cgi-bin/koha/opac-user.pl#opac-user-holds
4) Confirm that the button is translated as "Ta bort"
5) Sign off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 096327cfcd27d7abf484c3653b13e059bb9152e5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 20804: Add support for "days" to the timeout syspref
Jonathan Druart [Thu, 30 Jul 2020 13:15:46 +0000 (15:15 +0200)]
Bug 20804: Add support for "days" to the timeout syspref

If the timeout syspref did not contain an integer, or was not matching
integer.'d|D', then it "fallback" to 0

We can easily add support for hours and fallback to 600 if the value is
not correct.
It will prevent the session to timeout immediately

Test plan:
0. Do not apply the patches
1. Fill the timeout syspref with "5h"
2. Login
3. Click somewhere
=> Notice that the session timed out
4. Apply the patches, restart_all
5. Login
6. Click somewhere
=> You have 5 hours to enjoy Koha
7. Fill the pref with an incorrect value ("5x" for instance)
8. Logout, login
9. There is a warning in the log, and you have 10 minutes (600 secondes) to enjoy Koha

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 97b9eab178f0b45b38662747a4e009e71d8b73ff)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 20804: Add tests
Jonathan Druart [Thu, 30 Jul 2020 13:15:36 +0000 (15:15 +0200)]
Bug 20804: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c9c7f4543a06553c6cbf04ff58a82eb6a40fc9c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26018: Fix frameworks errors with subfields in wrong tab
Katrin Fischer [Sat, 18 Jul 2020 12:52:06 +0000 (14:52 +0200)]
Bug 26018: Fix frameworks errors with subfields in wrong tab

All subfields for a MARC21 field should always be in the same tab.
There were some mistakes found by the "MARC bibliographic framework
test" this fixes.

Before you apply the patch:
- Check the "MARC bibliographic framework test" page
- Ideally you should see the "wrong tab" mistakes
- Reset your db (reset_all) or drop your db and run the web installer
- Verify the page no longer points out any issues

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1cd22331732f6ffef3478ebbc034aa0fba154dba)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 9118: (QA follow-up) Fix spelling on "To Date :"
Katrin Fischer [Sun, 4 Oct 2020 03:23:24 +0000 (03:23 +0000)]
Bug 9118: (QA follow-up) Fix spelling on "To Date :"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 57182d6a043a25bda74de0e9e1320adfe930016c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 9118: Do not show option to create exception on range for unique holiday
Emmi Takkinen [Mon, 5 Oct 2020 08:19:44 +0000 (11:19 +0300)]
Bug 9118: Do not show option to create exception on range for unique holiday

When an unique holiday is edited one can choose
option 'Generate exceptions on a range of dates.'
Exceptions are meant to be used with repeating
holidays and it makes no sense to have option to
be able to create one for an unique holiday.

This patch hides exception on range option when
editing an unique holiday. Also fixes a minor
spelling error.

To test:
1. Create unique holiday and edit it.
2. Note that option to create exception on range is shown.
3. Apply patch.
=> Option is now hidden.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 683d6ced64a92cc391ac81b4a046bcdf2110bb83)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26389: Add auto renewal error to opac-user.tt
Lucas Gass [Sat, 5 Sep 2020 05:26:47 +0000 (05:26 +0000)]
Bug 26389: Add auto renewal error to opac-user.tt

Test plan:
1 Check out an auto-renewing item to a patron
2 confirm in circ rules that the rule allows at least one renewal
3 log into OPAC, confirm your summary shows item is scheduled for auto-renewal
4 click Renew All
5 Get note "Please note: Your loan renewal failed because of the following reason(s):" with no following reasons
6 Apply patch
7 Repeat 3-5
8 See appropriate error

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ace5b632a6ed965931e1332cacb1419c16286d65)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26429: Show correct expiration date at the request.pl
Emmi Takkinen [Fri, 25 Sep 2020 10:52:06 +0000 (13:52 +0300)]
Bug 26429: Show correct expiration date at the request.pl

Bug 25789 changed holds tables expriration input class as "datepickerto".
This results to past expiration date to be displayed as tomorrows date.
Class "futuredate" should have been used instead.

To test:

1. Have waiting hold with expiration date in past (e.g 24.9)
2. Observe that waiting reserves table displays correct expiration date
3. At the request.pl page expiration date is however displayed as 26.9
=> Apply patch
4. Confirm that expiration date at the request.pl is now 24.9

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1b40ee8d18b7fee42193cfb2bac5e44146a1afd9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26538: Display cities list before input text
Fridolin Somers [Fri, 25 Sep 2020 15:08:38 +0000 (17:08 +0200)]
Bug 26538: Display cities list before input text

In patron creation or edition actually the city field is displayed with input text then cities list.
I propose to display cities list first since it is more likely used.

Test plan :
1) Create some cities
2) Open patron creation form
3) Check you see for each city field : cities list, text "or enter", text input
4) Delete all cities
5) Open patron creation form
6) Check you see for each city field : only text input

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5a669249148d3f874ebc9977be9d4be6a6d92f8d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled
Alex Buckley [Tue, 29 Sep 2020 05:53:34 +0000 (05:53 +0000)]
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled

Test plan:
1. Check the OAI-PMH:AutoUpdateSets syspref is disabled
2. Run t/db_dependent/OAI/Sets.t tests and confirm tests pass
successfully
3. Enabled the OAI-PMH:AutoUpdateSets syspref
4. Repeat step 2 and confirm the tests fail

5. Apply this patch and restart plack: sudo koha-plack --restart
<instance>
6. Repeat step 2 and confirm the tests now pass
7. Disable the OAI-PMH:AutoUpdateSets syspref and repeat step 2 and
confirm tests still pass

Sponsored-By: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 913897f3a484ea31a2373de7aac2cc8298319575)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26675: (bug 23463 follow-up) Fix typo onloadn vs onloan
Jonathan Druart [Wed, 14 Oct 2020 09:17:46 +0000 (11:17 +0200)]
Bug 26675: (bug 23463 follow-up) Fix typo onloadn vs onloan

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c32503fcb685e3bba209ba7baba1abe560fda94c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26604: "Generate next" button gives error on serials-collection.pl
Kyle M Hall [Fri, 2 Oct 2020 16:11:48 +0000 (12:11 -0400)]
Bug 26604: "Generate next" button gives error on serials-collection.pl

In serials-collection.pl, the line

$frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});

causes the error

Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198.

This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down.

Signed-off-by: kelly mcelligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD

Test plan:
1. Create a new subscription
  * When there is an irregular issue: Skip issue number
  * Select a frequency (not irregular)
  * Test prediction pattern and mark some "not published" (to fill the subscription.irregular DB field
2. Receive a first serial (mark it arrived, an "expected" one is created)
3. Claim the expected one
=> You have 1 arrived and 1 claimed.
It's the only way to not have an expected one and hit the else block in serials/serials-collection.pl
4. Generate next => boom

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9f4b54a6d74b9635195bb9ea0b9c11fe5570cf6e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26137: Remove warnings from viewlog.pl
Jonathan Druart [Thu, 8 Oct 2020 09:33:23 +0000 (11:33 +0200)]
Bug 26137: Remove warnings from viewlog.pl

The warnings are
Use of uninitialized value $val in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 138.
Problem = a value of  has been passed to param without key at /kohadevbox/koha/C4/Templates.pm line 138.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8b541714a177fc141c77967c8fc528c5c5453139)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26506: (QA follow-up) Add Unit Test
Martin Renvoize [Thu, 1 Oct 2020 13:33:46 +0000 (14:33 +0100)]
Bug 26506: (QA follow-up) Add Unit Test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ae475eb15a4b1c8b5c49c1c4f79388c9e1d7686a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26506: Fix Koha::Account::pay if called when no user is logged-in
Matthias Meusburger [Tue, 22 Sep 2020 13:16:23 +0000 (15:16 +0200)]
Bug 26506: Fix Koha::Account::pay if called when no user is logged-in

Currently, Koha::Account::pay will fail if no user is logged-in when it is
called.

In this case, this patch will use undef instead of 0 for $manager_id in order
to comply with the foreign key constraint on manager_id.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Biblibre and Libriotech have created a OPAC payment plugin that was
having problems because of this bug. Applying the fix in this patch
to a live server solved the problem.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 63c93d3c114c6720100cd2b843e8989a1a0eecb7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26599: Unused parameter name in POD of ModZebra
Marcel de Rooy [Fri, 2 Oct 2020 06:20:38 +0000 (06:20 +0000)]
Bug 26599: Unused parameter name in POD of ModZebra

This patch removes the $record reference in POD.
Nothing else ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0113df1a7a9495423533b3fe75b8a90c04d056be)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26600: Missing module in Elasticsearch/Indexer.pm
Marcel de Rooy [Fri, 2 Oct 2020 06:28:06 +0000 (06:28 +0000)]
Bug 26600: Missing module in Elasticsearch/Indexer.pm

Just formally needed. It is already loaded somewhere.
That is: Koha::SearchEngine::Elasticsearch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6deb177576f8cb6d1fc02da6555f023f6c27e1d5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26184: Add div element to 'items available' note in OPAC reserve template
Lucas Gass [Fri, 7 Aug 2020 18:17:49 +0000 (18:17 +0000)]
Bug 26184: Add div element to 'items available' note in OPAC reserve template

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bc61f27b2203d8f7f0dadbf7a13bb4c66e346244)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26449: fix web installer typo
Andreas Roussos [Mon, 14 Sep 2020 07:39:44 +0000 (09:39 +0200)]
Bug 26449: fix web installer typo

The onboarding segment of the web installer contains a small typo
in Step 4: "Importantl:" (should be "Important:").

This patch fixes that.

Test plan: apply the patch and access the web installer, Step 4 of
the onboarding tool should no longer display the typo.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5f5e6c85d9d86196da802b2d9155b0d7cafad2da)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26551: Correct modal markup to prevent long heading from overflowing
Owen Leonard [Mon, 28 Sep 2020 11:46:17 +0000 (11:46 +0000)]
Bug 26551: Correct modal markup to prevent long heading from overflowing

This patch modifies the markup of the MARC framework import and export
modals so that CSS intended only for Bootstrap buttons isn't applied to
content in the modal.

The modal dialog markup was nested inside a ".btn-group" <div>, which
carries with it CSS that prevents text wrapping. Moving the modal markup
out of the button group while keeping it inside the <td> corrects the
problem. Lines have only been shifted and reindented.

To test, apply the patch and go to Administration -> MARC bibliographic
framework.

- In the table of frameworks, from the "Actions" menu, test both
  the "Import" and "Export" links. Both should work as expected.
- Confirm that the text of the heading on the "Import" modal wraps
  correctly.
- Test the same operations for a framework other than the default one.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c21de86ab2d1bf5c147dfd453b195a441603e118)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 26191: Relocate track_login call in Auth.pm
Marcel de Rooy [Tue, 11 Aug 2020 11:22:22 +0000 (11:22 +0000)]
Bug 26191: Relocate track_login call in Auth.pm

This is a leftover from bug 22543.
Trivial move.

Test plan:
Do not apply this patch.
Pick a user that has not yet logged in today.
Only login via the opac and immediately check if borrowers.datelastseen did not change.
Apply this patch, restart, flush etc.
Only login via the opac and verify again rightaway (no further opac actions).
Now datelastseen should have been changed already.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b827acf53ffde71d787123095b8524ea6bd08fd6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoUpdate release notes for 20.05.05 v20.05.05
Lucas Gass [Tue, 27 Oct 2020 20:44:29 +0000 (20:44 +0000)]
Update release notes for 20.05.05

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3b0694fd43e9ca1d37288e80c1bc7d2852baacc3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoIncrement version for 20.05.05 release
Lucas Gass [Tue, 27 Oct 2020 20:37:08 +0000 (20:37 +0000)]
Increment version for 20.05.05 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d59ec16fd07aa95bc870ad06b7b568c38fb4bcc0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoTranslation updates for Koha 20.05.05
Koha translators [Tue, 27 Oct 2020 20:26:51 +0000 (17:26 -0300)]
Translation updates for Koha 20.05.05

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 808ae69135ac956f5dc943d6d5a8bbe8142ab2bb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26562: [20.05.x] Removes 'searches' from localStorage on logout
Jonathan Druart [Tue, 29 Sep 2020 09:43:00 +0000 (11:43 +0200)]
Bug 26562: [20.05.x] Removes 'searches' from localStorage on logout

A user recently logged in will inherit the "searches" item stored in localStorage.

To recreate:
Log in with user A, do some searches
Note that the "searches" item is filled in with the search queries
Logout and log in with user B
Note that the "searches" item is still there

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 402bf0240325a9a194dd6c62f7b4e478e1505b15)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26592: (Rmaint follow-up) add missing parenthesis to escapeHTML
Lucas Gass [Tue, 27 Oct 2020 20:09:58 +0000 (20:09 +0000)]
Bug 26592: (Rmaint follow-up) add missing parenthesis to escapeHTML

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 997a0fbec691b80fe77baf447c01c3db9456894b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26592: [20.05] Prevent XSS vulnerabilities when circ/ysearch.pl is used
Jonathan Druart [Thu, 1 Oct 2020 09:22:46 +0000 (11:22 +0200)]
Bug 26592: [20.05] Prevent XSS vulnerabilities when circ/ysearch.pl is used

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c272e8d9e4f8cb4922291d9b35e027e3ccbc9e1e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26785: Fix JS error in pos/pay.tt
Lucas Gass [Fri, 23 Oct 2020 13:17:28 +0000 (13:17 +0000)]
Bug 26785: Fix JS error in pos/pay.tt

To Test:
1. enable  EnablePointOfSale
2. enable  UseCashRegisters
3. Go to /cgi-bin/koha/pos/pay.pl
4. See the console error
5. Apply patch
6. Add some debit types and make sure you can add them /cgi-bin/koha/pos/pay.pl
7. Check for console errors, there should be none
8. Make sure you can confrim payments.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25913: Get the correct return of AddBiblio
Jonathan Druart [Thu, 8 Oct 2020 08:58:48 +0000 (10:58 +0200)]
Bug 25913: Get the correct return of AddBiblio

We need the parenthesis to get the biblionumber and not the
biblioitemnumber, in case there is a discrepancy.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 08386fabcbfbc29f23091f6fd7838fcb362abed3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25913: Prevent get_coins to crash if record does not have title
Jonathan Druart [Thu, 30 Jul 2020 08:41:45 +0000 (10:41 +0200)]
Bug 25913: Prevent get_coins to crash if record does not have title

If a bibliographic record does not have a title, get_coins will crash
with
Can't call method "as_string" on an undefined value at /kohadevbox/koha/Koha/Biblio.pm line 645
Koha::Biblio::get_coins('Koha::Biblio=HASH(0x5558f91bb740)') called at /kohadevbox/koha/catalogue/ISBDdetail.pl line 144

We can handle that situation easily by checking the existence of the
title field.

Test plan:
1. Create a record without 245
2. Enable COinSinOpac
4. Go to the ISBD detail view
=> It must not fail with this patch applied

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 64c939ca80a306af2560c99da0f58b1aeaed13c6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25957: Don't push blank field values to ES document
Nick Clemens [Mon, 28 Sep 2020 15:29:51 +0000 (15:29 +0000)]
Bug 25957: Don't push blank field values to ES document

To test:
 1 - Load the sample DB or edit a record (using advanced cataloging editor) to have a blank subfield in a field that is indexed as suggestible
 2 - For example 'author' / 100a
     100 _ _ ‡a
 3 - Index that record into Elasticsearch 5.X:
     perl misc/search_tools/rebuild_elasticsearch.pl  -v -bn 115 -b -d
 4 - Note error 'value must have length > 0'
 5 - Edit mappings to set author 100a not suggestible
 6 - perl misc/search_tools/rebuild_elasticsearch.pl  -v -bn 115 -b -d
 7 - Success
 8 - Set field to suggestible again
 9 - Apply patch
10 - perl misc/search_tools/rebuild_elasticsearch.pl  -v -bn 115 -b -d
11 - Success!

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eb3d0982ae8f22fe5354fae93dc4ea13c4f07ce3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25957: Unit test
Nick Clemens [Wed, 8 Jul 2020 17:29:45 +0000 (17:29 +0000)]
Bug 25957: Unit test

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6cfdd793549d86f9d607c63fceafb64290981204)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26260: Add missing elastic>cnx_pool to koha-conf-site.xml.in
Jonathan Druart [Thu, 20 Aug 2020 08:10:44 +0000 (10:10 +0200)]
Bug 26260: Add missing elastic>cnx_pool to koha-conf-site.xml.in

Added by bug 22705, but only in etc/koha-conf.xml

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 33ab3c690076bf78d62105502b6de54e45e766b2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 19322: Typo in UNIMARC field 140 plugin
Owen Leonard [Mon, 14 Sep 2020 13:33:01 +0000 (13:33 +0000)]
Bug 19322: Typo in UNIMARC field 140 plugin

This patch corrects some incorrect information in the UNIMARC plugin for
tag 140. Literature code "li" should be "mystic literature."

To test you do not need a UNIMARC installation. Apply the patch and go
to Administration -> MARC frameworks and Actions -> MARC structure for
one of your frameworks.

- Edit subfields for a tag, e.g. 245. This is only for testing purposes
  so it doesn't have to be any particular tag.
- Change the options for one of the subfields, e.g. $a. Under "Other
  options (choose one), set "Plugin" to "unimarc_field_140.pl"
- Save changes.
- Open a bibliographic record for editing using the framework you
  modified.
- Click the plugin link next to the subfield you modified, e.c. 245$a.
- This should trigger the "UNIMARC field 140 builder" popup window.
- Find "Literature" and select "Mystic literature." Save.
- In the MARC editor, the field you modified should contain the value
  "li" at position 17-18.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c72f01d9072a35753d235db26983560a4c984522)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 19327: Typo in UNIMARC field 128a plugin
Owen Leonard [Mon, 14 Sep 2020 13:49:14 +0000 (13:49 +0000)]
Bug 19327: Typo in UNIMARC field 128a plugin

This patch corrects some incorrect information in the UNIMARC plugin for
tag 128$a. The value for "partsong" should be "pt#"

To test you do not need a UNIMARC installation. Apply the patch and go
to Administration -> MARC frameworks and Actions -> MARC structure for
one of your frameworks.

- Edit subfields for a tag, e.g. 245. This is only for testing purposes
  so it doesn't have to be any particular tag.
- Change the options for one of the subfields, e.g. $a. Under "Other
  options (choose one), set "Plugin" to "unimarc_field_128a.pl"
- Save changes.
- Open a bibliographic record for editing using the framework you
  modified.
- Click the plugin link next to the subfield you modified, e.c.
  245$a.
- This should trigger the "UNIMARC field 128a builder" popup window.
- Select "partsong" in the dropdown. Save.
- In the MARC editor, the field you modified should contain the
  value "pt#"
- Trigger the popup window again and click "Save" without making
  changes.
- The value in the MARC editor should be the same.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fce5887e16c7869eeeea49c4bab6620eaa2f26e3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25242: Compile CSS
Lucas Gass [Tue, 20 Oct 2020 17:48:37 +0000 (17:48 +0000)]
Bug 25242: Compile CSS

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25242: Improve column wrapping for holdingst
Martin Renvoize [Tue, 1 Sep 2020 16:11:24 +0000 (17:11 +0100)]
Bug 25242: Improve column wrapping for holdingst

This patch attempts to improve the column wrapping for the holdingst
datatable and sets the tabel to fixed width to prevent overlapping
with other content on high zoom levels/low width screen sizes.

Test plan
1/ Build the OPAC CSS from the updated SCSS
2/ Navigate to an item with holdings visible in the OPAC
3/ 'Play' with various window sizes and zoom levels.
4/ The table should not overlap with right navigation content
5/ Signoff

NOTE: This is an alternative patch to those pushed and reverted that
attempted to provide a global fix to overlap issues. This patch
specifically targets just the holdings table in the opac detail view.

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6e5142e61be8604c5144077d15e3782e6853677b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25320: (follow-up) Remove obsolete include file
Owen Leonard [Tue, 29 Sep 2020 11:17:34 +0000 (11:17 +0000)]
Bug 25320: (follow-up) Remove obsolete include file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1ac0850a336d2bb3e5d0bd3ad990e61a34b3dd65)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25320: Move translatable strings out of merge-record-strings.inc into merge-record.js
Owen Leonard [Thu, 18 Jun 2020 14:28:38 +0000 (14:28 +0000)]
Bug 25320: Move translatable strings out of merge-record-strings.inc into merge-record.js

This patch eliminates the use of a separate include file containing
translatable strings in favor of embedding translatable strings in the
JavaScript itself.

To test, apply the patch and clear your browser cache if necessary.

 - Perform a catalog search in the staff interface.
 - Select two results to merge. Click Edit -> Merge records.
 - Click "Next" on the "Merging records" page.
 - On the "Source records" page click the second tab where all the
   checkboxes are unchecked.
   - Check the box for a tag which is non-repeatable, e.g. 245.
     - You should see a message, "The field is non-repeatable and
       already exists in the destination record. Therefore, you cannot add it."
   - Check the box for a subfield which is non-repeatable, e.g. 245$a.
     - You should see a message, "The subfield is non-repeatable and
       already exists in the destination record. Therefore, you cannot
       add it."

TESTING TRANSLATABILITY

 - Update a translation, e.g. fr-FR:

   > cd misc/translator
   > perl translate update fr-FR

 - Open the corresponding .po file for JavaScript strings, e.g.
   misc/translator/po/fr-FR-messages-js.po
 - Locate strings pulled from prog/js/merge-record.js for
   translation, e.g.:

   #: koha-tmpl/intranet-tmpl/prog/js/merge-record.js:72
   msgctxt "Bibliographic record"
   msgid ""
   "The field is non-repeatable and already exists in the destination
   record. "
   "Therefore, you cannot add it."
   msgstr ""

 - Edit the "msgstr" string however you want (it's just for testing).
 - Install the updated translation:

   > perl translate install fr-FR

 - Switch to your newly translated language in the staff client and
   repeat the test plan above. The translated string should appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dc393dc6bee00170b0b5789691de6b24b06a73a7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26291: (follow-up) Correct stray MSG instances
Owen Leonard [Tue, 29 Sep 2020 11:29:29 +0000 (11:29 +0000)]
Bug 26291: (follow-up) Correct stray MSG instances

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 654eda8edc6fb82a13553b3e9b55ea1264177aca)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js
Owen Leonard [Mon, 24 Aug 2020 18:25:35 +0000 (18:25 +0000)]
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js

This patch moves translatable strings out of z3950_search.inc into
z3950_search.js, wrapped in the double-underscore function for
translation.

To test, apply the patch and go to Cataloging.

 - Click "New from Z39.50/SRU"
 - In the search form, uncheck all search targets and submit the form.
   You should get an error: "Please choose at least one external target"
 - Peform a search which will return multiple pages of results.
 - Test  that you can enter a number in the "Go to page" form to
   navigate to a specific page.
 - Enter a non-number in the field and submit. You should get an error,
   "The page entered is not a number."
 - Enter a number in the field which is greater than the number of pages
   of results. Submitting the form should trigger an error, "The page
   should be a number between 1 and 10."

 - Perform the same tests from the other Z39.50 search results
   interfaces:
   - Acquisitions -> Add to basket -> From an external source.
   - Authorities -> New authority -> New from Z39.50/SRU.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/z3950_search.js for translation,
  e.g.:

  msgid "The page entered is not a number."
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 45558c35e3a425f749029088424f1eedd898c938)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26431: Update NewsToolEditor system preference description
Katrin Fischer [Sat, 12 Sep 2020 17:24:36 +0000 (17:24 +0000)]
Bug 26431: Update NewsToolEditor system preference description

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 05537bcd8ea5bceb38805709eb29c2660edd0fa8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26431: Use split button to offer choice of WYSIWYG or code editor for news
Owen Leonard [Thu, 30 Jul 2020 12:38:22 +0000 (12:38 +0000)]
Bug 26431: Use split button to offer choice of WYSIWYG or code editor for news

This patch modifies the news interface so that the user is offered a
choice of editing news items using the default editor as defined by the
NewsToolEditor system preference or the non-default one.

To test, apply the patch and go to Tools -> News.

- In the list of news items you should see an "Edit" split button in
  each row.
- Clicking the "Edit" part of the button should open the edit view with
  the correct editor as defined by the NewsToolEditor preference.
- Clicking the menu arrow on the button should offer the other editing
  method:
 - If NewsToolEditor is set to "WYSIWYG," the menu should offer "text
   editor."
 - If NewsToolEditor is set to "text editor," the menu should offer
   "WYSIWYG editor."
- Test the button with the NewsToolEditor preference set to both options
  and confirm that the button and menu work correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 72485629565dd76022e4202549defafec1dd2998)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26261: Split calendar.inc into include file and JavaScript file
Owen Leonard [Thu, 20 Aug 2020 20:10:40 +0000 (20:10 +0000)]
Bug 26261: Split calendar.inc into include file and JavaScript file

This patch moves most of the JavaScript out of calendar.inc and into a
new file, calendar.js. English strings in calendar.js are now wrapped in
the double-underscore function to allow for translation.

The patch shouldn't affect datepicker functionality in any way.

To test, apply the patch and test the datepicker in various contexts:

- Reports -> Statistics wizards -> Patrons
- Date of birth "from" and "to" should be linked so that the former
  must come before the latter.
- Patrons -> Add or edit patron
- The date of birth field datepicker shouldn't allow you to pick a
  future year from the dropdown.
- Tools -> Calendar.
- Test that the calendar tool works correctly.
- Test with various settings of the dateformat system preference.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/en/js/calendar.js for translation,
  e.g.:

  msgid "August"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and test the datepicker again. Translated strings like days of
  the week and months should be correct.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 701fde53ed703c751e37fd184de342838e8a9f2f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26245: Remove unused functions from members.js
Owen Leonard [Wed, 19 Aug 2020 00:33:45 +0000 (00:33 +0000)]
Bug 26245: Remove unused functions from members.js

This patch removes some code from members.js which was unused.

To test, apply the patch and test that the process of adding or editing
a patron is unaffected. Check the Koha codebase for references to these
functions in JavaScript:

CheckDate
unique (note: Not the jQuery function)
check_manip_date
check_password

There should be none.

Signed-off-by: Brandon J <brandon.jimenez@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 558e64eec0fa9d4e3b31e284038cbd223df8b0d8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26120: Remove the use of jquery.checkboxes plugin from tags review template
Owen Leonard [Sat, 1 Aug 2020 00:37:32 +0000 (00:37 +0000)]
Bug 26120: Remove the use of jquery.checkboxes plugin from tags review template

This patch removes the use of the jquery.checkboxes plugin and improves
the handling of tag status markup so that the "Select all pending"
selection link works correctly.

To test, apply the patch and go to Tools -> Tags. To test properly you
should have multiple tags awaiting moderation.

 - The initial view of tags moderation shows only tags awaiting
    moderation. Test that the "select all," "clear all," and "Select all
    pending" links work correctly.
 - Click the "Approve" button for a tag, and the "Reject" button for
   another tag.
 - Test the "Select all pending" link again. Only the tags awaiting
   moderation should be selected.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 99befa42c80eddec6e49aa1a86b77e74f529f0bd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26151: Remove the use of jquery.checkboxes plugin from suggestions management...
Owen Leonard [Wed, 5 Aug 2020 17:27:58 +0000 (17:27 +0000)]
Bug 26151: Remove the use of jquery.checkboxes plugin from suggestions management page

This patch removes the use of the jquery.checkboxes plugin from the
suggestions management page and replaces it with custom JS.

To test, apply the patch and go to Acquisitions -> Suggestions

Under each tab ("Accepted," "Pending," etc.), test that the "Check all"
and "Uncheck all" controls work correctly and only affect the table on
that tab.

Signed-off-by: Brandon J <brandon.jimenez@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f0275e6677891be3467dbfa34340665ed97605ec)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26504: Remove the use of jquery.checkboxes plugin from checkout notes page
Owen Leonard [Mon, 21 Sep 2020 19:16:14 +0000 (19:16 +0000)]
Bug 26504: Remove the use of jquery.checkboxes plugin from checkout notes page

This patch removes the inclusion of the jquery.checkboxes plugin from
the checkout notes page. It is unused.

To test, apply the patch and confirm that the AllowCheckoutNotes system
preference is enabled.

- Go to Circulation -> Checkout notes.
- Confirm that the "Select all" and "Clear all" links work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8620d1ec4b99a6182d59ebe889504b4b87e991a8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26217: Move translatable strings out of templates into acq.js
Owen Leonard [Fri, 14 Aug 2020 18:12:09 +0000 (18:12 +0000)]
Bug 26217: Move translatable strings out of templates into acq.js

This patch removes the definition of translatable strings out of
templates and into the JavaScript file, using the new JS i81n function.

To test:

- Apply the patch, go to acquisitions, and view a vendor.
- Click "Uncertain prices" in the sidebar menu.
- In the table of orders, enter something in the "price" form field
  which isn't a valid price. You should get an error message.

- Test the validation of fund amounts: Go to Administration -> Budgets
  and create an active budget if necessary.
- Add a fund to that budget. Try to save the fund with a fund amount
  which exceed the amount in the budget.
- You should get an error message: "Fund amount exceeds period
  allocation"
- Add a fund with valid data and then go to Administration -> Funds and
  locate the fun you just created.
- Use the "Actions" menu to add a sub fund to that fund.
- Try to save this new fund with an amount which exceeds the amount in
  the parent fund.
- You should get an error message, "Fund amount exceeds parent
  allocation."

Note: I was unable to properly test the error message "New budget-parent
is beneath budget." I couldn't figure out how to trigger it.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

> cd misc/translator
> perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/acq.js for translation, e.g.:

  msgid "Fund amount exceeds period allocation"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 912d911db2eff822b3a964cc84f7d2653d696815)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26256: Move translatable strings out of templates and into serials-toolbar.js
Owen Leonard [Wed, 19 Aug 2020 18:33:28 +0000 (18:33 +0000)]
Bug 26256: Move translatable strings out of templates and into serials-toolbar.js

This patch removes the definition of translatable strings out of
templates and into the corresponding JavaScript file, using the new JS
i81n function.

To test:

- Apply the patch and go to Serials and search for a subscription.
- Open the detail page for an open subscription.
- Click the "Close" button. You should get a confirmation, "Are you
  sure you want to close this subscription?"
- Confirm that you want to close it.
- When the page reloads, click the "Reopen" button. You should get a
  confirmation, "Are you sure you want to reopen this subscription?"
- Cancel.
- Choose Edit -> Delete subscription. You should get a confirmation,
  "Are you sure you want to delete this subscription?"
- Perform the same tests from the "Serial collection" page.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js for translation,
  e.g.:

  msgid "Are you sure you want to delete this subscription?"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ea72b15480c7230c03e7620e9900dc32ae0691c5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26243: (QA follow-up) Switch quotes to avoid translation issues
Katrin Fischer [Fri, 25 Sep 2020 20:24:20 +0000 (20:24 +0000)]
Bug 26243: (QA follow-up) Switch quotes to avoid translation issues

The QA script warned about text in single quotes which can be
a problem for languages like French that need to be able to use
these quotes in their translations.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 124560556efea775ceb04c77a0ef77cbc130f894)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26243: Move translatable strings out of templates and into circulation.js
Owen Leonard [Tue, 18 Aug 2020 18:45:56 +0000 (18:45 +0000)]
Bug 26243: Move translatable strings out of templates and into circulation.js

This patch removes the definition of translatable strings out of
templates and into the corresponding JavaScript file, using the new JS
i81n function.

To test:

- Apply the patch and check out to a patron.
- If there are none on the account, add a new message using the "Add a
  new message" link.
- Click "Delete" for that message.
- You should get a confirmation message, "Are you sure you want to
  delete this message? This cannot be undone."
- If necessary, enable the ExportCircHistory system preference.
- Check out to a patron who has one or more items checked out.
- Wihtout checking any checkboxes, click the "Export" button at the
  bottom of the page.
- You should get an error message, "You must select checkout(s) to
  export."
- Add a restriction the patron's account.
- Delete the restriction. You should get a confirmation message, "Remove
  restriction?"
- Perform the same tests from the patron detail page.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js for translation,
  e.g.:

  msgid "You must select checkout(s) to export"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 111b14dc965d51561add33d94eaf18616a815e88)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26118: Move translatable strings out of tags/review.tt and into tags-review.js
Owen Leonard [Fri, 31 Jul 2020 17:19:00 +0000 (17:19 +0000)]
Bug 26118: Move translatable strings out of tags/review.tt and into tags-review.js

This patch removes the section of the tags review template which defined
strings for translation. They can now be embedded in the JavaScript
file, wrapped in the __() function.

To test, apply the patch and clear your browser cache if necessary.

- Go to Tools -> Tags and perform some actions which will trigger the
  use of translated strings in the interface. For instance:
  - Approving and rejecting tags
  - Testing tags which are approved, rejected, or unclassified.
    - Status messages for these operations should work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

> cd misc/translator
> perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js for
  translation, e.g.:

  msgid "Both subfield values should be filled or empty."
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

> perl translate install fr-FR

- Switch to your newly translated language in the staff client and
  repeat the test plan above. The translated strings should appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b1a3aeb0624700627a2cb4e1069190e596d50d12)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26242: Remove one unused occurrences of MSG_NON_RESERVES_SELECTED
Jonathan Druart [Tue, 29 Sep 2020 08:48:04 +0000 (10:48 +0200)]
Bug 26242: Remove one unused occurrences of MSG_NON_RESERVES_SELECTED

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 88c40e50975957b1de4b5e6b097555ee61ff062b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25321: Remove 2 remaining occurrences of strings.inc
Jonathan Druart [Tue, 29 Sep 2020 12:26:58 +0000 (14:26 +0200)]
Bug 25321: Remove 2 remaining occurrences of strings.inc

They were used for browser.js

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d2afd19bc34b4cbd3d9c7d7b38a1d50cd79678e6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25321: Remove PLACE_HOLD from results.js
Jonathan Druart [Tue, 29 Sep 2020 09:12:23 +0000 (11:12 +0200)]
Bug 25321: Remove PLACE_HOLD from results.js

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ee5914b9b9531a97c24b0acce230aeb315334557)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Owen Leonard [Fri, 21 Aug 2020 12:11:11 +0000 (12:11 +0000)]
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript

This patch moves string definitions out of strings.inc and into the
corresponding JavaScript files.

To test, apply the patch and test various pages in the staff interface:

A few suggestions:

- Perform a catalog search and view the detail page for a bibliographic record.
  - Confirm that the search results browser in the left-hand sidebar
    work correctly and that the title attributes of the controls are
    correct.
- Locate a patron with multiple checkouts. View the checkout page and
  test the various controls in the table of checkouts: Renew, check in,
  return claims, etc.
- View the list of holds on a patron's account. Test suspending and
  resuming holds.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  msgid "Checked in"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for
  testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5fa99d7d59ffe65a3533c79a637b50f04e904736)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.js
Owen Leonard [Tue, 18 Aug 2020 17:09:31 +0000 (17:09 +0000)]
Bug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.js

This patch removes the definition of translatable strings out of
templates and into the corresponding JavaScript file, using the new JS
i81n function.

To test you must have the SMSSendDriver preference populated ("Email" is
fine).

- Apply the patch and go to Administration -> SMS cellular providers.
- Click "New SMS provider."
- The legend on the form's fieldset should read "Add an SMS cellular
  provider."
- Add an SMS provider.
- Edit an SMS provider.
- The legend on the form's fieldset should read "Edit provider <provider
  name>"
- If necessary, edit a patron's SMS settings to use one of your existing
  SMS providers.
- From the list of SMS providers, click to delete the provider which is
  in use.
- The error message should read "Are you sure you want to delete
  <provider name>? <number> patron(s) are using it!"
- Click to delete a provider which isn't in use. The error message
  should read "Are you sure you want to delete <provider>?"

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/sms_providers.js for translation,
  e.g.:

  msgid "Add an SMS cellular provider"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9e06e62a7fa59228d5aa8b4dcf16205dc33e8897)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26242: Move translatable strings out of results.tt and into results.js
Owen Leonard [Tue, 18 Aug 2020 17:43:22 +0000 (17:43 +0000)]
Bug 26242: Move translatable strings out of results.tt and into results.js

This patch removes the definition of translatable strings out of
templates and into the corresponding JavaScript file, using the new JS
i81n function.

To test:

- Apply the patch and perform a catalog search which will return
  multiple results.
- Without checking any checkboxes, click the "Add to Cart" button. You
  should see a message, "No item was selected."
- The same should happen if you select an item from the "Add to list"
  menu or click the "Place hold" button.
- Click the "Select all" link to check all checkboxes.
- Click the "Place hold" button.
- You will inevitably get a "One or more selected items cannot be placed
  on hold." message. If you were to want to complete this process you
  would have to painstakingly sift through each search result to find
  which item couldn't be placed on hold so that you could uncheck the
  corresponding checkbox. Luckily this test plan doesn't require you to
  do that.
- If you don't get an error message you're living in a catalog utopia
  unlike any I have ever seen.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/pages/results.js for translation,
  e.g.:

  msgid "Nothing is selected"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c2b14f6a1e1f4b80e2aab5ce111e67841b8b90a6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26334: Move translatable strings out of members-menu.inc into members-menu.js
Owen Leonard [Tue, 1 Sep 2020 12:24:57 +0000 (12:24 +0000)]
Bug 26334: Move translatable strings out of members-menu.inc into members-menu.js

This patch moves translatable strings out of members-menu.inc into
members-menu.js where they can be translated using the double-underscore
i18n function.

To test, apply the patch and go to Patrons.

- Expand the search options in the search header by clicking the [+]
  link.
- Select "Date of birth" from the "Search fields" dropdown.
  - A tooltip should appear above the search form, "Dates of birth
    should be entered in the format..." with your current date format.
- Remove all "Adult" type patron categories but one.
  - Check out to a child patron.
  - From the "More" menu choose "Update child to adult patron."
  - You should see a confirmation.
- From the checkout screen, from the "More" menu, choose "Renew patron"
  - You should get a confirmation.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/members-menu.js for translation,
  e.g.:

  msgid "Are you sure you want to renew this patron's registration?"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f04ea65fa35a1f906a177b4a14e672ba4a4c3790)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 years agoBug 26230: Move translatable strings out of item_search_fields.tt and into item_searc...
Owen Leonard [Mon, 17 Aug 2020 18:40:10 +0000 (18:40 +0000)]
Bug 26230: Move translatable strings out of item_search_fields.tt and into item_search_fields.js

This patch removes the definition of translatable strings out of
templates and into the corresponding JavaScript file, using the new JS
i81n function.

To test:

- Apply the patch, go to Administration -> Item search fields.
- If necessary, add a new search field.
- From the table of search fields, click the "Delete" button for one of
  the fields.
- You should get a confirmation: "Are you sure you want to delete this
  field?"

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

> cd misc/translator
> perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate the string pulled from
  koha-tmpl/intranet-tmpl/prog/js/item_search_fields.js for translation:

  #: koha-tmpl/intranet-tmpl/prog/js/item_search_fields.js:18
  msgid "Are you sure you want to delete this field?"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2c98f4849ddad3494e936a0b4ea39eca247dd9f2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>