Lines 1-110
Link Here
|
1 |
[% INCLUDE 'doc-head-open.inc' %] |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
<title>Koha › Patrons [% IF ( searching ) %]› Search results[% END %]</title> |
2 |
<title>Koha › Patrons [% IF ( searching ) %]› Search results[% END %]</title> |
3 |
[% INCLUDE 'doc-head-close.inc' %] |
3 |
[% INCLUDE 'doc-head-close.inc' %] |
4 |
</head> |
4 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> |
5 |
<body id="pat_member" class="pat"> |
5 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
6 |
[% INCLUDE 'header.inc' %] |
6 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
7 |
[% INCLUDE 'patron-search.inc' %] |
7 |
<script type="text/javascript"> |
|
|
8 |
//<![CDATA[ |
9 |
var dtMemberResults; |
8 |
|
10 |
|
9 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( searching ) %]<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Search results[% ELSE %]Patrons[% END %]</div> |
11 |
$(document).ready(function() { |
|
|
12 |
[% IF searchmember %] |
13 |
$("#searchmember_filter").val("[% searchmember %]"); |
14 |
[% END %] |
15 |
[% IF searchfieldstype %] |
16 |
$("searchfieldstype_filter").val("[% searchfieldstype %]"); |
17 |
[% END %] |
18 |
[% IF searchtype %] |
19 |
$("#searchtype_filter").val("[% searchtype %]"); |
20 |
[% END %] |
21 |
[% IF categorycode %] |
22 |
$("#categorycode_filter").val("[% categorycode %]"); |
23 |
[% END %] |
24 |
[% IF branchcode %] |
25 |
$("#branchcode_filter").val("[% branchcode %]"); |
26 |
[% END %] |
10 |
|
27 |
|
11 |
<div id="doc2" class="yui-t7"> |
28 |
// Build the aLengthMenu |
|
|
29 |
var aLengthMenu = [ |
30 |
[%PatronsPerPage %], 10, 20, 50, 100 |
31 |
]; |
32 |
jQuery.unique(aLengthMenu); |
33 |
aLengthMenu.sort(function(a,b){return parseInt(a) < parseInt(b) ? -1 : 1;}); |
12 |
|
34 |
|
13 |
<div id="bd"> |
35 |
// Apply DataTables on the results table |
14 |
<div id="yui-main"> |
36 |
dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, { |
15 |
<div class="yui-b"> |
37 |
'bServerSide': true, |
16 |
<div class="yui-g"> |
38 |
'sAjaxSource': "/cgi-bin/koha/svc/members/search", |
|
|
39 |
'fnServerData': function(sSource, aoData, fnCallback) { |
40 |
aoData.push({ |
41 |
'name': 'searchmember', |
42 |
'value': $("#searchmember_filter").val() |
43 |
},{ |
44 |
'name': 'firstletter', |
45 |
'value': $("#firstletter_filter").val() |
46 |
},{ |
47 |
'name': 'searchfieldstype', |
48 |
'value': $("#searchfieldstype_filter").val() |
49 |
},{ |
50 |
'name': 'searchtype', |
51 |
'value': $("#searchtype_filter").val() |
52 |
},{ |
53 |
'name': 'categorycode', |
54 |
'value': $("#categorycode_filter").val() |
55 |
},{ |
56 |
'name': 'branchcode', |
57 |
'value': $("#branchcode_filter").val() |
58 |
},{ |
59 |
'name': 'name_sorton', |
60 |
'value': 'borrowers.surname borrowers.firstname' |
61 |
},{ |
62 |
'name': 'category_sorton', |
63 |
'value': 'categories.description', |
64 |
},{ |
65 |
'name': 'branch_sorton', |
66 |
'value': 'branches.branchname' |
67 |
},{ |
68 |
'name': 'template_path', |
69 |
'value': 'members/tables/members_results.tt', |
70 |
}); |
71 |
$.ajax({ |
72 |
'dataType': 'json', |
73 |
'type': 'POST', |
74 |
'url': sSource, |
75 |
'data': aoData, |
76 |
'success': function(json){ |
77 |
// redirect if there is only 1 result. |
78 |
if ( json.aaData.length == 1 ) { |
79 |
var borrowernumber = json.aaData[0].borrowernumber; |
80 |
document.location.href="/cgi-bin/koha/members/moremember.pl?borrowernumber="+borrowernumber; |
81 |
return false; |
82 |
} |
83 |
fnCallback(json); |
84 |
} |
85 |
}); |
86 |
}, |
87 |
'aoColumns': [ |
88 |
{ 'mDataProp': 'dt_cardnumber' }, |
89 |
{ 'mDataProp': 'dt_name' }, |
90 |
{ 'mDataProp': 'dt_category' }, |
91 |
{ 'mDataProp': 'dt_branch' }, |
92 |
{ 'mDataProp': 'dt_dateexpiry' }, |
93 |
{ 'mDataProp': 'dt_od_checkouts', 'bSortable': false }, |
94 |
{ 'mDataProp': 'dt_fines', 'bSortable': false }, |
95 |
{ 'mDataProp': 'dt_borrowernotes', 'bSortable': false }, |
96 |
{ 'mDataProp': 'dt_action', 'bSortable': false } |
97 |
], |
98 |
'fnRowCallback': function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { |
99 |
/* Center text for 6th column */ |
100 |
$("td:eq(5)", nRow).css("text-align", "center"); |
17 |
|
101 |
|
18 |
[% INCLUDE 'patron-toolbar.inc' %] |
102 |
return nRow; |
|
|
103 |
}, |
104 |
'bFilter': false, |
105 |
'bAutoWidth': false, |
106 |
'bProcessing': true, |
107 |
[% IF orderby_cardnumber_0 %] |
108 |
'aaSorting': [[0, 'asc']], |
109 |
[% ELSE %] |
110 |
'aaSorting': [[1, 'asc']], |
111 |
[% END %] |
112 |
"aLengthMenu": [aLengthMenu, aLengthMenu], |
113 |
'sPaginationType': 'full_numbers', |
114 |
"iDisplayLength": [% PatronsPerPage %], |
115 |
})); |
116 |
}); |
19 |
|
117 |
|
20 |
[% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3> |
118 |
// Update the string "Results found ..." |
21 |
[% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %] |
119 |
function update_searched(){ |
22 |
[% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.[% END %]</p>[% END %]</div> |
120 |
var searched = ""; |
23 |
[% END %] |
121 |
searched += "on " + $("#searchfieldstype_filter").find("option:selected").text().toLowerCase() + " fields"; |
|
|
122 |
if ( $("#searchmember_filter").val() ) { |
123 |
if ( $("#searchtype_filter").val() == 'start_with' ) { |
124 |
searched += _(" starting with "); |
125 |
} else { |
126 |
searched += _(" containing "); |
127 |
} |
128 |
searched += $("#searchmember_filter").val(); |
129 |
} |
130 |
if ( $("#firstletter_filter").val() ) { |
131 |
searched += _(" begin with ") + $("#firstletter_filter").val(); |
132 |
} |
133 |
if ( $("#categorycode_filter").val() ) { |
134 |
searched += _(" with category ") + $("#categorycode_filter").find("option:selected").text(); |
135 |
} |
136 |
if ( $("#branchcode_filter").val() ) { |
137 |
searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text(); |
138 |
} |
139 |
$("#searchpattern").text("for patron " + searched); |
140 |
} |
24 |
|
141 |
|
25 |
<div class="browse"> |
142 |
// Redraw the table |
26 |
Browse by last name: |
143 |
function filter() { |
27 |
[% FOREACH letter IN alphabet.split(' ') %] |
144 |
$("#firstletter_filter").val(''); |
28 |
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&surname=[% letter %]">[% letter %]</a> |
145 |
update_searched(); |
29 |
[% END %] |
146 |
dtMemberResults.fnDraw(); |
30 |
</div> |
147 |
return false; |
|
|
148 |
} |
31 |
|
149 |
|
32 |
[% IF ( CAN_user_borrowers && pending_borrower_modifications ) %] |
150 |
// User has clicked on the Clear button |
33 |
<div class="pending-info" id="patron_updates_pending"> |
151 |
function clearFilters(redraw) { |
34 |
<a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>: |
152 |
$("#searchform select").val(''); |
35 |
<span class="holdcount"><a href="/cgi-bin/koha/members/members-update.pl">[% pending_borrower_modifications %]</a></span> |
153 |
$("#firstletter_filter").val(''); |
36 |
</div> |
154 |
$("#searchmember_filter").val(''); |
37 |
[% END %] |
155 |
if(redraw) { |
|
|
156 |
dtMemberResults.fnDraw(); |
157 |
} |
158 |
} |
38 |
|
159 |
|
39 |
[% IF ( resultsloop ) %] |
160 |
// User has clicked on a letter |
40 |
<div id="searchheader"> <h3>Results [% from %] to [% to %] of [% numresults %] found for [% IF ( member ) %]'<span class="ex">[% member %]</span>'[% END %][% IF ( surname ) %]'<span class="ex">[% surname %]</span>'[% END %]</h3></div> |
161 |
function filterByFirstLetterSurname(letter) { |
41 |
<div class="searchresults"> |
162 |
clearFilters(false); |
|
|
163 |
$("#firstletter_filter").val(letter); |
164 |
dtMemberResults.fnDraw(); |
165 |
} |
166 |
//]]> |
167 |
</script> |
168 |
</head> |
169 |
<body id="pat_member" class="pat"> |
170 |
[% INCLUDE 'header.inc' %] |
171 |
[% INCLUDE 'patron-search.inc' %] |
42 |
|
172 |
|
43 |
<table id="memberresultst"> |
173 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( searching ) %]<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Search results[% ELSE %]Patrons[% END %]</div> |
44 |
<thead> |
|
|
45 |
<tr> |
46 |
<th>Card</th> |
47 |
<th>Name</th> |
48 |
<th>Cat</th> |
49 |
<th>Library</th> |
50 |
<th>Expires on</th> |
51 |
<th>OD/Checkouts</th> |
52 |
<th>Fines</th> |
53 |
<th>Circ note</th> |
54 |
<th> </th> |
55 |
</tr> |
56 |
</thead> |
57 |
<tbody> |
58 |
[% FOREACH resultsloo IN resultsloop %] |
59 |
[% IF ( resultsloo.overdue ) %] |
60 |
<tr class="problem"> |
61 |
[% ELSE %] |
62 |
[% UNLESS ( loop.odd ) %] |
63 |
<tr class="highlight"> |
64 |
[% ELSE %] |
65 |
<tr> |
66 |
[% END %] |
67 |
[% END %] |
68 |
<td>[% resultsloo.cardnumber %]</td> |
69 |
<td style="white-space: nowrap;"> |
70 |
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resultsloo.borrowernumber %]"> |
71 |
[% INCLUDE 'patron-title.inc' borrowernumber = resultsloo.borrowernumber category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%] |
72 |
</a> <br /> |
73 |
[% IF ( resultsloo.streetnumber ) %][% resultsloo.streetnumber %] [% END %][% resultsloo.address %][% IF ( resultsloo.address2 ) %]<br />[% resultsloo.address2 %][% END %][% IF ( resultsloo.city ) %]<br />[% resultsloo.city %][% IF ( resultsloo.state ) %],[% END %][% END %][% IF ( resultsloo.state ) %] [% resultsloo.state %][% END %] [% IF ( resultsloo.zipcode ) %] [% resultsloo.zipcode %][% END %][% IF ( resultsloo.country ) %], [% resultsloo.country %][% END %]</td> |
74 |
<td>[% resultsloo.category_description %] ([% resultsloo.category_type %])</td> |
75 |
<td>[% resultsloo.branchname %]</td> |
76 |
<td>[% resultsloo.dateexpiry %]</td> |
77 |
<td>[% IF ( resultsloo.overdues ) %]<span class="overdue"><strong>[% resultsloo.overdues %]</strong></span>[% ELSE %][% resultsloo.overdues %][% END %]/[% resultsloo.issues %]</td> |
78 |
<td>[% IF ( resultsloo.fines < 0 ) %]<span class="credit">[% resultsloo.fines %]</span> [% ELSIF resultsloo.fines > 0 %] <span class="debit"><strong>[% resultsloo.fines %]</strong></span> [% ELSE %] [% resultsloo.fines %] [% END %]</td> |
79 |
<td>[% resultsloo.borrowernotes %]</td> |
80 |
<td>[% IF ( resultsloo.category_type ) %] |
81 |
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% resultsloo.borrowernumber %]&category_type=[% resultsloo.category_type %]">Edit</a> |
82 |
[% ELSE %] <!-- try with categorycode if no category_type --> |
83 |
[% IF ( resultsloo.categorycode ) %] |
84 |
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% resultsloo.borrowernumber %]&categorycode=[% resultsloo.categorycode %]">Edit</a> |
85 |
[% ELSE %] <!-- if no categorycode, set category_type to A by default --> |
86 |
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% resultsloo.borrowernumber %]&category_type=A">Edit</a> |
87 |
[% END %] |
88 |
[% END %]</td> |
89 |
</tr> |
90 |
[% END %] |
91 |
</tbody> |
92 |
</table> |
93 |
<div class="pages">[% IF ( multipage ) %][% paginationbar %][% END %]</div> |
94 |
</div> |
95 |
[% ELSE %] |
96 |
[% IF ( searching ) %] |
97 |
<div class="dialog alert">No results found</div> |
98 |
[% END %] |
99 |
[% END %] |
100 |
|
174 |
|
101 |
</div> |
175 |
<div id="doc3" class="yui-t2"> |
102 |
</div> |
176 |
<div id="bd"> |
|
|
177 |
<div id="yui-main"> |
178 |
<div class="yui-b"> |
179 |
<div class="yui-g"> |
180 |
[% INCLUDE 'patron-toolbar.inc' %] |
181 |
[% IF ( no_add ) %] |
182 |
<div class="dialog alert"> |
183 |
<h3>Cannot add patron</h3> |
184 |
[% IF ( no_branches ) %] |
185 |
<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p> |
186 |
[% END %] |
187 |
[% IF ( no_categories ) %] |
188 |
<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.[% END %]</p> |
189 |
[% END %] |
190 |
</div> |
191 |
[% END %] |
192 |
<div class="browse"> |
193 |
Browse by last name: |
194 |
[% FOREACH letter IN alphabet.split(' ') %] |
195 |
<a style="cursor:pointer" onclick="filterByFirstLetterSurname('[% letter %]');">[% letter %]</a> |
196 |
[% END %] |
197 |
</div> |
103 |
|
198 |
|
104 |
<div class="yui-g"> |
199 |
[% IF ( CAN_user_borrowers && pending_borrower_modifications ) %] |
105 |
[% INCLUDE 'members-menu.inc' %] |
200 |
<div class="pending-info" id="patron_updates_pending"> |
106 |
</div> |
201 |
<a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>: |
|
|
202 |
<span class="holdcount"><a href="/cgi-bin/koha/members/members-update.pl">[% pending_borrower_modifications %]</a></span> |
203 |
</div> |
204 |
[% END %] |
107 |
|
205 |
|
|
|
206 |
<div id="searchheader"> |
207 |
<h3>Results found <span id="searchpattern">[% IF searchmember %] for '[% searchmember %]'[% END %]</span></h3> |
208 |
</div> |
209 |
<div class="searchresults"> |
210 |
<table id="memberresultst"> |
211 |
<thead> |
212 |
<tr> |
213 |
<th>Card</th> |
214 |
<th>Name</th> |
215 |
<th>Cat</th> |
216 |
<th>Library</th> |
217 |
<th>Expires on</th> |
218 |
<th>OD/Checkouts</th> |
219 |
<th>Fines</th> |
220 |
<th>Circ note</th> |
221 |
<th> </th> |
222 |
</tr> |
223 |
</thead> |
224 |
<tbody></tbody> |
225 |
</table> |
226 |
</div> |
227 |
</div> |
228 |
</div> |
229 |
</div> |
230 |
<div class="yui-b"> |
231 |
<form onsubmit="return filter();" id="searchform"> |
232 |
<input type="hidden" id="firstletter_filter" value="" /> |
233 |
<fieldset class="brief"> |
234 |
<h3>Filters</h3> |
235 |
<ol> |
236 |
<li> |
237 |
<label for="searchmember_filter">Search:</label> |
238 |
<input type="text" id="searchmember_filter" value="[% searchmember %]"/> |
239 |
</li> |
240 |
<li> |
241 |
<label for="searchfieldstype_filter">Search fields:</label> |
242 |
<select name="searchfieldstype" id="searchfieldstype_filter"> |
243 |
[% IF searchfieldstype == "standard" %] |
244 |
<option selected="selected" value='standard'>Standard</option> |
245 |
[% ELSE %] |
246 |
<option value='standard'>Standard</option> |
247 |
[% END %] |
248 |
[% IF searchfieldstype == "email" %] |
249 |
<option selected="selected" value='email'>Email</option> |
250 |
[% ELSE %] |
251 |
<option value='email'>Email</option> |
252 |
[% END %] |
253 |
[% IF searchfieldstype == "borrowernumber" %] |
254 |
<option selected="selected" value='borrowernumber'>Borrower number</option> |
255 |
[% ELSE %] |
256 |
<option value='borrowernumber'>Borrower number</option> |
257 |
[% END %] |
258 |
[% IF searchfieldstype == "phone" %] |
259 |
<option selected="selected" value='phone'>Phone number</option> |
260 |
[% ELSE %] |
261 |
<option value='phone'>Phone number</option> |
262 |
[% END %] |
263 |
[% IF searchfieldstype == "address" %] |
264 |
<option selected="selected" value='address'>Street Address</option> |
265 |
[% ELSE %] |
266 |
<option value='address'>Street Address</option> |
267 |
[% END %] |
268 |
[% IF searchfieldstype == "dateofbirth" %] |
269 |
<option selected="selected" value='dateofbirth'>Date of birth</option> |
270 |
[% ELSE %] |
271 |
<option value='dateofbirth'>Date of birth</option> |
272 |
[% END %] |
273 |
</select> |
274 |
</li> |
275 |
<li> |
276 |
<label for="searchtype_filter">Search type:</label> |
277 |
<select name="searchtype" id="searchtype_filter"> |
278 |
<option value='start_with'>Starts with</option> |
279 |
[% IF searchtype == "contain" %] |
280 |
<option value="contain" selected="selected">Contains</option> |
281 |
[% ELSE %] |
282 |
<option value="contain" selected="selected">Contains</option> |
283 |
[% END %] |
284 |
</select> |
285 |
</li> |
286 |
<li> |
287 |
<label for="categorycode_filter">Category:</label> |
288 |
<select id="categorycode_filter"> |
289 |
<option value="">Any</option> |
290 |
[% FOREACH cat IN categories %] |
291 |
[% IF cat.selected %] |
292 |
<option selected="selected" value="[% cat.categorycode %]">[% cat.description %]</option> |
293 |
[% ELSE %] |
294 |
<option value="[% cat.categorycode %]">[% cat.description %]</option> |
295 |
[% END %] |
296 |
[% END %] |
297 |
</select> |
298 |
</li> |
299 |
<li> |
300 |
<label for="branchcode_filter">Branch:</label> |
301 |
<select id="branchcode_filter"> |
302 |
[% IF branchloop.size != 1 %] |
303 |
<option value="">Any</option> |
304 |
[% END %] |
305 |
[% FOREACH b IN branchloop %] |
306 |
[% IF b.selected %] |
307 |
<option selected="selected" value="[% b.branchcode %]">[% b.branchname %]</option> |
308 |
[% ELSE %] |
309 |
<option value="[% b.branchcode %]">[% b.branchname %]</option> |
310 |
[% END %] |
311 |
[% END %] |
312 |
</select> |
313 |
</li> |
314 |
</ol> |
315 |
<fieldset class="action"> |
316 |
<input type="submit" value="Search" /> |
317 |
<input type="button" value="Clear" onclick="clearFilters(true);" /> |
318 |
</fieldset> |
319 |
</fieldset> |
320 |
</form> |
108 |
</div> |
321 |
</div> |
|
|
322 |
</div> |
323 |
<div class="yui-g"> |
324 |
[% INCLUDE 'members-menu.inc' %] |
325 |
</div> |
109 |
</div> |
326 |
</div> |
110 |
[% INCLUDE 'intranet-bottom.inc' %] |
327 |
[% INCLUDE 'intranet-bottom.inc' %] |