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

(-)a/Koha/Template/Plugin/Borrowers.pm (+7 lines)
Lines 24-29 use base qw( Template::Plugin ); Link Here
24
24
25
use Koha::Borrower::Debarments qw//;
25
use Koha::Borrower::Debarments qw//;
26
26
27
use C4::Category;
28
27
=pod
29
=pod
28
30
29
This plugin is a home for various patron related Template Toolkit functions
31
This plugin is a home for various patron related Template Toolkit functions
Lines 48-51 sub IsDebarred { Link Here
48
    return Koha::Borrower::Debarments::IsDebarred($borrower->{borrowernumber});
50
    return Koha::Borrower::Debarments::IsDebarred($borrower->{borrowernumber});
49
}
51
}
50
52
53
sub getBorrowerCategories {
54
    my ( $self ) = @_;
55
    return C4::Category->all;
56
}
57
51
1;
58
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-19 / +33 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Borrowers %]
3
[% SET patron_categories = Borrowers.getBorrowerCategories() %]
2
<div class="gradient">
4
<div class="gradient">
3
<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Resident Search Box -->
5
<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Resident Search Box -->
4
<div id="header_search">
6
<div id="header_search">
Lines 85-108 Link Here
85
      </select>
87
      </select>
86
88
87
    <input value="Search" class="submit" type="submit" />
89
    <input value="Search" class="submit" type="submit" />
88
    [% IF ( branchloop ) %]
90
    [% IF ( branchloop || patron_categories ) %]
89
    <p id="filters"> <label for="branchcode">Library: </label>
91
        <p id="filters">
90
    <select name="branchcode" id="branchcode">
92
            [% IF ( branchloop ) %]
91
        [% IF branchloop.size != 1 %]
93
                <label for="branchcode">Library: </label>
92
          <option value="">Any</option>
94
                <select name="branchcode" id="branchcode">
93
        [% END %]
95
                    [% IF branchloop.size != 1 %]
94
        [% FOREACH branchloo IN branchloop %]
96
                        <option value="">Any</option>
95
        [% IF ( branchloo.selected ) %]
97
                    [% END %]
96
        <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]
98
                    [% FOREACH branchloo IN branchloop %]
97
        <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
99
                        [% IF ( branchloo.selected ) %]
98
      [% END %]</select>
100
                            <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
99
                 <label for="categorycode">Category: </label><select name="categorycode" id="categorycode">
101
                        [% ELSE %]
100
        <option value="">Any</option>[% FOREACH categorie IN categories %]
102
                            <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
101
        [% IF ( categorie.selected ) %]
103
                        [% END %]
102
        <option value="[% categorie.categorycode %]" selected="selected">[% categorie.description |html_entity %]</option>[% ELSE %]
104
                    [% END %]
103
        <option value="[% categorie.categorycode %]">[% categorie.description |html_entity %]</option>[% END %]
105
                </select>
104
      [% END %]</select>
106
            [% END %]
105
    </p>
107
            [% IF ( patron_categories ) %]
108
                <label for="patron_search_categorycode">Category: </label>
109
                <select name="categorycode" id="patron_search_categorycode">
110
                    <option value="">Any</option>
111
                    [% FOREACH categorie IN patron_categories %]
112
                        [% IF ( categorie.selected ) %]
113
                            <option value="[% categorie.categorycode %]" selected="selected">[% categorie.description |html_entity %]</option>
114
                        [% ELSE %]
115
                            <option value="[% categorie.categorycode %]">[% categorie.description |html_entity %]</option>
116
                        [% END %]
117
                    [% END %]
118
                </select>
119
            [% END %]
120
        </p>
106
    [% END %]
121
    [% END %]
107
</form>
122
</form>
108
	</div>
123
	</div>
109
- 

Return to bug 12982