Continuing fixing license and metadata
[koha.git] / opac / opac-search.pl
index 4a16db0..74f8fe5 100755 (executable)
@@ -72,6 +72,7 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
 elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
     $template->param('usmarc' => 1);
 }
+$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
 
 if (C4::Context->preference('BakerTaylorEnabled')) {
        $template->param(
@@ -147,7 +148,6 @@ if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
        for my $thisitemtype (@$advsearchtypes) {
            my %row =(
                    number=>$cnt++,
-                   imageurl=> getitemtypeimagelocation( 'opac', $thisitemtype->{'imageurl'} ),
                    ccl => $advanced_search_types,
                    code => $thisitemtype->{authorised_value},
                    selected => $selected,
@@ -218,10 +218,11 @@ if ( $template_type eq 'advsearch' ) {
                $template->param( expanded_options => C4::Context->preference("expandedSearchOption") );
        }
        # but let the user override it
-       if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
-       $template->param( expanded_options => $cgi->param('expanded_options'));
-       }
-
+       if (defined $cgi->param('expanded_options')) {
+           if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
+           $template->param( expanded_options => $cgi->param('expanded_options'));
+           }
+        }
     output_html_with_http_headers $cgi, $cookie, $template->output;
     exit;
 }
@@ -422,6 +423,7 @@ for (my $i=0;$i<=@servers;$i++) {
                        $tag_quantity = C4::Context->preference('TagsShowOnList')) {
                        foreach (@newresults) {
                                my $bibnum = $_->{biblionumber} or next;
+                               $_->{itemsissued} = CountItemsIssued( $bibnum );
                                $_ ->{'TagLoop'} = get_tags({biblionumber=>$bibnum, approved=>1, 'sort'=>'-weight',
                                                                                limit=>$tag_quantity });
                        }