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

(-)a/installer/data/mysql/updatedatabase.pl (-2 / +18 lines)
Lines 6787-6793 if ( CheckVersion($DBversion) ) { Link Here
6787
$DBversion = "3.11.00.XXX";
6787
$DBversion = "3.11.00.XXX";
6788
if ( CheckVersion($DBversion) ) {
6788
if ( CheckVersion($DBversion) ) {
6789
    print "Upgrade to $DBversion done (IndependentBranches)\n";
6789
    print "Upgrade to $DBversion done (IndependentBranches)\n";
6790
    $dbh->do("
6790
    $dbh->do(q{
6791
        INSERT INTO systempreferences (
6791
        INSERT INTO systempreferences (
6792
            variable,
6792
            variable,
6793
            value,
6793
            value,
Lines 6801-6807 if ( CheckVersion($DBversion) ) { Link Here
6801
            'If on, the staff interface search will hide all records that do not contain an item owned by the logged in branch.',
6801
            'If on, the staff interface search will hide all records that do not contain an item owned by the logged in branch.',
6802
            'YesNo'
6802
            'YesNo'
6803
        )
6803
        )
6804
    ");
6804
    });
6805
6806
    $dbh->do(q{
6807
        INSERT INTO systempreferences (
6808
            variable,
6809
            value,
6810
            options,
6811
            explanation,
6812
            type
6813
        ) VALUES (
6814
            'IndependentBranchesOpacSearch',
6815
            '0',
6816
            '',
6817
            "If on, the opac catalog search will hide all records that do not contain an item owned by the branchcode defined by the OPAC's branch via the URL.",
6818
            'YesNo'
6819
        )
6820
    });
6805
    SetVersion ($DBversion);
6821
    SetVersion ($DBversion);
6806
}
6822
}
6807
6823
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+7 lines)
Lines 77-82 Administration: Link Here
77
                  yes: Prevent
77
                  yes: Prevent
78
                  no: "Don't prevent"
78
                  no: "Don't prevent"
79
            - staff from seeing records without items owned by the logged in branch.
79
            - staff from seeing records without items owned by the logged in branch.
80
        -
81
            - pref: IndependentBranchesOpacSearch
82
              default: 0
83
              choices:
84
                  yes: Prevent
85
                  no: "Don't prevent"
86
            - OPAC search results from containing records that do not have item's owned by the library defined by the OPAC's branch via the URL.
80
    CAS Authentication:
87
    CAS Authentication:
81
        -
88
        -
82
            - pref: casAuthentication
89
            - pref: casAuthentication
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt (-22 / +37 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %]
3
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %]
3
    catalog › Advanced search
4
    catalog › Advanced search
Lines 282-311 Link Here
282
<div class="yui-u first">
283
<div class="yui-u first">
283
<!-- AVAILABILITY LIMITS -->
284
<!-- AVAILABILITY LIMITS -->
284
    [% UNLESS ( singleBranchMode ) %]
285
    [% UNLESS ( singleBranchMode ) %]
285
    <div id="location" class="container"><fieldset><legend>Location and availability: </legend>
286
        <div id="location" class="container">
287
            <fieldset>
288
                <legend>Location and availability: </legend>
286
289
287
        <label for="branchloop">Library:</label>
290
                [% UNLESS Koha.Preference('IndependentBranchesOpacSearch') %]
288
        <select name="limit" id="branchloop">
291
                    <label for="branchloop">Library:</label>
289
        <option value="">All libraries</option>
292
                    <select name="limit" id="branchloop">
290
        [% FOREACH BranchesLoo IN BranchesLoop %]
293
                        <option value="">All libraries</option>
291
        [% IF ( BranchesLoo.selected ) %]
294
                        [% FOREACH BranchesLoo IN BranchesLoop %]
292
        <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
295
                            [% IF ( BranchesLoo.selected ) %]
293
        [% ELSE %]    
296
                                <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
294
        <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
297
                            [% ELSE %]
295
        [% END %]    
298
                                <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
296
        [% END %]
299
                            [% END %]
297
        </select>
300
                        [% END %]
298
        [% IF ( searchdomainloop ) %]
301
                    </select>
299
            <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
302
300
                <label for="categoryloop">Groups of libraries</label><select name="multibranchlimit" id="categoryloop">
303
                    [% IF ( searchdomainloop ) %]
301
                <option value=""> -- none -- </option>
304
                        <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
302
                [% FOREACH searchdomainloo IN searchdomainloop %]
305
303
                <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
306
                        <label for="categoryloop">Groups of libraries</label>
307
                        <select name="multibranchlimit" id="categoryloop">
308
                            <option value=""> -- none -- </option>
309
                            [% FOREACH searchdomainloo IN searchdomainloop %]
310
                                <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
311
                            [% END %]
312
                        </select>
313
                    [% END %]
304
                [% END %]
314
                [% END %]
305
                </select>
315
306
        [% END %]        
316
                <div style="margin-top:.4em">
307
        <div style="margin-top:.4em"><label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label></div>
317
                    <label for="available-items">
308
    </fieldset></div>
318
                        <input type="checkbox" id="available-items" name="limit" value="available" />
319
                        Only items currently available for loan or reference
320
                    </label>
321
                </div>
322
            </fieldset>
323
        </div>
309
    [% END %]
324
    [% END %]
310
<!-- /AVAILABILITY LIMITS -->
325
<!-- /AVAILABILITY LIMITS -->
311
</div>
326
</div>
(-)a/opac/opac-search.pl (-2 / +5 lines)
Lines 402-408 if ($operands[0] && !$operands[1]) { Link Here
402
my @limits = $cgi->param('limit');
402
my @limits = $cgi->param('limit');
403
@limits = map { uri_unescape($_) } @limits;
403
@limits = map { uri_unescape($_) } @limits;
404
404
405
if($params->{'multibranchlimit'}) {
405
if ( C4::Context->preference('IndependentBranchesOpacSearch') ) {
406
    @limits = map { ( $_ =~ /^branch:/ ) ? undef : $_ } @limits;
407
    push( @limits, "branch: " . $ENV{'BRANCHCODE'} );
408
}
409
elsif($params->{'multibranchlimit'}) {
406
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
410
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
407
}
411
}
408
412
409
- 

Return to bug 10200