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