Lines 64-71
BEGIN {
Link Here
|
64 |
&GetPendingIssues |
64 |
&GetPendingIssues |
65 |
&GetAllIssues |
65 |
&GetAllIssues |
66 |
|
66 |
|
67 |
&GetNoticeEmailAddress |
|
|
68 |
|
69 |
&GetMemberAccountRecords |
67 |
&GetMemberAccountRecords |
70 |
|
68 |
|
71 |
&GetBorrowersToExpunge |
69 |
&GetBorrowersToExpunge |
Lines 878-913
sub get_cardnumber_length {
Link Here
|
878 |
return ( $min, $max ); |
876 |
return ( $min, $max ); |
879 |
} |
877 |
} |
880 |
|
878 |
|
881 |
=head2 GetNoticeEmailAddress |
|
|
882 |
|
883 |
$email = GetNoticeEmailAddress($borrowernumber); |
884 |
|
885 |
Return the email address of borrower used for notices, given the borrowernumber. |
886 |
Returns the empty string if no email address. |
887 |
|
888 |
=cut |
889 |
|
890 |
sub GetNoticeEmailAddress { |
891 |
my $borrowernumber = shift; |
892 |
|
893 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
894 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
895 |
if ( $which_address eq 'OFF' ) { |
896 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
897 |
return $patron->first_valid_email_address(); |
898 |
} |
899 |
# specified email address field |
900 |
my $dbh = C4::Context->dbh; |
901 |
my $sth = $dbh->prepare( qq{ |
902 |
SELECT $which_address AS primaryemail |
903 |
FROM borrowers |
904 |
WHERE borrowernumber=? |
905 |
} ); |
906 |
$sth->execute($borrowernumber); |
907 |
my $data = $sth->fetchrow_hashref; |
908 |
return $data->{'primaryemail'} || ''; |
909 |
} |
910 |
|
911 |
=head2 GetBorrowersToExpunge |
879 |
=head2 GetBorrowersToExpunge |
912 |
|
880 |
|
913 |
$borrowers = &GetBorrowersToExpunge( |
881 |
$borrowers = &GetBorrowersToExpunge( |