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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt (-9 / +22 lines)
Lines 45-51 function add_item(borrowernum,batch_id,type_id){ Link Here
45
<div id="custom-doc" class="yui-t7">
45
<div id="custom-doc" class="yui-t7">
46
  <div id="bd">
46
  <div id="bd">
47
	<div class="yui-g">
47
	<div class="yui-g">
48
<h3>Patron Search</h3>
48
<h3>Patron search</h3>
49
49
50
<div class="browse">
50
<div class="browse">
51
    Browse by last name:
51
    Browse by last name:
Lines 58-71 function add_item(borrowernum,batch_id,type_id){ Link Here
58
<input type="hidden" name="batch_id" value="[% batch_id %]" />
58
<input type="hidden" name="batch_id" value="[% batch_id %]" />
59
<input type="hidden" name="type" value="[% type %]" />
59
<input type="hidden" name="type" value="[% type %]" />
60
<label for="member">Name: </label>
60
<label for="member">Name: </label>
61
<input id="member" name="member" />
61
<input id="member" name="member" value="[% member %]" />
62
<label for="category">Category code: </label>
62
63
<input id="category" name="category" />
63
[% UNLESS ( no_categories ) %]
64
    <label for="category">Category: </label>
65
    <select name="category" id="category">
66
        <option value="">Any</option>
67
        [% FOREACH categorie IN categories %]
68
            [% IF ( categorie.categorycode == category ) %]
69
                <option value="[% categorie.categorycode %]" selected="selected">[% categorie.description |html_entity %]</option>
70
            [% ELSE %]
71
                <option value="[% categorie.categorycode %]">[% categorie.description |html_entity %]</option>
72
            [% END %]
73
        [% END %]
74
    </select>
75
[% END %]
76
64
<input type="submit" value="Search" /></p>
77
<input type="submit" value="Search" /></p>
65
</form>
78
</form>
66
79
67
[% IF ( resultsloop ) %]
80
[% IF ( resultsloop ) %]
68
<div id="searchheader"> <h3>Results [% from %] to [% to %] of [% numresults %] found for [% IF ( member ) %]name: '<span class="ex">[% member %][% ELSIF ( category_type ) %]category code: '<span class="ex">[% category_type %][% END %]</span>'</h3></div>
81
<div id="searchheader"> <h3>Results [% from %] to [% to %] of [% numresults %] found [% IF ( member ) %]for name: '<span class="ex">[% member %]</span>'[% END %] [% IF ( category ) %]with category code: '<span class="ex">[% category %]</span>'[% END %]</h3></div>
69
[% IF ( paginationbar ) %]<div id="pagination_top" class="pages">[% paginationbar %]</div>[% END %]
82
[% IF ( paginationbar ) %]<div id="pagination_top" class="pages">[% paginationbar %]</div>[% END %]
70
<form name="resultform" action="/cgi-bin/koha/patroncards/members-search.pl" method="get" class="checkboxed"><div style="float: right; margin-top: .5em;"><input type="submit" class="icon addchecked" value="Add checked" onclick="add_item('checked',[% batch_id %]); return false" /> <input type="button" class="close" value="Done" /></div>
83
<form name="resultform" action="/cgi-bin/koha/patroncards/members-search.pl" method="get" class="checkboxed"><div style="float: right; margin-top: .5em;"><input type="submit" class="icon addchecked" value="Add checked" onclick="add_item('checked',[% batch_id %]); return false" /> <input type="button" class="close" value="Done" /></div>
71
<div style="line-height: 2em; margin-left: .7em;"><a id="CheckAll" href="/cgi-bin/koha/patroncards/members-search.pl">Select All</a><a id="CheckNone" href="/cgi-bin/koha/patroncards/members-search.pl">Clear All</a></div>
84
<div style="line-height: 2em; margin-left: .7em;"><a id="CheckAll" href="/cgi-bin/koha/patroncards/members-search.pl">Select All</a><a id="CheckNone" href="/cgi-bin/koha/patroncards/members-search.pl">Clear All</a></div>
Lines 74-83 function add_item(borrowernum,batch_id,type_id){ Link Here
74
    <table style="float: left; margin: .5em 0;">
87
    <table style="float: left; margin: .5em 0;">
75
    <tr>
88
    <tr>
76
    <th>Select</th>
89
    <th>Select</th>
77
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category_type %]&amp;batch_id=[% batch_id %]&amp;orderby=cardnumber">Card</a></th>
90
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category %]&amp;batch_id=[% batch_id %]&amp;orderby=cardnumber">Card</a></th>
78
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category_type %]&amp;batch_id=[% batch_id %]&amp;orderby=surname">Name</a></th>
91
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category %]&amp;batch_id=[% batch_id %]&amp;orderby=surname">Name</a></th>
79
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category_type %]&amp;batch_id=[% batch_id %]&amp;orderby=borrowers.categorycode">Category</a></th>
92
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category %]&amp;batch_id=[% batch_id %]&amp;orderby=borrowers.categorycode">Category</a></th>
80
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category_type %]&amp;batch_id=[% batch_id %]&amp;orderby=branchcode">Library</a></th>
93
    <th><a href="members-search.pl?member=[% member %]&amp;category=[% category %]&amp;batch_id=[% batch_id %]&amp;orderby=branchcode">Library</a></th>
81
    <th>Expires on</th>
94
    <th>Expires on</th>
82
    <th>Notes</th>
95
    <th>Notes</th>
83
    <th></th>
96
    <th></th>
(-)a/patroncards/members-search.pl (-1 / +12 lines)
Lines 38-43 my $orderby = $cgi->param('orderby') || undef; Link Here
38
38
39
my @categories=C4::Category->all;
39
my @categories=C4::Category->all;
40
my %categories_display;
40
my %categories_display;
41
my $no_categories;
41
42
42
foreach my $category (@categories) {
43
foreach my $category (@categories) {
43
    my $hash={
44
    my $hash={
Lines 47-52 foreach my $category (@categories) { Link Here
47
    $categories_display{$$category{categorycode}} = $hash;
48
    $categories_display{$$category{categorycode}} = $hash;
48
}
49
}
49
50
51
50
my ($template, $loggedinuser, $cookie) = get_template_and_user({
52
my ($template, $loggedinuser, $cookie) = get_template_and_user({
51
                template_name => "patroncards/members-search.tmpl",
53
                template_name => "patroncards/members-search.tmpl",
52
                query => $cgi,
54
                query => $cgi,
Lines 55-60 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
55
                flagsrequired => {borrowers => 1},
57
                flagsrequired => {borrowers => 1},
56
                debug => 1,});
58
                debug => 1,});
57
59
60
if(scalar(@categories) < 1){ $no_categories = 1; }
61
if($no_categories && C4::Context->preference("AddPatronLists")=~/code/){
62
    $template->param(no_categories => 1);
63
} else {
64
    $template->param(
65
        categories=>\@categories,
66
        category => $category
67
    );
68
}
69
58
$orderby = "surname,firstname" unless $orderby;
70
$orderby = "surname,firstname" unless $orderby;
59
$member =~ s/,//g;   #remove any commas from search string
71
$member =~ s/,//g;   #remove any commas from search string
60
$member =~ s/\*/%/g;
72
$member =~ s/\*/%/g;
61
- 

Return to bug 5502