Commit graph

3131 commits

Author SHA1 Message Date
72d0f23367
Bug 38408: Add parallel exporting in rebuild_zebra.pl
The first part of the Zebra rebuild is the exporting. This part is
made faster. The second part with zebraidx is not changed.

A new commandline parameter -forks is added to the rebuild_zebra.pl
script. A subroutine export_marc_records is added between index_records
and export_marc_records_from_sth. The last routine has a new parameter,
the sequence number of the export file.

NOTE: This report does not touch koha-rebuild-zebra yet! This will be
done on a follow-up.

Test plan:
Note that the number of forks/records below can be adjusted
according to your server and database setup.

[1] Reindex a subset of 100 records without forks:
    su [YOUR_KOHA_USER]
    misc/migration_tools/rebuild_zebra.pl -a -b -r -d /tmp/rebuild01 -k --length 100
    Check if /tmp/rebuild01/biblio contains one export file for auth/bib.
    Verify that max. 100 auth and bib were indexed (check Auth search, Cataloguing)
[2] Reindex an additional subset of 100 recs with forks (remove -r, add -forks):
    su [YOUR_KOHA_USER]
    misc/migration_tools/rebuild_zebra.pl -a -b -d /tmp/rebuild02 -k --length 100 --offset 100 -forks 3
    Check if /tmp/rebuild02/biblio contains 3 export files for auth/bib.
    Verify that max. 200 auth and bib were indexed (check Auth search, Cataloguing)
[3] Run a full reindex with forks:
    su [YOUR_KOHA_USER]
    misc/migration_tools/rebuild_zebra.pl -a -b -d /tmp/rebuild03 -k -forks 3
    Check both searches again.
[4] Bonus: To get a feeling of improved speed, reindex a larger production db with and
    without using -forks. (Use something like above.) You may add -I to skip indexing
    in order to better compare both exports.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Reindexed a prod db in 96 mins instead of 150 mins (3 forks, 4 cores). Main gain in
biblio export; complete export took 35 mins, zebraidx 61 mins.
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-10 11:42:33 +01:00
2d93ec69bd
Bug 39250: Add archive_purchase_suggestions.pl to cron.daily commented
It will be a commented line in the debian template and added also
in the crontab.example file.
As mentioned on BZ, the comment can easily be removed automatically
during Docker builds or startups etc.

Test plan:
Just read the patch. Nothing changes here actually.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-07 15:41:17 +01:00
PerplexedTheta
3040f46d5e
Bug 32216: Add print notices to membership_expiry.pl
This patch adds print notice functionality to the membership_expiry.pl script,
by adding both conditional and and forced modes. When passing only --confirm,
the script will check the patron's record for an email address. If one is
found, an email notice is generated. If one is not, a print notice is used
instead. By adding a -p flag, print notices will be generated, even if an
email address is present.

To test:
a)  set the MembershipExpiryDaysNotice syspref to 7 days
b)  choose or set up half a dozen patrons with expiry dates
    1)  take heed: these expiry dates will need to be T+7 days
c)  add fake email addresses to two of the patrons
    1)  take heed: the other patrons should have no primary or secondary
        email
d)  set up the MEMBERSHIP_EXPIRY notice
    a)  set content & subject in the email notice to contain the word
        email
    b)  set content & subject in the print notice to contain the word
        print
e)  run ./misc/cronjobs/membership_expiry.pl -n -c
    1)  notice how the printed notices contain the word email
f)  run ./misc/cronjobs/membership_expiry.pl -c
g)  check the notices for the patrons from step b
    1)  notice how only email notices are generated
h)  APPLY PATCH
i)  repeat step e
    1)  notice how a mix of email and print notices are now generated
j)  run ./misc/cronjobs/membership_expiry.pl -n -p -c
    1)  notice how the output is the same as in step i - this is by
        design
k)  repeat steps f-g
    1)  notice how some patrons will only get an email notice, whilst
        others will only get a print notice
    2)  this should occur based on which patrons do, or do not have a
        valid primary or secondary email
l)  run ./misc/cronjobs/membership_expiry.pl -p -c
m)  repeat step g
    1)  notice that all patrons now get a print notice, whilst some get
        both a print notice, and an email notice. Again, this should
        occur based on whether the patron has a valid primary or
        secondary email
n)  SIGN OFF

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-27 17:32:32 +01:00
Lari Taskula
b4662eb60a
Bug 32440: Support purging statistics by type in cleanup_database.pl
Cleanup_database can delete all statistics entries more than X days
old. If one is using pseudonymization to create pseudonymized_transactions
data, then one may wish to use that cleanup_database function to delete
statistics entries that have been duplicated in pseudonymized_transactions.
However, not all types of transactions in statistics are duplicated in
pseudonymized transactions.

Pseudonymized_transactions currently only includes checkouts, returns,
and renewals.

This patch adds two additional parameters to cleanup_database.pl:

  1. --statistics-type

  Defines the types of statistics to purge. Will purge all types if
  parameter is omitted. Repeatable.

  2. --statistics-type-pseudo

  Grabs values from @Koha::Statistic::pseudonymization_types. At the
  time of writing this patch, they are:

  renew, issue, return and onsite_checkout

To test:
1. prove t/db_dependent/Koha/Statistic.t
2. Before applying this patch:
3. Create some statistics entry by checking out, renewing and checking in
   items.
4. perl misc/cronjobs/cleanup_database.pl --statistics 1 --verbose

Observe:
Purging statistics older than 1 days
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment

5. Apply patch
6. Repeat step 4, observe same result
7. perl misc/cronjobs/cleanup_database.pl --statistics 1 --statistics-type-pseudo --verbose

Observe:

Purging statistics older than 1 days with types "onsite_checkout,renew,return,issue".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

8. perl misc/cronjobs/cleanup_database.pl --statistics 1 --statistics-type test1 --statistics-type test2 --verbose

Observe:

Purging statistics older than 1 days with types "test1,test2".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

9. perl misc/cronjobs/cleanup_database.pl --statistics 1 --statistics-type-pseudo --statistics-type test1 --verbose

Observe:

Purging statistics older than 1 days with types "test1,onsite_checkout,renew,return,issue".
n statistics would have been removed

Where n is the amount of statistics rows matching your test environment
(order of listed types does not matter)

10. Try previous cleanup_database.pl commands with --confirm flag and make sure correct rows are purged

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 16:41:29 +01:00
Aleisha Amohia
d19fb66c32
Bug 38307: Make overdue_notices.pl die quietly if no branches have overdue rules
If no patron categories require overdue notices, then there will be no overdue rules/status triggers. This isn't necessarily a bad thing and shouldn't be noisy.

To test:

1. Go to Administration -> Patron categories
2. Set all your category types to have overdue notice required: No
3. Go to Tools -> Overdue notices/status triggers
4. Notice you're unable to set any overdue rules
5. Run the cronjob misc/cronjobs/overdue_notices.pl and notice the error about no overdue rules is printed
6. Apply the patch and restart services
7. Run the cronjob misc/cronjobs/overdue_notices.pl and notice the error is not printed
8. Run the cronjob misc/cronjobs/overdue_notices.pl --verbose and notice the error is printed

Sponsored-by: Catalyst IT
Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 16:41:26 +01:00
Janusz Kaczmarek
271ca1f067
Bug 26684: Remove misc/exportauth.pl as a consequence of removing auth_header.marc
Since we have misc/export_records.pl and we want to remove
auth_header.marc, the ancient script misc/exportauth.pl can be removed
as well (it is relied upon auth_header.marc).

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 10:41:43 +01:00
cc0aa072dd
Bug 38762: Make compare_es_to_db.pl provide links to staff interface
This patch makes the script provide links to the staff interface instead
of the OPAC. This way, the links can just be picked to access the
problematic records for fixing them.

To test:
1. Run:
   $ ktd --shell
  k$ perl misc/maintenance/compare_es_to_db.pl
=> FAIL: Generated links point to the OPAC
2. Apply this patch
3. Repeat 1
=> SUCCESS: Generated links are useful as they point to the staff
interface
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-19 17:05:37 +01:00
74050efda3
Bug 38871: Remove sub string_list from misc/translator/xgettext.pl
It is never used

% git grep string_list
should not return anything

Signed-off-by: Thibault Keromnes <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-19 17:05:36 +01:00
63cba14abd
Bug 39149: Make tidy.pl deal with .PL files
This patch adds handling for files with the `.PL` extension to the
`tidy.pl` helper script.

It will now consider them Perl files and tidy them as appropriate.

I opted for explicitly listing `PL` instead of making the existing check
case-insensitive because the only files I found with changed case (i.e.
Perl scripts that don't have `.pl`) are:

$ find . -type f -iname "*.pl" ! -name "*.pl"
./fix-perl-path.PL
./build-resources.PL
./rewrite-config.PL
./Makefile.PL

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-18 15:35:52 +01:00
57f271d6b2
Bug 39106: Use LWP::UserAgent and add error checking
This patch replaces the (newly introduced use of) REST::Client library
with (the already existing in the dependencies) LWP::UserAgent.

Bonus 1: validation on the response status is added to print a proper
error message and die if bugzilla is not available

Bonus 2: License added to the file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:24 +01:00
d58e670ffe
Bug 39106: The auto-rebase script - Add --bugzilla
Julian wrote a script a while ago to retrieve patches from bugzilla
and checkout the good commit to make sure the patches will apply cleanly.

This change reuses the same logic for the auto-rebase script.

Test plan:
0.
 a. You will need to install REST::Client using cpanm:
  `cpanm REST::Client`
 b. You need the --confirm flag from git-bz, see https://gitlab.com/koha-community/git-bz/-/issues/14
1. Pick a bug number with patches that does not apply on current main
2. Use the auto_rebase script with the --bugzilla option
3. Enjoy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:23 +01:00
2a3fe18734
Bug 39115: Finally use ':(exclude)' and grep
This was not working:
% git ls-files Koha/Schema.pm --exclude='Koha/Schema/Result' --exclude='Koha/Schema.pm'
Koha/Schema.pm

The efficiency of the script is getting worse and it will need to be
rewritten.
The xt/tt_tidy.t will take longer.

But at least it should work correctly now

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:22 +01:00
44c7c99132
Bug 39115: Restore ability to tidy files not in git index (yet)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:21 +01:00
9d1bdfd07f
Bug 39115: Replace (:exclude) with --exclude
I don't really explain this one, but this is something wrong with
(:exclude)

% git ls-files koha-tmpl/intranet-tmpl/js/i18n.js --exclude='koha-tmpl/intranet-tmpl/lib' --exclude='koha-tmpl/intranet-tmpl/js/Gettext.js' --exclude='koha-tmpl/opac-tmpl/lib'
koha-tmpl/intranet-tmpl/js/i18n.js
=> Return the file has expected

% git ls-files koha-tmpl/intranet-tmpl/js/i18n.js ':(exclude)koha-tmpl/intranet-tmpl/lib' ':(exclude)koha-tmpl/intranet-tmpl/js/Gettext.js' ':(exclude)koha-tmpl/opac-tmpl/lib'
=> Does not return anything!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:21 +01:00
8ba8b9b1ce
Bug 39115: Do not tidy files that must not be touched
It should prevent to tidy files that must be kept unchanged.

It was initially a feature (the script does what you ask it to do),
but it's a mess maintain the list of files we want to keep tidy.

Test plan:
Koha/Schema.pm is one of the file we don't want to modify/tidy
So let's play with this one, feel free to pick others (see the
exception list per filetype in the script)

 % perl misc/devel/tidy.pl --perl
will not touch Koha/Schema.pm

 % perl misc/devel/tidy.pl mainpage.pl Koha/Schema.pm
will not touch Koha/Schema.pm but mainpage.pl will

 % perl misc/devel/tidy.pl --no-write Koha/Schema.pm
The --no-write option is called by the QA script to compare the output
and see if files are tidy. We want to return something in this case. So
the file will be printed to STDOUT untouched

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:19 +01:00
5dcfb91db3
Bug 39114: The auto-rebase script - Fix files removal
Wrong handling of the return of the try-catch, $git->rm has an output
("rm /file/path").

This patch retrieves the status from the `git diff-tree` output

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl

WNC amended patch, tidied, ironically

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 17:11:10 +01:00
8c0d196ff6
Bug 39077: Do not complain about obsolete translations
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:31:01 +01:00
2ebf61c174
Bug 39126: tidy - Show error if stderr_buf is empty
If yarn is not installed:
Tidying file 1/1 (koha-tmpl/intranet-tmpl/prog/fr-FR/modules/intranet-main.tt)
Warning: something's wrong at misc/devel/tidy.pl line 79.

There is the error hidden in $error_message
open3: exec of yarn --silent run prettier --write koha-tmpl/intranet-tmpl/prog/fr-FR/modules/intranet-main.tt failed: No such file or directory

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:56 +01:00
a76a1f0073
Bug 38664: The auto-rebase script - Create parent directory if missing
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 12:12:16 +01:00
6daf09496a
Bug 38664: Add a xt test for TT files 2025-02-11 23:39:26 +01:00
aea905f704
Bug 38664: Fix the auto_rebase script
I had the tidy.pl script with correct +x permission during my testing
session. Now we retrieve it from main, write its content into a
temporary file. It does not have the +x bit.
2025-02-11 22:31:23 +01:00
fa10e13691
Bug 38664: Manual revert
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:26 +01:00
aa24f1e6d1
Bug 38664: Treat .vue files like other JS files
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:25 +01:00
Koha Development Team
d659526b5a
Bug 38664: Tidy the whole codebase
This commit is generated using:
  % perl misc/devel/tidy.pl
*within* ktd, to get the same version of perltidy than what will be used
by our CI (currently v20230309).

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:24 +01:00
a3c5620cc6
Bug 38664: The tidy script: remove blank line after SWITCH
The prettier plugin does not deal correctly with SWITCH
https://gitlab.com/koha-community/prettier-plugin-template-toolkit/-/issues/2

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:22 +01:00
616102740a
Bug 38664: The tidy script - Implement --no-write and --silent
To ease comparisons, from the QA script

Bug 38664: Fix perltidyrc option

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:22 +01:00
287cb328bc
Bug 38664: Move prettier options to .prettierrc.js
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:20 +01:00
c531081d86
Bug 38664: The auto-rebase script - use misc/devel/tidy.pl from the target branch
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:20 +01:00
54cbdcc951
Bug 38664: Revert "Bug 38664: WIP trim msgid"
This reverts commit c54b476d80961f7d81f23c6be686309fed7ecbbc.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:18 +01:00
c00809a1c2
Bug 38664: WIP trim msgid
* Test the translation process
    * Confirm that the changes make sense
```
-                    <option value="r" selected="selected">Remote-sensing image</option>
+                    <option value="r" selected="selected">
+                        Remote-sensing image
+                    </option>
```
=> Generate
```
+#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:89
+#, fuzzy, c-format
+msgid "Remote-sensing image "
+msgstr "Image de télédétection"
```

Added a "trim" commit, and it actually fixes some problem with the current script:
```
+#. For the first occurrence,
 #. SCRIPT
-#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114
+#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:139
 msgid "b- Large print"
 msgstr "b- Gros caractères"

-#. SCRIPT
-#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114
-msgid "b- Large print "
-msgstr "b- Gros caractères "
```
Is that enough?

OR we modify prettier's default behaviour: https://prettier.io/docs/en/options.html#html-whitespace-sensitivity

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:18 +01:00
ba83aa61b4
Bug 38664: The auto-rebase script - Remove the dependency IPC::System::Simple
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:16 +01:00
675ff64ef7
Bug 38664: The tidy script - Remove the dependency IPC::System::Simple
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:15 +01:00
ba1aafe9e5
Bug 38664: The tidy script - Fix extra blank lines and spaces around script tags
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:14 +01:00
955521be23
Bug 38664: The tidy script - Add exceptions
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:14 +01:00
745da164ad
Bug 38664: The tidy script - fix race condition - replace edit_file
It seems that File::Slurp::edit_file is not thread safe?
Not sure what's happening here but I end up with corrupted file, or
getting the same error "write_file: No such file or directory"

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:13 +01:00
4a7a8fbef1
Bug 38664: The tidy script - fix race condition
There was a race condition, edit_file trying to open it while it was not
fully written by prettier (?) This is a dirty fix but it seems to do the
trick.

The error was:
edit_file 'koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc' - write_file: No such file or directory at misc/devel/tidy.pl line 149.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:13 +01:00
0cdaf9935f
Bug 38664: The tidy script - tidy tt twice
For an unknown reason the script is not idempotent (!)
Decided to run it twice for now, and have a look at this problem later.
It might be related to the length of the line

Version 0

<div>
    <div class="page-section clearfix">
        <div class="listgroup">
            <h4>
                <span>Statuses</span>
                [% IF foo %]
                    [% IF ( ITEM_DAT.withdrawn ) %]<span>Withdrawn</span>[% END %]
                    [% IF ITEM_DAT.bookable == 1 %] Yes [% ELSIF ITEM_DAT.bookable == 0 %] No [% ELSE %] Follow item type [% END %]

                    [% IF ITEM_DAT.bookable == 1 %] [% t('Yes') %] [% ELSIF ITEM_DAT.bookable == 0 %] [% t('No') %] [% ELSE %] [% t('Follow item type') %] [% END %]
                [% END %]
            </h4>
        </div>
    </div>
</div>

Version 1
<div>
    <div class="page-section clearfix">
        <div class="listgroup">
            <h4>
                <span>Statuses</span>
                [% IF foo %]
                    [% IF ( ITEM_DAT.withdrawn ) %]<span
                        >Withdrawn</span
                    >[% END %]
                    [% IF ITEM_DAT.bookable == 1 %]Yes[% ELSIF ITEM_DAT.bookable == 0 %]No[% ELSE %]Follow
                    item type[% END %]

                    [% IF ITEM_DAT.bookable == 1 %][% t('Yes') %][% ELSIF ITEM_DAT.bookable == 0 %][% t('No') %][% ELSE %][% t('Follow item type') %][% END %]
                [% END %]
            </h4>
        </div>
    </div>
</div>

Version 2
div>
    <div class="page-section clearfix">
        <div class="listgroup">
            <h4>
                <span>Statuses</span>
                [% IF foo %]
                    [% IF ( ITEM_DAT.withdrawn ) %]
                        <span>Withdrawn</span>
                    [% END %]
                    [% IF ITEM_DAT.bookable == 1 %]
                        Yes
                    [% ELSIF ITEM_DAT.bookable == 0 %]
                        No
                    [% ELSE %]
                        Follow item type
                    [% END %]

                    [% IF ITEM_DAT.bookable == 1 %][% t('Yes') %][% ELSIF ITEM_DAT.bookable == 0 %][% t('No') %][% ELSE %][% t('Follow item type') %][% END %]
                [% END %]
            </h4>
        </div>
    </div>
</div>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:12 +01:00
2c6f9d31b6
Bug 38664: The tidy script
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:12 +01:00
a9c0a70f67
Bug 38664: The auto-rebase script
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:11 +01:00
3d3ccd4624
Bug 30300: (QA follow-up) Move logic to queue_notice
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-03 14:26:54 +01:00
ae68d05b59
Bug 30300: Update the cronjob to respect patron messaging preferences
Test plan:
1) Apply patch and run updatedatabase
2) In system preferences set MembershipExpiryDaysNotice to 5
3) Choose a patron and edit their expiry date to today's date
4) Ensure that patron has a primary email address
5) Run perl misc/cronjobs/membership_expiry.pl -c -v -before 10 -after 10
6) Check the patron's messages, there should be no expiry notice queued
7) Edit the patron's messaging preferences and select the checkbox for email in the row for 'Patron expiry'
8) Repeat step 5
9) There should be a patron expiry message in the patron's message queue
10) Sign off!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-03 14:26:54 +01:00
Nicolas Hunstein
d8c5e63ec7
Bug 31270: Terminology - use "self-registration"
Standardize on the use of "self-registration" (and variations)
for consistency in the OPAC and staff interface, instead of
"self registration".

Test plan:
1. Check the codebase for occurences of "self reg":
   . git grep "self reg"
   . git grep "selfreg"
   . git grep "Self reg"
   . git grep "Selfreg"
2. Note the occurences, excluding code comments, previous
   database updates, and previous release notes.
3. Search the system preferences for "self reg" and "selfreg".
4. Note the occurences in the results for the system preference
   descriptions (excluding system preference names) for:
   - PatronSelfRegistrationDefaultCategory
   - PatronSelfRegistrationEmailMustBeUnique
   - PatronSelfRegistrationLibraryList
   - PatronSelfRegistrationPrefillForm
5. Note the system preferences category heading for the OPAC
   - "Self registration and modification".
6. Apply the patch.
7. Repeat steps 1 to 5. There should now be no occurences
   (excluding code comments, previous database updates, and
   previous release notes).

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-31 15:57:36 +01:00
3a5d8d51ca
Bug 38900: Provide info about the problematic strings
The translation script explodes without meaningful error when
"incorrect" structure is found (edit)

Found when working on bug 38714, the translation script can break with
an error that does not directly point to the problematic string

[13:00:23] Error: Command failed: misc/translator/xgettext.pl --charset=UTF-8 -F -o /tmp/koha-2rwDEm/Koha-opac-bootstrap.pot -f /tmp/koha-2rwDEm/files
Can't use an undefined value as a HASH reference at misc/translator/xgettext.pl line 131.

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:552:15)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5)
    at Process.callbackTrampoline (node:internal/async_hooks:128:17)
[13:00:23] 'po:update' errored after 992 ms

Test plan:
0. Use main and confirm that `gulp po:update --lang LANG` returns
   successfully
1. Apply the first patch
=> The error is
Can't use an undefined value as a HASH reference at misc/translator/xgettext.pl line 131, <$INPUT> line 80.
2. Apply this patch
=> The error is now:
Incorrect structure found at ./koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt:230: '<option value="*" ' at misc/translator/xgettext.pl line 124, <$INPUT> line 100.

Which is way more interesting to fix the problem as we know exactly
where the problem comes from

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-30 18:55:20 +01:00
c26a989c64
Bug 38104: Always update when hea cronjob is run
If the cronjob is configured to run every month we don't need to add
another test on the delay in the script itself.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-24 16:14:31 +01:00
phette23
97c2437bb3
Bug 29238: Cataloging cron jobs are not logged
Testing plan:

1. set CronjobLog to "Log"
2. Run the three cron jobs
   `perl misc/link_bibs_to_authorities.pl; perl misc/cronjobs/merge_authorities.pl -b; perl misc/migration_tools/remove_unused_authorities.pl --confirm`
3. Visit the log viewer /cgi-bin/koha/tools/viewlog.pl, select the "Cron jobs" module, & note it's empty
4. apply the patch
5. Repeat steps 2 & 3 but note the cron logs aren't empty

squash

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-24 16:14:30 +01:00
562dd9e2c9
Bug 38894: Use HomeOrHoldingBranch with longoverdue cronjob
To test:
1: Add 4 items, 2 with homebranch = Library A and 2 with homebranch = Library B
2: Logged into Library A, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
3: Set yourself to Library B, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
4: Run longoverdue cron with --verbose, without --confirm, and without --Library. see that it would act on all 4 items
5: Set CircControl to "the library the item is from"
6: Set HomeOrHoldingBranch to "the item's home library"
7: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
8: See the cron wants to act on the items with homebranch = A
9: Set HomeOrHoldingBranch to "the item's holding library"
10: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
11: See the cron is still trying to act on the two items with homebranch = A
12: Apply patch, restart all
13: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
14: See the cron is now trying to act on the two items with holdingbranch = A
15: Set HomeOrHoldingBranch to "the item's home library"
16: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
17: See the cron wants to act on the items with homebranch = A

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-24 12:02:14 +01:00
576621a6df
Bug 37448: Add script to allow developers to quickly generate large amounts of data for development and testing
Test Plan:
1) Apply this patch
2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall  -d zipcode=111111
3) Search patrons' for the name "Hall"
4) Note there are 99 Hall's in your results!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Bug 37448: Make use of build_sample_biblio and build_sample_item

The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed

To test, before this patch, run:
1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test
  Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio)
2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 37448: (QA follow-up) Tidy script

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:26 +01:00
9e894ee790
Bug 38857: (QA follow-up) Fix perltidy errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:23 +01:00
ed04d5b0fa
Bug 38857: Update cronjobs to log run before processing parameters
A few notes:
- I grabbed this list by looking for things in misc/ that had cronlogaction
- I didn't touch scripts that aren't in the cronjobs directory, except
  fix_invalid_dates where I follow import_patrons and only log if confirmed
  since they aren't crons, I figure this seems reasonable
- purge_suggestions I moved the logggin up and changed the addition of
  effective days to a verbose message - this seems more consistent

To test:
 1 - Enable CronjobLog
 2 - On command line:
     perl misc/cronjobs/cleanup_database.pl --old_reservers 550
 3 - Error on command line
 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit
 5 - No entries
 6 - Apply patch
 7 - Repeat and see run is logged with wrong parameter
 8 - Fix parameter and confirm
 9 - Spot check other files until you are satisfied
10 - Sign it off!

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:23 +01:00
7fb78e4a5d
Bug 22415: (QA follow-up) Fix misc qa issues
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:14 +01:00