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

(-)a/catalogue/search.pl (-1 / +9 lines)
Lines 179-187 else { Link Here
179
    flagsrequired   => { catalogue => 1 },
179
    flagsrequired   => { catalogue => 1 },
180
    }
180
    }
181
);
181
);
182
183
$template->param( IndependentBranchesIntranetSearch => C4::Context->preference('IndependentBranchesIntranetSearch') );
184
182
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
185
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
183
    $template->param('UNIMARC' => 1);
186
    $template->param('UNIMARC' => 1);
184
}
187
}
188
185
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
189
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
186
    $template->param('numbersphr' => 1);
190
    $template->param('numbersphr' => 1);
187
}
191
}
Lines 411-417 my @operands = $cgi->param('q'); Link Here
411
# limits are use to limit to results to a pre-defined category such as branch or language
415
# limits are use to limit to results to a pre-defined category such as branch or language
412
my @limits = $cgi->param('limit');
416
my @limits = $cgi->param('limit');
413
417
414
if($params->{'multibranchlimit'}) {
418
if ( C4::Context->preference('IndependentBranchesIntranetSearch') ) {
419
    @limits = map { ( $_ =~ /^branch:/ ) ? undef : $_ } @limits;
420
    push( @limits, "branch: " . C4::Context->userenv->{branch} );
421
}
422
elsif( $params->{'multibranchlimit'} ) {
415
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
423
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
416
}
424
}
417
425
(-)a/installer/data/mysql/updatedatabase.pl (+20 lines)
Lines 6784-6789 if ( CheckVersion($DBversion) ) { Link Here
6784
    SetVersion ($DBversion);
6784
    SetVersion ($DBversion);
6785
}
6785
}
6786
6786
6787
$DBversion = "3.11.00.XXX";
6788
if ( CheckVersion($DBversion) ) {
6789
    print "Upgrade to $DBversion done (IndependentBranches)\n";
6790
    $dbh->do("
6791
        INSERT INTO systempreferences (
6792
            variable,
6793
            value,
6794
            options,
6795
            explanation,
6796
            type
6797
        ) VALUES (
6798
            'IndependentBranchesIntranetSearch',
6799
            '0',
6800
            '',
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'
6803
        )
6804
    ");
6805
    SetVersion ($DBversion);
6806
}
6787
6807
6788
=head1 FUNCTIONS
6808
=head1 FUNCTIONS
6789
6809
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc (-28 / +36 lines)
Lines 1-33 Link Here
1
<div class="gradient">
1
<div class="gradient">
2
<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Catalogue Resident Search Box -->
2
    <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Catalogue Resident Search Box -->
3
<div id="header_search">
3
    <div id="header_search">
4
4
5
[% INCLUDE 'patron-search-box.inc' %]
5
        [% INCLUDE 'patron-search-box.inc' %]
6
6
7
[% IF ( CAN_user_circulate ) %]
7
        [% IF ( CAN_user_circulate ) %]
8
<div id="checkin_search" class="residentsearch">
8
            <div id="checkin_search" class="residentsearch">
9
    <p class="tip">Scan a barcode to check in:</p>
9
                <p class="tip">Scan a barcode to check in:</p>
10
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
10
                <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
11
        <input name="barcode" id="ret_barcode" size="40" />
11
                    <input name="barcode" id="ret_barcode" size="40" />
12
        <input value="Submit" class="submit" type="submit" />
12
                    <input value="Submit" class="submit" type="submit" />
13
    </form>
13
                </form>
14
</div>
14
            </div>
15
	[% END %]
15
        [% END %]
16
	[% IF ( CAN_user_catalogue ) %]
16
17
	<div id="catalog_search" class="residentsearch">
17
        [% IF ( CAN_user_catalogue ) %]
18
	<p class="tip">Enter search keywords:</p>
18
            <div id="catalog_search" class="residentsearch">
19
		<form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
19
            <p class="tip">Enter search keywords:</p>
20
			 <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
20
                <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
21
				<input type="submit" class="submit" value="Submit" />
21
                    <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
22
		</form>
22
                    <input type="submit" class="submit" value="Submit" />
23
	</div>
23
                </form>
24
	[% END %]
24
            </div>
25
	
25
        [% END %]
26
			<ul>
26
27
            [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %]
27
28
    [% IF ( CAN_user_circulate ) %]<li><a href="#checkin_search">Check in</a></li>[% END %]
28
        <ul>
29
            [% IF ( CAN_user_catalogue ) %]<li class="ui-tabs-selected"><a href="#catalog_search">Search the catalog</a></li>[% END %]
29
            [% IF ( CAN_user_circulate ) %]
30
			</ul>	
30
                <li><a href="#circ_search">Check out</a></li>
31
</div><!-- /header_search -->
31
            [% END %]
32
            [% IF ( CAN_user_circulate ) %]
33
                <li><a href="#checkin_search">Check in</a></li>
34
            [% END %]
35
            [% IF ( CAN_user_catalogue ) %]
36
                <li class="ui-tabs-selected"><a href="#catalog_search">Search the catalog</a></li>
37
            [% END %]
38
        </ul>
39
    </div><!-- /header_search -->
32
</div><!-- /gradient -->
40
</div><!-- /gradient -->
33
<!-- End Catalogue Resident Search Box -->
41
<!-- End Catalogue Resident Search Box -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+7 lines)
Lines 70-75 Administration: Link Here
70
                  yes: Prevent
70
                  yes: Prevent
71
                  no: "Don't prevent"
71
                  no: "Don't prevent"
72
            - staff (but not superlibrarians) from modifying objects (holds, items, patrons, etc.) belonging to other libraries.
72
            - staff (but not superlibrarians) from modifying objects (holds, items, patrons, etc.) belonging to other libraries.
73
        -
74
            - pref: IndependentBranchesIntranetSearch
75
              default: 0
76
              choices:
77
                  yes: Prevent
78
                  no: "Don't prevent"
79
            - staff from seeing records without items owned by the logged in branch.
73
    CAS Authentication:
80
    CAS Authentication:
74
        -
81
        -
75
            - pref: casAuthentication
82
            - pref: casAuthentication
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-26 / +33 lines)
Lines 229-262 Link Here
229
[% END %]
229
[% END %]
230
230
231
<!-- AVAILABILITY LIMITS -->
231
<!-- AVAILABILITY LIMITS -->
232
    <fieldset id="availability"><legend>Location and availability</legend>
232
<fieldset id="availability"><legend>Location and availability</legend>
233
<fieldset id="currently-avail">
233
    <fieldset id="currently-avail">
234
        <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
234
            <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
235
</fieldset>
235
    </fieldset>
236
237
    [% UNLESS IndependentBranchesIntranetSearch %]
238
        <fieldset id="select-libs">
239
                <p>
240
                    <label for="branchloop">Individual libraries:</label>
241
                    <select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'>
242
                        <option value="">All libraries</option>
243
                        [% FOREACH branchloo IN branchloop %]
244
                            [% IF ( branchloo.selected ) %]
245
                                <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
246
                            [% ELSE %]
247
                                <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option>
248
                            [% END %]
249
                        [% END %]
250
                    </select>
251
                </p>
236
252
237
<fieldset id="select-libs">
253
                [% IF ( searchdomainloop ) %]
238
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'>
254
                    <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
239
        <option value="">All libraries</option>
255
                    <p>
240
        [% FOREACH branchloo IN branchloop %]
256
                        <label for="categoryloop">Groups of libraries: </label>
241
        [% IF ( branchloo.selected ) %]
257
                        <select name="multibranchlimit" id="categoryloop">
242
        <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
258
                            <option value=""> -- none -- </option>
243
        [% ELSE %]
259
                            [% FOREACH searchdomainloo IN searchdomainloop %]
244
        <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option>
260
                                <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
245
        [% END %]
261
                            [% END %]
246
        [% END %]
262
                        </select>
247
        </select></p>
263
                    </p>
248
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
264
                [% END %]
249
        [% IF ( searchdomainloop ) %]
265
        </fieldset>
250
    <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
251
        <p><label for="categoryloop">Groups of libraries: </label><select name="multibranchlimit" id="categoryloop">
252
        <option value=""> -- none -- </option>
253
        [% FOREACH searchdomainloo IN searchdomainloop %]
254
        <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
255
        [% END %]
256
        </select></p>
257
    [% END %]
266
    [% END %]
258
</fieldset>
267
</fieldset>
259
    </fieldset>
260
<!-- /AVAILABILITY LIMITS -->
268
<!-- /AVAILABILITY LIMITS -->
261
269
262
<!-- RANK LIMITS -->
270
<!-- RANK LIMITS -->
263
- 

Return to bug 10200