|
Lines 49-73
$template->param( $borrower );
Link Here
|
| 49 |
my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); |
49 |
my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); |
| 50 |
$template->param( picture => 1 ) if $picture; |
50 |
$template->param( picture => 1 ) if $picture; |
| 51 |
|
51 |
|
| 52 |
# Getting the messages |
52 |
# Allow resending of messages in Notices tab |
| 53 |
my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber}); |
53 |
my $op = $input->param('op') || q{}; |
| 54 |
|
54 |
if ( $op eq 'resend_notice' ) { |
| 55 |
# Bug 12426 - Allow resending of messages in Notices tab |
55 |
my $message_id = $input->param('message_id'); |
| 56 |
if ($input->param('resendnotice')) { |
56 |
my $message = C4::Letters::GetMessage( $message_id ); |
| 57 |
foreach my $message (@$queued_messages){ |
57 |
if ( $message->{borrowernumber} = $borrowernumber ) { |
| 58 |
# resendnotice must be in this borrower's queue - we don't want to make it |
58 |
C4::Letters::ResendMessage( $message_id ); |
| 59 |
# possible to change any message just by changing resendnotice id. |
|
|
| 60 |
if ($message->{message_id} == $input->param('resendnotice')) { |
| 61 |
# We also only want to resend messages in failed status |
| 62 |
last unless $message->{status} eq "failed"; |
| 63 |
|
| 64 |
# Modify the message in $queued_message to have its new pending status |
| 65 |
$message->{status} = 'pending' if (C4::Letters::ResendMessage($message->{message_id})); |
| 66 |
last; |
| 67 |
} |
| 68 |
} |
59 |
} |
| 69 |
} |
60 |
} |
| 70 |
|
61 |
|
|
|
62 |
# Getting the messages |
| 63 |
my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber}); |
| 64 |
|
| 71 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
65 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
| 72 |
my $attributes = GetBorrowerAttributes($borrowernumber); |
66 |
my $attributes = GetBorrowerAttributes($borrowernumber); |
| 73 |
$template->param( |
67 |
$template->param( |