Bug 6164 Send Borrower Data to template consistently github/bug_6164 origin/new/bug_6164
authorColin Campbell <colin.campbell@ptfs-europe.com>
Mon, 11 Apr 2011 17:12:08 +0000 (18:12 +0100)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 11 Apr 2011 21:30:33 +0000 (09:30 +1200)
messaging and notices patron tabs were not passing borrower
info in a manner consistent with other tabs

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
members/messaging.pl
members/notices.pl

index ef9cfa4..8791dcf 100755 (executable)
@@ -84,7 +84,6 @@ $template->param( messagingview               => 1,
                   message_queue               => $message_queue,
                   DHTMLcalendar_dateformat    => C4::Dates->DHTMLcalendar(), 
                   borrowernumber              => $borrowernumber,
-                  branchcode                  => $borrower->{'branchcode'},
                   branchname                 => GetBranchName($borrower->{'branchcode'}),
                   dateformat                  => C4::Context->preference("dateformat"),
                   categoryname                => $borrower->{'description'},
@@ -94,7 +93,8 @@ $template->param( messagingview               => 1,
 #$messaging_preferences->{'SMSnumber'}{'value'} = defined $borrower->{'smsalertnumber'}
 #  ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'};
 
-$template->param( BORROWER_INFO         => [ $borrower ],
+$template->param( %{ $borrower } );
+$template->param(
                   messagingview         => 1,
                                  is_child        => ($borrower->{'category_type'} eq 'C'),
                 );
index f6680d5..088d5a8 100755 (executable)
@@ -51,16 +51,12 @@ $template->param( picture => 1 ) if $picture;
 
 # Getting the messages
 my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber});
+$template->param( %{$borrower} );
 
 $template->param(
                        QUEUED_MESSAGES         => $queued_messages,
-                       BORROWER_INFO           => [ $borrower ],
-                        firstname              => $borrower->{'firstname'},
-                       surname                 => $borrower->{'surname'},
                        borrowernumber          => $borrowernumber,
                        sentnotices             => 1
                );
 output_html_with_http_headers $input, $cookie, $template->output;
 
-
-