Lines 1891-1902
sub _koha_notify_reserve {
Link Here
|
1891 |
substitute => { today => C4::Dates->new()->output() }, |
1891 |
substitute => { today => C4::Dates->new()->output() }, |
1892 |
); |
1892 |
); |
1893 |
|
1893 |
|
1894 |
my $print_sent = 0; |
1894 |
my $notification_sent = 0; #Keeping track if a Hold_filled message is sent. If no message can be sent, then default to a print message. |
1895 |
while ( my ( $mtt, $letter_code ) = each %{ $messagingprefs->{transports} } ) { |
1895 |
my $send_notification = sub { |
1896 |
if ( ($mtt eq 'email' and not $to_address) or ($mtt eq 'sms' and not $borrower->{smsalertnumber}) ) { |
1896 |
my ( $mtt, $letter_code ) = (@_); |
1897 |
# email or sms is requested but not exist, do a print. |
|
|
1898 |
$mtt = 'print'; |
1899 |
} |
1900 |
$letter_params{letter_code} = $letter_code; |
1897 |
$letter_params{letter_code} = $letter_code; |
1901 |
$letter_params{message_transport_type} = $mtt; |
1898 |
$letter_params{message_transport_type} = $mtt; |
1902 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) |
1899 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) |
Lines 1908-1914
sub _koha_notify_reserve {
Link Here
|
1908 |
from_address => $admin_email_address, |
1905 |
from_address => $admin_email_address, |
1909 |
message_transport_type => $mtt, |
1906 |
message_transport_type => $mtt, |
1910 |
} ); |
1907 |
} ); |
|
|
1908 |
}; |
1909 |
|
1910 |
while ( my ( $mtt, $letter_code ) = each %{ $messagingprefs->{transports} } ) { |
1911 |
if ( ($mtt eq 'email' and not $to_address) or ($mtt eq 'sms' and not $borrower->{smsalertnumber}) ) { |
1912 |
# email or sms is requested but not exist |
1913 |
next; |
1914 |
} |
1915 |
&$send_notification($mtt, $letter_code); |
1916 |
$notification_sent++; |
1911 |
} |
1917 |
} |
|
|
1918 |
#Making sure that a print notification is sent if no other transport types can be utilized. |
1919 |
if (! $notification_sent) { |
1920 |
&$send_notification('print', 'HOLD'); |
1921 |
} |
1922 |
|
1912 |
} |
1923 |
} |
1913 |
|
1924 |
|
1914 |
=head2 _ShiftPriorityByDateAndPriority |
1925 |
=head2 _ShiftPriorityByDateAndPriority |
1915 |
- |
|
|