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

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 559-565 sub get_template_and_user { Link Here
559
        if (
559
        if (
560
            ( $opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:([\w-]+)/ ) ||
560
            ( $opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:([\w-]+)/ ) ||
561
            ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:([\w-]+)/ ) ||
561
            ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:([\w-]+)/ ) ||
562
            ( $in->{'query'}->param('multibranchlimit') && $in->{'query'}->param('multibranchlimit') =~ /multibranchlimit-(\w+)/ )
562
            ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /multibranchlimit:(\w+)/ )
563
          ) {
563
          ) {
564
            $opac_name = $1;    # opac_search_limit is a branch, so we use it.
564
            $opac_name = $1;    # opac_search_limit is a branch, so we use it.
565
        } elsif ( $in->{'query'}->param('multibranchlimit') ) {
565
        } elsif ( $in->{'query'}->param('multibranchlimit') ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-10 / +21 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
341
        var Sticky;
341
        var Sticky;
342
        $(document).ready(function() {
342
        $(document).ready(function() {
343
            $("input[name=q]:eq(0)").focus();
343
            $("input[name=q]:eq(0)").focus();
Lines 347-359 Link Here
347
                stickTo: ".main",
347
                stickTo: ".main",
348
                stickyClass: "floating"
348
                stickyClass: "floating"
349
            });
349
            });
350
            $("#branchloop").on("change",function(){
350
            [% IF search_groups %]
351
                if( this.value != ""){
351
                function branch_limit() {
352
                    document.getElementById("categoryloop").disabled=true;
352
                    if( $("#branchloop").val() != "" ){
353
                } else {
353
                        $("#categoryloop").val("").prop('disabled',true);
354
                    document.getElementById("categoryloop").disabled=false;
354
                    } else {
355
                        $("#categoryloop").prop('disabled',false);
356
                    }
357
                    if ( $("#categoryloop").val() != "" ){
358
                        $("#branchloop").val("").prop('disabled',true);
359
                    } else {
360
                        $("#branchloop").prop('disabled',false);
361
                    }
355
                }
362
                }
356
            });
363
                branch_limit();
364
                $("#branchloop,#categoryloop").on("change",function(){
365
                    branch_limit();
366
                });
367
            [% END %]
357
368
358
            [% IF searchid %]
369
            [% IF searchid %]
359
                browser = KOHA.browser('[% searchid | html %]');
370
                browser = KOHA.browser('[% searchid | html %]');
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-5 / +5 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 252-260 Link Here
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 || 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 (-3 / +19 lines)
Lines 244-253 Link Here
244
                                    [% IF search_groups %]
244
                                    [% IF search_groups %]
245
                                        <p>OR</p>
245
                                        <p>OR</p>
246
                                        <label for="categoryloop">Groups of libraries</label>
246
                                        <label for="categoryloop">Groups of libraries</label>
247
                                        <select name="multibranchlimit" id="categoryloop">
247
                                        <select name="limit" id="categoryloop">
248
                                            <option value=""> -- none -- </option>
248
                                            <option value=""> -- none -- </option>
249
                                            [% FOREACH sg IN search_groups %]
249
                                            [% FOREACH sg IN search_groups %]
250
                                                <option value="[% sg.id | html %]">[% sg.title | html %]</option>
250
                                                <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
251
                                            [% END %]
251
                                            [% END %]
252
                                        </select>
252
                                        </select>
253
                                    [% END %]
253
                                    [% END %]
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