use C4::Debug;
use YAML;
use URI::Escape;
+use C4::Charset;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
'holdingbranch',
'homebranch',
'issues',
+ 'item',
'itemnumber',
'itype',
'Local-classification',
my ( $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults ) = @_;
my $dbh = C4::Context->dbh;
my @newresults;
-
#Build branchnames hash
#find branchname
#get branch information.....
# loop through all of the records we've retrieved
for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) {
my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] );
+ SetUTF8Flag($marcrecord);
my $biblionumber;
-
+
if(not $scan){
if ($bibliotag<10){
- $biblionumber = $marcrecord->field($bibliotag)->data;
+ $biblionumber = $marcrecord->field($bibliotag) ? $marcrecord->field($bibliotag)->data : undef;
}else{
$biblionumber = $marcrecord->subfield($bibliotag,$bibliosubf);
}
- $fw = GetFrameworkCode($biblionumber);
+ $fw = (defined $biblionumber) ? GetFrameworkCode($biblionumber) : '';
}
my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, $fw );
# XSLT processing of some stuff
if (C4::Context->preference("XSLTResultsDisplay") && !$scan) {
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display(
- $oldbiblio->{biblionumber}, $marcrecord, 'Results' );
+ $oldbiblio->{biblionumber}, $marcrecord, C4::Context->preference("XSLTResultsDisplay") );
}
# last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
);
}
+=head2 enabled_opac_search_views
+
+%hash = enabled_opac_search_views()
+
+This function returns a hash that contains two flags obtained from the system
+preferences, used to determine whether a particular opac search results view
+is enabled.
+
+=over 2
+
+=item C<Output arg:>
+
+ * $hash{can_view_MARC} is true only if the MARC view is enabled
+ * $hash{can_view_ISBD} is true only if the ISBD view is enabled
+
+=item C<usage in the script:>
+
+=back
+
+$template->param ( C4::Search::enabled_opac_search_views );
+
+=cut
+
+sub enabled_opac_search_views
+{
+ return (
+ can_opac_view_MARC => C4::Context->preference('OPACviewMARC'), # 1 if the opac search allows the MARC view
+ can_opac_view_ISBD => C4::Context->preference('OPACviewISBD'), # 1 if the opac search allows the ISBD view
+ );
+}
+
=head2 z3950_search_args