X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-topissues.pl;h=6899215cc7cb9cd40d44e074faf8cd1e571ca3fd;hb=e7251f73a2bb1fbf8c047f19f210d7bcc591cddf;hp=b4b83f1458f09af970a15120b6a1787e79136b57;hpb=f45969422c55f34edec3145b7e2fa1a85222932f;p=koha.git diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index b4b83f1458..6899215cc7 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -46,7 +46,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({template_name => 'opac-topissues.tmpl', query => $input, type => "opac", - authnotrequired => 1, + authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), debug => 1, }); my $dbh = C4::Context->dbh; @@ -127,13 +127,11 @@ $template->param( branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'} my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; $itemtypes = GetItemTypes; my @itemtypesloop; -my $selected=1; if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { - my $selected = 1 if $thisitemtype eq $itemtype; my %row =( value => $thisitemtype, description => $itemtypes->{$thisitemtype}->{'description'}, - selected => $selected, + selected => $thisitemtype eq $itemtype, ); push @itemtypesloop, \%row; } @@ -142,7 +140,7 @@ if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { for my $thisitemtype (@$advsearchtypes) { my $selected = 1 if $thisitemtype->{authorised_value} eq $itemtype; my %row =( value => $thisitemtype->{authorised_value}, - selected => $selected, + selected => $thisitemtype eq $itemtype, description => $thisitemtype->{'lib'}, ); push @itemtypesloop, \%row;