|
Lines 503-508
sub ModSuggestion {
Link Here
|
| 503 |
# fetch the entire updated suggestion so that we can populate the letter |
503 |
# fetch the entire updated suggestion so that we can populate the letter |
| 504 |
my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} ); |
504 |
my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} ); |
| 505 |
my $patron = Koha::Patrons->find( $full_suggestion->{suggestedby} ); |
505 |
my $patron = Koha::Patrons->find( $full_suggestion->{suggestedby} ); |
|
|
506 |
my $transport; |
| 507 |
|
| 508 |
#Set message_transport_type of suggestion notice to email by default, unless the patron has a smsalertnumber set and no email address set |
| 509 |
if ($patron->smsalertnumber && (!$patron->email)) { |
| 510 |
$transport="sms"; |
| 511 |
} else { |
| 512 |
$transport="email"; |
| 513 |
} |
| 514 |
|
| 506 |
if ( |
515 |
if ( |
| 507 |
my $letter = C4::Letters::GetPreparedLetter( |
516 |
my $letter = C4::Letters::GetPreparedLetter( |
| 508 |
module => 'suggestions', |
517 |
module => 'suggestions', |
|
Lines 524-530
sub ModSuggestion {
Link Here
|
| 524 |
borrowernumber => $full_suggestion->{suggestedby}, |
533 |
borrowernumber => $full_suggestion->{suggestedby}, |
| 525 |
suggestionid => $full_suggestion->{suggestionid}, |
534 |
suggestionid => $full_suggestion->{suggestionid}, |
| 526 |
LibraryName => C4::Context->preference("LibraryName"), |
535 |
LibraryName => C4::Context->preference("LibraryName"), |
| 527 |
message_transport_type => 'email', |
536 |
message_transport_type => $transport, |
| 528 |
} |
537 |
} |
| 529 |
) or warn "can't enqueue letter $letter"; |
538 |
) or warn "can't enqueue letter $letter"; |
| 530 |
} |
539 |
} |
| 531 |
- |
|
|