https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17499
Sam Lau <sama...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151900|0 |1 is obsolete| | --- Comment #180 from Sam Lau <sama...@gmail.com> --- Created attachment 151937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151937&action=edit 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 <domi...@inlibro.com> Signed-off-by: David Nind <da...@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer...@web.de> Signed-off-by: Michal Denar <blac...@gmail.com> Signed-off-by: Sam Lau <sama...@gmail.com> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/