View | Details | Raw Unified | Return to bug 10857
Collapse All | Expand All

(-)a/catalogue/search.pl (+12 lines)
Lines 411-416 my @operands = map uri_unescape($_), $cgi->param('q'); Link Here
411
411
412
# limits are use to limit to results to a pre-defined category such as branch or language
412
# limits are use to limit to results to a pre-defined category such as branch or language
413
my @limits = map uri_unescape($_), $cgi->param('limit');
413
my @limits = map uri_unescape($_), $cgi->param('limit');
414
my @nolimits = map uri_unescape($_), $cgi->param('nolimit');
415
my %is_nolimit = map { $_ => 1 } @nolimits;
416
@limits = grep { not $is_nolimit{$_} } @limits;
414
417
415
if($params->{'multibranchlimit'}) {
418
if($params->{'multibranchlimit'}) {
416
    my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
419
    my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
Lines 685-690 my $gotopage = $cgi->param('gotoPage'); Link Here
685
$template->{'VARS'}->{'gotoPage'} = $gotopage
688
$template->{'VARS'}->{'gotoPage'} = $gotopage
686
  if $gotopage =~ m/^(ISBD|labeledMARC|MARC|more)?detail.pl$/;
689
  if $gotopage =~ m/^(ISBD|labeledMARC|MARC|more)?detail.pl$/;
687
690
691
my @input_values = map { $_->{input_value} } @limit_inputs;
692
for my $facet ( @$facets ) {
693
    for my $entry ( @{ $facet->{facets} } ) {
694
        my $index = $entry->{type_link_value};
695
        my $value = $entry->{facet_link_value};
696
        $entry->{active} = grep { $_ eq qq{$index:$value} } @input_values;
697
    }
698
}
699
688
$template->param(
700
$template->param(
689
            #classlist => $classlist,
701
            #classlist => $classlist,
690
            total => $total,
702
            total => $total,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc (-3 / +24 lines)
Lines 20-28 Link Here
20
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
20
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
21
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
21
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
22
<ul>
22
<ul>
23
        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
23
  [% FOREACH facet IN facets_loo.facets %]
24
        <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
24
    <li>
25
[% END %]
25
      [% SET query_cgi_f = query_cgi | html %]
26
      [% SET limit_cgi_f = limit_cgi | html %]
27
      [% SET url = "/cgi-bin/koha/catalogue/search.pl?" _ query_cgi_f _ limit_cgi_f %]
28
      [% IF ( sort_by ) %]
29
        [% SET url = url _ "&amp;sort_by=" _ sort_by %]
30
      [% END %]
31
      [% IF facet.active %]
32
        [% SET url = url _ "&amp;nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %]
33
        [% facet.facet_label_value %]
34
        [<a href="[% url |url %]" title="Remove facet [% facet.facet_link_value | html %]">x</a>]
35
      [% ELSE %]
36
        [% SET url = url _ "&amp;limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %]
37
        <a href="[% url | url %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a>
38
        [% IF ( displayFacetCount ) %]
39
          ([% facet.facet_count %])
40
        [% END %]
41
      [% END %]
42
    </li>
43
  [% END %]
44
  [% IF ( facets_loo.expandable ) %]
45
    <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
46
  [% END %]
26
</ul></li>
47
</ul></li>
27
[% END %]
48
[% END %]
28
[% END %]
49
[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc (-4 / +27 lines)
Lines 21-30 Link Here
21
[% END %]
21
[% END %]
22
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
22
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
23
<ul>
23
<ul>
24
        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]&amp;limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
24
  [% FOREACH facet IN facets_loo.facets %]
25
        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
25
    <li>
26
[% END %]
26
      [% SET query_cgi_f = query_cgi | html %]
27
</ul></li>
27
      [% SET limit_cgi_f = limit_cgi | html %]
28
      [% SET url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi_f _ limit_cgi_f %]
29
      [% IF ( sort_by ) %]
30
        [% SET url = url _ "&amp;sort_by=" _ sort_by |html %]
31
      [% END %]
32
      [% IF facet.active %]
33
        [% SET url = url _ "&amp;nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %]
34
        [% facet.facet_label_value %]
35
        [<a href="[% url |url %]" title="Remove facet [% facet.facet_link_value | html %]">x</a>]
36
      [% ELSE %]
37
        [% SET url = url _ "&amp;limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %]
38
        <a href="[% url | url %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a>
39
        [% IF ( displayFacetCount ) %]
40
          ([% facet.facet_count %])
41
        [% END %]
42
      [% END %]
43
    </li>
44
  [% END %]
45
  [% IF ( facets_loo.expandable ) %]
46
    <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a>
47
    </li>
48
  [% END %]
49
</ul>
50
</li>
28
[% END %]
51
[% END %]
29
[% END %]
52
[% END %]
30
</ul>
53
</ul>
(-)a/opac/opac-search.pl (-1 / +13 lines)
Lines 400-405 if ($operands[0] && !$operands[1]) { Link Here
400
400
401
# limits are use to limit to results to a pre-defined category such as branch or language
401
# limits are use to limit to results to a pre-defined category such as branch or language
402
my @limits = $cgi->param('limit');
402
my @limits = $cgi->param('limit');
403
my @nolimits = $cgi->param('nolimit');
404
my %is_nolimit = map { $_ => 1 } @nolimits;
405
@limits = grep { not $is_nolimit{$_} } @limits;
403
@limits = map { uri_unescape($_) } @limits;
406
@limits = map { uri_unescape($_) } @limits;
404
407
405
if($params->{'multibranchlimit'}) {
408
if($params->{'multibranchlimit'}) {
Lines 848-853 for (my $i=0;$i<@servers;$i++) { Link Here
848
} #/end of the for loop
851
} #/end of the for loop
849
#$template->param(FEDERATED_RESULTS => \@results_array);
852
#$template->param(FEDERATED_RESULTS => \@results_array);
850
853
854
my @input_values = map { $_->{input_value} } @limit_inputs;
855
for my $facet ( @$facets ) {
856
    for my $entry ( @{ $facet->{facets} } ) {
857
        my $index = $entry->{type_link_value};
858
        my $value = $entry->{facet_link_value};
859
        $entry->{active} = grep { $_ eq qq{$index:$value} } @input_values;
860
    }
861
}
862
863
851
$template->param(
864
$template->param(
852
            #classlist => $classlist,
865
            #classlist => $classlist,
853
            total => $total,
866
            total => $total,
854
- 

Return to bug 10857