|
Lines 64-71
BEGIN {
Link Here
|
| 64 |
&GetPendingIssues |
64 |
&GetPendingIssues |
| 65 |
&GetAllIssues |
65 |
&GetAllIssues |
| 66 |
|
66 |
|
| 67 |
&GetNoticeEmailAddress |
|
|
| 68 |
|
| 69 |
&GetMemberAccountRecords |
67 |
&GetMemberAccountRecords |
| 70 |
&GetBorNotifyAcctRecord |
68 |
&GetBorNotifyAcctRecord |
| 71 |
|
69 |
|
|
Lines 917-952
sub get_cardnumber_length {
Link Here
|
| 917 |
return ( $min, $max ); |
915 |
return ( $min, $max ); |
| 918 |
} |
916 |
} |
| 919 |
|
917 |
|
| 920 |
=head2 GetNoticeEmailAddress |
|
|
| 921 |
|
| 922 |
$email = GetNoticeEmailAddress($borrowernumber); |
| 923 |
|
| 924 |
Return the email address of borrower used for notices, given the borrowernumber. |
| 925 |
Returns the empty string if no email address. |
| 926 |
|
| 927 |
=cut |
| 928 |
|
| 929 |
sub GetNoticeEmailAddress { |
| 930 |
my $borrowernumber = shift; |
| 931 |
|
| 932 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
| 933 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
| 934 |
if ( $which_address eq 'OFF' ) { |
| 935 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
| 936 |
return $patron->first_valid_email_address(); |
| 937 |
} |
| 938 |
# specified email address field |
| 939 |
my $dbh = C4::Context->dbh; |
| 940 |
my $sth = $dbh->prepare( qq{ |
| 941 |
SELECT $which_address AS primaryemail |
| 942 |
FROM borrowers |
| 943 |
WHERE borrowernumber=? |
| 944 |
} ); |
| 945 |
$sth->execute($borrowernumber); |
| 946 |
my $data = $sth->fetchrow_hashref; |
| 947 |
return $data->{'primaryemail'} || ''; |
| 948 |
} |
| 949 |
|
| 950 |
=head2 GetBorrowersToExpunge |
918 |
=head2 GetBorrowersToExpunge |
| 951 |
|
919 |
|
| 952 |
$borrowers = &GetBorrowersToExpunge( |
920 |
$borrowers = &GetBorrowersToExpunge( |