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

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 561-567 sub get_template_and_user { Link Here
561
        if (
561
        if (
562
            ( $opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:([\w-]+)/ ) ||
562
            ( $opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:([\w-]+)/ ) ||
563
            ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:([\w-]+)/ ) ||
563
            ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:([\w-]+)/ ) ||
564
            ( $in->{'query'}->param('multibranchlimit') && $in->{'query'}->param('multibranchlimit') =~ /multibranchlimit-(\w+)/ )
564
            ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /multibranchlimit:(\w+)/ )
565
          ) {
565
          ) {
566
            $opac_name = $1;    # opac_search_limit is a branch, so we use it.
566
            $opac_name = $1;    # opac_search_limit is a branch, so we use it.
567
        } elsif ( $in->{'query'}->param('multibranchlimit') ) {
567
        } elsif ( $in->{'query'}->param('multibranchlimit') ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-10 / +19 lines)
Lines 289-305 Link Here
289
        [%# FIXME Should not we filter the libraries displayed? %]
289
        [%# FIXME Should not we filter the libraries displayed? %]
290
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1 ) %]
290
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1 ) %]
291
        </select></p>
291
        </select></p>
292
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
293
        [% IF search_groups %]
292
        [% IF search_groups %]
294
            <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
293
            <p>OR</p>
295
294
296
            <p>
295
            <p>
297
                <label for="categoryloop">Groups of libraries: </label>
296
                <label for="categoryloop">Groups of libraries: </label>
298
                <select name="multibranchlimit" id="categoryloop">
297
                <select name="limit" id="categoryloop">
299
                    <option value=""> -- none -- </option>
298
                    <option value=""> -- none -- </option>
300
                    [% FOREACH sg IN search_groups %]
299
                    [% FOREACH sg IN search_groups %]
301
                        [% UNLESS sg.branchcode %]
300
                        [% UNLESS sg.branchcode %]
302
                            <option value="[% sg.id | html %]">[% sg.title | html %]</option>
301
                            <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
303
                        [% END %]
302
                        [% END %]
304
                    [% END %]
303
                    [% END %]
305
                </select>
304
                </select>
Lines 338-343 Link Here
338
            dad.appendChild(line.cloneNode(true));
337
            dad.appendChild(line.cloneNode(true));
339
            line.removeChild(ButtonPlus);
338
            line.removeChild(ButtonPlus);
340
        }
339
        }
340
        function branch_limit() {
341
            if( $("#branchloop").val() != "" ){
342
                $("#categoryloop").val("").prop('disabled',true);
343
            } else {
344
                $("#categoryloop").prop('disabled',false);
345
            }
346
            if ( $("#categoryloop").val() != "" ){
347
                $("#branchloop").val("").prop('disabled',true);
348
            } else {
349
                $("#branchloop").prop('disabled',false);
350
            }
351
        }
352
341
        var Sticky;
353
        var Sticky;
342
        $(document).ready(function() {
354
        $(document).ready(function() {
343
            $("input[name=q]:eq(0)").focus();
355
            $("input[name=q]:eq(0)").focus();
Lines 347-358 Link Here
347
                stickTo: ".main",
359
                stickTo: ".main",
348
                stickyClass: "floating"
360
                stickyClass: "floating"
349
            });
361
            });
350
            $("#branchloop").on("change",function(){
362
            branch_limit();
351
                if( this.value != ""){
363
            $("#branchloop,#categoryloop").on("change",function(){
352
                    document.getElementById("categoryloop").disabled=true;
364
                branch_limit();
353
                } else {
354
                    document.getElementById("categoryloop").disabled=false;
355
                }
356
            });
365
            });
357
366
358
            [% IF searchid %]
367
            [% IF searchid %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-6 / +6 lines)
Lines 234-240 Link Here
234
234
235
                                            [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
235
                                            [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
236
                                                <div class="col-sm col-md-3 col-lg-2 order-3 order-sm-4">
236
                                                <div class="col-sm col-md-3 col-lg-2 order-3 order-sm-4">
237
                                                    <select name="branch_group_limit" id="select_library" class="form-control">
237
                                                    <select name="limit" id="select_library" class="form-control">
238
                                                        <option value="">All libraries</option>
238
                                                        <option value="">All libraries</option>
239
239
240
                                                        [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
240
                                                        [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
Lines 251-260 Link Here
251
                                                            </optgroup>
251
                                                            </optgroup>
252
                                                            <optgroup label="Groups">
252
                                                            <optgroup label="Groups">
253
                                                                [% FOREACH lsg IN LibrarySearchGroups %]
253
                                                                [% FOREACH lsg IN LibrarySearchGroups %]
254
                                                                    [% IF 'multibranchlimit-' _ lsg.id == opac_name %]
254
                                                                    [% IF 'multibranchlimit-' _ lsg.id == opac_name || lsg.id == opac_name %]
255
                                                                        <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
255
                                                                        <option selected="selected" value="multibranchlimit:[% lsg.id | html %]">[% lsg.title | html %]</option>
256
                                                                    [% ELSE %]
256
                                                                    [% ELSE %]
257
                                                                        <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
257
                                                                        <option value="multibranchlimit:[% lsg.id | html %]">[% lsg.title | html %]</option>
258
                                                                    [% END # / bc.selected %]
258
                                                                    [% END # / bc.selected %]
259
                                                                [% END %]
259
                                                                [% END %]
260
                                                            </optgroup>
260
                                                            </optgroup>
Lines 267-274 Link Here
267
                                            [% ELSE %]
267
                                            [% ELSE %]
268
                                                [% IF ( opac_limit_override ) %]
268
                                                [% IF ( opac_limit_override ) %]
269
                                                    [% IF ( opac_search_limit ) %]
269
                                                    [% IF ( opac_search_limit ) %]
270
                                                        [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
270
                                                        [% IF ( multibranchlimit = opac_search_limit.match( 'branch:multibranchlimit-(\d+)' ) ) %]
271
                                                            <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
271
                                                            <input name="limit" value="multibranchlimit:[% multibranchlimit.0 | html %]" type="hidden" />
272
                                                        [% ELSE %]
272
                                                        [% ELSE %]
273
                                                            <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
273
                                                            <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
274
                                                        [% END %]
274
                                                        [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt (-1 / +17 lines)
Lines 455-461 Link Here
455
[% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
455
[% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
456
[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
456
[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
457
<script>
457
<script>
458
    function branch_limit() {
459
        if( $("#branchloop").val() != "" ){
460
            $("#categoryloop").val("").prop('disabled',true);
461
        } else {
462
            $("#categoryloop").prop('disabled',false);
463
        }
464
        if ( $("#categoryloop").val() != "" ){
465
            $("#branchloop").val("").prop('disabled',true);
466
        } else {
467
            $("#branchloop").prop('disabled',false);
468
        }
469
    }
458
$(document).ready(function() {
470
$(document).ready(function() {
471
    branch_limit();
472
    $("#branchloop,#categoryloop").on("change",function(){
473
        branch_limit();
474
    });
475
459
    $('#advsearches').tabs();
476
    $('#advsearches').tabs();
460
    jQuery.cookie.json = true;
477
    jQuery.cookie.json = true;
461
    //$('#advsearches > ul').tabs();
478
    //$('#advsearches > ul').tabs();
462
- 

Return to bug 28847