From 5279faf72ead1bc260c769ec5641b01c15847a11 Mon Sep 17 00:00:00 2001 From: John Beppu Date: Thu, 5 Feb 2009 16:36:22 -0600 Subject: [PATCH] bug 356: removed redundant interface The messaging tab already provided a way to configure these notifications, so this isn't needed. Signed-off-by: Daniel Sweeney Signed-off-by: Galen Charlton --- .../en/modules/members/memberentrygen.tmpl | 46 ------------- members/memberentry.pl | 67 +------------------ 2 files changed, 1 insertion(+), 112 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index 19732eb7bf..b8b4f2f0e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -866,52 +866,6 @@ -
- Items Borrowed Notifications -
    - -
  1. - - - - " name="" value="1" checked="checked" /> - - " name="" value="1" /> - - - - " name="" value="0" checked="checked"/> - - " name="" value="0" /> - -
  2. - -
-
- -
- Items Returned Notifications -
    - -
  1. - - - - " name="" value="1" checked="checked" /> - - " name="" value="1" /> - - - - " name="" value="0" checked="checked"/> - - " name="" value="0" /> - -
  2. - -
-
- diff --git a/members/memberentry.pl b/members/memberentry.pl index 08e2e10942..bf20434501 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -148,9 +148,7 @@ if ($op eq 'insert' || $op eq 'modify' || $op eq 'save') { # remove keys from %newdata that ModMember() doesn't like { - my @keys_to_delete = - map { ("items_borrowed_$_", "items_returned_$_") } qw(email sms feed); - push @keys_to_delete, qw( + my @keys_to_delete = qw( BorrowerMandatoryField category_type check_member @@ -312,7 +310,6 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ delete $newdata{'userid'}; } &ModMember(%newdata); - save_messaging_preferences($input); if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) { C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes); } @@ -476,33 +473,6 @@ foreach (keys(%flags)) { push @flagdata,\%row; } -## Mesaging Preferences -##____________________________________________________________________________ -sub yes_or_no { - my ($transport, $config) = @_; - if (grep { $_ eq $transport } @{$config->{transports}}) { - return (yes => 1); - } else { - return (no => 1); - } -} -my $checkin_prefs = C4::Members::Messaging::GetMessagingPreferences({ - borrowernumber => $borrowernumber, - message_name => 'Item Checkout' -}); -my @items_borrowed_loop = ( - { name => 'items_borrowed_email', label => 'Email', yes_or_no('email', $checkin_prefs) }, - { name => 'items_borrowed_sms', label => 'Text Message', yes_or_no('sms', $checkin_prefs) }, -); -my $checkout_prefs = C4::Members::Messaging::GetMessagingPreferences({ - borrowernumber => $borrowernumber, - message_name => 'Item Check-in' -}); -my @items_returned_loop = ( - { name => 'items_returned_email', label => 'Email', yes_or_no('email', $checkout_prefs) }, - { name => 'items_returned_sms', label => 'Text Message', yes_or_no('sms', $checkout_prefs) }, -); - #get Branches my @branches; my @select_branch; @@ -625,8 +595,6 @@ $template->param( borrotitlepopup => $borrotitlepopup, guarantorinfo => $guarantorinfo, flagloop => \@flagdata, - items_borrowed_loop => \@items_borrowed_loop, - items_returned_loop => \@items_returned_loop, dateformat => C4::Dates->new()->visual(), C4::Context->preference('dateformat') => 1, check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function @@ -725,39 +693,6 @@ sub patron_attributes_form { } -sub save_messaging_preferences { - my $input = shift; - my %options = map { $_->{message_name} => $_ } - @{C4::Members::Messaging::GetMessagingOptions()}; - my @checkin_transports; - my @checkout_transports; - for (qw(email sms feed)) { - push @checkin_transports, $_ if ($input->param("items_returned_$_")); - push @checkout_transports, $_ if ($input->param("items_borrowed_$_")); - } - #use Data::Dump 'pp'; - #warn pp({ checkin => \@checkin_transports, checkout => \@checkout_transports }); - - # Check-in Notifications - C4::Members::Messaging::SetMessagingPreference({ - borrowernumber => $borrowernumber, - wants_digest => 0, - message_attribute_id => $options{'Item Check-in'}{message_attribute_id}, - message_transport_types => \@checkin_transports, - }); - # Checkout Notifications - C4::Members::Messaging::SetMessagingPreference({ - borrowernumber => $borrowernumber, - wants_digest => 0, - message_attribute_id => $options{'Item Checkout'}{message_attribute_id}, - message_transport_types => \@checkout_transports, - }); - return { - checkin => \@checkin_transports, - checkout => \@checkout_transports, - }; -} - # Local Variables: # tab-width: 8 # End: -- 2.39.5