View | Details | Raw Unified | Return to bug 12532
Collapse All | Expand All

(-)a/C4/Members.pm (-2 / +2 lines)
Lines 1019-1026 sub GetNoticeEmailAddress { Link Here
1019
    my $to_address = $which_address eq 'OFF' ? GetFirstValidEmailAddress($member->{'borrowernumber'}) : $member->{ $which_address };
1019
    my $to_address = $which_address eq 'OFF' ? GetFirstValidEmailAddress($member->{'borrowernumber'}) : $member->{ $which_address };
1020
    my $guarantor_to_address = $which_address eq 'OFF' ? GetFirstValidEmailAddress($guarantor->{'borrowernumber'}) : $guarantor->{ $which_address } if $guarantor;
1020
    my $guarantor_to_address = $which_address eq 'OFF' ? GetFirstValidEmailAddress($guarantor->{'borrowernumber'}) : $guarantor->{ $which_address } if $guarantor;
1021
    $to_address .="," . $guarantor_to_address if $guarantor_to_address;
1021
    $to_address .="," . $guarantor_to_address if $guarantor_to_address;
1022
1022
    
1023
   return $to_address || '';
1023
    return $to_address || '';
1024
}
1024
}
1025
1025
1026
=head2 GetBorrowersToExpunge
1026
=head2 GetBorrowersToExpunge
(-)a/installer/data/mysql/atomicupdate/bug_12532-EnableRedirectGuaranteeEmail_syspref.sql (-1 / +1 lines)
Lines 1-2 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
2
VALUES ('RedirectGuaranteeEmail','0',NULL,'Enable the ability to redirect guarantee email messages to guarantor.','YesNo');
2
VALUES ('EnableRedirectGuaranteeEmail','0',NULL,'Enable the ability to redirect guarantee email messages to guarantor.','YesNo');
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 148-154 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
148
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
148
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
149
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
149
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
150
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
150
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
151
('RedirectGuaranteeEmail', '0', NULL, 'Enable the ability to redirect guarantee email messages to guarantor.', 'YesNo'),
152
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
151
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
153
('EnhancedMessagingPreferences','0','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
152
('EnhancedMessagingPreferences','0','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
154
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
153
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 192-198 Patrons: Link Here
192
         - track last patron activity.
192
         - track last patron activity.
193
         - Everytime a patron will connect, the borrowers.lastseen will be updated with the current time.
193
         - Everytime a patron will connect, the borrowers.lastseen will be updated with the current time.
194
     -
194
     -
195
         - pref: RedirectGuaranteeEmail
195
         - pref: EnableRedirectGuaranteeEmail
196
           choices:
196
           choices:
197
               yes: Enable
197
               yes: Enable
198
               no: "Don't enable"
198
               no: "Don't enable"
(-)a/t/db_dependent/Letters.t (-5 / +5 lines)
Lines 183-189 my $guarantee_message = { Link Here
183
sub SendToGuarantor {
183
sub SendToGuarantor {
184
    my ($useGuarantor, $message) = @_;
184
    my ($useGuarantor, $message) = @_;
185
    C4::Context->set_preference( 'AutoEmailPrimaryAddress', 'OFF' );
185
    C4::Context->set_preference( 'AutoEmailPrimaryAddress', 'OFF' );
186
    C4::Context->set_preference( 'RedirectGuaranteeEmail', $useGuarantor );
186
    C4::Context->set_preference( 'EnableRedirectGuaranteeEmail', $useGuarantor );
187
    C4::Context->clear_syspref_cache();
187
    C4::Context->clear_syspref_cache();
188
    my $id = C4::Letters::EnqueueLetter($message);
188
    my $id = C4::Letters::EnqueueLetter($message);
189
    C4::Letters::SendQueuedMessages();
189
    C4::Letters::SendQueuedMessages();
Lines 191-202 sub SendToGuarantor { Link Here
191
    return $result;
191
    return $result;
192
}
192
}
193
my $result = SendToGuarantor(0,$guarantee_message);
193
my $result = SendToGuarantor(0,$guarantee_message);
194
is($result->{'status'}, "sent", "With RedirectGuaranteeEmail off, message is sent.");
194
is($result->{'status'}, "sent", "With EnableRedirectGuaranteeEmail off, message is sent.");
195
is($result->{'to_address'}, $GUARANTEE_TO_ADDRESS, "With RedirectGuaranteeEmail off, Message is sent to the specified to_address.");
195
is($result->{'to_address'}, $GUARANTEE_TO_ADDRESS, "With EnableRedirectGuaranteeEmail off, Message is sent to the specified to_address.");
196
196
197
$result = SendToGuarantor(1,$guarantee_message);
197
$result = SendToGuarantor(1,$guarantee_message);
198
is($result->{'status'}, "sent", "With RedirectGuaranteeEmail on, message is sent.");
198
is($result->{'status'}, "sent", "With EnableRedirectGuaranteeEmail on, message is sent.");
199
is($result->{'to_address'}, $GUARANTOR_EMAIL, "With RedirectGuaranteeEmail on, Message is sent to the guarantor's email address.");
199
is($result->{'to_address'}, $GUARANTOR_EMAIL, "With EnableRedirectGuaranteeEmail on, Message is sent to the guarantor's email address.");
200
200
201
# GetLetters
201
# GetLetters
202
my $letters = C4::Letters::GetLetters();
202
my $letters = C4::Letters::GetLetters();
(-)a/t/db_dependent/Members.t (-5 / +4 lines)
Lines 139-145 is ($checkcardnum, "2", "Card number is too long"); Link Here
139
139
140
t::lib::Mocks::mock_preference( 'AutoEmailPrimaryAddress', 'OFF' );
140
t::lib::Mocks::mock_preference( 'AutoEmailPrimaryAddress', 'OFF' );
141
141
142
C4::Context->set_preference( 'RedirectGuaranteeEmail', 0 );
142
C4::Context->set_preference( 'EnableRedirectGuaranteeEmail', 0 );
143
C4::Context->set_preference( 'AutoEmailPrimaryAddress', 'OFF' );
143
C4::Context->set_preference( 'AutoEmailPrimaryAddress', 'OFF' );
144
C4::Context->clear_syspref_cache();
144
C4::Context->clear_syspref_cache();
145
145
Lines 164-176 my $guarantee = { Link Here
164
$guarantee->{'borrowernumber'} = AddMember(%$guarantee);
164
$guarantee->{'borrowernumber'} = AddMember(%$guarantee);
165
165
166
$notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'});
166
$notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'});
167
is ($notice_email, $GUARANTEE_EMAIL, "GetNoticeEmailAddress returns correct value when RedirectGuaranteeEmail is disabled");
167
is ($notice_email, $GUARANTEE_EMAIL, "GetNoticeEmailAddress returns correct value when EnableRedirectGuaranteeEmail is disabled");
168
168
169
C4::Context->set_preference( 'RedirectGuaranteeEmail', 1 );
169
C4::Context->set_preference( 'EnableRedirectGuaranteeEmail', 1 );
170
C4::Context->clear_syspref_cache();
170
C4::Context->clear_syspref_cache();
171
171
172
$notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'});
172
$notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'});
173
is ($notice_email, "$GUARANTEE_EMAIL,$EMAILPRO", "GetNoticeEmailAddress returns correct value when RedirectGuaranteeEmail is activated");
173
is ($notice_email, "$GUARANTEE_EMAIL,$EMAILPRO", "GetNoticeEmailAddress returns correct value when EnableRedirectGuaranteeEmail is activated");
174
174
175
175
176
ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired");
176
ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired");
177
- 

Return to bug 12532