&GetRoadTypes
&GetRoadTypeDetails
&GetSortDetails
- &GetTitles
+ &GetTitles
+ &GetPatronImage
&GetMemberAccountRecords
&GetBorNotifyAcctRecord
}
}
+=head2 GetPatronImage
+ $patronimage = &GetPatronImage('cardnumber');
+
+Returns the path/filename.jpg of the image for the patron with the supplied cardnumber.
+
+=cut
+
+sub GetPatronImage {
+ my $cardnumber = shift;
+ warn "Cardnumber passed to GetPatronImage is $cardnumber" if $debug;
+ my $htdocs = C4::Context->config('intrahtdocs');
+ my $picture = "patronimages/" . $cardnumber . ".jpg";
+ if ( -e "$htdocs/$picture" ) {
+ return ( "/intranet-tmpl/$picture" ); # FIXME: This is a real hack and should be handled better, but I'm in a hurry... -fbcit
+ }
+ else {
+ return ();
+ }
+}
=head2 GetRoadTypeDetails (OUEST-PROVENCE)
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
+# grab patron's image if available
+my $picture = GetPatronImage($data->{'cardnumber'});
+$template->param( picture => $picture );
+
$template->param(
- finesview => 1,
- firstname => $data->{'firstname'},
- surname => $data->{'surname'},
- borrowernumber => $borrowernumber,
- cardnumber => $data->{'cardnumber'},
- categorycode => $data->{'categorycode'},
- category_type => $data->{'category_type'},
- category_description => $data->{'description'},
- address => $data->{'address'},
- address2 => $data->{'address2'},
- city => $data->{'city'},
- zipcode => $data->{'zipcode'},
- phone => $data->{'phone'},
- email => $data->{'email'},
- branchcode => $data->{'branchcode'},
- total => sprintf("%.2f",$total),
- totalcredit => $totalcredit,
- accounts => \@accountrows );
+ finesview => 1,
+ firstname => $data->{'firstname'},
+ surname => $data->{'surname'},
+ borrowernumber => $borrowernumber,
+ cardnumber => $data->{'cardnumber'},
+ categorycode => $data->{'categorycode'},
+ category_type => $data->{'category_type'},
+ category_description => $data->{'description'},
+ address => $data->{'address'},
+ address2 => $data->{'address2'},
+ city => $data->{'city'},
+ zipcode => $data->{'zipcode'},
+ phone => $data->{'phone'},
+ email => $data->{'email'},
+ branchcode => $data->{'branchcode'},
+ total => sprintf("%.2f",$total),
+ totalcredit => $totalcredit,
+ accounts => \@accountrows );
output_html_with_http_headers $input, $cookie, $template->output;
$_->{ $_->{type} } = 1;
$_->{relatedto} = findrelatedto( $_->{type}, $_->{externalid} );
}
-my $picture;
-my $htdocs = C4::Context->config('intrahtdocs');
-$picture = "patronimages/" . $data->{'cardnumber'} . ".jpg";
-if ( -e "$htdocs/$picture" ) {
- $template->param( picture => "/intranet-tmpl/$picture" ); # FIXME: This is a real hack and should be handled better, but I'm in a hurry... -fbcit
-}
+
+# grab patron's image if available
+my $picture = GetPatronImage($data->{'cardnumber'});
+$template->param( picture => $picture );
+
+
my $branch=C4::Context->userenv->{'branch'};
$template->param($data);