Use hour or day deltas to calculate overdue durations
[koha.git] / catalogue / search.pl
index 20d21f1..0052f66 100755 (executable)
@@ -147,7 +147,7 @@ use C4::Search;
 use C4::Languages qw(getAllLanguages);
 use C4::Koha;
 use C4::Members qw(GetMember);
-use C4::VirtualShelves qw(GetRecentShelves);
+use C4::VirtualShelves;
 use POSIX qw(ceil floor);
 use C4::Branch; # GetBranches
 
@@ -256,7 +256,7 @@ foreach my $advanced_srch_type (@advanced_search_types) {
                ccl => "$itype_or_itemtype,phr",
                 code => $thisitemtype,
                 description => $itemtypes->{$thisitemtype}->{'description'},
-                imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ),
+                imageurl=> getitemtypeimagelocation( 'intranet', $itemtypes->{$thisitemtype}->{'imageurl'} ),
             );
            push @itypesloop, \%row;
        }
@@ -265,7 +265,7 @@ foreach my $advanced_srch_type (@advanced_search_types) {
         push @advancedsearchesloop, \%search_code;
     } else {
     # covers all the other cases: non-itemtype authorized values
-       my $advsearchtypes = GetAuthorisedValues($advanced_srch_type, '', 'opac');
+       my $advsearchtypes = GetAuthorisedValues($advanced_srch_type);
         my @authvalueloop;
        for my $thisitemtype (@$advsearchtypes) {
                my %row =(
@@ -701,21 +701,13 @@ if ($query_desc || $limit_desc) {
 # VI. BUILD THE TEMPLATE
 
 # Build drop-down list for 'Add To:' menu...
-
-my $row_count = 10; # FIXME:This probably should be a syspref
-my ($pubshelves, $total) = GetRecentShelves(2, $row_count, undef);
-my ($barshelves, $total) = GetRecentShelves(1, $row_count, $borrowernumber);
-
-if (@{$pubshelves}) {
-        $template->param( addpubshelves     => scalar @{$pubshelves});
-        $template->param( addpubshelvesloop => $pubshelves);
-}
-
-if (@{$barshelves}) {
-        $template->param( addbarshelves     => scalar @{$barshelves});
-        $template->param( addbarshelvesloop => $barshelves);
-}
-
-
+my ($totalref, $pubshelves, $barshelves)=
+       C4::VirtualShelves::GetSomeShelfNames($borrowernumber,'COMBO',1);
+$template->param(
+        addbarshelves     => $totalref->{bartotal},
+        addbarshelvesloop => $barshelves,
+       addpubshelves     => $totalref->{pubtotal},
+       addpubshelvesloop => $pubshelves,
+       );
 
 output_html_with_http_headers $cgi, $cookie, $template->output;