Lines 64-70
BEGIN {
Link Here
|
64 |
&GetPendingIssues |
64 |
&GetPendingIssues |
65 |
&GetAllIssues |
65 |
&GetAllIssues |
66 |
|
66 |
|
67 |
&GetFirstValidEmailAddress |
|
|
68 |
&GetNoticeEmailAddress |
67 |
&GetNoticeEmailAddress |
69 |
|
68 |
|
70 |
&GetMemberAccountRecords |
69 |
&GetMemberAccountRecords |
Lines 918-941
sub get_cardnumber_length {
Link Here
|
918 |
return ( $min, $max ); |
917 |
return ( $min, $max ); |
919 |
} |
918 |
} |
920 |
|
919 |
|
921 |
=head2 GetFirstValidEmailAddress |
|
|
922 |
|
923 |
$email = GetFirstValidEmailAddress($borrowernumber); |
924 |
|
925 |
Return the first valid email address for a borrower, given the borrowernumber. For now, the order |
926 |
is defined as email, emailpro, B_email. Returns the empty string if the borrower has no email |
927 |
addresses. |
928 |
|
929 |
=cut |
930 |
|
931 |
sub GetFirstValidEmailAddress { |
932 |
my $borrowernumber = shift; |
933 |
|
934 |
my $borrower = Koha::Patrons->find( $borrowernumber ); |
935 |
|
936 |
return $borrower->first_valid_email_address(); |
937 |
} |
938 |
|
939 |
=head2 GetNoticeEmailAddress |
920 |
=head2 GetNoticeEmailAddress |
940 |
|
921 |
|
941 |
$email = GetNoticeEmailAddress($borrowernumber); |
922 |
$email = GetNoticeEmailAddress($borrowernumber); |
Lines 951-957
sub GetNoticeEmailAddress {
Link Here
|
951 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
932 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
952 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
933 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
953 |
if ( $which_address eq 'OFF' ) { |
934 |
if ( $which_address eq 'OFF' ) { |
954 |
return GetFirstValidEmailAddress($borrowernumber); |
935 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
|
|
936 |
return $patron->first_valid_email_address(); |
955 |
} |
937 |
} |
956 |
# specified email address field |
938 |
# specified email address field |
957 |
my $dbh = C4::Context->dbh; |
939 |
my $dbh = C4::Context->dbh; |