]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 24473: Add $raw filter for Syndetics content
Lucas Gass [Tue, 21 Jan 2020 17:53:09 +0000 (17:53 +0000)]
Bug 24473: Add $raw filter for Syndetics content

Syndetics offers enhanced content in the OPAC under the tabs 'Title Notes',
'Excerpt', 'About the author', 'Editions'. They provide this info as HTML
therefore we should filter it as $raw so the content shows up without the markup.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25862: Prevent TinyMCE to mangle local url links
Didier Gautheron [Wed, 24 Jun 2020 14:03:16 +0000 (16:03 +0200)]
Bug 25862: Prevent TinyMCE to mangle local url links

To test:
1 create a report 1 if it doesn't exist
2 open /cgi-bin/koha/tools/koha-news.pl
3 create a news
4 add a HTML link with Insert/Edit link tinyMCE dialog box to
  /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1"
5 save
6 on the main page "report 1" link returns a 404 error

Apply patch
7 Modify news' URL
8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl

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>
4 years agoBug 24379: DBIC schema changes
Jonathan Druart [Mon, 20 Jul 2020 10:57:00 +0000 (12:57 +0200)]
Bug 24379: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24379: DBRev 20.06.00.005
Jonathan Druart [Mon, 20 Jul 2020 10:53:43 +0000 (12:53 +0200)]
Bug 24379: DBRev 20.06.00.005

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24379: Make login_attempts not nullable
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +0000 (20:59 +0000)]
Bug 24379: Make login_attempts not nullable

While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE

When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1

This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0

Let's default to 0 like we intend

To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
    SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable  OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!

Bug 24379: Fix the test

First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.

Bug 24379: Don't drop default of 0 for login attempts

When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set

To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)

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>
4 years agoBug 25868: Fix transfers page to show effective itemtype
Fridolin Somers [Wed, 24 Jun 2020 15:05:30 +0000 (17:05 +0200)]
Bug 25868: Fix transfers page to show effective itemtype

In transfers page /cgi-bin/koha/circ/branchtransfers.pl :
Itemtype is always from biblioitems.itemtype, regardless of system preference item-level_itypes.

Patch also changes template to use the object Koha::Item.

Patch also fixes a small typo : closed <form> tag.

Test plan :
1) Test with both values of system preference 'item-level_itypes'
2) Go to Circulation > Transfert
3) Enter a barcode
4) Enter another barcode
5) Check you see in table all datas and that 'Item type' is 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>
4 years agoBug 25869: Fix Coce display for lists
Nick Clemens [Wed, 24 Jun 2020 16:17:19 +0000 (16:17 +0000)]
Bug 25869: Fix Coce display for lists

To test:
1 - Enable Coce for Opac
    CoceHost: https://coce.bywatersolutions.com
    CoceProviders: Select all
    OpacCoce: Enable
2 - Do a search on the Opac, confirm you see some covers
3 - Add some of the items with covers to a public list
4 - View the public list
5 - Note no covers display
6 - Apply patch
7 - Success!

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>
4 years agoBug 25950: Remove <client> in X-Forwarded-For from proxy tests
David Cook [Wed, 8 Jul 2020 07:10:50 +0000 (07:10 +0000)]
Bug 25950: Remove <client> in X-Forwarded-For from proxy tests

This patch removes the <client> ip address in the X-Forwarded-For
header from being tested against koha_trusted_proxies.

Without this patch, REMOTE_ADDR will be set to null, if the <client>
ip address matches against koha_trusted_proxies.

To Test:
1. Run the unit test t/Koha/Middleware/RealIP.t

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25726: make holds to pull ignore holds where found is not null and itemnumber...
Andrew Fuerste-Henry [Fri, 12 Jun 2020 13:51:16 +0000 (13:51 +0000)]
Bug 25726: make holds to pull ignore holds where found is not null and itemnumber is null

To test:
1- place 2 bib-level holds on available items
2- confirm they both show on Holds to Pull
3- edit one hold from the database to set found='T'
4- reload Holds to Pull, confirm it is now empty
5- apply patch
6- Reload Holds to Pull
7- confirm it now shows the hold you did not edit

Signed-off-by: donnab <donna@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Using capitals for SQL reserved words; added a FIXME
Tested with:
    update reserves set found='T', itemnumber=NULL where reserve_id=...
This should be a workaround while we fix the underlying problem.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25909: Recent change to datatables JS in the OPAC causes errors
Owen Leonard [Thu, 2 Jul 2020 12:50:17 +0000 (12:50 +0000)]
Bug 25909: Recent change to datatables JS in the OPAC causes errors

This patch reverts some changes made by Bug 25287 which prematurely
introduced the double-underscore i18n function. The i18n features
haven't been fully implemented in the OPAC.

Some lines are reverts to the previous version, and some are additions,
for instance where Bug 25287 introduced new DataTables features and a
new string translation is required.

In addition to i18n changes, the patch also reverts the default
configuration of DataTables in the OPAC so that the "dom" configuration
option is set back to "t." This turns off features like pagination
buttons, filters, etc. which were previously disabled by default.

Enabling these features requires revision to the OPAC CSS in order for
them to display well.

To test, apply the patch and view a page in the OPAC which includes a
DataTable. For instance: checkouts on the "your summary" page, serial
issues on the "full subscription history" page.

Tables should display correctly and sorting should work correctly. There
should be no other DataTables controls visible.

To test translatability:

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

    - Update a translation:

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

    - Open the corresponding .po file for the strings pulled from
      the templates  e.g.  misc/translator/po/fr-FR-opac-bootstrap.po
    - Locate strings pulled from bootstrap/en/includes/datatables.inc
      for translation, e.g.:

      #. SCRIPT
      #: opac-tmpl/bootstrap/en/includes/datatables.inc:4
      msgid "Copy to clipboard"
      msgstr ""

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

      > perl translate install fr-FR

Open the translated copy of datatables.inc and confirm that the
translated string appears.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25944: Schema fix for illrequests route
Martin Renvoize [Tue, 7 Jul 2020 08:27:48 +0000 (09:27 +0100)]
Bug 25944: Schema fix for illrequests route

The illrequests path was missing the `comments` and `status_alias`
embedable relations in the path specification.

Test plan:
1/ Ensure you have the latest Mojolicious + OpenAPI modules installed.
2/ Navigate to the ill requests page and note that the table is empty.
3/ Note that under the networking tab in your browsers developer tools
that the api call fails with a 400 error.
4/ Apply the patch
5/ Refresh the page
6/ The table should now load and the api route should return a proper
200 response.
7/ Signoff

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch to a production server that was having the 400
error on the main ILL page, and the error was gone.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25566: Add option to ignore found holds and use it when checking high holds
Nick Clemens [Thu, 21 May 2020 13:41:23 +0000 (13:41 +0000)]
Bug 25566: Add option to ignore found holds and use it when checking high holds

To test:
 1 - Find or create a record with 10 items
 2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
 3 - Set circ rules to allow 1 hold per record on the relevant record
 4 - Place 3 holds on the record
 5 - Check one item in and confirm hold to set to waiting
 6 - Issue to the patron with the waiting hold
 7 - Get a notice that loan period is decreased
 8 - Don't confirm the checkout
 9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25850: (QA follow-up) use dt_from_string
Nick Clemens [Tue, 7 Jul 2020 12:05:42 +0000 (12:05 +0000)]
Bug 25850: (QA follow-up) use dt_from_string

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25850: (QA follow-up) Match logic in is_holiday
Martin Renvoize [Mon, 29 Jun 2020 08:54:58 +0000 (09:54 +0100)]
Bug 25850: (QA follow-up) Match logic in is_holiday

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being...
Andreas Jonsson [Tue, 23 Jun 2020 13:57:29 +0000 (15:57 +0200)]
Bug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being Sunday.

1. Go to tools -> calendar and make sure Sundays are holidays by adding
   a holiday on a Sunday and selecting "Holiday repeated every same day
   of the week" and "Copy to all libraries" and save.
2. Go to administration -> system preferences and select "Use the
   calendar to push the due date to the next open matching weekday
   for weekly loan periods, or the next open day otherwise" for the
   system preference "useDaysMode" and save the system preferences.
3. Put the below code in a file name test.pl and execute it using
   the command "sudo koha-shell -c 'perl test.pl' kohadev"

   use Koha::Calendar;

   my $calendar = Koha::Calendar->new( branchcode => 'CPL' );
   $dt = DateTime->new(
       year       => 2020,
       month      => 06,
       day        => 21
   );

   print "This is a sunday: " .
   $dt->day_of_week . "\n";

   my $ndt = $calendar->next_open_days($dt, 0);

   print "This is a monday: " .
   $ndt->day_of_week . "\n";

4. Without the patch applied, this script
   will freeze after printing "This is a
   sunday ...".  Abort using ctrl-c.
5. Apply patch and run the script again.
   The test script will now complete.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25850: Regression Test
Martin Renvoize [Fri, 26 Jun 2020 15:52:50 +0000 (16:52 +0100)]
Bug 25850: Regression Test

This patch adds a unit test to test for an infinite loop as highlighted
by the bug.

Test plan
1/ Run the test before applying the fix
2/ The test should fail for 'Sundays'
3/ Apply the subsquent patch
4/ Re-run the test
5/ It should now pass

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25850: Add tests for weekday holidays
Martin Renvoize [Fri, 26 Jun 2020 15:24:00 +0000 (16:24 +0100)]
Bug 25850: Add tests for weekday holidays

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25992: Make SIP2 logger subroutines exportable to prevent crash
Joonas Kylmälä [Wed, 15 Jul 2020 11:08:32 +0000 (11:08 +0000)]
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash

If the subroutines are not exportable we get the following crash:

> Undefined subroutine &C4::SIP::SIPServer::set_logger

To test:
 In kohadevbox run for example:
 $ ps -aux # check that no existing sip server is running, kill the process if exists
 $ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
 $ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information

 After applying this patch the Undefined subroutine error should be gone.
 Note: when using the sip_cli_emulator.pl the credentials can be anything.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25851: DBRev 20.06.00.004
Martin Renvoize [Thu, 16 Jul 2020 14:16:41 +0000 (15:16 +0100)]
Bug 25851: DBRev 20.06.00.004

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25964: Prevent data loss when editing items from a MARC record
Jonathan Druart [Thu, 9 Jul 2020 08:52:11 +0000 (10:52 +0200)]
Bug 25964: Prevent data loss when editing items from a MARC record

Coming from:
  Bug 23463: Use new method Koha::Object->set_or_blank

We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly.

In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
4 years agoBug 25443: (follow-up) surround strings with <span>
Bernardo Gonzalez Kriegel [Sun, 24 May 2020 11:51:27 +0000 (08:51 -0300)]
Bug 25443: (follow-up) surround strings with <span>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25443: Improve translation of 'Select the record to link%s to'
Katrin Fischer [Sun, 24 May 2020 00:04:03 +0000 (02:04 +0200)]
Bug 25443: Improve translation of 'Select the record to link%s to'

Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:

Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link

To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25890: Update sorting column for checkouts table
Nick Clemens [Mon, 29 Jun 2020 11:04:59 +0000 (11:04 +0000)]
Bug 25890: Update sorting column for checkouts table

Test plan:
- Check some items out, all from different libraries
- Modify the checkout and due dates, like:
    2018-10-22
    2018-01-23
    2018-05-27
- Sort by checkout date, verify it is actually sorting on homebranch
- Apply patch
- Reload page
- Note you can now sort items correctly

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>
4 years agoBug 25695: merge of similar code blocks after circulation_rules update
Slava Shishkin [Thu, 18 Jun 2020 09:11:29 +0000 (12:11 +0300)]
Bug 25695: merge of similar code blocks after circulation_rules update

In onboarding.pl we have second block with adding just one more
rule parameter (maxissueqty) which can be merged to first one
after all parameters now stored in circulation_rules table.

Also this eliminates the need of adding forgotten "warn $@" after
the second eval block.

Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25914: Fix incorrect variable name causing relative's checkouts column to be...
Kyle M Hall [Thu, 2 Jul 2020 12:32:51 +0000 (08:32 -0400)]
Bug 25914: Fix incorrect variable name causing relative's checkouts column to be empty in OPAC

In the OPAC, the title column in the relatives checkouts table is always empty.

Test Plan:
1) Enable viewing of relative's checkouts in OPAC
2) Check some items out to a patron
3) Log into the OPAC as a relative of that patron that should be able to
   view them
4) Note the title column is empty in the relative's checkouts tab
5) Apply this patch
6) Reload the page
7) Titles should appear in the title column!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded
Alex Buckley [Sun, 14 Jun 2020 22:41:03 +0000 (22:41 +0000)]
Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded

If 'Actual cost' has not been set then it has the value of 0.00 which
Perl evaluates to true so this patchset resets it to 0, so the fallback
to ecost_tax_included/ecost_tax_excluded happens.

Test plan:
1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax')
2. Set 'Vendor price' = 10 and do not set 'Actual cost'
3. Save order
4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST
column has value of -8.70

5. Jump into the database:
select tax_value_on_ordering from aqorders where
ordernumber=<ordernumber>;
[You can get the ordernumber from clicking on the 'Modify' line the item
is listed in]
6. Observe a negative value: -8.70

7. Apply patch and restart plack
8. Add a second item to the basket
9. Set 'Vendor price' = 10 and don't set 'Actual cost'
10. Save order
11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST
has value of 1.30
12. Repeat step 5 and observe tax_value_on_ordering = 1.30
13. Run t/Prices.t unit test:
sudo koha-shell <instancename>
prove t/Prices.t

Sponsored-by: Horowhenua District Council, NZ
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25752: Stay in cwd after koha-shell
Jonathan Druart [Mon, 15 Jun 2020 14:11:49 +0000 (16:11 +0200)]
Bug 25752: Stay in cwd after koha-shell

After bug 25538, after a koha-shell we are not longer in the current directory:

root@cec7bffd8100:koha(master)$ pwd
/kohadevbox/koha
root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev
kohadev-koha@cec7bffd8100:~$ pwd
/var/lib/koha/kohadev

Test plan:
Repeat the commands above and confirm that with this version of the
script you get /kohadevbox/koha inside the koha-shell

Search for possible regressions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25864: Lower case fields for searching
Nick Clemens [Wed, 24 Jun 2020 12:20:03 +0000 (12:20 +0000)]
Bug 25864: Lower case fields for searching

To recreate:
 1 - Have Koha using ES5 and Elasticsearch as search engine
 2 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate
 3 - Do a search in authorities using 'Search entire record' (abduction if using sample db)
 4 - Note no results
 5 - View the page source and find 'search_query'
 6 - Note the uppercased fields
 7 - curl 'es:9200/koha_kohadev_authorities/data/417?pretty'
 8 - Note all fields lower-cased
 9 - Apply patch
10 - Repeat search
11 - It works!

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25864: Unit test adjustment
Nick Clemens [Wed, 24 Jun 2020 12:22:48 +0000 (12:22 +0000)]
Bug 25864: Unit test adjustment

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string
Jonathan Druart [Wed, 24 Jun 2020 06:37:18 +0000 (08:37 +0200)]
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string

On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.

Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Fix misc/admin/koha-preferences
Julian Maurice [Mon, 29 Jun 2020 13:23:35 +0000 (17:23 +0400)]
Bug 21395: Fix misc/admin/koha-preferences

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Fix C4/Barcodes/ValueBuilder.pm
Julian Maurice [Mon, 29 Jun 2020 13:13:10 +0000 (17:13 +0400)]
Bug 21395: Fix C4/Barcodes/ValueBuilder.pm

$DEBUG variable was always set to 0, so it was useless

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Ignore .perlcriticrc in t/Makefile.t
Julian Maurice [Mon, 29 Jun 2020 13:01:25 +0000 (17:01 +0400)]
Bug 21395: Ignore .perlcriticrc in t/Makefile.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Fix creation of PO file
Julian Maurice [Mon, 29 Jun 2020 12:57:11 +0000 (16:57 +0400)]
Bug 21395: Fix creation of PO file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25440: Fixed list of 'show_rule' forming variables in the template
Andrew Nugged [Wed, 17 Jun 2020 20:18:01 +0000 (23:18 +0300)]
Bug 25440: Fixed list of 'show_rule' forming variables in the template

In smart-rules.tt we have `SET show_rule = ...` section which filled
with 'all used in the loop' variables. Because if historical reasons it
seems that there are some missing, few old, and even doubled ones.
This list is fixed now by:

  - variable names 'article_requests' and 'renewalsallowed' repeated
    so duplicates are removed;

  - 'hardduedatebefore' and 'hardduedateexact' not present in the whole
    site code anywhere anymore;
    IMPORTANT NOTE: these 'hardduedatebefore/hardduedateexact' also
                    exists as remnants in .po-translation files, a lot.

  - 'note', 'hardduedatecompare', 'renewalperiod', 'rentaldiscount'
    template variables were missing from this 'show_rule =' checking
    code so they are added.

Order of fields updated to match with above "SET field = ..." pack.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 25440: (QA follow-up) Correction for typo

'engthunit -> lengthunit

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25440: Fix for "uninitialized $maxsuspensiondays" in smart-rules.pl
Andrew Nugged [Tue, 19 May 2020 08:20:41 +0000 (11:20 +0300)]
Bug 25440: Fix for "uninitialized $maxsuspensiondays" in smart-rules.pl

This warning emitted:

Use of uninitialized value $maxsuspensiondays in string eq
at /admin/smart-rules.pl line 257.

But that not just undef-warning, there is broken logic,
these two lines are mutually contradictory and goes one-by-one:

    $maxsuspensiondays = undef if $maxsuspensiondays eq q||;
    $maxsuspensiondays = '' if $maxsuspensiondays eq q||;

Fix is simple: to make it '' if it comes undef.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25440: Fix for "uninitialized value in string eq" in smart-rules.pl
Andrew Nugged [Tue, 19 May 2020 08:03:13 +0000 (11:03 +0300)]
Bug 25440: Fix for "uninitialized value in string eq" in smart-rules.pl

This warning emitted:

Use of uninitialized value in string eq at /admin/smart-rules.pl line 289.

It is solved by one line added to exclude comparison with 'on' string
when variable is 'undef'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25440: Fix for "uninitialized value in hash" warning in smart-rules.pl
Andrew Nugged [Sun, 10 May 2020 15:18:35 +0000 (18:18 +0300)]
Bug 25440: Fix for "uninitialized value in hash" warning in smart-rules.pl

This warning emitted:

Use of uninitialized value in hash element
at /admin/smart-rules.pl line 569.

that happened because we have NULLs in SQL results for 'categorycode'
and 'itemtype' which later used as 'any' kind of category/item in the
template, so for the template it passed this way:

    $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->...

but undef will stringify as "" to become a hash key ("Hashes are
unordered collections of scalar values indexed by their associated
string key" https://perldoc.perl.org/perldata.html),

that's why "undef warning". To prevent warning here is the simple fix:

    $rules->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->...

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25440: Fix for "CGI::param called in list context" in smart-rules.pl
Andrew Nugged [Sun, 10 May 2020 10:28:40 +0000 (13:28 +0300)]
Bug 25440: Fix for "CGI::param called in list context" in smart-rules.pl

This warning emitted:

CGI::param called in list context from /admin/smart-rules.pl line 262,
this can lead to vulnerabilities. See the warning in "Fetching the value
or values of a single named parameter" at CGI.pm line 412.

Explained here: https://metacpan.org/pod/CGI#Fetching-the-value-or-values-of-a-single-named-parameter

And because all these params are not multi-params, so simple "scalar .."
forcing for CGI->param is the fix. Changes are transparent and same
values should be assigned as before, just no more warnings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25440: Extra duplicated call to CGI->param method removed
Andrew Nugged [Sun, 10 May 2020 10:54:29 +0000 (13:54 +0300)]
Bug 25440: Extra duplicated call to CGI->param method removed

In code CGI param 'no_auto_renewal_after_hard_limit' assigned to
"$no_auto_renewal_after_hard_limit" var, and then just in the next line
again variable "$no_auto_renewal_after_hard_limit" reassigned with
call to same "$input->param('no_auto_renewal_after_hard_limit')".

Fixed. No logic or results should be changed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Remove 'variable $DEBUG masks earlier declaration in same scope' warning
Jonathan Druart [Mon, 29 Jun 2020 11:42:55 +0000 (13:42 +0200)]
Bug 21395: Remove 'variable $DEBUG masks earlier declaration in same scope' warning

% prove t/db_dependent/Serials.t
t/db_dependent/Serials.t .. 8/49 "my" variable $DEBUG masks earlier declaration in same scope at /kohadevbox/koha/C4/Barcodes/ValueBuilder.pm line 45.
"my" variable $DEBUG masks earlier declaration in same scope at /kohadevbox/koha/C4/Barcodes/ValueBuilder.pm line 87.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: (QA follow-up) POD fixes
Martin Renvoize [Thu, 25 Jun 2020 12:48:36 +0000 (13:48 +0100)]
Bug 21395: (QA follow-up) POD fixes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: (QA follow-up) Remove some introduced issues
Martin Renvoize [Thu, 25 Jun 2020 10:31:49 +0000 (11:31 +0100)]
Bug 21395: (QA follow-up) Remove some introduced issues

This patch removes some new error cases introduced during rebase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Fix QA errors
Julian Maurice [Mon, 27 Apr 2020 08:31:19 +0000 (10:31 +0200)]
Bug 21395: Fix QA errors

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 21395: Make perlcritic happy
Julian Maurice [Fri, 21 Sep 2018 16:05:42 +0000 (18:05 +0200)]
Bug 21395: Make perlcritic happy

This patch adds a .perlcriticrc (copied from qa-test-tools) and fixes
almost all perlcrictic violations according to this .perlcriticrc
The remaining violations are silenced out by appending a '## no critic'
to the offending lines. They can still be seen by using the --force
option of perlcritic
This patch also modify t/00-testcritic.t to check all Perl files using
the new .perlcriticrc.
I'm not sure if this test script is still useful as it is now equivalent
to `perlcritic --quiet .` and it looks like it is much slower
(approximatively 5 times slower on my machine)

Test plan:
1. Run `perlcritic --quiet .` from the root directory. It should output
   nothing
2. Run `perlcritic --quiet --force .`. It should output 7 errors (6
   StringyEval, 1 BarewordFileHandles)
3. Run `TEST_QA=1 prove t/00-testcritic.t`
4. Read the patch. Check that all changes make sense and do not
   introduce undesired behaviour

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 23410: Add submenus to system preferences sidebar menu
Owen Leonard [Thu, 1 Aug 2019 11:49:59 +0000 (11:49 +0000)]
Bug 23410: Add submenus to system preferences sidebar menu

This patch adds a submenu to the sidebar menu in the system preferences
interface. Submenu links let you jump to the sub-sections in each
preference category.

In the search results view, a link is added to allow the user to jump
directly to the section from which those results came. For instance, if
your search returns the "SuspendHoldsOpac" preference, the link will
take you to to the Circulation preferences page and jump the page to the
"Holds policy" section.

This patch also converts the expand/collapse arrows to Font Awesome
icons. The obsolete image files are removed.

If you click a submenu link for a section on the current page which has
been collapsed, the section will expand.

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

 - Go to Administration -> System preferences.
 - Test the various preference categories and confirm that the submenus
   appear correctly and jump you to the right section.
   - Test that if you click a section heading to collapse it that
     clicking the corresponding submenu link in the sidebar causes it to
     expand again.
 - Do a search for system preferences and confirm that the sidebar menu
   displays correctly.
 - Confirm that the "View all..." links take you to the correct page and
   section.

Signed-off-by: David Nind <david@davidnind.com>
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>
4 years agoBug 15400: (follow-up) Remove unnecessary class
Josef Moravec [Thu, 25 Jun 2020 15:08:27 +0000 (15:08 +0000)]
Bug 15400: (follow-up) Remove unnecessary class

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: Add class on patron brief info to allow hiding date of birth
Katrin Fischer [Sun, 21 Jun 2020 16:41:04 +0000 (16:41 +0000)]
Bug 15400: Add class on patron brief info to allow hiding date of birth

This just makes a small addition by adding a class to the new
"Born:" entry in the patron brief information area to allow for hiding
it easily with css.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: (follow-up) Remove line break
Josef Moravec [Tue, 21 Apr 2020 13:20:57 +0000 (13:20 +0000)]
Bug 15400: (follow-up) Remove line break

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: Clarify usage of patron-age.inc
Jonathan Druart [Wed, 4 Mar 2020 13:51:40 +0000 (14:51 +0100)]
Bug 15400: Clarify usage of patron-age.inc

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: (follow-up) Add class to years span
Josef Moravec [Thu, 18 Apr 2019 09:27:30 +0000 (09:27 +0000)]
Bug 15400: (follow-up) Add class to years span

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: (follow-up) Restore 'years' string, remove untranslatable string
Josef Moravec [Mon, 11 Mar 2019 14:25:46 +0000 (14:25 +0000)]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: (follow-up) Adding age to check out search dropdown
Aleisha Amohia [Thu, 21 Feb 2019 20:44:20 +0000 (20:44 +0000)]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: (follow-up) Updating text display
Aleisha Amohia [Thu, 21 Feb 2019 19:45:49 +0000 (19:45 +0000)]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 15400: Display date of birth and age more consistantly
Josef Moravec [Fri, 2 Nov 2018 08:13:35 +0000 (08:13 +0000)]
Bug 15400: Display date of birth and age more consistantly

Test plan:
0) Apply the patch
1) Go to all of these pages
    Patron detail
    Other patron pages - look on the left side (circ-menu)
    Patron search
    Guarantor search ( go to child patron -> edit -> in guarantor
        section click "Set to patron"
    Search through "Check out" (in the header)

2) Confirm that does show date of birth and date consistantly,
    try it on patrons with and without date of birth set to find
    possible reggressions

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25322: fix for not selected "relationship" defaults to father
Petro Vashchuk [Wed, 17 Jun 2020 13:44:42 +0000 (16:44 +0300)]
Bug 25322: fix for not selected "relationship" defaults to father

When a user creates a patron's guarantor on /cgi-bin/koha/members/memberentry.pl but doesn't select the relationship from a dropdown, the relationship defaults to first value, which in default sysprefs is "father". This may or may not be correct as this is not a conscious choice from the user.

The solution is to make the "Relationship" field mandatory when there is no empty entry in the system preferences, always starting with an empty option but not allowing the user to save an empty entry.
And if there is an empty option in sysprefs, it allows to save empty, as well as makes it default choice.

To reproduce with default system preferences:
    1) Create a new patron who is assumed to have a guarantor or modify the existing one.
    2) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes.
    3) Observe that relationship is set as "father".
    4) Apply the patch.
    5) Repeat steps 1 and 2.
    6) Observe that it doesn't allow you to save the form until you pick a relationship type.

To reproduce with empty entry added to system preferences:
    1) Add an empty entry to borrowerRelationship at /cgi-bin/koha/admin/preferences.pl?tab=patrons in Patron relationships section (example: "|father|mother").
    2) Create a new patron who is assumed to have a guarantor or modify the existing one.
    3) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes.
    4) Observe that relationship is set as "father".
    5) Apply the patch.
    6) Repeat steps 1, 2 and 3.
    7) Observe when you save the empty entry it does set the relationship as empty.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 22672: Change <i> to <em> and <b> to <strong> in templates, includes, xslt
Lucas Gass [Wed, 27 May 2020 21:35:16 +0000 (21:35 +0000)]
Bug 22672: Change <i> to <em> and <b> to <strong> in templates, includes, xslt

This patch attempts to replace <i> with <em> AND <b> with <strong> in
order to more accessible to screen readers. This patch makes no attempt
to change Font Awesome icons which typically use <i>. I found templates,
includes and XSLT by using 'git grep ‘<b>’
koha-tmpl/opac-tmpl/bootstrap/en/' and git grep ‘<i>’
koha-tmpl/opac-tmpl/bootstrap/en/

TEST PLAN:
There should be no visible difference on the changed pages. The files
changed are:
koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browser.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/xslt/OAI.xslt

Read the changes and make sure everything looks correct, try to visit as
many pages as possible and confirm that everything looks as it should.
grep around for cases of <b> or <i> that I could have missed.

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25875: Unit test
Nick Clemens [Thu, 25 Jun 2020 10:38:16 +0000 (10:38 +0000)]
Bug 25875: Unit test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25875: Move check for module_bit and code to the JOIN
Nick Clemens [Thu, 25 Jun 2020 10:38:26 +0000 (10:38 +0000)]
Bug 25875: Move check for module_bit and code to the JOIN

If we limit the JOIN to rows with the correct subpermission we won't
duplicate the returned patrons

To test:
 1 - Give a patron full acquisitions permissions
 2 - Also give them several subpermissions on other areas
 3 - Go to Acquisitions
 4 - Edit a fund
 5 - Add a user to the fund
 6 - Search for user above
 7 - They return multiple times in results
 8 - Apply patch
 9 - Restart all the things
10 - Repeat search
11 - Patron appears once

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>
4 years agoBug 25793: OAI 'Set' and 'Metadata' dropdowns broken by OPAC jQuery upgrade
Owen Leonard [Mon, 22 Jun 2020 23:57:29 +0000 (23:57 +0000)]
Bug 25793: OAI 'Set' and 'Metadata' dropdowns broken by OPAC jQuery upgrade

This patch modifies the OAI XSLT file, correcting the path to jQuery
assets and adds a link to jquery-migrate.

To test, apply the patch and make sure the "OAI-PMH" system preference
is enabled.

1. Go to: <OPACBaseURL>/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
   e.g.
   localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
2. Click on the 'Sets' and 'Metadata' links. The corresponding
   panels with set and metatdata information should be shown.

Tested against master, works as described.
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25807: Add Template 3.008 to the exclude list
Martin Renvoize [Wed, 24 Jun 2020 10:34:32 +0000 (11:34 +0100)]
Bug 25807: Add Template 3.008 to the exclude list

This patch adds version 3.008 of Template to the excludes list in our
cpanfile. It also adds support for displaying this version on the about
page.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm
Slava Shishkin [Wed, 13 May 2020 17:20:27 +0000 (20:20 +0300)]
Bug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm

This warning was thrown:
    Use of uninitialized value $info{"invalid_username_or_password"}
    in numeric eq (==) at /home/vagrant/kohaclone/C4/InstallAuth.pm
    line 387.

There is the case when hash key can be undefined in numeric comparison.

Fixed by adding additional precheck for
$info{"invalid_username_or_password"} being Perl's "true".

To test:
    1) Go to the first page of the web-installer where it asks to login.
    2) Observe the warning in the log file.
    3) Apply patch.
    4) Repeat step 1.
    7) Check that previous warning suppressed.

Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25858: Use bitwise OR for setting a bit in borrowers.flag
Julian Maurice [Fri, 26 Jun 2020 06:55:44 +0000 (10:55 +0400)]
Bug 25858: Use bitwise OR for setting a bit in borrowers.flag

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25858: (bug 25858 follow-up) Don't attempt to set flag if already set
Nick Clemens [Wed, 24 Jun 2020 10:06:57 +0000 (10:06 +0000)]
Bug 25858: (bug 25858 follow-up) Don't attempt to set flag if already set

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: DBRev 20.06.00.003
Jonathan Druart [Thu, 25 Jun 2020 08:53:51 +0000 (10:53 +0200)]
Bug 24156: DBRev 20.06.00.003

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: (follow-up) UI - Use "Table settings"
Jonathan Druart [Wed, 24 Jun 2020 12:21:37 +0000 (14:21 +0200)]
Bug 24156: (follow-up) UI - Use "Table settings"

After a discussion with Owen we ended up with this decision.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: Rename 'Columns settings' with 'Tables settings' on the UI
Jonathan Druart [Tue, 23 Jun 2020 09:32:36 +0000 (11:32 +0200)]
Bug 24156: Rename 'Columns settings' with 'Tables settings' on the UI

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: Fix some QA failures
Jonathan Druart [Tue, 23 Jun 2020 09:29:05 +0000 (11:29 +0200)]
Bug 24156: Fix some QA failures

* Add POD to get_table_settings
* Remove USE Dumper debug statement
* Add missing "10" entry
* Fix newly created test file (and renamed)

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: Fix set sort order to the first column
Jonathan Druart [Wed, 5 Feb 2020 12:00:38 +0000 (13:00 +0100)]
Bug 24156: Fix set sort order to the first column

In that case it's equal to 0 and we need to adjust the test condition.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: Make sort order and number of items to display configurable (basket page)
Jonathan Druart [Thu, 5 Dec 2019 16:55:00 +0000 (17:55 +0100)]
Bug 24156: Make sort order and number of items to display configurable (basket page)

This patch is the main patch of this patchset, you will find the
description and the test plan.

The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
  * rename variables and files
  * Modify the structure of the yml files
  * Create a new DB table to store the tables settings

Test plan:
0)
  a. Execute the update DB entry to create the new table
  b. Restart all (to get a new version of the yml file, that is cached by
   memcached)
  c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table

QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.

Sponsored-by: Institute of Technology Tallaght
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: Adjust other tables in the yml file
Jonathan Druart [Tue, 10 Dec 2019 17:00:37 +0000 (18:00 +0100)]
Bug 24156: Adjust other tables in the yml file

To match the new structure, we adjust the other tables.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: Add columns_settings.yml changes
Jonathan Druart [Thu, 12 Dec 2019 15:18:09 +0000 (16:18 +0100)]
Bug 24156: Add columns_settings.yml changes

Modification of the structure of the yml file.
It was
  table:
    - column list
It now becomes
    table:
      default_display_length: X
      default_sort_order: Y
      columns:
        - column list

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: move ColumnsSettings to TablesSettings
Jonathan Druart [Thu, 5 Dec 2019 16:40:08 +0000 (17:40 +0100)]
Bug 24156: move ColumnsSettings to TablesSettings

We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.

Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: DBIC changes
Jonathan Druart [Thu, 5 Dec 2019 16:13:50 +0000 (17:13 +0100)]
Bug 24156: DBIC changes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24156: DB changes
Jonathan Druart [Thu, 5 Dec 2019 16:13:30 +0000 (17:13 +0100)]
Bug 24156: DB changes

Add a new table tables_settings to store default_display_length and
default_sort_order.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: (QA follow-up) Make terminology consistent
Martin Renvoize [Thu, 18 Jun 2020 11:16:45 +0000 (12:16 +0100)]
Bug 24159: (QA follow-up) Make terminology consistent

This patch changes the new circulation rule that's introduced from
useDaysMode to daysmode to improve consistency with other rule names.

We also update the accessors and code using them to reflect the new
term.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Fix shift in the header
Jonathan Druart [Tue, 24 Mar 2020 17:13:38 +0000 (18:13 +0100)]
Bug 24159: Fix shift in the header

Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Fix one occurrence in updatedatabase.pl
Jonathan Druart [Thu, 12 Mar 2020 08:00:15 +0000 (09:00 +0100)]
Bug 24159: Fix one occurrence in updatedatabase.pl

Here we just want to get the value from the syspref, the circ rule does
not exist yet.

Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Use days_mode circ rule to calculate the dropbox date
Jonathan Druart [Thu, 12 Mar 2020 07:46:59 +0000 (08:46 +0100)]
Bug 24159: Use days_mode circ rule to calculate the dropbox date

Calculate the drop box date depending on the circ rule. Note that only
the branchcode is taken into account here. Is that correct?

Test plan:
Use the drop box date feature and confirm that it takes into account the
calendar, depending on the circ rule.

Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Set days_mode according to circ rules in 3 other places
Jonathan Druart [Thu, 12 Mar 2020 07:29:27 +0000 (08:29 +0100)]
Bug 24159: Set days_mode according to circ rules in 3 other places

There are 3 other occurrences where the new circ rule can be used:
 * C4::Circulation::checkHighHolds
 * Koha::Hold->set_waiting
 * misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl

Test plan:
* checkHighHolds
Enable decreaseLoanHighHolds and fill decreaseLoanHighHoldsDuration
Setup things to hit a "high demand" alert with a shortened due date
Check an item out
=> The due date must be recalculated depending on the circ rule useDaysMode.

* set_waiting
Set ExcludeHolidaysFromMaxPickUpDelay to "1" (note that there is currently
a bug in the description of the syspref, see bug 22381 comment 19)
Mark a hold waiting
The expiration date should have been set depending on the value of the
circ rule.

* TalkingTech cronjob
Cannot test this

Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Add new tests for get_useDaysMode_effective_value
Jonathan Druart [Fri, 28 Feb 2020 13:49:50 +0000 (14:49 +0100)]
Bug 24159: Add new tests for get_useDaysMode_effective_value

Sponsored-by: Institute of Technology Carlow
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Adjust tests
Jonathan Druart [Fri, 28 Feb 2020 13:28:33 +0000 (14:28 +0100)]
Bug 24159: Adjust tests

Sponsored-by: Institute of Technology Carlow
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Add UI changes
Jonathan Druart [Fri, 28 Feb 2020 13:28:21 +0000 (14:28 +0100)]
Bug 24159: Add UI changes

Sponsored-by: Institute of Technology Carlow
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Throw an exception if days_mode option is not given when needed
Jonathan Druart [Fri, 28 Feb 2020 12:33:13 +0000 (13:33 +0100)]
Bug 24159: Throw an exception if days_mode option is not given when needed

Sponsored-by: Institute of Technology Carlow
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24159: Move useDaysMode pref to circulation rules
Jonathan Druart [Fri, 28 Feb 2020 12:29:09 +0000 (13:29 +0100)]
Bug 24159: Move useDaysMode pref to circulation rules

Moving the useDaysMode system preference to a circulation rule will add
much more flexibility in the calculation of the due date.

The initial request was to make hourly loan returned on closed when
(when checked out on the same close day).
To do so we do not want to take into account the calendar.
However the calendar need to be taken into account for other loan item types.

Other scenarios are possible, for instance depending on the branch.

This patchset will add a new "Days mode" column (next to "Loan period")
to the circulation rules page, with the different values of the
"useDaysMode" system preference + a "default" value, to default to the
system preference value.

Test plan:
- Define a long loan item type (like 10 days) that will use the calendar
(or default to the pref value, if the pref is not set to "ignore the
calendar")
- and a hourly loan (like 2 hours) that will ignore the calendar
- Create items with those item types
- Mark today as a closed day
- Check the items out
=> The hourly loan is due the same day
=> The other loan is due on an open day

QA note:
There is the need to force the "days_mode" option when Koha::Calendar is
initiated for the due date calculation. To make sure devs will not
forget it, the methods that need have it defined will throw an
exception.

Sponsored-by: Institute of Technology Carlow
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25232: DBRev 20.06.00.002
Jonathan Druart [Thu, 25 Jun 2020 08:51:35 +0000 (10:51 +0200)]
Bug 25232: DBRev 20.06.00.002

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25232: Add ability to specify multiple notforloan values to skip
Kyle M Hall [Thu, 7 May 2020 13:16:37 +0000 (09:16 -0400)]
Bug 25232: Add ability to specify multiple notforloan values to skip

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25232: Add ability to skip trapping items with a given notforloan value
Kyle M Hall [Tue, 21 Apr 2020 17:52:40 +0000 (13:52 -0400)]
Bug 25232: Add ability to skip trapping items with a given notforloan value

This is a companion/alternative to bug 25184, in that it allows an
explicit workflow for placing returned books into temporary storage for
a few days for decontamination purposes.

The idea here is to create a specific notforloan value for "In
Decontamination" or something along along those lines. This notforloan
value would never be trappable. At the end of decon,
UpdateNotForLoanStatusOnCheckin  could be used to remove the
notforloan status and allow checkins to be trapped to fill holds.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Give an item a negative notforloan value
4) Place a hold on the item
5) Check the item in
6) Note the item is trapped for hold
7) Set SkipHoldTrapOnNotForLoanValue to the same notforloan value
   you used in step 3
8) Check the item in again
9) Note Koha did not ask you to trap the item for hold!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24986: DBIC Schema files
Jonathan Druart [Thu, 25 Jun 2020 08:49:42 +0000 (10:49 +0200)]
Bug 24986: DBIC Schema files

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24986: DBRev 20.06.00.001
Jonathan Druart [Thu, 25 Jun 2020 08:49:08 +0000 (10:49 +0200)]
Bug 24986: DBRev 20.06.00.001

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 24986: Modify some borrowers DB fields to (TINY|MEDIUM)TEXT
Jonathan Druart [Thu, 4 Jun 2020 10:12:23 +0000 (12:12 +0200)]
Bug 24986: Modify some borrowers DB fields to (TINY|MEDIUM)TEXT

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25805: Return empty strings instead of undef in C4::SIP::ILS::Item::hold_patron_name
Kyle M Hall [Thu, 18 Jun 2020 13:01:36 +0000 (09:01 -0400)]
Bug 25805: Return empty strings instead of undef in C4::SIP::ILS::Item::hold_patron_name

This bug is basically the same as bug 24966, but for hold_patron_name instead of hold_patron_bcode.
The subroutine hold_patron_bcode should always return an empty string, not undef.

Test Plan:
1) Using the SIP cli emulator, checkin an item that is not checked out
2) Note the DA field contains someting like "C4::SIP::SIPServer=HASH(0x88175c8)"
   The hex number will almost certainly be different from this example
3) Apply this patch
4) Restart the SIP server
5) Run the SIP checkin again
6) Note the DA field is no longer present!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25805: Regression tests
Tomas Cohen Arazi [Thu, 18 Jun 2020 19:54:42 +0000 (16:54 -0300)]
Bug 25805: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 4985: Fix Plack scope errors
Emmi Takkinen [Thu, 19 Mar 2020 07:12:19 +0000 (09:12 +0200)]
Bug 4985: Fix Plack scope errors

This patch 'ours' several variables to fix Plack scope errors
in exceptionHolidays.pl.

This also adds '@holidays_list' as parameter to 'edit_holidays'.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 4985: Edit a calendar entry for all branches
Emmi Takkinen [Fri, 7 Feb 2020 10:43:54 +0000 (12:43 +0200)]
Bug 4985: Edit a calendar entry for all branches

This patch adds functionality to calendar tool to
make edits or deletes to all branches at once.

To test:
-Apply patch
-Add holiday for a library and copy it to all or some
libraries
-Edit previosly made holiday (edit, delete etc.) and
check out "Copy changes to all libraries." checkbox
=> Changes are made to all libraries sharing changed
holiday

Sponsored by: Koha-Suomi Oy

Signed-off-by: Christofer <christofer.zorn@ajaxlibrary.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 18911: (follow-up) We should save changes with a POST
Marcel de Rooy [Wed, 17 Jun 2020 11:50:26 +0000 (11:50 +0000)]
Bug 18911: (follow-up) We should save changes with a POST

Test plan:
Verify if changes to messaging table and language are still saved.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 18911: Add the ability to set the preferred lang for notice at the OPAC
Jonathan Druart [Wed, 17 Jun 2020 10:20:36 +0000 (12:20 +0200)]
Bug 18911: Add the ability to set the preferred lang for notice at the OPAC

Patron should be allowed to modify this setting without asking a staff
member.

The setting is not configurable and cannot be hidden via a syspref.

Test plan:
- Turn the pref TranslateNotices on
- Install some languages
- Edit your messaging settings at the OPAC
=> Notice the "Preferred language for notices" dropdown list
- Select one
=> Confirm that the value is saved in DB

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25097: Add option to message_queue to allow for only specific sending notices
Kyle M Hall [Thu, 9 Apr 2020 15:23:04 +0000 (11:23 -0400)]
Bug 25097: Add option to message_queue to allow for only specific sending notices

The message_queue.pl currently will send all the messages queued up.  It would be nice to have some control over which messages are to be sent.

Example: We have libraries who only wanted to send 'hold notices' but not overdue, advance notice, etc during the covid-19 quarantine.  And some that were the opposite - turn off hold notices, but send other generated notices.

Test Plan:
1) Apply this patch
2) Enqueue some messages with different letter codes
3) Run process_message_queue.pl with the new -c parameter using one of the letter codes enqueued
4) Note that only the messages with the selected code were processed!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25288: (follow-up) Use .escapeHtml()
Tomas Cohen Arazi [Thu, 7 May 2020 14:00:19 +0000 (11:00 -0300)]
Bug 25288: (follow-up) Use .escapeHtml()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 25288: (QA follow-up) Escape data and restore empty list behaviour
Tomas Cohen Arazi [Wed, 6 May 2020 21:50:29 +0000 (18:50 -0300)]
Bug 25288: (QA follow-up) Escape data and restore empty list behaviour

After the QA round on bug 25279, some things needed to get fixed:
- Data needs to be escaped
- When no library is defined, we should keep the original behaviour and
  message.
- aria-hidden="true" for FontAwesome coding guideline enforced
- Added role="button" as well.

This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>