Main Koha release repository https://koha-community.org
Find a file
Lari Taskula b5b88b053d
Bug 17499: Add Koha-objects for messaging preferences
This patch adds Koha-objects for messaging preferences.

Adds simple validation for messaging preferences.

The validation includes
- throw exception if both borrowernumber or categorycode is given for a new pref
- throw exception if patron for the given borrowernumber is not found
- throw exception if category for the given categorycode is not found
- throw exception if days in advance cannot be configured but is given
- throw exception if days in advance configuration is invalid (value between 0-30)
- throw exception if digest is not available but attempted to set on
- throw exception if digest must be enabled but attempted to set off
- throw exception on duplicate messaging preference

Adds a method for getting available messaging options.

Adds a method for setting default messaging preferenes.
  $patron->set_default_messaging_preferences (where $patron is a Koha::Patron)
  ...or...
  Koha::Patron::Message::Preference->new_from_default({
    borrowernumber => 123,
    categorycode => "ABC",
    message_attribute_id => 1,
  });

Since messaging preference is a feature that has multiple related database tables,
usage via Koha-objects is sometimes frustrating. This patch adds easy access to
message transport types via
  $preference->message_transport_types                              (for getting)
  $preference->set({ message_transport_types => ['email', 'sms'] }) (for setting)
  (also supports other calling conventions, see documentation for more)

Adds optional parameter message_name for Koha::Patron::Message::Preferences->find
and ->search. Simplifies the Koha-object usage by allowing developer to skip joins
and / or querying the message name via attribute_id from message_attributes table.

Includes test coverage for basic usage.

To test:
1. prove t/db_dependent/Koha/Patron/Message/*

Following Bug 17499, check also Bug 18595 that replaces C4::Members::Messaging
with these new Koha-objects.

Signed-off-by: Dominic Pichette <dominic@inlibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-12 10:16:06 -03:00
acqui Bug 34445: Set default budget in addorderiso2709.pl 2023-08-30 10:07:05 -03:00
admin Bug 27378: (QA follow-up) Tidy admin/preferences.pl 2023-09-12 09:45:07 -03:00
api Bug 34313: Add patron information in pass validation response 2023-08-29 14:59:02 -03:00
authorities Bug 33803: Remove comment about tab width 2023-06-06 09:58:47 -03:00
basket Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
bin
C4 Bug 34731: Use Koha::Notice::Message in EnqueueLetter 2023-09-12 09:44:59 -03:00
catalogue Bug 34441: Fixed Typo "Paramater" 2023-09-01 11:23:21 -03:00
cataloguing Bug 34288: Allow access to the cataloguing module with tools permission 2023-07-18 12:46:53 -03:00
circ Bug 28966: Prefetch patron data for holds queue viewer 2023-07-25 16:25:38 -03:00
clubs Bug 25079: Show club enrollment question answers in staff client 2023-06-23 11:00:54 -03:00
course_reserves
debian Bug 32911: (follow-up) Remove partner_code 2023-09-01 11:43:42 -03:00
docs Bug 33899: Add the 23.11 release team 2023-06-09 08:28:57 -03:00
erm Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
errors
etc Bug 32911: (follow-up) Remove partner_code 2023-09-01 11:43:42 -03:00
ill Bug 34598: Improve handling of not found ILL request 2023-08-30 09:02:39 -03:00
installer Bug 27378: Fix permissions 2023-09-12 09:48:32 -03:00
Koha Bug 17499: Add Koha-objects for messaging preferences 2023-09-12 10:16:06 -03:00
koha-tmpl Bug 34502: Remove useless SEARCH_RESULT.localimage 2023-09-12 10:16:05 -03:00
labels
lib/CGI/Session/Serialize
members Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
misc Bug 28995: Update aliases 2023-09-08 11:54:55 -03:00
offline_circ Bug 33444: Update AddRenewal to take a hashref of params 2023-07-19 12:06:52 -03:00
opac Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
patron_lists
patroncards
plugins Bug 30367: (follow-up) Same adjustment for gitlab 2023-05-05 10:18:57 -03:00
pos Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
recalls Bug 34013: Recalls awaiting pickup doesn't show count on each tab 2023-06-23 10:01:04 -03:00
reports Bug 29664: (QA follow-up) Typo transacton 2023-07-03 14:51:36 -03:00
reserve Bug 34634: Show expirationdate of expired holds on reserve/request.pl 2023-09-01 12:08:37 -03:00
reviews
rotating_collections
serials Bug 33039: Add ability to specify a template for serial subscription "Published on (text)" field 2023-07-14 08:59:43 -03:00
services
skel
suggestion Bug 34601: Fix edit/delete links on suggestion.tt 2023-08-29 14:37:10 -03:00
svc Bug 34533: jsdiff library missing from guided reports page 2023-08-29 14:37:13 -03:00
t Bug 17499: Add Koha-objects for messaging preferences 2023-09-12 10:16:06 -03:00
tags
tools Bug 34257: (QA follow-up): tidy up code 2023-09-12 09:45:05 -03:00
virtualshelves Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
xt Bug 30002: Remove unused xt/perltidyrc 2023-06-08 08:32:40 -03:00
.editorconfig
.eslintrc.json
.gitignore Bug 33710: Ignore how-to related files 2023-05-12 17:50:01 -03:00
.htaccess
.mailmap Update .mailmap 2023-06-12 11:52:05 -03:00
.perlcriticrc
.perltidyrc Bug 30002: Adjust perltidy 2023-06-08 08:32:42 -03:00
.proverc.dist
.stylelintrc.json
about.pl Bug 32911: Remove ILL partner_code config from koha-conf.xml and turn it into a system preference 2023-09-01 11:43:39 -03:00
app.psgi
build-resources.PL Bug 32609: Use the current yarn.lock to generate node_modules 2023-02-10 11:07:57 -03:00
changelanguage.pl
cpanfile Bug 33964: (QA follow-up) Remove library from cpanfile 2023-07-25 08:25:41 -03:00
cypress.config.ts Bug 34319: Upgrade cypress 9.7.0 to 12.17.2 2023-09-05 11:52:25 -03:00
fix-perl-path.PL
gulpfile.js Bug 32978: Replace node-sass with dart-sass 2023-02-22 10:03:39 -03:00
help.pl
INSTALL
Koha.pm Bug 27378: DBRev 23.06.00.018 2023-09-12 09:45:08 -03:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl Bug 33133: Add fast cataloging to 'Cataloging' page 2023-03-27 12:50:07 +02:00
Makefile.PL Bug 34319: Remove cypress.json from Makefile.PL 2023-09-06 09:57:01 -03:00
MANIFEST.SKIP
package.json Bug 34319: Upgrade cypress 9.7.0 to 12.17.2 2023-09-05 11:52:25 -03:00
README
README.md
README.robots
rewrite-config.PL
tsconfig.json
webpack.config.js Bug 32806: Move main-erm.ts to modules/erm.ts 2023-02-27 11:12:01 -03:00
yarn.lock Bug 34319: Update yarn.lock 2023-09-05 11:52:25 -03:00

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo