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

(-)a/catalogue/search.pl (-1 / +7 lines)
Lines 179-187 else { Link Here
179
    flagsrequired   => { catalogue => 1 },
179
    flagsrequired   => { catalogue => 1 },
180
    }
180
    }
181
);
181
);
182
182
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
183
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
183
    $template->param('UNIMARC' => 1);
184
    $template->param('UNIMARC' => 1);
184
}
185
}
186
185
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
187
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
186
    $template->param('numbersphr' => 1);
188
    $template->param('numbersphr' => 1);
187
}
189
}
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
413
# limits are use to limit to results to a pre-defined category such as branch or language
412
my @limits = $cgi->param('limit');
414
my @limits = $cgi->param('limit');
413
415
414
if($params->{'multibranchlimit'}) {
416
if ( C4::Context->preference('IndependentBranchesIntranetSearch') ) {
417
    @limits = map { ( $_ =~ /^branch:/ ) ? undef : $_ } @limits;
418
    push( @limits, "branch: " . C4::Context->userenv->{branch} );
419
}
420
elsif( $params->{'multibranchlimit'} ) {
415
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
421
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
416
}
422
}
417
423
(-)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 / +34 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
3
<title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 229-262 Link Here
229
[% END %]
230
[% END %]
230
231
231
<!-- AVAILABILITY LIMITS -->
232
<!-- AVAILABILITY LIMITS -->
232
    <fieldset id="availability"><legend>Location and availability</legend>
233
<fieldset id="availability"><legend>Location and availability</legend>
233
<fieldset id="currently-avail">
234
    <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>
235
            <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
235
</fieldset>
236
    </fieldset>
237
238
    [% UNLESS Koha.Preference('IndependentBranchesIntranetSearch') %]
239
        <fieldset id="select-libs">
240
                <p>
241
                    <label for="branchloop">Individual libraries:</label>
242
                    <select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'>
243
                        <option value="">All libraries</option>
244
                        [% FOREACH branchloo IN branchloop %]
245
                            [% IF ( branchloo.selected ) %]
246
                                <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
247
                            [% ELSE %]
248
                                <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option>
249
                            [% END %]
250
                        [% END %]
251
                    </select>
252
                </p>
236
253
237
<fieldset id="select-libs">
254
                [% 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;}'>
255
                    <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
239
        <option value="">All libraries</option>
256
                    <p>
240
        [% FOREACH branchloo IN branchloop %]
257
                        <label for="categoryloop">Groups of libraries: </label>
241
        [% IF ( branchloo.selected ) %]
258
                        <select name="multibranchlimit" id="categoryloop">
242
        <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
259
                            <option value=""> -- none -- </option>
243
        [% ELSE %]
260
                            [% FOREACH searchdomainloo IN searchdomainloop %]
244
        <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option>
261
                                <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
245
        [% END %]
262
                            [% END %]
246
        [% END %]
263
                        </select>
247
        </select></p>
264
                    </p>
248
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
265
                [% END %]
249
        [% IF ( searchdomainloop ) %]
266
        </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 %]
267
    [% END %]
258
</fieldset>
268
</fieldset>
259
    </fieldset>
260
<!-- /AVAILABILITY LIMITS -->
269
<!-- /AVAILABILITY LIMITS -->
261
270
262
<!-- RANK LIMITS -->
271
<!-- RANK LIMITS -->
263
- 

Return to bug 10200