From 1f9895092dad3956f95ebc1d5bf0907d190e1f6e Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 27 Oct 2016 16:25:05 +0300 Subject: [PATCH] Bug 18595: Remove references to C4::Members::Messaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To test: 1. grep -r 'C4::Members::Messaging' This command should not produce any results in Koha source code after this patch. 2. Check the pages touched by this commit 3. Try setting and viewing patron and patron category messaging preferences As this completes the move from C4::Members::Messaging to new Koha-objects for messaging preferences, everything should be ready for proper testing. Make sure you have EnhancedMessagingPreferences system preference enabled. Then, try creating new categories and setting default messaging preferences, as well as editing the messaging preferences of the already existing categories. Try adding new patrons and make sure the default patron messaging preferences are by default the same that you set for that category. Edit already exisiting patrons' messaging preferences and make sure changes are applied. Observe no crash at any point, otherwise fail this patch. Don't forget to test both intranet and OPAC. Finally, run unit tests: 1. prove t/db_dependent/Circulation.t 2. prove t/db_dependent/Reserves.t 3. prove t/db_dependent/Koha/Patron/Categories.t Signed-off-by: Marc VĂ©ron Signed-off-by: David Bourgault Rebased-by: Emmi Takkinen --- C4/Auth_with_ldap.pm | 1 - C4/Auth_with_shibboleth.pm | 1 - C4/Form/MessagingPreferences.pm | 3 +- C4/Members/Messaging.pm | 95 ------------------- C4/Message.pm | 2 +- C4/Reserves.pm | 1 - Koha/Patron/Category.pm | 2 - circ/returns.pl | 1 - misc/cronjobs/advance_notices.pl | 1 - .../borrowers-force-messaging-defaults.pl | 1 - opac/opac-messaging.pl | 1 - t/Members_Messaging.t | 14 --- 12 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 C4/Members/Messaging.pm delete mode 100755 t/Members_Messaging.t diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index af33519561..3b82903075 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -21,7 +21,6 @@ use Modern::Perl; use Carp qw( croak ); use C4::Context; -use C4::Members::Messaging; use C4::Auth qw( checkpw_internal ); use C4::Letters qw( GetPreparedLetter EnqueueLetter SendQueuedMessages ); use Koha::Patrons; diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm index 06cd0d5868..bc19868e85 100644 --- a/C4/Auth_with_shibboleth.pm +++ b/C4/Auth_with_shibboleth.pm @@ -24,7 +24,6 @@ use Koha::AuthUtils qw( get_script_name ); use Koha::Database; use Koha::Patrons; use C4::Letters qw( GetPreparedLetter EnqueueLetter SendQueuedMessages ); -use C4::Members::Messaging; use Carp qw( carp ); use List::MoreUtils qw( any ); diff --git a/C4/Form/MessagingPreferences.pm b/C4/Form/MessagingPreferences.pm index 10854479fe..1affcac8e6 100644 --- a/C4/Form/MessagingPreferences.pm +++ b/C4/Form/MessagingPreferences.pm @@ -22,7 +22,6 @@ use warnings; use CGI qw ( -utf8 ); use C4::Context; -use C4::Members::Messaging; use Koha::Patron::MessagePreferences; use Koha::Patrons; @@ -177,7 +176,7 @@ sub set_form_values { =head1 SEE ALSO -L, F, F, F +L, F, F, F =head1 AUTHOR diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm deleted file mode 100644 index a065636da2..0000000000 --- a/C4/Members/Messaging.pm +++ /dev/null @@ -1,95 +0,0 @@ -package C4::Members::Messaging; - -# Copyright (C) 2008 LibLime -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use strict; -use warnings; -use C4::Context; - -=head1 NAME - -C4::Members::Messaging - manage patron messaging preferences - -=head1 SYNOPSIS - - use C4::Members::Messaging - -=head1 DESCRIPTION - -This module lets you modify a patron's messaging preferences. - -=head1 TABLES - -=head2 message_queue - -The actual messages which will be sent via a cron job running -F. - -=head2 message_attributes - -What kinds of messages can be sent? - -=head2 message_transport_types - -What transports can messages be sent vith? (email, sms, etc.) - -=head2 message_transports - -How are message_attributes and message_transport_types correlated? - -=head2 borrower_message_preferences - -What messages do the borrowers want to receive? - -=head2 borrower_message_transport_preferences - -What transport should a message be sent with? - -=head1 CONFIG - -=head2 Adding a New Kind of Message to the System - -=over 4 - -=item 1. - -Add a new template to the `letter` table. - -=item 2. - -Insert a row into the `message_attributes` table. - -=item 3. - -Insert rows into `message_transports` for each message_transport_type. - -=back - -=head1 SEE ALSO - -L - -=head1 AUTHOR - -Koha Development Team - -Andrew Moore - -=cut - -1; diff --git a/C4/Message.pm b/C4/Message.pm index 7a55152e05..452e4c4b71 100644 --- a/C4/Message.pm +++ b/C4/Message.pm @@ -404,7 +404,7 @@ sub DESTROY { } =head1 SEE ALSO -L, L, L +L, L, L =head1 AUTHOR diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 1785c2c3cc..b9549feaa3 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -30,7 +30,6 @@ use C4::Context; use C4::Items qw( CartToShelf get_hostitemnumbers_of ); use C4::Letters; use C4::Log qw( logaction ); -use C4::Members::Messaging; use C4::Members; use Koha::Account::Lines; use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue; diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm index 449ae4b0a5..7fd7ebb2ec 100644 --- a/Koha/Patron/Category.pm +++ b/Koha/Patron/Category.pm @@ -19,8 +19,6 @@ use Modern::Perl; use List::MoreUtils qw( any ); -use C4::Members::Messaging; - use Koha::Database; use Koha::DateUtils qw( dt_from_string ); use Koha::Patron::MessagePreferences; diff --git a/circ/returns.pl b/circ/returns.pl index 4fb2131038..1cf87acff2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -38,7 +38,6 @@ use C4::Auth qw( get_template_and_user get_session haspermission ); use C4::Circulation qw( barcodedecode GetBranchItemRule AddReturn updateWrongTransfer LostItem ); use C4::Context; use C4::Items qw( ModItemTransfer ); -use C4::Members::Messaging; use C4::Members; use C4::Output qw( output_html_with_http_headers ); use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves ); diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index f496d84399..59e3f557df 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -44,7 +44,6 @@ use Koha::Script -cron; use C4::Context; use C4::Letters; use C4::Members; -use C4::Members::Messaging; use C4::Log qw( cronlogaction ); use Koha::Items; use Koha::Libraries; diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl index 152e351611..24119539c5 100755 --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ b/misc/maintenance/borrowers-force-messaging-defaults.pl @@ -22,7 +22,6 @@ use warnings; use Koha::Script; use C4::Context; -use C4::Members::Messaging; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use Koha::Patrons; diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 224cca10cb..4e64a4c8d1 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -24,7 +24,6 @@ use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Output qw( output_html_with_http_headers ); -use C4::Members::Messaging; use C4::Form::MessagingPreferences; use Koha::Patrons; use Koha::SMS::Providers; diff --git a/t/Members_Messaging.t b/t/Members_Messaging.t deleted file mode 100755 index 93950084c1..0000000000 --- a/t/Members_Messaging.t +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/perl -# -# This Koha test module is a stub! -# Add more tests here!!! - -use strict; -use warnings; - -use Test::More tests => 1; - -BEGIN { - use_ok('C4::Members::Messaging'); -} - -- 2.25.1