Lines 1839-1849
sub _koha_notify_reserve {
Link Here
|
1839 |
my $messagingprefs; |
1839 |
my $messagingprefs; |
1840 |
if ( $to_address || $borrower->{'smsalertnumber'} ) { |
1840 |
if ( $to_address || $borrower->{'smsalertnumber'} ) { |
1841 |
$messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold_Filled' } ); |
1841 |
$messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold_Filled' } ); |
1842 |
|
|
|
1843 |
return if ( !defined( $messagingprefs->{'letter_code'} ) ); |
1844 |
$letter_code = $messagingprefs->{'letter_code'}; |
1845 |
} else { |
1842 |
} else { |
1846 |
$letter_code = 'HOLD_PRINT'; |
|
|
1847 |
$print_mode = 1; |
1843 |
$print_mode = 1; |
1848 |
} |
1844 |
} |
1849 |
|
1845 |
|
Lines 1859-1867
sub _koha_notify_reserve {
Link Here
|
1859 |
|
1855 |
|
1860 |
my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); |
1856 |
my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); |
1861 |
|
1857 |
|
1862 |
my $letter = C4::Letters::GetPreparedLetter ( |
1858 |
my %letter_params = ( |
1863 |
module => 'reserves', |
1859 |
module => 'reserves', |
1864 |
letter_code => $letter_code, |
|
|
1865 |
branchcode => $reserve->{branchcode}, |
1860 |
branchcode => $reserve->{branchcode}, |
1866 |
tables => { |
1861 |
tables => { |
1867 |
'branches' => $branch_details, |
1862 |
'branches' => $branch_details, |
Lines 1871-1881
sub _koha_notify_reserve {
Link Here
|
1871 |
'items', $reserve->{'itemnumber'}, |
1866 |
'items', $reserve->{'itemnumber'}, |
1872 |
}, |
1867 |
}, |
1873 |
substitute => { today => C4::Dates->new()->output() }, |
1868 |
substitute => { today => C4::Dates->new()->output() }, |
1874 |
) or die "Could not find a letter called '$letter_code' in the 'reserves' module"; |
1869 |
); |
1875 |
|
|
|
1876 |
|
1870 |
|
1877 |
|
1871 |
|
1878 |
if ( $print_mode ) { |
1872 |
if ( $print_mode ) { |
|
|
1873 |
$letter_params{ 'letter_code' } = 'HOLD_PRINT'; |
1874 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) or die "Could not find a letter called '$letter_params{'letter_code'}' in the 'reserves' module"; |
1875 |
|
1879 |
C4::Letters::EnqueueLetter( { |
1876 |
C4::Letters::EnqueueLetter( { |
1880 |
letter => $letter, |
1877 |
letter => $letter, |
1881 |
borrowernumber => $borrowernumber, |
1878 |
borrowernumber => $borrowernumber, |
Lines 1885-1892
sub _koha_notify_reserve {
Link Here
|
1885 |
return; |
1882 |
return; |
1886 |
} |
1883 |
} |
1887 |
|
1884 |
|
1888 |
if ( grep { $_ eq 'email' } @{$messagingprefs->{transports}} ) { |
1885 |
if ( $to_address && defined $messagingprefs->{transports}->{'email'} ) { |
1889 |
# aka, 'email' in ->{'transports'} |
1886 |
$letter_params{ 'letter_code' } = $messagingprefs->{transports}->{'email'}; |
|
|
1887 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) or die "Could not find a letter called '$letter_params{'letter_code'}' in the 'reserves' module"; |
1888 |
|
1890 |
C4::Letters::EnqueueLetter( |
1889 |
C4::Letters::EnqueueLetter( |
1891 |
{ letter => $letter, |
1890 |
{ letter => $letter, |
1892 |
borrowernumber => $borrowernumber, |
1891 |
borrowernumber => $borrowernumber, |
Lines 1896-1902
sub _koha_notify_reserve {
Link Here
|
1896 |
); |
1895 |
); |
1897 |
} |
1896 |
} |
1898 |
|
1897 |
|
1899 |
if ( grep { $_ eq 'sms' } @{$messagingprefs->{transports}} ) { |
1898 |
if ( $borrower->{'smsalertnumber'} && defined $messagingprefs->{transports}->{'sms'} ) { |
|
|
1899 |
$letter_params{ 'letter_code' } = $messagingprefs->{transports}->{'sms'}; |
1900 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) or die "Could not find a letter called '$letter_params{'letter_code'}' in the 'reserves' module"; |
1901 |
|
1900 |
C4::Letters::EnqueueLetter( |
1902 |
C4::Letters::EnqueueLetter( |
1901 |
{ letter => $letter, |
1903 |
{ letter => $letter, |
1902 |
borrowernumber => $borrowernumber, |
1904 |
borrowernumber => $borrowernumber, |