Lines 1720-1742
sub _koha_notify_reserve {
Link Here
|
1720 |
|
1720 |
|
1721 |
my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); |
1721 |
my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); |
1722 |
|
1722 |
|
1723 |
my $letter = getletter( 'reserves', $letter_code ); |
|
|
1724 |
die "Could not find a letter called '$letter_code' in the 'reserves' module" unless( $letter ); |
1725 |
|
1723 |
|
1726 |
C4::Letters::parseletter( $letter, 'branches', $reserve->{'branchcode'} ); |
1724 |
if ( $print_mode ) { |
1727 |
C4::Letters::parseletter( $letter, 'borrowers', $borrowernumber ); |
1725 |
my $letter = getletter( 'reserves', 'HOLD_PRINT' ); |
1728 |
C4::Letters::parseletter( $letter, 'biblio', $biblionumber ); |
1726 |
die "Could not find a letter called '$letter_code' in the 'reserves' module" unless( $letter ); |
1729 |
C4::Letters::parseletter( $letter, 'reserves', $borrowernumber, $biblionumber ); |
|
|
1730 |
|
1727 |
|
1731 |
if ( $reserve->{'itemnumber'} ) { |
1728 |
C4::Letters::parseletter( $letter, 'branches', $reserve->{'branchcode'} ); |
1732 |
C4::Letters::parseletter( $letter, 'items', $reserve->{'itemnumber'} ); |
1729 |
C4::Letters::parseletter( $letter, 'borrowers', $borrowernumber ); |
1733 |
} |
1730 |
C4::Letters::parseletter( $letter, 'biblio', $biblionumber ); |
1734 |
my $today = C4::Dates->new()->output(); |
1731 |
C4::Letters::parseletter( $letter, 'reserves', $borrowernumber, $biblionumber ); |
1735 |
$letter->{'title'} =~ s/<<today>>/$today/g; |
1732 |
|
1736 |
$letter->{'content'} =~ s/<<today>>/$today/g; |
1733 |
if ( $reserve->{'itemnumber'} ) { |
1737 |
$letter->{'content'} =~ s/<<[a-z0-9_]+\.[a-z0-9]+>>//g; #remove any stragglers |
1734 |
C4::Letters::parseletter( $letter, 'items', $reserve->{'itemnumber'} ); |
|
|
1735 |
} |
1736 |
my $today = C4::Dates->new()->output(); |
1737 |
$letter->{'title'} =~ s/<<today>>/$today/g; |
1738 |
$letter->{'content'} =~ s/<<today>>/$today/g; |
1739 |
$letter->{'content'} =~ s/<<[a-z0-9_]+\.[a-z0-9]+>>//g; #remove any stragglers |
1738 |
|
1740 |
|
1739 |
if ( $print_mode ) { |
|
|
1740 |
C4::Letters::EnqueueLetter( { |
1741 |
C4::Letters::EnqueueLetter( { |
1741 |
letter => $letter, |
1742 |
letter => $letter, |
1742 |
borrowernumber => $borrowernumber, |
1743 |
borrowernumber => $borrowernumber, |
Lines 1746-1753
sub _koha_notify_reserve {
Link Here
|
1746 |
return; |
1747 |
return; |
1747 |
} |
1748 |
} |
1748 |
|
1749 |
|
1749 |
if ( grep { $_ eq 'email' } @{$messagingprefs->{transports}} ) { |
1750 |
if ( defined $messagingprefs->{transports}->{'email'} ) { |
1750 |
# aka, 'email' in ->{'transports'} |
1751 |
my $letter = getletter( 'reserves', $messagingprefs->{transports}->{'email'} ); |
|
|
1752 |
die "Could not find a letter called '$messagingprefs->{transports}->{'email'}' in the 'reserves' module" unless( $messagingprefs->{transports}->{'email'} ); |
1753 |
|
1754 |
C4::Letters::parseletter( $letter, 'branches', $reserve->{'branchcode'} ); |
1755 |
C4::Letters::parseletter( $letter, 'borrowers', $borrowernumber ); |
1756 |
C4::Letters::parseletter( $letter, 'biblio', $biblionumber ); |
1757 |
C4::Letters::parseletter( $letter, 'reserves', $borrowernumber, $biblionumber ); |
1758 |
|
1759 |
if ( $reserve->{'itemnumber'} ) { |
1760 |
C4::Letters::parseletter( $letter, 'items', $reserve->{'itemnumber'} ); |
1761 |
} |
1762 |
my $today = C4::Dates->new()->output(); |
1763 |
$letter->{'title'} =~ s/<<today>>/$today/g; |
1764 |
$letter->{'content'} =~ s/<<today>>/$today/g; |
1765 |
$letter->{'content'} =~ s/<<[a-z0-9_]+\.[a-z0-9]+>>//g; #remove any stragglers |
1766 |
|
1751 |
C4::Letters::EnqueueLetter( |
1767 |
C4::Letters::EnqueueLetter( |
1752 |
{ letter => $letter, |
1768 |
{ letter => $letter, |
1753 |
borrowernumber => $borrowernumber, |
1769 |
borrowernumber => $borrowernumber, |
Lines 1757-1763
sub _koha_notify_reserve {
Link Here
|
1757 |
); |
1773 |
); |
1758 |
} |
1774 |
} |
1759 |
|
1775 |
|
1760 |
if ( grep { $_ eq 'sms' } @{$messagingprefs->{transports}} ) { |
1776 |
if ( defined $messagingprefs->{transports}->{'sms'} ) { |
|
|
1777 |
my $letter = getletter( 'reserves', $messagingprefs->{transports}->{'sms'} ); |
1778 |
die "Could not find a letter called '$messagingprefs->{transports}->{'sms'}' in the 'reserves' module" unless( $messagingprefs->{transports}->{'sms'} ); |
1779 |
|
1780 |
C4::Letters::parseletter( $letter, 'branches', $reserve->{'branchcode'} ); |
1781 |
C4::Letters::parseletter( $letter, 'borrowers', $borrowernumber ); |
1782 |
C4::Letters::parseletter( $letter, 'biblio', $biblionumber ); |
1783 |
C4::Letters::parseletter( $letter, 'reserves', $borrowernumber, $biblionumber ); |
1784 |
|
1785 |
if ( $reserve->{'itemnumber'} ) { |
1786 |
C4::Letters::parseletter( $letter, 'items', $reserve->{'itemnumber'} ); |
1787 |
} |
1788 |
my $today = C4::Dates->new()->output(); |
1789 |
$letter->{'title'} =~ s/<<today>>/$today/g; |
1790 |
$letter->{'content'} =~ s/<<today>>/$today/g; |
1791 |
$letter->{'content'} =~ s/<<[a-z0-9_]+\.[a-z0-9]+>>//g; #remove any stragglers |
1792 |
|
1761 |
C4::Letters::EnqueueLetter( |
1793 |
C4::Letters::EnqueueLetter( |
1762 |
{ letter => $letter, |
1794 |
{ letter => $letter, |
1763 |
borrowernumber => $borrowernumber, |
1795 |
borrowernumber => $borrowernumber, |