Commit graph

51216 commits

Author SHA1 Message Date
6a42c85434
Bug 31503: (QA follow-up) Fix number of tests in rebase
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 10:35:25 -03:00
685ac83fa4
Bug 31503: (QA follow-up) Improve count of available_types
Tidied one other line.

Test plan:
Run t/db_dependent/Koha/Patron/Consents.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 10:35:24 -03:00
22651c9c2b
Bug 31503: (follow-up) Remove OPACCustomConsentTypes
This patch removes all trace of the original OPACCustomConsentTypes
preference.  We now use Koha::Plugins->feature_enabled in preference.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 10:35:23 -03:00
cef4ef4fb1
Bug 31503: (follow-up) Use KohaPlugins.feature_enabled
This patch switches the code from using
Koha.preference('OPACCustomConsentTypes') to using
KohaPlugins.feature_enabled('patron_consent_type').

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 10:35:23 -03:00
3d857d8e95
Bug 31503: (follow-up) Add 'feature_enabled' to Koha::Plugins
This patch adds a 'feature_enabled' accessor to the Koha::Plugins class.
Passing the plugin method name for the plugin feature you're looking for
will return a boolean denoting whether any enabled plugins carry said
method.

Included in the patch is an addition to the TT KohaPlugins plugin to
enable quick access to this function.

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

[EDIT] Tidied t/db_dependent/Koha/Plugins/Plugins.t
[EDIT] Tidied Koha/Template/Plugin/KohaPlugins.pm

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 10:35:22 -03:00
90604fcfcf
Bug 31503: (follow-up) Styling and pre-selection
This patch restores some of the wording and styling from the original
GDPR/Privacy policy feature including highlighting in a warning box.

I also remove the jQuery approach for pre-selecting already selected
radio options and rely on standard TT processing instead.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-25 10:35:22 -03:00
David Nind
90ca82b551
Bug 31503: (follow-up) Update description for system preference
Update new OPACCustomConsentType system preference description - bold
and capitalize NOTE for consistency, link to PrivacyPolicyConsent
system preference for consistency, and other minor changes.

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

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-25 10:35:21 -03:00
0a471bfeda
Bug 31503: Make opac-patron-consent more generic
Adds $patron->consent and $consents->available_types.
Incorporates them into script/template.
Provides two unit tests.

Note: A follow-up patch helps you test this with an
example plugin.

Test plan:
Run t/db_dependent/Koha/Patron.t
Run t/db_dependent/Koha/Patron/Consents.t
Toggle the value of pref PrivacyPolicyConsent and look at
OPAC account, tab Consents.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-10-25 10:35:20 -03:00
5d682d514b
Bug 31503: Change usermenu condition, add preference
Adds preference OPACCustomConsentTypes.

Test plan:
Run dbrev.
Toggle value of OPACCustomConsentTypes / PrivacyPolicyConsent.
Check user page for Consents tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-10-25 10:35:20 -03:00
05fb6f7848
Bug 31503: Change patron_consent.type
Test plan:
Run db rev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-10-25 10:35:19 -03:00
2b8275379e
Bug 27153: DBRev 23.06.00.048
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:36 -03:00
f0e76ce9d8
Bug 27153: DBIC schema
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:36 -03:00
825ff04bc8
Bug 27153: Adjust kohastructure for new primary key
Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:35 -03:00
f54556041b
Bug 27153: Adjust mappings to add title without punctuation
This patch finally adjust the default mappings to add a new field to
the elastic index with the title stripped of punctuation

This method optionally allows the library to place the filtered version in the same
search field, or a new search field. The default mappings will include the filtered version
in a keyword search, but not a targeted search

To test:
1 - Import some affected records via z3950, e.g.:
    Carrie's war
    1,000 Japanese words
2 - Search (using Elasticsearch) for the titles without including punctuation
    Carries war
    1000 Japanese words
3 - No results
4 - Reload mappings and reindex
    perl misc/search_tools/rebuild_elasticsearch.pl -v -r
5 - Search again
6 - Success!
7 - Search title specifically:
    ti:Carries war
8 - No results
9 - Adjust mappings.yaml to add second mapping for 245 to title index:
    - facet: ''
      marc_field: 245abp
      marc_type: marc21
      sort: 1
      suggestible: 1
      filter: punctuation
10 - Reload mappings and reindex
11 - Repeat 7
12 - Success

Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:34 -03:00
f5347f4958
Bug 27153: Add filter option to Elasticsearch indexing
This patch uses the filter option from the mappings to add a value_callback
to reord processing for indexing.

Fields defined with 'punctuation' filter will have all punctuation stripped when
conveted to documents.

Tests are updated.

Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:34 -03:00
9972085a93
Bug 27153: Interface updates
This patch adds a new column to the 'Bibliographic records' tab in
Administration > Search engine configuration (Elasticsearch)

To test:
1 - Confirm the new 'filter' column shows
2 - Update an existing field to set filter to punctuation
3 - Confirm it can be saved
4 - Add a new field
5 - Confirm it saves correctly
6 - Unset filter for a field
7 - Confirm it saves

Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:33 -03:00
333109c7fd
Bug 27153: DB Updates
We start by adding the field to the table

It is possible a library would want two versions of the same field in
the indexing. We need to make the filter part of the primary key in
order to allow this

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
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
5c2c6252fa
Bug 35001: Simplify ->is_active in light of activity triggers
The fact that we update lastseen for various triggers now, makes
it a bit easier to let go of those 'hardcoded queries' ;)

Test plan:
Run t/db_dependent/Koha/Patron.t

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:31 -03:00
7d783c21ef
Bug 35136: (bug 31383 follow-up) Fix db rev
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 15:44:31 -03:00
Michał Kula
da9f74e56a
Bug 35072: Fix invalid usage of "&amp;" in JavaScript intranet-tmpl script redirects
These escapes were invalid in these places, as HTML entity escapes
are meant to be used only inside of HTML elements/attributes, not
inside of JavaScript code.

These URLs would be sent out by the browser as-is, and that'd usually
work on the default install only coincidentally. Unfortunately, on some
setups (such as when using reverse proxies), this would break, and the
URL after "&amp;" would have been truncated.

This small patch adjusts the URLs in templates to not use wrong escapes,
and makes them consistent with how URLs are formatted for JavaScript
redirects in most of the templates already.

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>
2023-10-24 10:05:27 -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
21315eb8dc
Bug 35030: Add 'article' to patron activity triggers
This patch adds 'article' to the list of triggers available for
tracking patron activity.

Test plan
1) Select 'Placing an article request
   TrackPatronLastActivityTriggers system preference
2) As a staff member, place a hold on any item for a test user
3) Confirm that the borrowers.lastseen field is updated for that
   test borrower

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:26 -03:00
795c60e577
Bug 35027: Add 'hold' to patron activity triggers
This patch adds 'hold' to the list of triggers available for tracking
patron activity.

Test plan
1) Select 'Placing a hold on an item' in the
   TrackPatronLastActivityTriggers system preference
2) As a staff member, place a hold on any item for a test user
3) Confirm that the borrowers.lastseen field is updated for that test
   borrower

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:25 -03:00
e1a4284258
Bug 15504: Fix tests count
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:25 -03:00
57cc290bb8
Bug 15504: DBRev 23.06.00.047
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:24 -03:00
d6b6ac6a9d
Bug 15504: (QA follow-up): more consistent quotes in atomicupdate
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:24 -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
7a91be1814
Bug 15504: (QA follow-up) Fix dbrev
Resolve:
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Unknown column 'check_out' in 'field list' at /usr/share/koha/C4/Installer.pm line 741

Test plan:
Remove new pref from db.
Run dbrev again.
Check results.

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
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
6c9924f9f4
Bug 15504: (follow-up) Update terminology on cleanborrowers
This patch updates the terminology on the cleanborrowers form to reflect
that 'activity' and not just 'connectivity' is tracked by
TrackLastPatronActivity.

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:20 -03:00
299c05c3d6
Bug 15504: (QA follow-up) Terminology
This just updates 'Login to OPAC' to 'Login'.. we should squash this

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:20 -03:00
a377be6afe
Bug 15504: (follow-up) Rename cache key
I agree, it's better to use borrowernumber for the cache key and I also
take the oportunity to rename it to more clearly reflect the function
(it's no longer 'login' only, it's now 'activity')

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:19 -03:00
66b6c3e936
Bug 15504: (follow-up) Respect existing TrackLastPatronActivity
This patch updates the database update to set
'check_out,connection,login' as the activity triggers should we find at
upgrade time that TrackLastPatronActivity is set to true.

This retains the existing functionality.

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:19 -03:00
305a221112
Bug 15504: (follow-up) Fix is_active test
Bug 33245 introduced a new is_active patron method and the corresponding
tests included calls to the method we depreacte in this patchset

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:18 -03:00
2d8dfd89c2
Bug 15504: (follow-up) Tidy 'lastseen' section of unit test
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:17 -03:00
91b7799c96
Bug 15504: (follow-up) Add Triggers mock to unit tests
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:17 -03:00
0ae97bba6b
Bug 15504: (follow-up) Use borrowernumber in Koha::Patrons->find
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:16 -03:00
75f68914be
Bug 15504: (follow-up) Migrate to one clear method
We were using a series of similarly named methods spread in distinct places
around the codebase. This combines the logic of C4::Auth::track_login_daily
and Koha::Patron->track_login into a new Koha::Patron->update_lastseen method.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:15 -03:00
b30d32a571
Bug 15504: (follow-up) Unit tests
This patch removes, moves and updates the existing unit tests for
track_login_daily and track_login to all sit under Koha::Patron and
update_lastseen.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:15 -03:00
dff2fc82d7
Bug 15504: Add unit test
prove -v t/db_dependent/Auth.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:14 -03:00
2db5afffa1
Bug 15504: Remove update_lastseen method
This patch removes update_lastseen which has been replaced by a call to track_login_daily

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:13 -03:00
68f1154f6d
Bug 15504: Add triggers to instances of track_login_daily
This patch adds a trigger to every instance of track_login_daily

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:13 -03:00
6b20144bbb
Bug 15504: Update track_login_daily to accept triggers
This patch adds triggers to track_login_daily so that it only tracks activity when that trigger is active

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:12 -03:00
b694c85edf
Bug 15504: Add new syspref TrackLastPatronActivityTriggers
This patch adds a new syspref TrackLastPatronActivityTriggers to determine which actions should update borrowers.lastseen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
2023-10-24 10:05:12 -03:00
a36e05904a
Bug 34030: non-table view
Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-23 11:33:55 -03:00
d0d0a940ea
Bug 34030: Add a "print slips" action links to print in batch
Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: BULAC - http://www.bulac.fr/
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-23 11:33:55 -03:00
8a099dc488
Bug 33547: DBRev 23.06.00.046
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-23 11:33:54 -03:00
cc69c69614
Bug 33547: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-23 11:33:53 -03:00