|
Lines 503-532
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 |
if ( |
506 |
if ($patron) { |
| 507 |
my $letter = C4::Letters::GetPreparedLetter( |
507 |
if ( |
| 508 |
module => 'suggestions', |
508 |
my $letter = C4::Letters::GetPreparedLetter( |
| 509 |
letter_code => $full_suggestion->{STATUS}, |
509 |
module => 'suggestions', |
| 510 |
branchcode => $full_suggestion->{branchcode}, |
510 |
letter_code => $full_suggestion->{STATUS}, |
| 511 |
lang => $patron->lang, |
511 |
branchcode => $full_suggestion->{branchcode}, |
| 512 |
tables => { |
512 |
lang => $patron->lang, |
| 513 |
'branches' => $full_suggestion->{branchcode}, |
513 |
tables => { |
| 514 |
'borrowers' => $full_suggestion->{suggestedby}, |
514 |
'branches' => $full_suggestion->{branchcode}, |
| 515 |
'suggestions' => $full_suggestion, |
515 |
'borrowers' => $full_suggestion->{suggestedby}, |
| 516 |
'biblio' => $full_suggestion->{biblionumber}, |
516 |
'suggestions' => $full_suggestion, |
| 517 |
}, |
517 |
'biblio' => $full_suggestion->{biblionumber}, |
| 518 |
) |
518 |
}, |
| 519 |
) |
519 |
) |
| 520 |
{ |
520 |
) |
| 521 |
C4::Letters::EnqueueLetter( |
521 |
{ |
| 522 |
{ |
522 |
C4::Letters::EnqueueLetter( |
| 523 |
letter => $letter, |
523 |
{ |
| 524 |
borrowernumber => $full_suggestion->{suggestedby}, |
524 |
letter => $letter, |
| 525 |
suggestionid => $full_suggestion->{suggestionid}, |
525 |
borrowernumber => $full_suggestion->{suggestedby}, |
| 526 |
LibraryName => C4::Context->preference("LibraryName"), |
526 |
suggestionid => $full_suggestion->{suggestionid}, |
| 527 |
message_transport_type => 'email', |
527 |
LibraryName => C4::Context->preference("LibraryName"), |
| 528 |
} |
528 |
message_transport_type => 'email', |
| 529 |
) or warn "can't enqueue letter $letter"; |
529 |
} |
|
|
530 |
) or warn "can't enqueue letter $letter"; |
| 531 |
} |
| 530 |
} |
532 |
} |
| 531 |
} |
533 |
} |
| 532 |
return $status_update_table; |
534 |
return $status_update_table; |
| 533 |
- |
|
|