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

(-)a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc (-32 / +21 lines)
Lines 157-194 Link Here
157
            <div id="libraries" class="mobile-hidden">
157
            <div id="libraries" class="mobile-hidden">
158
        [% END %]
158
        [% END %]
159
159
160
      <select name="limit" id="select_library" class="left" onchange="select_library_changed();">
160
        <select name="branch_group_limit" id="select_library" class="left">
161
         <option value="">All libraries</option>
161
           <option value="">All libraries</option>
162
         [% FOREACH BranchesLoo IN BranchesLoop %]
162
           <optgroup label="Libraries">
163
            [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
163
               [% FOREACH BranchesLoo IN BranchesLoop %]
164
            [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
164
                  [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
165
         [% END %]
165
                  [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
166
         [% IF BranchCategoriesLoop %]
166
               [% END %]
167
             <option value="__GROUPS__">-- GROUPS --</option>
167
           </optgroup>
168
             [% FOREACH bc IN BranchCategoriesLoop %]
168
           [% IF BranchCategoriesLoop %]
169
                 [% IF ( bc.selected ) %]
169
               <optgroup label="Groups">
170
                     <option selected="selected" value="[% bc.categorycode %]">[% bc.categoryname %]</option>
170
                   [% FOREACH bc IN BranchCategoriesLoop %]
171
                 [% ELSE %]
171
                       [% IF ( bc.selected ) %]
172
                     <option value="[% bc.categorycode %]">[% bc.categoryname %]</option>
172
                           <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
173
                 [% END %]
173
                       [% ELSE %]
174
             [% END %]
174
                           <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
175
         [% END %]
175
                       [% END %]
176
      </select>
176
                   [% END %]
177
      [% IF BranchCategoriesLoop %]
177
               </optgroup>
178
          <script type="text/javascript">
178
           [% END %]
179
              $(document).ready(function() {
179
        </select>
180
                  $("#select_library option[value='__GROUPS__']").attr("disabled","disabled");
180
181
              });
182
183
              function select_library_changed() {
184
                  if ( $("#select_library option:selected").index() > $("#select_library option[value='__GROUPS__']").index() ) {
185
                      $("#select_library").attr("name", "multibranchlimit");
186
                  } else {
187
                      $("#select_library").attr("name", "limit");
188
                  }
189
              };
190
          </script>
191
      [% END %]
192
    </div>
181
    </div>
193
   [% ELSE %]
182
   [% ELSE %]
194
      [% IF ( opac_limit_override ) %]
183
      [% IF ( opac_limit_override ) %]
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc (-27 / +15 lines)
Lines 77-114 Link Here
77
        <input type="text" title="Type search term" id = "transl1" name="q" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
77
        <input type="text" title="Type search term" id = "transl1" name="q" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
78
[% END %]
78
[% END %]
79
   [% IF ( OpacAddMastheadLibraryPulldown ) %]
79
   [% IF ( OpacAddMastheadLibraryPulldown ) %]
80
      <select name="limit" id="select_library" class="left" onchange="select_library_changed();">
80
      <select name="branch_group_limit" id="select_library" class="left">
81
         <option value="">All libraries</option>
81
         <option value="">All libraries</option>
82
         [% FOREACH BranchesLoo IN BranchesLoop %]
82
         <optgroup label="Libraries">
83
            [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
83
             [% FOREACH BranchesLoo IN BranchesLoop %]
84
            [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
84
                [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
85
         [% END %]
85
                [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
86
             [% END %]
87
         </optgroup>
86
         [% IF BranchCategoriesLoop %]
88
         [% IF BranchCategoriesLoop %]
87
             <option value="__GROUPS__">-- GROUPS --</option>
89
             <optgroup label="Groups">
88
             [% FOREACH bc IN BranchCategoriesLoop %]
90
                 [% FOREACH bc IN BranchCategoriesLoop %]
89
                 [% IF ( bc.selected ) %]
91
                     [% IF ( bc.selected ) %]
90
                     <option selected="selected" value="[% bc.categorycode %]">[% bc.categoryname %]</option>
92
                         <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
91
                 [% ELSE %]
93
                     [% ELSE %]
92
                     <option value="[% bc.categorycode %]">[% bc.categoryname %]</option>
94
                         <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
95
                     [% END %]
93
                 [% END %]
96
                 [% END %]
94
             [% END %]
97
             </optgroup>
95
         [% END %]
98
         [% END %]
96
      </select>
99
      </select>
97
      [% IF BranchCategoriesLoop %]
98
          <script type="text/javascript">
99
              $(document).ready(function() {
100
                  $("#select_library option[value='__GROUPS__']").attr("disabled","disabled");
101
              });
102
103
              function select_library_changed() {
104
                  if ( $("#select_library option:selected").index() > $("#select_library option[value='__GROUPS__']").index() ) {
105
                      $("#select_library").attr("name", "multibranchlimit");
106
                  } else {
107
                      $("#select_library").attr("name", "limit");
108
                  }
109
              };
110
          </script>
111
      [% END %]
112
   [% ELSE %]
100
   [% ELSE %]
113
      [% IF ( opac_limit_override ) %]
101
      [% IF ( opac_limit_override ) %]
114
          [% IF ( opac_search_limit ) %]
102
          [% IF ( opac_search_limit ) %]
(-)a/opac/opac-search.pl (-1 / +16 lines)
Lines 63-68 my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); Link Here
63
use CGI qw('-no_undef_params');
63
use CGI qw('-no_undef_params');
64
my $cgi = new CGI;
64
my $cgi = new CGI;
65
65
66
my $branch_group_limit = $cgi->param("branch_group_limit");
67
if ( $branch_group_limit ) {
68
    if ( $branch_group_limit =~ /^multibranchlimit/ ) {
69
        $cgi->param(
70
            -name => 'multibranchlimit', 
71
            -values => [ ( split( 'multibranchlimit-', $branch_group_limit ) )[1] ]
72
        );
73
    } else {
74
        $cgi->append(
75
            -name => 'limit',
76
            -values => [ $branch_group_limit ]
77
        );
78
    }
79
}
80
66
BEGIN {
81
BEGIN {
67
    if (C4::Context->preference('BakerTaylorEnabled')) {
82
    if (C4::Context->preference('BakerTaylorEnabled')) {
68
        require C4::External::BakerTaylor;
83
        require C4::External::BakerTaylor;
Lines 77-82 my $template_name; Link Here
77
my $template_type = 'basic';
92
my $template_type = 'basic';
78
my @params = $cgi->param("limit");
93
my @params = $cgi->param("limit");
79
94
95
80
my $format = $cgi->param("format") || '';
96
my $format = $cgi->param("format") || '';
81
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
97
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
82
if ($format =~ /(rss|atom|opensearchdescription)/) {
98
if ($format =~ /(rss|atom|opensearchdescription)/) {
83
- 

Return to bug 9257