koha.git
3 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>
3 years agoBug 21979: Add unit tests
Kyle M Hall [Fri, 25 Sep 2020 13:35:49 +0000 (09:35 -0400)]
Bug 21979: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of...
Kyle M Hall [Fri, 7 Dec 2018 19:32:00 +0000 (14:32 -0500)]
Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code

Some libraries need to send a different field as the collection code,
depending on how the library catalogs items. We should allow any arbitrary
item field to be used as the value for the CR field.

Test Plan:
1) Apply this patch
2) Set the new option cr_item_field to 'shelving_location'
3) Restart the SIP server
3) Perform a checkin via SIP
4) Note the CR field contains the shelving location code in the response
5) Perform an item information request
6) Note the CR field contains the shelving location code in the response

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23114: (QA follow-up) Slightly rephrase message when both barcode options are...
Katrin Fischer [Sat, 26 Sep 2020 18:36:12 +0000 (20:36 +0200)]
Bug 23114: (QA follow-up) Slightly rephrase message when both barcode options are used

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23114: Inventory: allow to scan barcodes
Matthias Meusburger [Wed, 26 Jun 2019 12:58:44 +0000 (14:58 +0200)]
Bug 23114: Inventory: allow to scan barcodes

This patch allows the user to scan barcodes in the inventory tool
(in addition to upload a barcode file, like in other tools)

Test plan:
 1) Apply the patch.
 2) Check that you can still upload a barcode file.
 3) Check that you can scan/enter barcodes in the new textarea.
 4) Check that if you both upload a barcode file and enter barcodes,
    you will be prompted to choose only one method.
 5) Check that you can then proceed to the next step by either resetting the
    upload file input or emptying the textarea.

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>
3 years agoBug 24155: (follow-up) Template fixes and updates
Owen Leonard [Fri, 18 Sep 2020 15:28:17 +0000 (15:28 +0000)]
Bug 24155: (follow-up) Template fixes and updates

This patch makes a few minor changes to the OPAC and staff interface
templates:

- In both, the "Apply field weights" checkbox will only appear after the
  "More options" button has been clicked. Otherwise a hidden input sets
  the value to 1.
- In both, the checkbox now appears below the search fields.
- Checkboxes are now wrapped in the <label> tag to ensure the label is
  clickable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24155: (follow-up) Add span with id to weighted search option
Nick Clemens [Mon, 31 Aug 2020 12:38:02 +0000 (12:38 +0000)]
Bug 24155: (follow-up) Add span with id to weighted search option

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24155: Apply weights if not advanced search
Nick Clemens [Mon, 18 May 2020 17:32:43 +0000 (17:32 +0000)]
Bug 24155: Apply weights if not advanced search

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24155: Make weighting an option on advanced search
Nick Clemens [Wed, 26 Feb 2020 14:30:17 +0000 (14:30 +0000)]
Bug 24155: Make weighting an option on advanced search

Currently we apply weighting to all searches except advanced search. The theory
being that when selecting indexes we don't want to apply weights. When searching
in ES weights are only applied to relevant results so it doesn't matter.

i.e. if weighting author*100 but searching subject, a term matching the subject search in author
is not boosted.

Given this, we should always apply weights, unless the user wishes not to

To test:
1 - Set some weighting
2 - Do some searches
3 - Note your terms and results, try advanced and regular searches specifying indexes or not
4 - Apply patch
5 - Note that opac and staff advanced search have option to apply weights
6 - Compare searches after the patch to see how weighting affects, it should be beneficial or not at all

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24322: Simplify condition to separate elements
Jonathan Druart [Wed, 30 Sep 2020 12:33:47 +0000 (14:33 +0200)]
Bug 24322: Simplify condition to separate elements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24322: National Library of Medicine (NLM) call number to XSLT Detail
Olli-Antti Kivilahti [Sun, 13 Sep 2020 21:57:41 +0000 (23:57 +0200)]
Bug 24322: National Library of Medicine (NLM) call number to XSLT Detail

This adds MARC21 060 - National Library of Medicine Call Number
https://www.loc.gov/marc/bibliographic/bd060.html

To test:
- Catalog records using the 060, examples can be found in the
  LOC documentation.
- Verify that the field displays on the detail pages in staff
  and OPAC

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
RRescued this patch by redoing the changes. Only change made
was moving the section up before "Other classification".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25242: Compiled CSS
Jonathan Druart [Thu, 1 Oct 2020 08:33:08 +0000 (10:33 +0200)]
Bug 25242: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 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>
3 years agoBug 25771: Allow the user to sort checkouts by the renew column in the OPAC
Owen Leonard [Tue, 16 Jun 2020 13:16:30 +0000 (13:16 +0000)]
Bug 25771: Allow the user to sort checkouts by the renew column in the OPAC

This patch makes it possible for the logged-in OPAC user to sort their
checkouts by the number of renewals they have remaining on their
checkouts.

To test, apply the patch and log in to the OPAC as a user with multiple
checkouts. To fully test the patch's functionality the user's checkouts
should have a varying number of renewals available.

On the "your summary" page, confirm that the "Renew" column is now
sortable and that it sorts correctly by the number of renewals left on
each checked-out item.

Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25776: DBIC schema changes
Jonathan Druart [Wed, 30 Sep 2020 15:33:33 +0000 (17:33 +0200)]
Bug 25776: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25776: DBRev 20.06.00.042
Jonathan Druart [Wed, 30 Sep 2020 14:16:31 +0000 (14:16 +0000)]
Bug 25776: DBRev 20.06.00.042

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25776: (QA follow-up) Add missing filter
Martin Renvoize [Thu, 17 Sep 2020 08:02:32 +0000 (09:02 +0100)]
Bug 25776: (QA follow-up) Add missing filter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25776: (follow-up) Fix sorting by change date in notices table
Katrin Fischer [Mon, 31 Aug 2020 21:53:29 +0000 (21:53 +0000)]
Bug 25776: (follow-up) Fix sorting by change date in notices table

Some markup was missing to sort the date correctly.

To test:
- Verify date sorting in the notices table works as expected

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>
3 years agoBug 25776: Add a 'last updated' column for notices
Katrin Fischer [Thu, 27 Aug 2020 10:38:25 +0000 (10:38 +0000)]
Bug 25776: Add a 'last updated' column for notices

This add an 'udated_on' column to the letter table and displays
the information in 'slips and notices'.

To test:
- Apply patch
- Run updatedatabase
  Note: the existing letters will all be set to the
  currnet date).
- Go to Tools > Notices and slips
- Verify there is a new column "Last updated" in the table
  Note: The table will always display the newest change date
  of the different message transport types.
- Edit any notice
- Verify the "Last updated" is shown for any transport type
  with an existing notice definition
- Edit and add a notice
- Verify the dates are correctly stored
- Test the column configuration for the new column works
  correctly

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>
3 years agoBug 26484: Add serials-related reports to serials sidebar menu
Owen Leonard [Fri, 18 Sep 2020 13:14:33 +0000 (13:14 +0000)]
Bug 26484: Add serials-related reports to serials sidebar menu

This patch adds a section to the serials sidebar menu for showing
serials reports.

To test, apply the patch and go to Serials.

- If you are logged in as a user with permission to access reports you
  should see a new "Reports" heading in the sidebar menu and a link to
  the serials statistics wizard.
- Confirm that the link works correctly.
- Log in as a user without reports permission and confirm that the
  section doesn't 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>
3 years agoBug 26089: Add acquisitions-related reports to acquisitions sidebar menu
Owen Leonard [Wed, 29 Jul 2020 15:18:12 +0000 (15:18 +0000)]
Bug 26089: Add acquisitions-related reports to acquisitions sidebar menu

This patch adds links to two acquisitions-related reports in the sidebar
menu shown on acquisitions pages: Acquisitions statistics wizard and
orders by fund.

To test, apply the patch and go to the Acquisitions page.

- If you are logged in as a user with permission to access reports you
  should see a new "Reports" heading in the sidebar menu and links to
  two reports.
- Confirm that the links work correctly.
- Log in as a user without reports permission and confirm that the
  section doesn't appear.

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>
3 years agoBug 26207: (follow-up) Hide comparison toolbar if there are no comparisons
Owen Leonard [Mon, 28 Sep 2020 11:09:01 +0000 (11:09 +0000)]
Bug 26207: (follow-up) Hide comparison toolbar if there are no comparisons

This patch adds a check to the JavaScript so that the comparisons
toolbar will be hidden if there are no system preferences in the results
to compare.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26207: (follow-up) Remove whitespace from markup
Owen Leonard [Thu, 20 Aug 2020 12:47:01 +0000 (12:47 +0000)]
Bug 26207: (follow-up) Remove whitespace from markup

Markup indentation around log entries in the template cause extra
whitespace in the diff view. Removing the markup whitespace corrects it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26207: Compare values of system preference log entries
Owen Leonard [Fri, 14 Aug 2020 12:08:10 +0000 (12:08 +0000)]
Bug 26207: Compare values of system preference log entries

This patch adds the ability to compare the values of system preferences
in the system log. The user can select two entries in the log search
results and view a diff of the two versions.

The feature is designed specifically for CSS and JS preferences like
OpacUserCSS or OpacUserJS where code changes are difficult to track.

To test, apply the patch and go to Tools -> Log viewer. You may need to
add values and make changes to preferences like OpacUserCSS if you don't
already have a history in your logs.

- Perform a search for log entries in the "System prefs" module.
- In the results, each entry for a system preference should have a
  "Compare" checkbox."
- Check one of the checkboxes.
  - The table should now be filtered by the system preference name. This
    facilitates meaningful selections for comparison.
  - You should see a message displayed onscreen, "Showing results
    for...[ preference name]"
  - The "Check none" link in the toolbar above the table should now be
    enabled.
  - If youy click the "Compare selected" link in the toolbar at this
    stage you should get a message, "You must select two entries to
    compare."
  - If you uncheck the checkbox the table should return to an unfiltered
    state.
- Check two checkboxes.
  - The "Compare selected" link in the toolbar should now be enabled.
  - Next to each of the checkboxes you checked should be a "View
    comparison" link.
  - Clicking either of the "View comparison" links or the "Compare
    selected" link should trigger a modal with the diff view of the two
    preferences.
- Try to select a third checkbox. You should get a message, "You can
  select a maximum of two checkboxes." The box should remain unchecked.
- Test that unchecking both checkboxes manually clears the table filter.
- Test that the "Check none" link works to uncheck checked boxes and
  clear the table filter.

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>
3 years agoBug 26266: Add jQuery validator to opac-password-recovery.tt
Timothy Alexis Vass [Fri, 18 Sep 2020 05:55:22 +0000 (05:55 +0000)]
Bug 26266: Add jQuery validator to opac-password-recovery.tt

To test:
0) Activate password reset in system preferences.
1) Initiate a password recovery.
2) Try to submit with an invalid password.
3) Confirm that validation occurs.
4) Try to submit with mismatching passwords.
5) Confirm that validation occurs.
6) Sign off.

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>
3 years agoBug 26268: DBIC schema changes
Jonathan Druart [Wed, 30 Sep 2020 15:32:01 +0000 (17:32 +0200)]
Bug 26268: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: DBRev 20.06.00.041
Jonathan Druart [Wed, 30 Sep 2020 14:16:31 +0000 (14:16 +0000)]
Bug 26268: DBRev 20.06.00.041

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: Fix deleteditems query in DB rev
Jonathan Druart [Tue, 29 Sep 2020 15:05:54 +0000 (17:05 +0200)]
Bug 26268: Fix deleteditems query in DB rev

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: Remove invalid mappings from MARC frameworks when items.paidfor is removed
Katrin Fischer [Fri, 25 Sep 2020 20:09:33 +0000 (20:09 +0000)]
Bug 26268: Remove invalid mappings from MARC frameworks when items.paidfor is removed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: Correct mapping for internal note to items.itemnotes_nonpublic
Katrin Fischer [Sat, 26 Sep 2020 21:44:02 +0000 (23:44 +0200)]
Bug 26268: Correct mapping for internal note to items.itemnotes_nonpublic

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: (QA follow-up) Conditionally remove
Martin Renvoize [Fri, 11 Sep 2020 11:51:47 +0000 (12:51 +0100)]
Bug 26268: (QA follow-up) Conditionally remove

This patch adds conditions to prevent the removal of items.paidfor if it
is populated and also adds the removal fo the marc_subfield_structure
row if it exists.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: (QA follow-up) Split DB update checks
Martin Renvoize [Fri, 4 Sep 2020 16:04:53 +0000 (17:04 +0100)]
Bug 26268: (QA follow-up) Split DB update checks

This patch splits the DB update such that the 'paidfor' field is checked
for distinctly in the deleteditems table rather than assuming if it
exists in the items table it will also exist in deleteditems.

We also correct the check as highlights by Julian.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: Remove final references to paidfor db field
Martin Renvoize [Fri, 21 Aug 2020 10:29:10 +0000 (11:29 +0100)]
Bug 26268: Remove final references to paidfor db field

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26268: Remove items.paidfor from the database
Martin Renvoize [Fri, 21 Aug 2020 10:25:12 +0000 (11:25 +0100)]
Bug 26268: Remove items.paidfor from the database

In bug 19919 we removed all references to setting, unsettling and
referring to the paidfor field but we neglected to actually drop the
field from the database (I think I intended to do this, but was asking
for feedback on the approach before adding the actual db change.. then
completely forgot when it went through SO/QA quickly).

In bug 23463 we inadvertently re-introduced some of the setting code
during a rebase.

In bug 18501 we then moved that inadvertently re-introduced setter into
Koha::Item->store.

We should kill it off once and for all!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26299: Use same SMS number help text in OPAC as staff interface
Nick Clemens [Thu, 3 Sep 2020 13:25:45 +0000 (13:25 +0000)]
Bug 26299: Use same SMS number help text in OPAC as staff interface

The SMS number help text in the OPAC follows a North American phone
number style. It should be more generic. To that end, this patch
makes the OPAC use the same help text for SMS numbers as
the staff interface

To test:
1) Apply the patch
2) Set "SMSSendDriver" to "Anything" in global system preferences
3) Go to the following link and note the help text by SMS number
http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51
4) Go to http://localhost:8080/cgi-bin/koha/opac-messaging.pl
5) Note that the help text in both interfaces uses the same wording

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>
3 years agoBug 26325: Add primary_key_exists check to C4::Installer
Nick Clemens [Mon, 31 Aug 2020 16:43:53 +0000 (16:43 +0000)]
Bug 26325: Add primary_key_exists check to C4::Installer

To test:
1 - prove -v t/db_dependent/Installer.t

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>
3 years agoBug 26338: Compiled CSS
Jonathan Druart [Thu, 1 Oct 2020 08:32:10 +0000 (10:32 +0200)]
Bug 26338: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26338: Show tool plugins run in tools home
Fridolin Somers [Tue, 1 Sep 2020 13:43:19 +0000 (15:43 +0200)]
Bug 26338: Show tool plugins run in tools home

In tools home there is a link to the table showing tool plugins.
Would be great to be able to run a tool plugin directly from tools home.

Also adds the behavior than if there is no tool plugin, "Tool plugins"
section is not displayed in tools home.
No need of a link that goes to an empty table ;)

Test plan :
1) Enable plugins, dont install any
2) Go to "Tools" module : /cgi-bin/koha/tools/tools-home.pl
3) Check you dont see "Tool plugins"
4) Install a tool plugin like Carrousel https://inlibro.com/instructions-carrousel/
5) Refresh /cgi-bin/koha/tools/tools-home.pl
6) Check you see "Tool plugins" and a link to Carrousel
7) Click on link to Carrousel => You see plugin run
8) Disable Carrousel plugin
9) Refresh /cgi-bin/koha/tools/tools-home.pl
10) Check you dont see "Tool plugins"

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>
3 years agoBug 26425: Update history.txt
Jonathan Druart [Fri, 11 Sep 2020 07:36:21 +0000 (09:36 +0200)]
Bug 26425: Update history.txt

With the modifications brought by
https://gitlab.com/koha-community/release-tools/-/issues/18

After the manual changes we can run the script with the 3 commits from
the issue #18 of release-tools.

* Add missing whitespace to align the dates
* Add all the releases (from the tag list) after 3.00.00

There is no change in the developers  numbering, neither in the wording.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26425: Manual changes
Jonathan Druart [Fri, 11 Sep 2020 07:33:27 +0000 (09:33 +0200)]
Bug 26425: Manual changes

Patches will be squashed when pushed.
Here the changes are done manually, we add the missing 0 for the
releases after 3.00.00 (with alpha, beta, etc)
And we remove all the laters, that will added automatically by the
release script

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26432: Remove unused ModZebrations
Marcel de Rooy [Fri, 11 Sep 2020 08:55:28 +0000 (08:55 +0000)]
Bug 26432: Remove unused ModZebrations

Test plan:
Git grep on ModZebrations

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26454: DBRev 20.06.00.040
Jonathan Druart [Wed, 30 Sep 2020 14:16:31 +0000 (14:16 +0000)]
Bug 26454: DBRev 20.06.00.040

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26454: Add system preference to set meta description for the OPAC
Timothy Alexis Vass [Wed, 16 Sep 2020 06:35:15 +0000 (08:35 +0200)]
Bug 26454: Add system preference to set meta description for the OPAC

Websites should have a meta description tag that shows in search engine results.
The content should also be available to set as a system preference.

To test:
1) Look at opac-main source (in the browser) and see that meta name="description" is missing.
2) Apply patch.
3) Run: perl installer/data/mysql/updatedatabase.pl
4) Go to system preferences > OPAC and add a description to OpacMetaDescription.
5) Look at opac-main source and confirm that meta name="description" now has content equal to the text set in the OpacMetaDescription system preference.
6) Sign off.

Sponsored by: Lunds University Libraries
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Newlines are preserved. Double quote is rendered
as &quot;. Nice enhancement!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26462: Don't delete existing data for tests
Nick Clemens [Tue, 15 Sep 2020 10:11:33 +0000 (10:11 +0000)]
Bug 26462: Don't delete existing data for tests

These tests generate their own items, patrons, and circ rules. Existing
system data will not affect the results of the tests. We do not need
to delete information.

You may be able to notice the difference in speed of tests depending on your system. It should
be faster after applying

To test:
1 - Before applying patch:
    prove -v t/db_dependent/Holds.t
2 - It passes
3 - Apply patch
4 - prove -v t/db_dependent/Holds.t
5 - It passes

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>
3 years agoBug 26458: Get item details using only itemnumber
Owen Leonard [Mon, 14 Sep 2020 16:56:21 +0000 (16:56 +0000)]
Bug 26458: Get item details using only itemnumber

This patch modifies moredetail.pl so that it can accept an itemnumber as
a single parameter.

To test, apply the patch and view a bibliographic record in the
catalog which has one or more items.

 - In the table showing holdings, click the barcode to view the item
   detail page for that item.
 - In the location bar, modify the URL so that it uses only the
   itemnumber parameter, e.g.

   /cgi-bin/koha/catalogue/moredetail.pl?itemnumber=1234

   The page should load correctly, showing information about just that
   item.

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>
3 years agoBug 26473: Get items for editing using only itemnumber
Owen Leonard [Wed, 16 Sep 2020 15:19:41 +0000 (15:19 +0000)]
Bug 26473: Get items for editing using only itemnumber

This patch modifies additem.pl so that it can accept an itemnumber as
a single parameter.

To test, apply the patch edit items on a bibliographic record which has
one or more items.

- In the location bar, modify the URL so that it uses only the
  itemnumber parameter, e.g.

  /cgi-bin/koha/cataloguing/additem.pl?itemnumber=12345

  The page should load the correct record's items.

- If you add the "op" parameter it should load the item for editing in
  the form:

  /cgi-bin/koha/cataloguing/additem.pl?itemnumber=12345&op=edititem

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>
3 years agoBug 26501: Add datatables to article-requests form
Marcel de Rooy [Mon, 21 Sep 2020 11:29:18 +0000 (11:29 +0000)]
Bug 26501: Add datatables to article-requests form

Actually two tables: one for pending and processing.
Variable active_table has been renamed to active_tab.
To prevent a flickering form we hide stuff until ready.

Test plan:
[1] Submit a few article requests.
[2] Verify that Process, Complete and Cancel still work via Actions.
[3] Test again with multiselect and top Actions menu.
[4] Test Search and Sort on the datatable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
3 years agoBug 26524: Save some processor cycles
Jonathan Druart [Tue, 29 Sep 2020 14:06:19 +0000 (16:06 +0200)]
Bug 26524: Save some processor cycles

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26524: Add Koha::Acquisition::Basket->orders
Tomas Cohen Arazi [Wed, 23 Sep 2020 18:56:41 +0000 (15:56 -0300)]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D

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>
3 years agoBug 26524: Unit tests
Tomas Cohen Arazi [Wed, 23 Sep 2020 18:56:32 +0000 (15:56 -0300)]
Bug 26524: Unit tests

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>
3 years agoBug 26530: Use patron card number as checkbox label during patron merge
Owen Leonard [Fri, 11 Sep 2020 16:32:29 +0000 (16:32 +0000)]
Bug 26530: Use patron card number as checkbox label during patron merge

This patch makes a minor change the the merge patrons template so that
on the patron selection stage the user can click the card number to
select the radio button.

To test, apply the patch and perform a patron search in the patrons
module.

- In patron search results, select two patrons to merge.
- Click the "Merge selected patrons" button.
- On the page showing the two patrons to merge, click each of the card
  numbers to confirm that it selects the correct radio button.

Signed-off-by: Jennifer <jennifer.marlatt@coronaca.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 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>
3 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>
3 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>
3 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>
3 years agoBug 26164: (and bug 26419) Compiled CSS
Jonathan Druart [Tue, 29 Sep 2020 09:47:41 +0000 (11:47 +0200)]
Bug 26164: (and bug 26419) Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26562: Removes 'searches' from localStorage on logout
Jonathan Druart [Tue, 29 Sep 2020 09:43:00 +0000 (11:43 +0200)]
Bug 26562: 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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 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>
3 years agoBug 26330: Change encoding of text used as tab triggers in MARC subfield constraints
Owen Leonard [Tue, 1 Sep 2020 11:51:25 +0000 (11:51 +0000)]
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints

This patch changes the encoding of the data being used to define
jQueryUI tabs on the MARC subfield constraints page. A jQueryUI bug
prevents non-Latin-1 characters from being used when defining tab
controls. Using Template:Toolkit's "uri" filter converts the data to
usable characters.

To test, apply the patch and go to Administration -> MARC frameworks ->
MARC structure -> tag 952 -> Edit subfields.

- Under the "New" tab, add a subfield code which is outside the basic
  Latin character set, e.g. £, §, æ.
- Save changes.
- Edit any subfield code to load the subfield constraints page again.
- Test that the subfield code tabs work correctly: Clicking each tab
  should load only the corresponding panel.
- Test a variety of tabs including the one you created with the
  non-Latin character.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 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>
3 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>
3 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>
3 years agoBug 26164: Replace OPAC table sort icons with SVG
Owen Leonard [Sat, 8 Aug 2020 13:15:43 +0000 (13:15 +0000)]
Bug 26164: Replace OPAC table sort icons with SVG

This patch modifies the OAPC CSS to convert table sorting icons from PNG
to SVG. These icons are added via background-image data-urls, so only
the SCSS file is modified.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface).

- Clear your browser cache if necessary
- View any DataTable in the OPAC, for instance the table of
  checkouts under the logged-in user's "your summary" tab.
- Confirm that the sorting icons in the table headers look
  correct in each state: Sorted ascending, sorted descending, and
  unsorted.

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>
3 years agoBug 26419: Replace OPAC Koha logo with SVG
Owen Leonard [Tue, 9 Jun 2020 19:37:19 +0000 (19:37 +0000)]
Bug 26419: Replace OPAC Koha logo with SVG

This patch replaces the OPAC Koha logo PNG file with an SVG version.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Clear your browser cache if necessary.
 - View any page in the OPAC. The Koha logo in the upper-left corner of
   the screen should look good.

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>
3 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>
3 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>
3 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>
3 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>
3 years agoBug 24958: Remember last selected tab in SQL reports
Owen Leonard [Tue, 14 Apr 2020 18:49:35 +0000 (18:49 +0000)]
Bug 24958: Remember last selected tab in SQL reports

This patch modifies the saved reports page so that it remembers, for the
duration of the browser session, the last active tab.

To test you should have multiple reports in multiple report groups.
Apply the patch and go to Reports -> Saved reports.

- Select a tab to filter the table of saved reports to a particular
  report group.
- Navigate away from the page
- Return to the save reports page. The tab you previously selected
  should be selected again.
- Restart your browser and return to the saved reports page. The tab
  should no longer be preselected.

Update: The tabs filtering JavaScript has been moved to a separate
function so that the function can be triggered by both the "create"
event (when the tabs are initialized) and the "activate" event (when a
tab is selected).

Update II: Persistence is now enable through localStorage instead of
Cookies. The localStorage item is now cleared during the logOut
function.

Update III: The logOut() function in staff-global.js is now called by
auth.tt to ensure that tabs are not remembered across sessions.

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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 years agoBug 26237: Move translatable strings out of preferences.tt and into JavaScript files
Owen Leonard [Tue, 18 Aug 2020 15:11:10 +0000 (15:11 +0000)]
Bug 26237: Move translatable strings out of preferences.tt and into JavaScript files

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 (a non-comprehensive list):

- Apply the patch, go to Administration -> System preference
- Modify any system preference. "modified" should appear next to the
  preference name.
- Click the "Save" button. You should get a message, "Saved preference
  <pref name>"
- Hover your mouse over a section heading (e.g. "Features" under
  Accounting). You should see a tooltip, "Click to collapse this
  section."
- Click to collapse the section. The tooltip should change to "Click to
  expand the section."
- Open a new tab for the staff interface and log out.
- In the original tab, modify and try to save a system preference. You
  should get a message, "Error; your data might not have been saved."

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/preferences.js for
  translation, e.g.:

  msgid "Saved preference %s"
  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>
3 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>
3 years agoBug 26395: Move translatable strings out of letter.tt into letter.js
Owen Leonard [Fri, 4 Sep 2020 19:10:50 +0000 (19:10 +0000)]
Bug 26395: Move translatable strings out of letter.tt into letter.js

This patch moves strings defined for translation in letter.tt
into letter.js for translation using the new double-underscore
i81n function.

Note, the "MSG_NO_NOTICE_FOUND" usage has been removed because it didn't
work.

To test, apply the patch and go to Tools -> Notices & Slips.

- Use the "Copy" dropdown to copy an existing notice to a specific
  library.
- Save the copied notice.
- Return to the "All libraries" view on the Notices & Slips page.
- Repeat the same process above: Copy the same notice to the same
  library.
- When you click save on the "Add notice" page you should get an error
  message, "A letter with the code 'ACCTDETAILS' already exists for
  <library>"

- From the "All libraries" view on the Notices & Slips page, copy the
  text in the "Code" column of an existing notice.
- Click "New notice" and choose the module of the notice you copied
  from.
- On the "Add notice" page, paste the code into the "Code" field and
  enter a name in the "Name" field.
- Click "Save" without making any other changes. You should get an error
  message, "Please fill at least one template."
- Enter some data into one of the message body fields but not message
  subject, and click "Save" again.
- You should get an error, "Please specify title and content for
  <notice>"
- Enter data in the message subject field and click "Save" again.
- You should get an error, "A default letter with the code <CODE>
  already exists."

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/letter.js for translation,
  e.g.:

  msgid "Please fill at least one template."
  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>
3 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>
3 years agoBug 26229: Move translatable strings out of categories.tt and into categories.js
Owen Leonard [Mon, 17 Aug 2020 14:50:46 +0000 (14:50 +0000)]
Bug 26229: Move translatable strings out of categories.tt and into categories.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 -> Patron categories
- Click "New category"
- Enter some special characters in the "Category code" field, e.g.
  "%^&*"
- Try to submit the form without filling in any other details.
- The category code field should have a validation message, "Category
  code can only contain the following characters: letters, numbers, -
  and _."
- The enrollment period fields should have a validation message, "Please
  choose an enrollment period in months OR by date."
- Enter valid data and confirm that the form can be submitted.

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/categories.js for translation, e.g.:

  msgid "Please choose an enrollment period in months OR by date."
  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>
3 years agoBug 26441: Move translatable strings out of catalog-strings.inc into catalog.js
Owen Leonard [Fri, 11 Sep 2020 19:39:08 +0000 (19:39 +0000)]
Bug 26441: Move translatable strings out of catalog-strings.inc into catalog.js

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

To test that each affected string correctly appears in the interface:

- View the details for a bibliographic record which has items attached.
- From the Edit menu, choose "Delete record." You should get an alert,
  "X item(s) are attached to this record. You must delete all items
   before deleting this record."
- From the Edit menu, choose "Delete all items." You should get an
  alert, "Are you sure you want to delete the X attached items?"

- When logged in as a user with acquisitions and cataloging privileges,
  view the details for a bibliographic record which is used in an order
  in Acquisitions. Delete any items attached.
- Choose "Delete record" from the Edit menu. You should get an alert,
  "Warning: This record is used in X order(s). Deleting it could cause
  serious issues on acquisition module. Are you sure you want to delete
  this record?"
- In Acquisitions, view a basket containing orders. Cancel the
  order for a title in the basket. Open the detail page for the title in
  the cancelled order. Try to delete it. You should get an confirmation,
  "X deleted order(s) are using this record. Are you sure you want to
  delete this record?"
  - Perform the same test as a user with cataloging but not acquisitions
    privileges. The alert should say "X deleted order(s) are using this
    record. You need order managing permissions to delete this record."

- When logged in as a user with cataloging but not acquisitions
  privileges, view the details for a bibliographic record which is used
  in an order in Acquisitions. Delete any items attached.
- Choose "Delete record" from the Edit menu. You should get an alert, "X
  order(s) are using this record. You need order managing permissions to
  delete this record."

- View the details for a bibliographic record which has a hold.
- Choose "Delete all items" from the Edit menu. You should get an alert,
  "X hold(s) on this record. You must delete all holds before deleting
  all items."
- View the details for a bibliographic record which has no items.
- Choose "Delete record" from the Edit menu. You should get an alert,
  "Are you sure you want to delete this record?"
- Choose "Edit items in a batch" from the Edit menu. You should get an
  alert, "This record has no items."

I could not find any instance of the PopupZ3950Confirmed function in
catalog.js being triggered so I don't think the associated string can be
tested.

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/catalog.js for
  translation, e.g.:

  msgid "This record has no items."
  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>
3 years agoBug 26225: Move translatable strings out of biblio_framework.tt and into biblio_frame...
Owen Leonard [Mon, 17 Aug 2020 13:04:27 +0000 (13:04 +0000)]
Bug 26225: Move translatable strings out of biblio_framework.tt and into biblio_framework.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 -> MARC bibliographic framework.
- Click Actions -> Export and save the file.
- Click Actions -> Import.
- Select a file which isn't CSV or ODS. You should get an error message,
  "Please select a CSV (.csv) or ODS (.ods) spreadsheet file."
- Select the file you exported previously and click "Import." You should
  see an error message, "Are you sure you want to replace the fields and
  subfields for the default framework structure? ..."
- Click "OK." You should see a message in the modal window, "Importing
  to framework:..."
- Edit your exported framework file in such a way that it isn't a valid
  framework export.
- Repeat the process of importing the file. You should get an error
  message, "Error importing the framework..."

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/biblio_framework.js for translation,
  e.g.:

  msgid "Please select a CSV (.csv) or ODS (.ods) spreadsheet file"
  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.

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26225: Move translatable strings out of audio_alerts.tt and into audio_alerts.js
Owen Leonard [Mon, 17 Aug 2020 12:26:39 +0000 (12:26 +0000)]
Bug 26225: Move translatable strings out of audio_alerts.tt and into audio_alerts.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 -> Audio alerts.
- Click the "Delete selected alerts" button without checking any
  checkboxes. You should see an error: "Check the box next to the alert
  you want to delete."
- Check the checkbox for an existing sound and click "Delete selected
  alerts." You should get a confirmation message, "Are you sure you want
  to delete the selected audio alerts?"
- Click "New alert."
- Without filling any details, click the "Play sound" button. You should
  see an error message, "Please select or enter a sound."

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/audio_alerts.js for translation, e.g.:

  msgid "Are you sure you want to delete the selected audio alerts?"
  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>
3 years agoBug 26339: Move translatable strings out of addorderiso2709.tt into addorderiso2709.js
Owen Leonard [Tue, 1 Sep 2020 13:46:35 +0000 (13:46 +0000)]
Bug 26339: Move translatable strings out of addorderiso2709.tt into addorderiso2709.js

This patch moves strings defined for translation in addorderiso2709.tt
into addorderiso2709.js for translation using the new double-underscore
i81n function.

To test, apply the patch and go to Acquisitions -> Vendor -> Basket ->
Add orders from MARC file.

 - Click "Add orders" next to a staged file.
 - Without making any selections, click "Save." You should get an error,
   "There is no record selected."
 - Select a record and click "Save." You should get an error, "Some
   budgets are not defined in item records."
 - Enter a non-numeric value in the "Quantity" field and click "Save."
   You should get an error, "1 quantity values are not filled in or are
    not numbers."

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/addorderiso2709.js for translation,
  e.g.:

  msgid "Some budgets are not defined in item records"
  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>
3 years agoBug 25317: Move translatable strings out of additem.js.inc
Owen Leonard [Thu, 20 Aug 2020 15:53:28 +0000 (15:53 +0000)]
Bug 25317: Move translatable strings out of additem.js.inc

This patch moves the definition of translatable strings out of
additem.js.inc and into additem.js using the new JS i81n function.
additem.js.inc is removed, being obsolete.

To test:

When creating an order:

- Go to Administration -> System preferences and set "AcqCreateItem" to
  "when placing an order."
- Apply the patch and go to Acquisitions -> Vendor -> Add to basket ->
  From a new (empty) record.
- In the "Item" section, confirm that the buttons at the bottom of the
  form are correct: "Add item," "Clear," and "Add multiple items."
- Click "Add multiple items." The placeholder in the revealed form field
  should read "Number of items to add." The corresponding button should
  be labeled "Add."
- You should see a note, "NOTE: Fields listed in the 'UniqueItemsFields'
  system preference will not be copied."
- Fill out the item entry form and add a number to the "multiple items"
  field. Click "Add."
- A table of items should be displayed with "Edit" and "Delete" buttons
  for each new item.
- Click one of the "Edit" buttons. The item form should be populated
  with the item's data, with an "Update item" button at the bottom.

When receiving an order:

- Go to Administration -> System preferences and set "AcqCreateItem" to
  "when receiving an order."
- Go to Acquisitions -> Vendor -> Receive shipments.
- Select or create an invoice.
- Click "Receive" on an order which has a quantity greater than 1.
- Add two items, duplicating in each at least one value which is marked
  as unique by the "UniqueItemFields" system preference (e.g. fill in
  the same barcode number for each item).
- Click "Save." You should get an alert about duplicated values, and
  there should be an alert message on the page, "barcode 'XXX' is
  duplicated."
- Edit one of the two items and change the barcode to one which already
  exists in your database.
- Click "Save." An alert message should be shown on the page, "barcode
  'XXX' already exists in the database."
- Note: I was unable to find out how to trigger this error, "You can't
  receive any more items." It may be obsolete.

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/additem.js for translation,
  e.g.:

  msgid "Add multiple items"
  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>
3 years agoBug 7143: Update about page for new dev - Alexis Ripetti
Jonathan Druart [Mon, 28 Sep 2020 14:18:51 +0000 (16:18 +0200)]
Bug 7143: Update about page for new dev - Alexis Ripetti

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26322: Permissions not checked correctly for plugins
Tomas Cohen Arazi [Mon, 31 Aug 2020 12:43:09 +0000 (09:43 -0300)]
Bug 26322: Permissions not checked correctly for plugins

This patch fixes the logic in a condition to address the fact that
permissions are not checked for plugins. This was due to bad parenthesis
pairing and the lack of good tests for this.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Tests fail because of bad logic
3. Apply this patch
4. Repeat (2)
=> SUCCESS: Tests pass!
5. Verify the tests cover the use cases that are needed:
   - Anonymous access
   - Real user with wrong permissions (parameters => 1)
   - Real user with right permissions (borrowers => 1)
=> SUCCESS: Needed use cases so we catch any regression are found
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26322: Regression tests
Tomas Cohen Arazi [Mon, 31 Aug 2020 12:36:56 +0000 (09:36 -0300)]
Bug 26322: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26556: (bug 25070 follow-up) Fix typo data_addressfield in address includes
Fridolin Somers [Mon, 28 Sep 2020 13:47:34 +0000 (15:47 +0200)]
Bug 26556: (bug 25070 follow-up) Fix typo data_addressfield in address includes

Selecting "main address" city or "alternate address" city does not trigger the automatic population of values to the city, state, and zip fields anymore.
It woks for "alternate contact".

Test plan :
1) Create some cities with all datas : city, state, zip code and country
2) Open patron creation form
3) On "main address", select a city in combobox
4) Check city, state, zip code and country are filled
5) Same with "alternate address"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11176: Add active switch on budgets select in suggestions
Fridolin Somers [Thu, 24 Sep 2020 12:21:43 +0000 (14:21 +0200)]
Bug 11176: Add active switch on budgets select in suggestions

When creating a new purchase suggestion, all funds display and are available for selection.
The behaviour of this drop-down menu should mirror that of those drop-down menus elsewhere in acquisitions,
where only funds that are linked to active budgets display to the user.

This patch add the active switch based on what exists in acqui/invoice.tt and acqui/invoice.pl.

Looks like actually in suggestion.pl budgets list was fetches with GetBudgets().
But this is for the filter in 'Acquisition information'.
Budgets selection on suggestion creation/edition must use GetBudgetHierarchy(), like in acqui/invoice.pl,
in order to have the actif status.

Test plan :
1) Create a budget periods active B1 with a fund F1
2) Create a budget periods inactive B2 with a fund F2
3) Go to suggestions module
4) Create a new suggestion
5) Check you see only active fund F1
6) Click on 'Show inactive'
7) Check you see also 'F2 (inactive)'
8) Choose fund F1 and save
9) Select the suggestion and edit
10) Check fund F1 is selected
11) Come back to suggestion table
12) Check filter 'Book fund' under 'Acquisition information' contains all funds

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>
3 years agoBug 11223: Fix the ind1 semantics for 785 in the staff interface
Katrin Fischer [Mon, 21 Sep 2020 04:49:48 +0000 (04:49 +0000)]
Bug 11223: Fix the ind1 semantics for 785 in the staff interface

For 780 and 785 the field should not display when the first indicator
is 1. After checking the code, I found that 785 in staff was missing.
This patches fixes that one.

To test:
- Catalog a record with 785 and 780 fields with one 1st indicator set to
  0 and another to 1.
- Verify in staff and OPAC detail pages that only the fields with 0 display.

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>
3 years agoBug 15437: (follow-up) Move $i subfield display to the beginning and add OPAC
Katrin Fischer [Sun, 13 Sep 2020 15:06:46 +0000 (15:06 +0000)]
Bug 15437: (follow-up) Move $i subfield display to the beginning and add OPAC

This patch builds on Caitlin's to finish the work but keeping as
much from her code as possible.

- Finishes reindenting started in first patch
- Readds a space after the label
- Moves $i to the beginning of the field as suggested by MARC21
  documentation:
  http://www.loc.gov/marc/bibliographic/bd76x78x.html
  The data in subfield $i can be displayed preceding the other
  data contained in the field.
- Adds a span with a class around the $i so people can control
  the formatting

To test:
  - Catalog a record with 780/785 with and without $i.
  - Verify that they display nicely in staff and OPAC, $i should show.
    Also $a and $t will show (unchanged by this patch)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 15437: MARC21: Show $i for 780/785
Caitlin Goodger [Wed, 18 Jan 2017 20:54:33 +0000 (20:54 +0000)]
Bug 15437: MARC21: Show $i for 780/785

Test Plan
1: Inside Administration go to MARC bibliographic framework and on the
default framework under Actions click on MARC structure
2: Search for 780 under search tag and under actions click subfields
3: Find i and click on edit.
4: Under Advanced Constraints select editor and save the changes.
5: Repeat for 785.
6: Find a Bibliograpical record and under Edit select edit record.
7: Under the 7 put values into 780 and 785. For this to work it is
dependant on the patch 17929 so that you can type into the indicators
8: When you save the changes you won't be able to see 780 or 785 on the
Bibliographical details
8: Apply the patch
9: Refresh and 780 and 785 should be there at the bottom under the
content

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26249: Set keep_text class correctly in cat-search.inc
David Cook [Wed, 19 Aug 2020 05:44:57 +0000 (15:44 +1000)]
Bug 26249: Set keep_text class correctly in cat-search.inc

This patch sets the keep_text class correctly in cat-search.inc
for the "Search the catalog" tab

To test:
1) Apply the patch
2) Go to /cgi-bin/koha/catalogue/search.pl
3) Type "A" into the search box for "Search the catalog"
4) Click on the "Check out" tab
5) Note that "A" appears in search box
6) Change "A" to "B" in search box
7) Click on the "Search the catalog" box
8) Note that "B" appears in the search box
9) Note no Javascript errors in the console

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26478: Display issue with buttons on the self checkout screens
Owen Leonard [Thu, 17 Sep 2020 10:53:20 +0000 (10:53 +0000)]
Bug 26478: Display issue with buttons on the self checkout screens

This patch adds missing Bootstrap classes to a few buttons on the self
checkout page. Without the classes the buttons are not styled correctly.

To test, apply the patch and open the self checkout page for a patron
with multiple checkouts, some renewable and some non-renewable.

In the table of the user's checkouts the "Renew item" button should be
styled as a green button. The "Check in item" button should be styled as
a blue button.

Try to check out an item which cannot be circulated. On the page warning
you "Item cannot be checked out," the "Return to account summary" button
should be styled as a blue button.

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>
3 years agoBug 26512: Display issue with buttons for OPAC checkout note
Owen Leonard [Wed, 23 Sep 2020 11:48:00 +0000 (11:48 +0000)]
Bug 26512: Display issue with buttons for OPAC checkout note

This patch adds the correct Bootstrap 4 class to the buttons for
submitting checkout notes in the OPAC.

The markup has been updated to use <button> instead of <a> because of a
style conflict with jQueryUI's CSS.

To test, apply the patch and enable the AllowCheckoutNotes system
preference.

- Log in to the OPAC as a patron with checkouts.
- On the "Your summary" page, enter some text into a field in the
  "Notes" column of the checkouts table.
- Upon typing in the field a button should appear, "Submit note."
- The button should be styled as a green button.
- Submit the note.
- Make a change to the text in the field. A button should appear,
  "Submit changes." It should also be styled 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>