Commit graph

50108 commits

Author SHA1 Message Date
88bd912254 Bug 35053: Make sure request is checked as an item-level request if item_id passed
This patch makes the validation code have the `$item` variable defined
when checking holdability, in the case both `item_id` and `biblio_id`
params are passed.

Otherwise, if the requested item is not holdable, but a biblio-level
hold *could* be placed, the item-level hold is placed.

This is highlighted by the regression tests.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests don't pass. A request that should be rejected is allowed
because biblio-level hold is allowed.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Item-level rules are checked and thus the
request rejected (code 403)
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82e0edd876)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8a945f3e81)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:04 +00:00
1058c877e4 Bug 35053: Regression tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 683b74d202)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6de7575cae)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:04 +00:00
f3742afa64 Bug 35101: Stop screen from jumping back to top when using barcode.pl plugin
To test:
1. Set 'autoBarcode' to something other than 'don't generate automatically'
2. If the a framwwork make sure some 952 fields have the barcode.pl plugin enabled
3. Add a new item and click the '...' next to the 952 field with the barcode.pl plugin enabled.
4. The screen jumps back to the top, annoying.
5. Apply patch
6. Try again, it should not jump anymore!

Signed-off-by: Barbara Johnson <barbara.johnson@swbell.net>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eec5d7e4be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 85d38e5ef5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:03 +00:00
831684ea2d Bug 34531: Fix template logic to not hide patron restrictions
To test:
1. From BorrowerUnwantedFields Hide Gone no address flag (gonenoaddress) and Lost card flag (lost).
2. Got to memberentrygen.tt and see that Patron restrictions is now hidden
3. Apply patch, now the Patron restrictions field should not be hidden.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7e23abcccb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 40a45f6d75)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:03 +00:00
d32d035c0e Bug 34980: Remove the use of event attributes from title-actions-menu.inc in OPAC
This patch updates the include file used to show actions with each
search result, removing two instances of "onclick" in favor of an event
handler class which was already in use elsewhere.

To test, apply the patch and log in to the OPAC.

- Perform a catalog search which will return results.
- Test the "Save to lists" link under any search result. The "Save to
  lists" pop-up window should appear.
- View the contents of a list which contains some titles.
- Test the "Save to another list" control. The same pop-up window should
  be triggered.
- Tag at least one title in the catalog and view the "Tag cloud" page.
- Perform the same test with the "Save to lists" button in the table of
  our tags.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5dd4043b06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 743538abe7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:02 +00:00
e82b35066e Bug 35055: Exclude actions column from patron search results DataTables export
This patch updates the markup of the patron search results table so that
the "actions" column (Edit, Check out) are excluded when using the
DataTables "Export" button. The configuration was already in place but
the column header lacked the required class.

To test, apply the patch and perform a patron search which will return
multiple results.

Click the "Export" control at the top of the patron search results
table and choose "Print." In the print preview there should be no final
column containing "Edit" and "Check out."

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5bad6a6d49)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c2970fd838)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:02 +00:00
David Nind
81cdcef46d Bug 34462: (follow-up) Shorten card experiation message
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ab14e7f8eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 28b8522ac6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:01 +00:00
emilyrose
493e6a0f70 Bug 34462: Display the patron's expiration date
The problem is in the patron_messages.inc file on line 25. The variable "expiry" is used, but it should be "patron.dateexpiry" because the patron's card isn't expired yet.

TEST PLAN
1) Go to “Patrons > + New patron”
2) Create a patron with an expiry date that is less than 30 days in the future
3) Go to the "details" tab of this account
4) Notice that the date is missing after "expires on":
"Expiration: Patron's card will expire soon. Patron's card expires on Renew or Edit details"
5) Apply the patch
6) Reload the page; the expiry date should now be displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d4e5a66bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0231f8d144)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:01 +00:00
d2d94b2de0 Bug 34204: Fix koha-shell under debian 12
In Debian 12/Bookworm:
root@kohadevbox:koha$ koha-shell kohadev
This account is currently not available.

This is because /etc/passwd has /usr/sbin/nologin as shell, which is coming from the --disabled-login param we passed to adduser in koha-create.

Looks like a bug has been fixed in adduser, because we didn't have this behavior in bullseye.

Context:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625758#72

"""
- change and document (adduser(8)) that --disabled-password will behave
  like --disabled-login and additionally set the shell to
  /usr/sbin/nologin.
"""
427ade7d91

Test plan:
Confirm the above and that the change makes sense.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c03352ae5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3d30dc4e8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:03:00 +00:00
25b9edd5f8 Bug 34271: Remove a few Logger statements from REST API
See also bug 22678.
We should call app->log->warn, ->debug, etc. instead of Logger.

Test plan:
The simplest way I tested V1, is add a app->log->warn in the try
blocks, restart all and check that your log4perl is set correctly
too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3ce05012b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c2f1a41670)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:02:59 +00:00
Blou
9ab09a2243 Bug 35064: Extra parenthesis in db_revs/220600072.pl
See Bug 34332.

The same error it corrected is also present in the update process.

This patch simply removes an extra parenthesis in the tt instruction.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0f860a43d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1de535046a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 14:02:59 +00:00
e1caf0e1b7 Bug 34119: Improve staff interface print stylesheet following redesign
This patch makes some updates to the staff interface print stylesheet in
order to make it work better following the staff interface redesign.

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

In the staff client, go to various pages and view the print preview. The
print view should exclude the header navigation, header search, page
toolbars and page sidebars.

- Pages with tabbed displays should show content from all tabs: e.g.
  bibliographic details, MARC editor.
- In Reports, check that report results print well.
- Pages with DataTables should print with table information visible but
  table controls hidden.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c8748cd289)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b95cde78ba)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:41 +00:00
56833f29c9 Bug 34119: (Preliminary) Run stylelint fixes on print.css
This patch corrects errors raised by the new stylelint configuration in
print.css. Most of the fixes were made automatically by using the
"--fix" option:

npx stylelint koha-tmpl/intranet-tmpl/prog/css/print.css --fix

Some examples of errors fixed automatically:

- Expected indentation of 4 spaces
- Unexpected whitespace before ":"
- Unexpected unit
- Expected single space before "{"
- Expected newline after ";" in a multi-line declaration block

Errors from use of "!important" have been ignored.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e8f6a3bfee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dad427b2d6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:41 +00:00
Emily Lamancusa
93df451c82 Bug 34901: Display transit status on patron holds tab only if hold found value is "T"
Check the transit status of the *hold* in addition to the transit status
of the *item*, to avoid displaying a misleading transit status on
item-level holds when the item is actually in transit for a different
hold

To test:
1. Create a record-level hold for Patron A for pickup at a library other
   than the logged-in library
2. Check in an item to fill that hold
3. Put an item-level hold on that same item for Patron B at a different
   library other than the logged-in library
4. Open Patron A's and Patron B's account details pages in separate tabs
--> Note that the Holds tab on Patron A's account detail page correctly
    shows that their hold is in-transit
--> Note that the Holds tab on Patron B's account detail page incorrectly
    shows that their hold on the same item is also in-transit
4. Apply patch
5. Clear browser cache
6. Refresh both patrons' account details pages
--> Confirm that the holds tab on Patron A's account still correctly
    says their hold is in-transit
--> Confirm that the holds tab on Patron B's account now correctly shows
    a blank status for their hold
7. Cancel Patron A's hold
8. Check in the item again to put it in transit for Patron B's hold
9. Reload Patron B's account page
--> Confirm that the holds tab on Patron B's account now correctly says
    their hold is in-transit

Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa1485639b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9411b66eaa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:40 +00:00
9ce2c8879d Bug 35042: Remove set datelastseen to null on table in Members.t
Non-trivial was adding the category_type <> S.

Test plan:
Run t/db_dependent/Members.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f08fc01867)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6dbbbef3e9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:40 +00:00
8556c3f424 Bug 35006: OPAC holdings table - Fix sort for library columns
This patch updates the holdings table on the OPAC's bibliographic detail
page so that home and current library columns can be sorted correctly by
library name. There have been changes to the way the template shows
these values, but the DataTables "data-sort" attribute on the table cell
had not been updated accordingly.

To test, apply the patch set the OpacLocationBranchToDisplay system
preference to "home and holding libraries."

- Make sure home and holding library columns are not hidden in the
  table settings under Administration -> Table settings -> OPAC ->
  holdingst.
- Locate a bibliographic record in the OPAC which has multiple items
  from different libraries.
- Test that the home and current library columns sort correctly by
  library name.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 06d182bc82)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ebfdba0cb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:39 +00:00
b4f750991f Bug 34881: (QA follow-up) Remove stray paren
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0128ce5b10)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43ab6e2825)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:39 +00:00
Emily Lamancusa
65a55ca831 Bug 34881: Improve idempotency of DBRev
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d9463f82c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bcc160ebb6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:38 +00:00
Julian Maurice
bafd8a47e3 Bug 27249: Replace DateTime->now by dt_from_string
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1a2288052d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff565dd3b8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:38 +00:00
Julian Maurice
312b0cd23c Bug 27249: Add missing POD for Koha::Exceptions::Calendar
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e2a258f6f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1ddb79448c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:38 +00:00
Julian Maurice
8be64fe8fd Bug 27249: Fix code style
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4b4028d783)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7cb8e222e4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:37 +00:00
Julian Maurice
cfe350a3d7 Bug 27249: Catch NoOpenDays exception while checking out an item
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4eec4020fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b1feff4228)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:36 +00:00
Julian Maurice
19c0d6c492 Bug 27249: Prevent infinite loop when searching for an open day
Calendars can be configured in a way that all days are closed.
The simplest way to do that is to configure a repeatable holiday for
every day of the week.
With such calendars, searching for an open day will literally take
forever.

This patch sets a hard limit on how many iterations are allowed before
giving up. This limit is set to the arbitrary value of 5000, which
should be large enough to be able to consider there is no open days if
we haven't found any with that many iterations, and small enough to
allow the loop to end quickly

Test plan:
1. Set system preference 'useDaysMode' to 'Use the calendar to push the
   due date to the next open day' ('Datedue'). Make sure the existing
   circulation rules do not conflict with that setting.
2. Browse to Tools » Calendar
3. Set every day of the week to "Holiday repeated every same day of the
   week"
4. Issue an item to a patron
5. Check the box and select 'Renew selected items'
6. The renewal should fail pretty quickly

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b58f4d89c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0f304c55e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:36 +00:00
Aleisha Amohia
c721788c20 Bug 34800: Adding openhub links for Koha contributors
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a7be7d6c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 458517fe0c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 13:45:35 +00:00
d5a34c7aad Rmaint fix: Add exec flag to atomic update file for 22.11.11.000
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-13 10:13:55 +00:00
Julian Maurice
dc9f4577c7 Bug 35079: Replace --force-extract by --generate-pot={always,auto,never}
This restores the original behaviour of always building the POT file
in order to not break existing workflows
Option --force-extract is deleted in favor of a new option
--generate-pot that can have 3 values:

* always: always build the POT file. This is the default value
* auto: build the POT file only if it does not exist
* never: never build the POT file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-08 12:59:54 +01:00
Julian Maurice
1b688e9ce4 Bug 35079: Rebuild POT files only if necessary or asked explicitely
By default, gulp tasks po:create and po:update won't rebuild the POT
files if they already exist.
Both tasks gained a new option --force-extract to rebuild them
unconditionally

This makes it possible to create/update PO files for multiple languages
sequentially without rebuilding the POT file for each language.
For instance:

    gulp po:update --lang fr-FR
    # do something with the PO files
    gulp po:update --lang en-GB
    # ...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-08 12:59:54 +01:00
4ba1b1afe3 Bug 35043: Do not have \n or \t appear in PO files
This is a trick, so that we won't have to deal with \t in PO files.
\n is not a problem, but it seems consistent to use the same method for
both.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-11-08 12:59:52 +01:00
f863398c33 Bug 35043: Use Locale::PO->quote
We have our own "quote_po" sub that is stating that Locale::PO::quote
is buggy because it does not deal with quoting new lines correctly.
However it seems that it is fixed now.

Ideally we could use Locale::PO::quote everywhere, but it does not
escape tab characters:
  $string =~ s/\\(?!t)/\\\\/g;           # \t is a tab

This means the following:
msgid "Tabulation (\\t)"
msgstr "Tabulation (\\t)"
become:
-msgid "Tabulation (\t)"
-msgstr "Tabulation (\t)"

And we are seeing the following on Weblate:
https://snipboard.io/BjQmDC.jpg

Note that Locale::PO has not been updated since 2014...

The real problem behind this is that we have 2 methods to quote strings.
At first glance it seems that Locale::PO::quote was not used before, but
with the introduction of the koha-i18n project we will have scripts that
will use Locale::PO->save_file_fromarray, which uses Locale::PO->quote
=> Those scripts will be used on the translation server for post
processing (security reason, marking potential XSS strings as fuzzy).

Test plan:
0. Do not apply the patch
1. gulp po:update --lang LANG # Replace LANG with your favorite language
   code
2. git commit -a -m"init PO files"
3. Apply this patch
4. Repeate 1.
5. git diff
   => The change is about the "Tabulation" and "New line" strings from
      tools/csv-profiles.tt
6. Translate them (replace the \t and \n with %s) and remove the fuzzy
   flag
7. install the template: cd misc/translator && perl translate install
   LANG
8. Enable the language, use it and go to the "Nouveau profil CSV" view
   => Notice that the \t and \n are correctly displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-11-08 12:59:52 +01:00
65aefa0683 Bug 35024: Do not wrap translations
PO files wrap differently depending on versions.

Looks like (thanks Julian!) it's coming from libunistring, between 0.9.10 and 1.0 I am seeing a change in how the strings in the PO files are wrapped.

Debian 11 (using libunistring 0.9):
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s %sÉté"
"%s %s %sAut%s %s %sHiv%s %s %s %s"

Debian 12, Ubuntu 22.04(using libunistring 1.0)
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s "
"%sÉté%s %s %sAut%s %s %sHiv%s %s %s %s"

It *could* come from this changes:
https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=NEWS;h=5a43ddd7011d62a952733f6c0b7ad52aa4f385c7;hb=HEAD
   * The functions u*_possible_linebreaks and u*_width_linebreaks now make it
     easier to work with strings that contain CR-LF sequences: In this case,
     in the returned array, it will return UC_BREAK_CR_BEFORE_LF followed by
     UC_BREAK_MANDATORY (instead of twice UC_BREAK_MANDATORY).

The command used is:
% msgmerge --backup=off --quiet -F --update misc/translator/po/fr-FR-staff-prog.po misc/translator/Koha-staff-prog.pot

No matter the value of --width.

One solution is to use --no-wrap, and never wrap :)

I sent an email to the list about this suggestion https://lists.katipo.co.nz/pipermail/koha/2023-October/060143.html

Test plan:
% gulp po:update --lang LANG

And notice that the lines are no wrapped anymore.

Note that in master there were already not wrapped (?)
commit edd378f4d1
Translation updates for Koha 23.05.00

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-11-08 12:59:46 +01:00
16cde09a51 Bug 34959: Sort PO files correctly
The PO files are not sorted when we update them which leads to
unnecessary changes that are commited: hard to see differences and
make git index grow superfluously.

Test plan:
0. Do not apply this patch
1. gulp po:update --lang es-ES
2. git commit -a -m"First PO update"
3. Run again the gulp update command
4. git diff
=> You have a lot of changes generated here, the po:update is not
idempotent.

5. Apply this patch
6. Run the gulp update command
7 git commit -a -m"PO update after 34959"
8. Run the gulp update command
9. git diff
=> No changes are generated

Note that this patch will all the entries by files, and per line
numbers.
It fixes a bug in some condition, where we add information/context about
the string. For instance search for "For the first occurrence" in the
file. Prior to this patch this was not correct, we didn't add info about
the first occurrence (but whichever in the list).

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2023-11-08 12:59:43 +01:00
545fd7fe4b Bug 34959: Remove unused sub
Nothing special here, this sub is not used and we can remove it.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2023-11-08 12:59:43 +01:00
00b27462fc Update release notes for 22.11.11 release
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-07 11:45:34 +00:00
b2a3ef8663 Increment version for 22.11.11 release
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-07 11:37:23 +00:00
75b2409311 Fix translations for Koha 22.11.11
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-07 11:34:18 +00:00
Koha translators
383367ee45 Translation updates for Koha 22.11.11
(cherry picked from commit d9d4d63892fc995430cd54e2076bdffe4d6d4aa0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-07 11:00:37 +00:00
871b100bad Bug 35014: Only set time for enable-time flatpickr
This patch adds a check to the onChange function such that we only
attempt to set the default time on change for time enabled flatpickrs
when the date is entered manually.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5b25b26f70)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-11-03 14:06:20 +00:00
56fb0d3275 Bug 34844: Rmaint fix: Remove unwanted permission 2023-10-18 08:53:38 +00:00
ebbf824f37 Rmaint fix: Fix number of tests in Auth.t 2023-10-18 08:18:46 +00:00
bae989f0b6 Rmaint fix: Fix number of tests in ILS.t 2023-10-18 08:17:10 +00:00
Katrin Fischer
54ec553904 Bug 35015: (QA follow-up) Fix paid transactions filter in the staff interface
Same problem: we added a column without adjusting the filter.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4b1d4ca170)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bd078e5ce4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:43 +00:00
575269f4a0 Bug 35015: Adjust column index in fnFilter
This patch fixes the column index in the call to fnFilter following the
addition of a new column to the table in bug 32341

Test plan:
1) Add some charges to a patron account
2) Pay some of these charges so that they are no longer outstanding
3) In the OPAC log in as that patron and navigate to the Charges tab in
   their account
4) Observe that all charges are listed, even if they have been paid and
   clicking the Show all transactions button has no effect even if
   clicked multiple times between the different filtering options
5) Apply patch
6) Refresh page and now the settled charges should be filtered out
7) Click the Show all transactions button and it should correctly update

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cf209a550)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 654594a789)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:42 +00:00
09677fa3a7 Bug 35010: In record checkout history do not show anonymous patron link
In a biblio record checkout history, when a checkout is anonymized the
patron id has been replaced by anonymous patron id.
In this case we should not show anonymous patron link.
It looks like a real patron did this checkout.

Test plan :
1) Set an existing patron id in system preference 'AnonymousPatron'
2) Perform anonymisation on old checkouts (or edit database manually)
3) Look at a record checkout history with old checkouts
=> You see 'Anonymized' for anonymized checkouts
4) Set system preference 'AnonymousPatron' empty
5) Look at same record checkout history
=> Check no error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dad04bbf0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 704ed48300)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:42 +00:00
51907834e0 Bug 34883: Add unit test
prove -v t/db_dependent/Koha/Patrons/Import.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4f928003e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c414e9a43b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:42 +00:00
868dda4b07 Bug 34883: Stop patron expiry date being set to NULL during import
A regression has been identified whereby an empty field in the dateexpiry field in a patron import file will cause the patron's expiry date to be set to NULL. This patch addresses this by checking for an empty field and using the existing expiry date if one is found.

Test plan:
1) Setup a csv with column headers:
    surname	firstname	branchcode	categorycode	cardnumber	dateenrolled dateexpiry
2) Add values:
    Acosta	Edna	CPL	PT	23529001000463	02/01/2013
3) Leave the dateexpiry column blank
4) Check Edna and make a note of her patron expiry date
5) Run the import_patrons.pl script with the following flags:
    a) --file <filepath_for_your_csv_file>
    b) --matchpoint cardnumber
    c) --confirm
    d) --overwrite
6) Check Edna, note her expiry date is now set to NULL
7) Manually edit Edna's expiry date to be reset to what it was before you ran the script
8) Apply the patch and restart_all
9) Repeat step 5
10) Check Edna, this time her expiry date should be the same as the value you set it to in step 7
11) Sign off!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f4f77357f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 08002cd0b9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:41 +00:00
fa2148b41b Bug 34467: OAI GetRecord bad encoding for Unimarc
For some Unimarc biblio records, the OAI Server returns a bad XML
document, ie a document with extended characters, such as accents, not
encoded in UTF8. It seems to come from somewhere in MARC::Record library
trying to deduce biblio record endoding from some fields. It may work
for MARC21 records. It doesn't for Unimarc records. So it's necessary to
send to the method transforming record into XML the marcflavour. This
way there is no encoding guessing from Unimarc biblio records content.

https://bugs.koha-community.org/show_bug.cgi?id=34467
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 216a2dcb9f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5f05074c11)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:41 +00:00
34dbeb9c7c Bug 34549: Strip non-XML chars during TransformHtmlToMarc
This patch strips non-XML characters from inputs during
TransformHtmlToMarc.

To test:
0. Apply patch
1. koha-plack --restart kohadev
2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl
3. Fill out record and use the text from "Text file containing control characters"
as the title
4. Click Save
5. Note that your record displays without any warnings like the following:
Error: invalid data, cannot decode metadata object
parser error : PCDATA invalid Char value 27

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Squashed the tidy patch. Still needed a few spaces to satisfy qa tools.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3e1d32f9ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 871d6eaa3f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:41 +00:00
42f123dae1 Bug 34982: Add pagination to the currencies table
Otherwise we only display the first 20.

Test plan:
Create more than 20 currencies and confirm that you can know
filter the table and see all the currencies.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6b6534a22a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 70af8ac564)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:40 +00:00
Zeno Tajoli
cff5dcaebe Bug 34558: Update custom.sql for it-IT webinstaller
It is an update of this file, here there are the specific customization for
italian users. There are simple changes on defaults values.

To test it:
1 - Start a web installation with italian language.
2 - Select Marc21 as biblio format
3 - Select all optional .sql files
4 - Conclude the installation.
5 - Go to MySQL command line and do:
    SELET value FROM systempreferences where variable = 'BorrowersTitles'
    You see: 'Sig|Sig.ra|Sig.na'
6 - Apply the patch.
7 - Drop and recreate the mysql db
8 - Redone the installation with italian language.
9 - Use the same options written above.
10 - Conclude the installation.
11 - Go to MySQL command line and do:
    SELECT value FROM systempreferences where variable = 'BorrowersTitles'
    You see: 'Sig|Sig.ra|Dott.|Dott.ssa'
12 - Refactor is OK

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 070af9aaf3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0bcfb0d95e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:40 +00:00
17680cf8bb Bug 33819: Add page numbers to opac results breadcrumb
This patch adds the page number to the breadcrumb in the opac search results to ensure that it is unique to the content on the page. Currently it is not compliant to Accessibility guidelines as the breadcrumb is identical on every page despite the content being different.

To test:
1) Apply patch
2) Run a search in the OPAC that will return more than 20 results.
3) The breadcrumb should say "Results of search for 'search term', page x of y"
4) Run a search that will return less than 20 results
5) The breadcrumb should say "Results of search for 'search term'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1a0ccaa991)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5d20395fa6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-10-17 17:35:39 +00:00