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 / +36 lines)
Lines 282-311 Link Here
282
<div class="yui-u first">
282
<div class="yui-u first">
283
<!-- AVAILABILITY LIMITS -->
283
<!-- AVAILABILITY LIMITS -->
284
    [% UNLESS ( singleBranchMode ) %]
284
    [% UNLESS ( singleBranchMode ) %]
285
    <div id="location" class="container"><fieldset><legend>Location and availability: </legend>
285
        <div id="location" class="container">
286
            <fieldset>
287
                <legend>Location and availability: </legend>
286
288
287
        <label for="branchloop">Library:</label>
289
                [% UNLESS IndependentBranchesOpacSearch %]
288
        <select name="limit" id="branchloop">
290
                    <label for="branchloop">Library:</label>
289
        <option value="">All libraries</option>
291
                    <select name="limit" id="branchloop">
290
        [% FOREACH BranchesLoo IN BranchesLoop %]
292
                        <option value="">All libraries</option>
291
        [% IF ( BranchesLoo.selected ) %]
293
                        [% FOREACH BranchesLoo IN BranchesLoop %]
292
        <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
294
                            [% IF ( BranchesLoo.selected ) %]
293
        [% ELSE %]    
295
                                <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
294
        <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
296
                            [% ELSE %]    
295
        [% END %]    
297
                                <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
296
        [% END %]
298
                            [% END %]    
297
        </select>
299
                        [% END %]
298
        [% IF ( searchdomainloop ) %]
300
                    </select>
299
            <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
301
300
                <label for="categoryloop">Groups of libraries</label><select name="multibranchlimit" id="categoryloop">
302
                    [% IF ( searchdomainloop ) %]
301
                <option value=""> -- none -- </option>
303
                        <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
302
                [% FOREACH searchdomainloo IN searchdomainloop %]
304
303
                <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
305
                        <label for="categoryloop">Groups of libraries</label>
306
                        <select name="multibranchlimit" id="categoryloop">
307
                            <option value=""> -- none -- </option>
308
                            [% FOREACH searchdomainloo IN searchdomainloop %]
309
                                <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
310
                            [% END %]
311
                        </select>
312
                    [% END %]        
304
                [% END %]
313
                [% END %]
305
                </select>
314
306
        [% END %]        
315
                <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>
316
                    <label for="available-items">
308
    </fieldset></div>
317
                        <input type="checkbox" id="available-items" name="limit" value="available" /> 
318
                        Only items currently available for loan or reference
319
                    </label>
320
                </div>
321
            </fieldset>
322
        </div>
309
    [% END %]
323
    [% END %]
310
<!-- /AVAILABILITY LIMITS -->
324
<!-- /AVAILABILITY LIMITS -->
311
</div>
325
</div>
(-)a/opac/opac-search.pl (-2 / +7 lines)
Lines 120-125 if ($template_name eq 'opac-results.tmpl') { Link Here
120
   $template->param('COinSinOPACResults' => C4::Context->preference('COinSinOPACResults'));
120
   $template->param('COinSinOPACResults' => C4::Context->preference('COinSinOPACResults'));
121
}
121
}
122
122
123
$template->param( IndependentBranchesOpacSearch => C4::Context->preference('IndependentBranchesOpacSearch') );
124
123
# get biblionumbers stored in the cart
125
# get biblionumbers stored in the cart
124
my @cart_list;
126
my @cart_list;
125
127
Lines 402-408 if ($operands[0] && !$operands[1]) { Link Here
402
my @limits = $cgi->param('limit');
404
my @limits = $cgi->param('limit');
403
@limits = map { uri_unescape($_) } @limits;
405
@limits = map { uri_unescape($_) } @limits;
404
406
405
if($params->{'multibranchlimit'}) {
407
if ( C4::Context->preference('IndependentBranchesOpacSearch') ) {
408
    @limits = map { ( $_ =~ /^branch:/ ) ? undef : $_ } @limits;
409
    push( @limits, "branch: " . $ENV{'BRANCHCODE'} );
410
}
411
elsif($params->{'multibranchlimit'}) {
406
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
412
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
407
}
413
}
408
414
409
- 

Return to bug 10200