|
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 879-902
sub get_cardnumber_length {
Link Here
|
| 879 |
return ( $min, $max ); |
878 |
return ( $min, $max ); |
| 880 |
} |
879 |
} |
| 881 |
|
880 |
|
| 882 |
=head2 GetFirstValidEmailAddress |
|
|
| 883 |
|
| 884 |
$email = GetFirstValidEmailAddress($borrowernumber); |
| 885 |
|
| 886 |
Return the first valid email address for a borrower, given the borrowernumber. For now, the order |
| 887 |
is defined as email, emailpro, B_email. Returns the empty string if the borrower has no email |
| 888 |
addresses. |
| 889 |
|
| 890 |
=cut |
| 891 |
|
| 892 |
sub GetFirstValidEmailAddress { |
| 893 |
my $borrowernumber = shift; |
| 894 |
|
| 895 |
my $borrower = Koha::Patrons->find( $borrowernumber ); |
| 896 |
|
| 897 |
return $borrower->first_valid_email_address(); |
| 898 |
} |
| 899 |
|
| 900 |
=head2 GetNoticeEmailAddress |
881 |
=head2 GetNoticeEmailAddress |
| 901 |
|
882 |
|
| 902 |
$email = GetNoticeEmailAddress($borrowernumber); |
883 |
$email = GetNoticeEmailAddress($borrowernumber); |
|
Lines 912-918
sub GetNoticeEmailAddress {
Link Here
|
| 912 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
893 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
| 913 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
894 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
| 914 |
if ( $which_address eq 'OFF' ) { |
895 |
if ( $which_address eq 'OFF' ) { |
| 915 |
return GetFirstValidEmailAddress($borrowernumber); |
896 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
|
|
897 |
return $patron->first_valid_email_address(); |
| 916 |
} |
898 |
} |
| 917 |
# specified email address field |
899 |
# specified email address field |
| 918 |
my $dbh = C4::Context->dbh; |
900 |
my $dbh = C4::Context->dbh; |