Commit graph

2902 commits

Author SHA1 Message Date
a4a343c543
Add release notes for 23.11.0
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-30 16:17:58 -03:00
Koha translators
986edc2aa9 Bug 35174: Remove .po files from Koha
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-16 08:56:36 +01:00
1fd6bc61d7
Bug 15157: (QA follow-up) Some more changes
Renamed some vars. Removed unused $success.
Extended die statement.
Added Modern::Perl.

Added verbose parameter.
Added some logic around the confirm parameter. Making it possible
to run the script in 'dry' mode.
Print totals at the end.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 11:41:30 -03:00
Emmi Takkinen
ac0c8cf181
Bug 15157: Add my $amount and fix options
Variable my $amount was missing. Also option
amount has to be declared as integer and
option confirm is no longer string.

Sponsored by: Koha-Suomi Oy

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

[EDIT] Run perltidy to resolve one line.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 11:41:30 -03:00
4eb84b0dd7
Bug 15157: (follow-up) Add ability to set lower limit
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 11:41:29 -03:00
Olli-Antti Kivilahti
9e3f47d6b2
Bug 15157: Cronjob to debar Patrons with unpaid accountlines
If your library wants to debar all Borrower who haven't paid
their fines by the end of the year, this script will do that
trick :)

You can give the message from a file if the cronjob runner
doesn't deal with quotes, or as a command-line parameter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Bug 15157: Update script

This patch updates debarrBorrowersWithFines.pl script to match
changes made in bug 15156.

To test:
1. Have patron(s) with unpaid fines
2. Run e.g debarrBorrowersWithFines.pl --confirm -m "This is a description of you bad deeds"
(test other options too)
3. Confirm patron(s) with fines has been debarred with the explanation

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Bug 15157: Modernise and Update for bug 15156

This patch updates the script to use filter_by_amount_owed, renames
it to debar_patrons_with_fines.pl and moves it to the cronjobs
directory whilst also adding a copyright notice and POD.

We could add a series of options to the script to allow more fine
grained control.

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

[EDIT] Run perltidy to resolve three lines.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 11:41:29 -03:00
f88cb1da4f
Bug 33050: Tidy
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 11:41:14 -03:00
4d604ac2a9
Bug 33050: Allow to specify quote char in runreport.pl
Add to script misc/cronjobs/runreport.pl quote char arg (only for CSV).
See perl doc https://metacpan.org/pod/Text::CSV#new

This patch also adds missing '--separator' in POD.

Test plan :
1 - Write a SQL report
2 - perl misc/cronjobs/runreport.pl --format csv 1 (or correct report number)
3 - Note you get double quotes
4 - Apply patch
5 - Repeat #2 - no change
6 - perl misc/cronjobs/runreport.pl --format csv --quote "'" 1
7 - Now it is single quote delimited
8 - perl misc/cronjobs/runreport.pl --format tsv --separator "'" 1
9 - Error is reported, you cannot set quote unless csv
10 - Try empty string as quote

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>
2023-11-08 11:41:13 -03:00
Katrin Fischer
4c15ad658d
Bug 34704: Remove regex for adding additional line breaks to print templates
This makes sure that we don't change the line breaking for either
HTML nor plain text print notices.
For plain text, the <pre> is used to keep the line breaks as defined
in the notices template.
For HTML we require on the line breaks added by block elements in the
HTML notice, not adding any additional ones like before.
This gives the full control of the formatting to the notice editor.

To test:
* Make sure your patron doesn't have an email address
* Make sure to check the hold filled notice in messaging preferences
* Place a old on any item
* Checkin the item
* Confirm hold
* Verify notices tab shows the Hold (print) notice
* ./misc/cronjobs/gather_print_notices.pl ./ --html
* Verify the generated file has the HTML output wrapped in pre.
* Reformat the HOLD print notice to be HTML by setting the checkbox.
  Mmake sure to add some empty lines for (they should not print later)
  and some <br>, <p>, <div>  - They should be reflected in the notice later.
* Repeat test.
* All should be well :)

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 11:41:10 -03:00
4310e13a64
Bug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink
This patch makes the trivial change of making the linker script rely on
LinkerRelink instead of CatalogModuleRelink, which is confusing and
incorrect (according to both sysprefs descriptions).

To test:
1. Verify that relinking is now tied to the right syspref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-03 14:22:45 -03:00
Katrin Fischer
e49abfa6b5
Bug 35196: Remove misc/perlmodule_* scripts
These scripts are outdated and no longer needed in
the codebase.

To test:
* Verify both perlmodule_* scripts have been removed from misc/

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-03 12:04:42 -03:00
Aleisha Amohia
3a1c40a290
Bug 8367: (follow-up) Remove unnecessary code and atomic update
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-01 18:01:33 -03:00
Aleisha Amohia
6c0eb32a08
Bug 8367: Add holds_pickup_period circulation rule
So that pickup delay can have a different value per patron category,
   item type or branch.

To test:

1) Update database, restart services
2) Set ReservesMaxPickUpDelay syspref (if not already set)
3) Edit your circulation rules and set a value under 'Holds pickup
period (day) that is DIFFERENT from ReservesMaxPickUpDelay. Set a few
different numbers for different branches as well.
4) Place a hold on a biblio from the staff client.
5) Check in an item from that biblio and confirm the hold as waiting
6) Confirm the expiration date is calculated using the 'Holds pickup
period' value instead of the ReservesMaxPickUpDelay syspref
7) Revert the waiting status and delete the hold
8) Re-place the hold on the biblio on the OPAC. Notice that when you
change the pick up location, the number of days in the pickup message
below the dropdown changes based on the circ rules.
9) Create a holiday with a date that will overlap with the 'Holds pickup
period'
10) Check in an item from that biblio and confirm the hold as waiting
11) Confirm the expiration date is calculated using the 'Holds pickup
period' value AND considers the special holiday
12) Confirm tests pass t/db_dependent/Holds/WaitingReserves.t
13) Test Talking Tech:
13a) Enable TalkingTechItivaPhoneNotification
13b) Go to Tools -> Notices & slips. Add content to the HOLD phone
(itiva) notice.
13c) In your terminal, run perl
/path/to/koha/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl -o
~/itiva.tmp -w 0 --type=RESERVE

Sponsored-by: Catalyst IT

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-01 18:01:30 -03:00
1e53f48efe
Bug 35171: (QA follow-up): tidy up POD
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-01 17:23:17 -03:00
4bfd1e21c6
Bug 35171: Add send_empty option to runreport
This patch adds a new 'send_empty' option to runreport.pl

To test:
1 - Create a report in Koha that will not return any results:
    SELECT barcode FROM items WHERE 1=2
2 - perl misc/cronjobs/runreport.pl 1
3 - Output is: NO OUTPUT: 0 results from execute_query
4 - perl misc/cronjobs/runreport.pl 1 --send_empty
5 - Output is: no results were returned for the report
6 - perl misc/cronjobs/runreport.pl 1 --send_empty --email
7 - It will die on an email error unless you have SMTP configured - this si good, it means we sent an email
8 - Bonus points: Test on a system that can correctly send emails, confirm it works :-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-01 17:23:16 -03:00
508d55eb7b
Bug 35074: Add support for category_code to writeoff_debts
This patch adds support for passing category_code as a limiter for the
writeoff_debts script.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-01 17:23:12 -03:00
17cf580f19
Bug 34587: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:32 -03:00
cd2a642c31
Bug 34587: Fix dry run and end date in the cronjob
The cronjob always logs a dry run even on a live harvest and the end date parameter was not working correctly. This patch addresses both issues

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:22 -03:00
ca8ea02fda
Bug 34587: Move everything into a ERM/EUsage subfolder
Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:18 -03:00
2951edc697
Bug 34587: SUSHI COUNTER Harvester
This commit is a squash of the following:

SUSHI harvesting process in the data providers class:
* Builds the URL query and requests the SUSHI service endpoint
* Parses the JSON response and builds the csv COUNTER file and adds it to counter_files table

Usage statistics data processing:
* When a counter_files entry is stored, CounterFile.pm will:
* Parse the csv COUNTER file and
* Add a usage_titles entry for each unique title in the COUNTER file
* Add the title's respective erm_usage_mus (monthly usage) entries, repeating for each metric_type
* Add the title's respective erm_usage_yus (yearly usage) entries, repeating for each metric_type

Harvesting cronjob;

'Run now':
* API endpoint to start the harvesting process of a data provider
* Button in the data providers list to run the harvesting process for each data provider upon clicked

ERM SUSHI: Background job

Job progress is updated to total amount of usage titles after retrieving
the response from SUSHI;
Job warning and success messages are added accordingly
Redundant duplicate titles will not be added
Redundant duplicate monthly and yearly usage statistics will not be added
Data provider harvest background job harvests once per report_type

Enqueue one background job for each report_type in the usage data provider

Update the way we measure progress in the background job.
It now uses the COUNTER report body rows instead of SUSHI response results.
We're now incrementing and showing the number of skipped mus, skipped
yus, added mus and added yus
There's a bug in the way we calculate yus
Updates to background job progress bar - Depends on 34468

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:45:58 -03:00
Emily Lamancusa
0680910177
Bug 34924: (QA follow-up) correctly handle digest data compilation for successful renewal
automatic_renewals.pl does some data compilation for digest notices that
depends on the error value returned from attempt_auto_renew. However, on
successful renewal $error is undefined. Add additional checks on value
of $success and definedness of $error to compile data accurately and
avoid warns for undefined variable

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:48 -03:00
7ecb05f4ec
Bug 34924: Add 'auto_renew_final' and 'auto_unseen_final' return to CanBookBeRenewed
There is a desire for auto_renewals to treat the final renewal differently. We would like to notify the patron of the final renewal - but not again when the next renewal fails. This patch adds the new return value and tests.

To test:
prove -v t/db_dependent/Circulation.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:46 -03:00
95f6015d43
Bug 34924: Add Koha::Checkout->attempt_auto_renew
This patch moves the actual renewal out of the auto_renewals cronjob script and into the object and adds tests. The logic for notices is still handled in the script.

To test:
1 - prove -v t/db_dependent/Koha/Checkouts.t
2 - Add a circ rule with auto_renew checked
3 - Checkout an item to a patron and set due date in the past
4 - Checkout an item to a patron and set due date in the future
5 - perl misc/cronjobs/automatic_renewals.pl -v
6 - Confirm one would be renewed and the other is too_soon
7 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
8 - Confirm the expected issue is successfully renewed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:46 -03:00
Thibaud Guillot
24ee60cb62
Bug 29811: Add timestamp option on authority record type
According to the timestamp option for bibs record type I added the
timestamp option for authority records.
Timestamp is already present in database on field "modification_time"

Test Plan :
1 - Be sure to have authority record type for easiest test create one
2 - Execute script export_records.pl in your koha/misc directory and
choose a date (example yesterday if you just created an authority
right now).(see export_records.pl -h for help)
3 - Timestamp option has no effect on authority record type
4 - Execute script again but choose the date of tomorrow for example
5 - Same result
6 - Apply this patch
7 - Play again steps 2 and 4
8 - On step 2 you will see only your authorities created today (because
script show you authority has changes since the date you choose in
option) and for step 4 you must see an empty file.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:40 -03:00
2988c54971
Bug 35111: Ignore SIGPIPE in background jobs worker
This change explicitly ignores SIGPIPE signals in the background jobs
worker.

Daemons like Starman ignore SIGPIPE so it makes sense to explicitly set this.
Differences in the inner workings of MySQL vs MariaDB client libraries have yielded
different behaviours in automatic reconnections and potentially SIGPIPE handling,
so this helps to make the overall behaviour more consistent.

Test plan:
0. Apply patch and run "restart_all"
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
2. Click "Save" > "MARCXML"
3. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
4. Click "Choose file", choose the MARCXML file, click "Upload file"
5. Click "Stage for import"
6. Note the job is marked as "100% Finished"

7. In a separate window run "docker restart koha-db-1"
8. Repeat steps 3-5 for uploading file and running stage for import
9. Note that the job is marked as "100% Finished" as you'd expect

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added comment on the SIG PIPE line.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:14 -03:00
6757cd5f86
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-10-27 16:45:52 -03:00
3439185bb0
Bug 35141: (QA follow-up) Increment the bad count
Also move earlier print to warn for consistency.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:56 -03:00
706641e747
Bug 35141: Prevent link_bibs_to_authorities from dying on invalid metadata
When fetching the record we need to eval in case of exception

To test:
1 - Apply first patch
2 - perl misc/link_bibs_to_authorities.pl
3 - Note it dies on parser error at record 369
4 - Apply this patch
5 - perl misc/link_bibs_to_authorities.pl
6 - The process completes - with warning thrown on record 369

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:56 -03:00
22c0be31c7
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
This patch simplay adds an eval and a warning to link_bibs_to_authorities to catch any errors while searching and continue linking.

To test:
1 - edit /etc/kohia/sites/kohadev/koha-conf.xml and add to elasticsearch stanza
    <request_timeout>0</request_timeout>
2 - perl misc/link_bibs_to_authorities.pl
3 - It dies immediately
4 - Apply patch
5 - perl misc/link_bibs_to_authorities.pl
6 - Now it tries every record, throwing warnings along the way, but completes

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:55 -03:00
1508e81505
Bug 35148: before_send_messages plugin hook does not pass the --where option
The before_send_messages plugin hook currently sends all the non-smtp related options with the exception of the --where option. This should be added.

Test Plan:
1) Install the latest version of the kitchen sink plugin (
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases
   )
2) Apply this patch
3) Run process_message_queue.pl with a --where option
4) Run the command: ./misc/cronjobs/process_message_queue.pl --where "letter_code='test'"
5) Note the output looks like:
Plugin hook before_send_message called with the params: $VAR1 = {
          'verbose' => 0,
          'where' => 'letter_code=\'test\'',
          'letter_code' => [],
          'type' => [],
          'limit' => undef
        };

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 11:08:03 -03:00
3c319d988c
Bug 35001: Add some checks to membership_expiry
Test plan:
Toggle pref TrackLastPatronActivityTriggers (clear it).
And try variations of --active, --inactive to see the warnings.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:32 -03:00
a5fc346403
Bug 34983: Force a sort order in JSON output of po2json
This patch does so by default. If you do not want them sorted,
export CANONICAL-0 on the command line.

Test plan:
Copy a staff PO file from misc/translator to test.po
Now run:   time misc/translator/po2json test.po > json1
And do:    time misc/translator/po2json test.po > json2
Run:       diff json1 json2; #They should be the same.
Now:       export CANONICAL=0
And run:   time misc/translator/po2json test.po > json3
And again: time misc/translator/po2json test.po > json4
And run:   diff json3 json4; # Lots of changes
Remove the created cruft. And signoff :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:27 -03:00
a939f8da15
Bug 15504: (QA follow-up) Final changes
[1] Comment in Patron->is_active sharpened.
[2] Patron->update_lastseen
      return if $cached && $cached eq $now->ymd;
    Should be
      return $self if $cached && $cached eq $now->ymd;
    Consistent return value.
[3] Typo if there are not TrackLastPatronActivityTriggers enabled
[4] Typo TrackLastPatronActivityTriggers must be contain
[5] Typo patron is does .. option => performs an action
[6] Tidy on dbrev to fix
      The file is less tidy than before (bad/messy lines before: 0, now: 4)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:23 -03:00
b46b614b6c
Bug 15504: Remove PatronLastActivity preference
This patch removes the older PatronLastActivity preference opting to
replace it by the new PatronLastActivityTriggers preference. The feature
can now be disabled by simply not selecting any triggers

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:22 -03:00
01a5d302b9
Bug 15504: (follow-up) Clarify --last_seen option in delete_patrons
This patch adds clarifications to the last_seen option in delete_patrons
to clarify that TrackLastPatronActivity and
TrackLastPatronActivityTriggers system preferences act as a couplet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:21 -03:00
Laura Escamilla
d742f29d77
Bug 34954: Fixed typo to 'dateexpiry'
To test:

1. In KTD use grep -rn --exclude=*.po "datexpiry" *
2. Notice that the four locations below are showing the typo:
    1. git add koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt
    2. git add misc/release_notes/release_notes_18_05_00.html
    3. git add misc/release_notes/release_notes_18_05_00.md
    4. git add t/db_dependent/Koha/Patrons/Import.t
3. Apply patch. Repeat step 1.
4. Notice that no results show. All instances of the typo have been fixed to dateexpiry.
5. Sign off and have a great day :)

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>
2023-10-20 17:22:02 -03:00
5b18fa1fc2
Bug 25393: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 16:31:24 -03:00
d67ab23373
Bug 25393: (QA follow-up) Report 'too_soon' errors from cron
This patchset made it possible for 'too_soon' to be returned instead of 'auto_too_soon' - we just need to take that into account in the error listing

To test:
1 - Set circ rule to no renewal before 2, no auto renewal before 3
2 - Checkout 3 items with auto renew, due tomorrow, in 2 days, in 3 days
3 - perl misc/cronjobs/automatic_renewals.pl -v
4 - Confirm 1 can be renewed, 1 is too soon, 1 is auto too soon

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 16:31:23 -03:00
709dabb7e8
Bug 32305: Counterpart for es_indexer_daemon.pl
This is a kind of copy-and-paste variant of background worker.
We probably could do better than having two scripts here ;)

Test plan:
See former test plan. Apply it to ES indexing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed queue from query at MQ side. Discussed on IRC.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 11:02:56 -03:00
f1edd8fe77
Bug 32305: Worker should ignore wrong status or queue in MQ mode
MQ mode: The worker has seen that MQ is running and consumes messages
instead of polling db only.

Test plan:
Stop worker for long tasks.
Make sure that Rabbit MQ runs.
Stage a file. (This adds a long task.)
Goto staff view of jobs and cancel this job.
Check if job is still in MQ with rabbitmqctl list_queues.
Now start worker for long tasks.
Check if job is gone in MQ with rabbitmqctl list_queues.
And check logfile for the adjusted warning like:
  [WARN] Job 5 not found, or has wrong status/queue main:: /usr/share/koha/misc/workers/background_jobs_worker.pl (134)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed queue from query at MQ side. Discussed on IRC.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 11:02:55 -03:00
4b337b107e
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 10:25:56 -03:00
e4d638e148
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 10:25:56 -03:00
Hammat Wele
2f8a24bd58
Bug 32740: Add a new option patron home library to OverdueNoticeFrom
This patch add 'patron home library' option to the OverdueNoticeFrom preference. When it's selected notification messages for overdues will be bundled and sent from the borrowing user's home library

To Test
1. Create 3 libraries B1, B2 and B3
    1.1. Go to Koha administration, click on Libraries
    1.2. Click New library
    1.3. Fill the Library Code (ex. B1), Name(ex. B1) and email(ex. b1@test.com) fields.
2. Create a user belonging to B1
    2.1. Go to patron module, click on New patron and patron
    2.2. Fill the Surname,Card number,Primary email,Card number field and select B1 as Library.
3. Create 2 notices : the first belongs to B2 and the second belong to B3
    3.1. Go to Cataloging module and click on new
    3.2. field the required field (000 subfield 0, 003 subfield 0,  005 subfield 0, 008 subfield 0, 040 subfield c,245 subfield a, and 942 subfield c )
    3.3. Click on save
    3.4. In the item form, Select Home library = B2 and Current library = B2 and type a Barcode.
    3.5. Repeat 3.1 3.2 3.3 3.4 to create a second notice belong to B3
4. Have (or create) a default notice for all branches in Notices and Slips Module
5. Make sure you connected to branch B2 or Switch to branch B2
6. checkout item I2 (belonging to B2) to the user created in step 2 (specifying as due date the day before (1 day overdue))
7. switch to branch B3
8. checkout item I3 (belonging to B3) to the user created in step 2 (specifying as due date the day before (1 day overdue))
9. make sure you have defined 'Overdue notice/status triggers' for that patron category, ie with Delay=1 so that 'Overdue Notice' is selected and 'Email' is checked.
Note: we have a user belong to B1, two item: I2 belong to B2, I3 belong to B3 and the user has borrowed I2 from B2 and I3 from B3.
10. Test
    10.1. Search for OverdueNoticeFrom in System preferences and select item home library
    10.2. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => Two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items.
        => The sender address is the item home library address for each entry.
11. Apply the patch
12. Search for OverdueNoticeFrom in System preferences
        => There is now 'patron home library' in the options list
13. Select patron home library
14. from cli run 'perl ./misc/cronjobs/overdue_notices.pl'
        => You will see that only one message had been created. Its content shows both B2 and B3 overdue items
        => The sender address matches B1 address (the patron home library).
15. Search for OverdueNoticeFrom in System preferences and select cron
16. from cli run './misc/cronjobs/overdue_notices.pl --frombranch patron-homebranch'
    => you will get the same result at step 14

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>

Was failing the qa script, so I perltidied the changed lines.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-11 12:13:04 -03:00
fecd7a0a27
Bug 33239: (QA follow-up) Tidy and improve description
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-11 10:31:46 -03:00
5c531ead87
Bug 33239: Add the ability to run borrowers-force-messaging-defaults.pl only on a specified message name
Test plan:
1) Select a patron A
2) Change all the message prefs away from defaults.
3) Run misc/maintenance/borrowers-force-messaging-defaults.pl --doit --message-name Item_due
    Verify that patron A prefs changed only for 'Item due'

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-11 10:31:46 -03:00
9e4b0c4c72
Bug 33837: Remove datetime parameter
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Perltidied one line in cleanup_database.pl.

Bug 33837: Perl tidy block in Objects.t

WARN   t/db_dependent/Koha/Objects.t
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 319, now: 320)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-11 10:31:45 -03:00
ba298ebdf9
Bug 33204: (QA follow-up) Improve option description
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-10 10:54:06 -03:00
20a3b13516
Bug 33204: Add the ability to filter on patron library for borrowers-force-messaging-defaults.pl
Like filter on category Bug 19454, it would be helpful to filter on a specified library for misc/maintenance/borrowers-force-messaging-defaults.pl

Test plan:
1) Select two patrons A and B in say libraries L1 and L2.
2) Change the msg prefs for A and B away from defaults.
3) Run misc/maintenance/borrowers-force-messaging-defaults.pl -doit -library L1
    Verify that patron A changed and patron B did not.
4) Run with both category and library filters

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-10 10:54:06 -03:00
813aaa6969
Bug 34064: Tidy script
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-10 10:54:05 -03:00
c30dd8d6b0
Bug 34064: Remove no_batch_alters option
This change removes the no_batch_alters option.

When working with real world databases, you really want to use batch
alters to group together changes. Otherwise, the output becomes
too overwhelming/unwieldy.

On real world databases, I'm noticing big discrepancies, although
I think most of the time this is a difference in the collation
at the column level.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-10 10:54:04 -03:00