|
Lines 1-7
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 |
|
4 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
|
|
5 |
[% INCLUDE 'datatables.inc' %] |
| 5 |
<script type="text/javascript"> |
6 |
<script type="text/javascript"> |
| 6 |
//<![CDATA[ |
7 |
//<![CDATA[ |
| 7 |
$(document).ready(function() { |
8 |
$(document).ready(function() { |
|
Lines 21-27
$(document).ready(function() {
Link Here
|
| 21 |
$('#new_patron_list').hide(); |
22 |
$('#new_patron_list').hide(); |
| 22 |
$('#add_to_patron_list_submit').attr('disabled', 'disabled'); |
23 |
$('#add_to_patron_list_submit').attr('disabled', 'disabled'); |
| 23 |
} |
24 |
} |
| 24 |
|
|
|
| 25 |
}); |
25 |
}); |
| 26 |
|
26 |
|
| 27 |
$('#new_patron_list').on('input', function() { |
27 |
$('#new_patron_list').on('input', function() { |
|
Lines 31-73
$(document).ready(function() {
Link Here
|
| 31 |
$('#add_to_patron_list_submit').attr('disabled', 'disabled'); |
31 |
$('#add_to_patron_list_submit').attr('disabled', 'disabled'); |
| 32 |
} |
32 |
} |
| 33 |
}); |
33 |
}); |
|
|
34 |
|
| 35 |
$("#patron_list_dialog").hide(); |
| 36 |
$("#add_to_patron_list_submit").on('click', function(e){ |
| 37 |
if ( $('#add_to_patron_list').val() == 'new' ) { |
| 38 |
if ( $('#new_patron_list').val() ) { |
| 39 |
$("#add_to_patron_list option").each(function() { |
| 40 |
if ( $(this).text() == $('#new_patron_list').val() ) { |
| 41 |
alert( _("You already have a list with that name!") ); |
| 42 |
return false; |
| 43 |
} |
| 44 |
}); |
| 45 |
} else { |
| 46 |
alert( _("You must give your new patron list a name!") ); |
| 47 |
return false; |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
if ( $("#memberresultst input:checkbox:checked").length == 0 ) { |
| 52 |
alert( _("You have not selected any patrons to add to a list!") ); |
| 53 |
return false; |
| 54 |
} |
| 55 |
|
| 56 |
var borrowernumbers = []; |
| 57 |
$("#memberresultst").find("input:checkbox:checked").each(function(){ |
| 58 |
borrowernumbers.push($(this).val()); |
| 59 |
}); |
| 60 |
var data = { |
| 61 |
add_to_patron_list: encodeURIComponent($("#add_to_patron_list").val()), |
| 62 |
new_patron_list: encodeURIComponent($("#new_patron_list").val()), |
| 63 |
borrowernumbers: borrowernumbers |
| 64 |
}; |
| 65 |
$.ajax({ |
| 66 |
data: data, |
| 67 |
type: 'POST', |
| 68 |
url: '/cgi-bin/koha/svc/members/add_to_list', |
| 69 |
success: function(data) { |
| 70 |
$("#patron_list_dialog").show(); |
| 71 |
$("#patron_list_dialog > span.patrons-length").html(data.patrons_added_to_list); |
| 72 |
$("#patron_list_dialog > a").attr("href", "/cgi-bin/koha/patron_lists/list.pl?patron_list_id=" + data.patron_list.patron_list_id); |
| 73 |
$("#patron_list_dialog > a").html(data.patron_list.name); |
| 74 |
}, |
| 75 |
error: function() { |
| 76 |
alert("an error occurred"); |
| 77 |
} |
| 78 |
}); |
| 79 |
return true; |
| 80 |
}); |
| 34 |
}); |
81 |
}); |
| 35 |
|
82 |
|
| 36 |
function CheckForm() { |
83 |
var dtMemberResults; |
| 37 |
if ( $('#add_to_patron_list').val() == 'new' ) { |
84 |
var search = 1; |
| 38 |
if ( $('#new_patron_list').val() ) { |
85 |
$(document).ready(function() { |
| 39 |
var exists = false; |
86 |
[% IF searchmember %] |
| 40 |
$("#add_to_patron_list option").each(function() { |
87 |
$("#searchmember_filter").val("[% searchmember %]"); |
| 41 |
if ( $(this).text() == $('#new_patron_list').val() ) { |
88 |
[% END %] |
| 42 |
exists = true; |
89 |
[% IF searchfieldstype %] |
| 43 |
return false; |
90 |
$("searchfieldstype_filter").val("[% searchfieldstype %]"); |
|
|
91 |
[% END %] |
| 92 |
[% IF searchtype %] |
| 93 |
$("#searchtype_filter").val("[% searchtype %]"); |
| 94 |
[% END %] |
| 95 |
[% IF categorycode %] |
| 96 |
$("#categorycode_filter").val("[% categorycode %]"); |
| 97 |
[% END %] |
| 98 |
[% IF branchcode %] |
| 99 |
$("#branchcode_filter").val("[% branchcode %]"); |
| 100 |
[% END %] |
| 101 |
|
| 102 |
[% IF view != "show_results" %] |
| 103 |
$("#searchresults").hide(); |
| 104 |
search = 0; |
| 105 |
[% END %] |
| 106 |
|
| 107 |
// Build the aLengthMenu |
| 108 |
var aLengthMenu = [ |
| 109 |
[%PatronsPerPage %], 10, 20, 50, 100, -1 |
| 110 |
]; |
| 111 |
jQuery.unique(aLengthMenu); |
| 112 |
aLengthMenu.sort(function( a, b ){ |
| 113 |
// Put "All" at the end |
| 114 |
if ( a == -1 ) { |
| 115 |
return 1; |
| 116 |
} else if ( b == -1 ) { |
| 117 |
return -1; |
| 118 |
} |
| 119 |
return parseInt(a) < parseInt(b) ? -1 : 1;} |
| 120 |
); |
| 121 |
var aLengthMenuLabel = []; |
| 122 |
$(aLengthMenu).each(function(){ |
| 123 |
if ( this == -1 ) { |
| 124 |
// Label for -1 is "All" |
| 125 |
aLengthMenuLabel.push("All"); |
| 126 |
} else { |
| 127 |
aLengthMenuLabel.push(this); |
| 128 |
} |
| 129 |
}); |
| 130 |
|
| 131 |
// Apply DataTables on the results table |
| 132 |
dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 133 |
'bServerSide': true, |
| 134 |
'sAjaxSource': "/cgi-bin/koha/svc/members/search", |
| 135 |
'fnServerData': function(sSource, aoData, fnCallback) { |
| 136 |
if ( ! search ) { |
| 137 |
return; |
| 138 |
} |
| 139 |
aoData.push({ |
| 140 |
'name': 'searchmember', |
| 141 |
'value': $("#searchmember_filter").val() |
| 142 |
},{ |
| 143 |
'name': 'firstletter', |
| 144 |
'value': $("#firstletter_filter").val() |
| 145 |
},{ |
| 146 |
'name': 'searchfieldstype', |
| 147 |
'value': $("#searchfieldstype_filter").val() |
| 148 |
},{ |
| 149 |
'name': 'searchtype', |
| 150 |
'value': $("#searchtype_filter").val() |
| 151 |
},{ |
| 152 |
'name': 'categorycode', |
| 153 |
'value': $("#categorycode_filter").val() |
| 154 |
},{ |
| 155 |
'name': 'branchcode', |
| 156 |
'value': $("#branchcode_filter").val() |
| 157 |
},{ |
| 158 |
'name': 'name_sorton', |
| 159 |
'value': 'borrowers.surname borrowers.firstname' |
| 160 |
},{ |
| 161 |
'name': 'category_sorton', |
| 162 |
'value': 'categories.description', |
| 163 |
},{ |
| 164 |
'name': 'branch_sorton', |
| 165 |
'value': 'branches.branchname' |
| 166 |
},{ |
| 167 |
'name': 'template_path', |
| 168 |
'value': 'members/tables/members_results.tt', |
| 169 |
}); |
| 170 |
$.ajax({ |
| 171 |
'dataType': 'json', |
| 172 |
'type': 'POST', |
| 173 |
'url': sSource, |
| 174 |
'data': aoData, |
| 175 |
'success': function(json){ |
| 176 |
// redirect if there is only 1 result. |
| 177 |
if ( json.aaData.length == 1 ) { |
| 178 |
var borrowernumber = json.aaData[0].borrowernumber; |
| 179 |
document.location.href="/cgi-bin/koha/members/moremember.pl?borrowernumber="+borrowernumber; |
| 180 |
return false; |
| 181 |
} |
| 182 |
fnCallback(json); |
| 44 |
} |
183 |
} |
| 45 |
}); |
184 |
}); |
|
|
185 |
}, |
| 186 |
'aoColumns':[ |
| 187 |
[% IF CAN_user_tools_manage_patron_lists %] |
| 188 |
{ 'mDataProp': 'dt_borrowernumber' }, |
| 189 |
[% END %] |
| 190 |
{ 'mDataProp': 'dt_cardnumber' }, |
| 191 |
{ 'mDataProp': 'dt_name' }, |
| 192 |
{ 'mDataProp': 'dt_category' }, |
| 193 |
{ 'mDataProp': 'dt_branch' }, |
| 194 |
{ 'mDataProp': 'dt_dateexpiry' }, |
| 195 |
{ 'mDataProp': 'dt_od_checkouts', 'bSortable': false }, |
| 196 |
{ 'mDataProp': 'dt_fines', 'bSortable': false }, |
| 197 |
{ 'mDataProp': 'dt_borrowernotes' }, |
| 198 |
{ 'mDataProp': 'dt_action', 'bSortable': false } |
| 199 |
], |
| 200 |
'fnRowCallback': function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { |
| 201 |
/* Center text for 6th column */ |
| 202 |
$("td:eq(5)", nRow).css("text-align", "center"); |
| 46 |
|
203 |
|
| 47 |
if ( exists ) { |
204 |
return nRow; |
| 48 |
alert( _("You already have a list with that name!") ); |
205 |
}, |
| 49 |
return false; |
206 |
'bFilter': false, |
| 50 |
} |
207 |
'bAutoWidth': false, |
|
|
208 |
[% IF orderby_cardnumber_0 %] |
| 209 |
'aaSorting': [[0, 'asc']], |
| 210 |
[% ELSE %] |
| 211 |
'aaSorting': [[1, 'asc']], |
| 212 |
[% END %] |
| 213 |
"aLengthMenu": [aLengthMenu, aLengthMenuLabel], |
| 214 |
'sPaginationType': 'full_numbers', |
| 215 |
"iDisplayLength": [% PatronsPerPage %], |
| 216 |
})); |
| 217 |
update_searched(); |
| 218 |
}); |
| 219 |
|
| 220 |
// Update the string "Results found ..." |
| 221 |
function update_searched(){ |
| 222 |
var searched = ""; |
| 223 |
searched += "on " + $("#searchfieldstype_filter").find("option:selected").text().toLowerCase() + " fields"; |
| 224 |
if ( $("#searchmember_filter").val() ) { |
| 225 |
if ( $("#searchtype_filter").val() == 'start_with' ) { |
| 226 |
searched += _(" starting with "); |
| 51 |
} else { |
227 |
} else { |
| 52 |
alert( _("You must give your new patron list a name!") ); |
228 |
searched += _(" containing "); |
| 53 |
return false; |
|
|
| 54 |
} |
229 |
} |
|
|
230 |
searched += $("#searchmember_filter").val(); |
| 231 |
} |
| 232 |
if ( $("#firstletter_filter").val() ) { |
| 233 |
searched += _(" begin with ") + $("#firstletter_filter").val(); |
| 234 |
} |
| 235 |
if ( $("#categorycode_filter").val() ) { |
| 236 |
searched += _(" with category ") + $("#categorycode_filter").find("option:selected").text(); |
| 237 |
} |
| 238 |
if ( $("#branchcode_filter").val() ) { |
| 239 |
searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text(); |
| 55 |
} |
240 |
} |
|
|
241 |
$("#searchpattern").text("for patron " + searched); |
| 242 |
} |
| 243 |
|
| 244 |
// Redraw the table |
| 245 |
function filter() { |
| 246 |
$("#firstletter_filter").val(''); |
| 247 |
update_searched(); |
| 248 |
search = 1; |
| 249 |
$("#searchresults").show(); |
| 250 |
dtMemberResults.fnDraw(); |
| 251 |
return false; |
| 252 |
} |
| 56 |
|
253 |
|
| 57 |
if ( $('#add_to_patron_list_which').val() == 'all' ) { |
254 |
// User has clicked on the Clear button |
| 58 |
return confirm( _("Are you sure you want to add the entire set of patron results to this list ( including results on other pages )?") ); |
255 |
function clearFilters(redraw) { |
| 59 |
} else { |
256 |
$("#searchform select").val(''); |
| 60 |
if ( $("#add-patrons-to-list-form input:checkbox:checked").length == 0 ) { |
257 |
$("#firstletter_filter").val(''); |
| 61 |
alert( _("You have not selected any patrons to add to a list!") ); |
258 |
$("#searchmember_filter").val(''); |
| 62 |
return false; |
259 |
if(redraw) { |
| 63 |
} |
260 |
search = 1; |
|
|
261 |
$("#searchresults").show(); |
| 262 |
dtMemberResults.fnDraw(); |
| 64 |
} |
263 |
} |
|
|
264 |
} |
| 65 |
|
265 |
|
| 66 |
return true; |
266 |
// User has clicked on a letter |
|
|
267 |
function filterByFirstLetterSurname(letter) { |
| 268 |
clearFilters(false); |
| 269 |
$("#firstletter_filter").val(letter); |
| 270 |
update_searched(); |
| 271 |
search = 1; |
| 272 |
$("#searchresults").show(); |
| 273 |
dtMemberResults.fnDraw(); |
| 67 |
} |
274 |
} |
| 68 |
//]]> |
275 |
//]]> |
| 69 |
</script> |
276 |
</script> |
| 70 |
|
|
|
| 71 |
</head> |
277 |
</head> |
| 72 |
<body id="pat_member" class="pat"> |
278 |
<body id="pat_member" class="pat"> |
| 73 |
[% INCLUDE 'header.inc' %] |
279 |
[% INCLUDE 'header.inc' %] |
|
Lines 75-237
function CheckForm() {
Link Here
|
| 75 |
|
281 |
|
| 76 |
<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> |
282 |
<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> |
| 77 |
|
283 |
|
| 78 |
<div id="doc2" class="yui-t7"> |
284 |
<div id="doc3" class="yui-t2"> |
|
|
285 |
<div id="bd"> |
| 286 |
<div id="yui-main"> |
| 287 |
<div class="yui-b"> |
| 288 |
<div class="yui-g"> |
| 289 |
[% IF CAN_user_tools_manage_patron_lists %] |
| 290 |
<div id="patron_list_dialog" class="dialog alert"> |
| 291 |
Added <span class="patrons-length"></span> patrons to <a></a>. |
| 292 |
</div> |
| 293 |
[% END %] |
| 79 |
|
294 |
|
| 80 |
<div id="bd"> |
295 |
[% INCLUDE 'patron-toolbar.inc' %] |
| 81 |
<div id="yui-main"> |
296 |
[% IF ( no_add ) %] |
| 82 |
<div class="yui-b"> |
297 |
<div class="dialog alert"> |
| 83 |
<div class="yui-g"> |
298 |
<h3>Cannot add patron</h3> |
|
|
299 |
[% IF ( no_branches ) %] |
| 300 |
<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> |
| 301 |
[% END %] |
| 302 |
[% IF ( no_categories ) %] |
| 303 |
<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> |
| 304 |
[% END %] |
| 305 |
</div> |
| 306 |
[% END %] |
| 307 |
<div class="browse"> |
| 308 |
Browse by last name: |
| 309 |
[% FOREACH letter IN alphabet.split(' ') %] |
| 310 |
<a style="cursor:pointer" onclick="filterByFirstLetterSurname('[% letter %]');">[% letter %]</a> |
| 311 |
[% END %] |
| 312 |
</div> |
| 84 |
|
313 |
|
| 85 |
[% IF patron_list %] |
314 |
[% IF ( CAN_user_borrowers && pending_borrower_modifications ) %] |
| 86 |
<div class="dialog alert"> |
315 |
<div class="pending-info" id="patron_updates_pending"> |
| 87 |
Added [% patrons_added_to_list.size %] patrons to <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% patron_list.patron_list_id %]">[% patron_list.name %]</a>. |
316 |
<a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>: |
| 88 |
</div> |
317 |
<span class="holdcount"><a href="/cgi-bin/koha/members/members-update.pl">[% pending_borrower_modifications %]</a></span> |
| 89 |
[% END %] |
318 |
</div> |
|
|
319 |
[% END %] |
| 320 |
|
| 321 |
<div id="searchresults"> |
| 322 |
<div id="searchheader"> |
| 323 |
<h3>Results found <span id="searchpattern">[% IF searchmember %] for '[% searchmember %]'[% END %]</span></h3> |
| 324 |
</div> |
| 325 |
[% IF CAN_user_tools_manage_patron_lists %] |
| 326 |
<div id="searchheader"> |
| 327 |
<div> |
| 328 |
<a href="javascript:void(0)" onclick="$('.selection').prop('checked', true)">Select all</a> |
| 329 |
| |
| 330 |
<a href="javascript:void(0)" onclick="$('.selection').prop('checked', false)">Clear all</a> |
| 331 |
| |
| 332 |
<span> |
| 333 |
Add selected patrons |
| 334 |
<label for="add_to_patron_list">to:</label> |
| 335 |
<select id="add_to_patron_list" name="add_to_patron_list"> |
| 336 |
<option value=""></option> |
| 337 |
[% IF patron_lists %] |
| 338 |
<optgroup label="Patron lists:"> |
| 339 |
[% FOREACH pl IN patron_lists %] |
| 340 |
<option value="[% pl.patron_list_id %]">[% pl.name %]</option> |
| 341 |
[% END %] |
| 342 |
</optgroup> |
| 343 |
[% END %] |
| 344 |
|
| 345 |
<option value="new">[ New list ]</option> |
| 346 |
</select> |
| 347 |
|
| 348 |
<input type="text" id="new_patron_list" name="new_patron_list" id="new_patron_list" /> |
| 90 |
|
349 |
|
| 91 |
[% INCLUDE 'patron-toolbar.inc' %] |
350 |
<input id="add_to_patron_list_submit" type="submit" class="submit" value="Save"> |
| 92 |
|
351 |
</span> |
| 93 |
[% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3> |
352 |
</div> |
| 94 |
[% 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 %] |
353 |
</div> |
| 95 |
[% 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> |
354 |
[% END %] |
| 96 |
[% END %] |
|
|
| 97 |
|
| 98 |
<div class="browse"> |
| 99 |
Browse by last name: |
| 100 |
[% FOREACH letter IN alphabet.split(' ') %] |
| 101 |
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&surname=[% letter %]">[% letter %]</a> |
| 102 |
[% END %] |
| 103 |
</div> |
| 104 |
|
| 105 |
[% IF ( CAN_user_borrowers && pending_borrower_modifications ) %] |
| 106 |
<div class="pending-info" id="patron_updates_pending"> |
| 107 |
<a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>: |
| 108 |
<span class="holdcount"><a href="/cgi-bin/koha/members/members-update.pl">[% pending_borrower_modifications %]</a></span> |
| 109 |
</div> |
| 110 |
[% END %] |
| 111 |
|
| 112 |
[% IF ( resultsloop ) %] |
| 113 |
[% IF (CAN_user_tools_manage_patron_lists) %] |
| 114 |
<form id="add-patrons-to-list-form" method="post" action="member.pl" onsubmit="return CheckForm()"> |
| 115 |
[% END %] |
| 116 |
<div id="searchheader"> |
| 117 |
<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> |
| 118 |
|
| 119 |
[% IF (CAN_user_tools_manage_patron_lists) %] |
| 120 |
<div> |
| 121 |
<a href="javascript:void(0)" onclick="$('.selection').prop('checked', true)">Select all</a> |
| 122 |
| |
| 123 |
<a href="javascript:void(0)" onclick="$('.selection').prop('checked', false)">Clear all</a> |
| 124 |
| |
| 125 |
<span> |
| 126 |
<label for="add_to_patron_list_which">Add:</label> |
| 127 |
<select id="add_to_patron_list_which" name="add_to_patron_list_which"> |
| 128 |
<option value="selected">Selected patrons</option> |
| 129 |
<option value="all">All resultant patrons</option> |
| 130 |
</select> |
| 131 |
|
| 132 |
<label for="add_to_patron_list">to:</label> |
| 133 |
<select id="add_to_patron_list" name="add_to_patron_list"> |
| 134 |
<option value=""></option> |
| 135 |
[% IF patron_lists %] |
| 136 |
<optgroup label="Patron lists:"> |
| 137 |
[% FOREACH pl IN patron_lists %] |
| 138 |
<option value="[% pl.patron_list_id %]">[% pl.name %]</option> |
| 139 |
[% END %] |
| 140 |
</optgroup> |
| 141 |
[% END %] |
| 142 |
|
| 143 |
<option value="new">[ New list ]</option> |
| 144 |
</select> |
| 145 |
|
| 146 |
<input type="text" id="new_patron_list" name="new_patron_list" id="new_patron_list" /> |
| 147 |
|
| 148 |
[% FOREACH key IN search_parameters.keys %] |
| 149 |
<input type="hidden" name="[% key %]" value="[% search_parameters.$key %]" /> |
| 150 |
[% END %] |
| 151 |
|
| 152 |
<input id="add_to_patron_list_submit" type="submit" class="submit" value="Save"> |
| 153 |
</span> |
| 154 |
</div> |
| 155 |
[% END %] |
| 156 |
</div> |
| 157 |
<div class="searchresults"> |
| 158 |
|
| 159 |
<table id="memberresultst"> |
| 160 |
<thead> |
| 161 |
<tr> |
| 162 |
[% IF (CAN_user_tools_manage_patron_lists) %] |
| 163 |
<th> </th> |
| 164 |
[% END %] |
| 165 |
<th>Card</th> |
| 166 |
<th>Name</th> |
| 167 |
<th>Cat</th> |
| 168 |
<th>Library</th> |
| 169 |
<th>Expires on</th> |
| 170 |
<th>OD/Checkouts</th> |
| 171 |
<th>Fines</th> |
| 172 |
<th>Circ note</th> |
| 173 |
<th> </th> |
| 174 |
</tr> |
| 175 |
</thead> |
| 176 |
<tbody> |
| 177 |
[% FOREACH resultsloo IN resultsloop %] |
| 178 |
[% IF ( resultsloo.overdue ) %] |
| 179 |
<tr class="problem"> |
| 180 |
[% ELSE %] |
| 181 |
[% UNLESS ( loop.odd ) %] |
| 182 |
<tr class="highlight"> |
| 183 |
[% ELSE %] |
| 184 |
<tr> |
| 185 |
[% END %] |
| 186 |
[% END %] |
| 187 |
[% IF (CAN_user_tools_manage_patron_lists) %] |
| 188 |
<td><input type="checkbox" class="selection" name="borrowernumber" value="[% resultsloo.borrowernumber %]" /></td> |
| 189 |
[% END %] |
| 190 |
<td>[% resultsloo.cardnumber %]</td> |
| 191 |
<td style="white-space: nowrap;"> |
| 192 |
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resultsloo.borrowernumber %]"> |
| 193 |
[% 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%] |
| 194 |
</a> <br /> |
| 195 |
[% 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 %] |
| 196 |
[% IF (resultsloo.email ) %]<br/>Email: <a href="mailto:[% resultsloo.email %]">[% resultsloo.email %]</a>[% END %] |
| 197 |
</td> |
| 198 |
<td>[% resultsloo.category_description %] ([% resultsloo.category_type %])</td> |
| 199 |
<td>[% resultsloo.branchname %]</td> |
| 200 |
<td>[% resultsloo.dateexpiry %]</td> |
| 201 |
<td>[% IF ( resultsloo.overdues ) %]<span class="overdue"><strong>[% resultsloo.overdues %]</strong></span>[% ELSE %][% resultsloo.overdues %][% END %]/[% resultsloo.issues %]</td> |
| 202 |
<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> |
| 203 |
<td>[% resultsloo.borrowernotes %]</td> |
| 204 |
<td>[% IF ( resultsloo.category_type ) %] |
| 205 |
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% resultsloo.borrowernumber %]&category_type=[% resultsloo.category_type %]">Edit</a> |
| 206 |
[% ELSE %] <!-- try with categorycode if no category_type --> |
| 207 |
[% IF ( resultsloo.categorycode ) %] |
| 208 |
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% resultsloo.borrowernumber %]&categorycode=[% resultsloo.categorycode %]">Edit</a> |
| 209 |
[% ELSE %] <!-- if no categorycode, set category_type to A by default --> |
| 210 |
<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% resultsloo.borrowernumber %]&category_type=A">Edit</a> |
| 211 |
[% END %] |
| 212 |
[% END %]</td> |
| 213 |
</tr> |
| 214 |
[% END %] |
| 215 |
</tbody> |
| 216 |
</table> |
| 217 |
<div class="pages">[% IF ( multipage ) %][% paginationbar %][% END %]</div> |
| 218 |
</div> |
| 219 |
[% IF (CAN_user_tools_manage_patron_lists) %] |
| 220 |
</form> |
| 221 |
[% END %] |
| 222 |
[% ELSE %] |
| 223 |
[% IF ( searching ) %] |
| 224 |
<div class="dialog alert">No results found</div> |
| 225 |
[% END %] |
| 226 |
[% END %] |
| 227 |
|
| 228 |
</div> |
| 229 |
</div> |
| 230 |
|
| 231 |
<div class="yui-g"> |
| 232 |
[% INCLUDE 'members-menu.inc' %] |
| 233 |
</div> |
| 234 |
|
355 |
|
|
|
356 |
<table id="memberresultst"> |
| 357 |
<thead> |
| 358 |
<tr> |
| 359 |
<th> </th> |
| 360 |
<th>Card</th> |
| 361 |
<th>Name</th> |
| 362 |
<th>Category</th> |
| 363 |
<th>Library</th> |
| 364 |
<th>Expires on</th> |
| 365 |
<th>OD/Checkouts</th> |
| 366 |
<th>Fines</th> |
| 367 |
<th>Circ note</th> |
| 368 |
<th> </th> |
| 369 |
</tr> |
| 370 |
</thead> |
| 371 |
<tbody></tbody> |
| 372 |
</table> |
| 373 |
</div> |
| 374 |
</div> |
| 375 |
</div> |
| 376 |
</div> |
| 377 |
<div class="yui-b"> |
| 378 |
<form onsubmit="return filter();" id="searchform"> |
| 379 |
<input type="hidden" id="firstletter_filter" value="" /> |
| 380 |
<fieldset class="brief"> |
| 381 |
<h3>Filters</h3> |
| 382 |
<ol> |
| 383 |
<li> |
| 384 |
<label for="searchmember_filter">Search:</label> |
| 385 |
<input type="text" id="searchmember_filter" value="[% searchmember %]"/> |
| 386 |
</li> |
| 387 |
<li> |
| 388 |
<label for="searchfieldstype_filter">Search fields:</label> |
| 389 |
<select name="searchfieldstype" id="searchfieldstype_filter"> |
| 390 |
[% IF searchfieldstype == "standard" %] |
| 391 |
<option selected="selected" value='standard'>Standard</option> |
| 392 |
[% ELSE %] |
| 393 |
<option value='standard'>Standard</option> |
| 394 |
[% END %] |
| 395 |
[% IF searchfieldstype == "email" %] |
| 396 |
<option selected="selected" value='email'>Email</option> |
| 397 |
[% ELSE %] |
| 398 |
<option value='email'>Email</option> |
| 399 |
[% END %] |
| 400 |
[% IF searchfieldstype == "borrowernumber" %] |
| 401 |
<option selected="selected" value='borrowernumber'>Borrower number</option> |
| 402 |
[% ELSE %] |
| 403 |
<option value='borrowernumber'>Borrower number</option> |
| 404 |
[% END %] |
| 405 |
[% IF searchfieldstype == "phone" %] |
| 406 |
<option selected="selected" value='phone'>Phone number</option> |
| 407 |
[% ELSE %] |
| 408 |
<option value='phone'>Phone number</option> |
| 409 |
[% END %] |
| 410 |
[% IF searchfieldstype == "address" %] |
| 411 |
<option selected="selected" value='address'>Street address</option> |
| 412 |
[% ELSE %] |
| 413 |
<option value='address'>Street address</option> |
| 414 |
[% END %] |
| 415 |
[% IF searchfieldstype == "dateofbirth" %] |
| 416 |
<option selected="selected" value='dateofbirth'>Date of birth</option> |
| 417 |
[% ELSE %] |
| 418 |
<option value='dateofbirth'>Date of birth</option> |
| 419 |
[% END %] |
| 420 |
[% IF searchfieldstype == "sort1" %] |
| 421 |
<option selected="selected" value='sort1'>Sort field 1</option> |
| 422 |
[% ELSE %] |
| 423 |
<option value='sort1'>Sort field 1</option> |
| 424 |
[% END %] |
| 425 |
[% IF searchfieldstype == "sort2" %] |
| 426 |
<option selected="selected" value='sort2'>Sort field 2</option> |
| 427 |
[% ELSE %] |
| 428 |
<option value='sort2'>Sort field 2</option> |
| 429 |
[% END %] |
| 430 |
</select> |
| 431 |
</li> |
| 432 |
<li> |
| 433 |
<label for="searchtype_filter">Search type:</label> |
| 434 |
<select name="searchtype" id="searchtype_filter"> |
| 435 |
<option value='start_with'>Starts with</option> |
| 436 |
[% IF searchtype == "contain" %] |
| 437 |
<option value="contain" selected="selected">Contains</option> |
| 438 |
[% ELSE %] |
| 439 |
<option value="contain" selected="selected">Contains</option> |
| 440 |
[% END %] |
| 441 |
</select> |
| 442 |
</li> |
| 443 |
<li> |
| 444 |
<label for="categorycode_filter">Category:</label> |
| 445 |
<select id="categorycode_filter"> |
| 446 |
<option value="">Any</option> |
| 447 |
[% FOREACH cat IN categories %] |
| 448 |
[% IF cat.selected %] |
| 449 |
<option selected="selected" value="[% cat.categorycode %]">[% cat.description %]</option> |
| 450 |
[% ELSE %] |
| 451 |
<option value="[% cat.categorycode %]">[% cat.description %]</option> |
| 452 |
[% END %] |
| 453 |
[% END %] |
| 454 |
</select> |
| 455 |
</li> |
| 456 |
<li> |
| 457 |
<label for="branchcode_filter">Branch:</label> |
| 458 |
<select id="branchcode_filter"> |
| 459 |
[% IF branchloop.size != 1 %] |
| 460 |
<option value="">Any</option> |
| 461 |
[% END %] |
| 462 |
[% FOREACH b IN branchloop %] |
| 463 |
[% IF b.selected %] |
| 464 |
<option selected="selected" value="[% b.branchcode %]">[% b.branchname %]</option> |
| 465 |
[% ELSE %] |
| 466 |
<option value="[% b.branchcode %]">[% b.branchname %]</option> |
| 467 |
[% END %] |
| 468 |
[% END %] |
| 469 |
</select> |
| 470 |
</li> |
| 471 |
</ol> |
| 472 |
<fieldset class="action"> |
| 473 |
<input type="submit" value="Search" /> |
| 474 |
<input type="button" value="Clear" onclick="clearFilters(true);" /> |
| 475 |
</fieldset> |
| 476 |
</fieldset> |
| 477 |
</form> |
| 235 |
</div> |
478 |
</div> |
|
|
479 |
</div> |
| 480 |
<div class="yui-g"> |
| 481 |
[% INCLUDE 'members-menu.inc' %] |
| 482 |
</div> |
| 236 |
</div> |
483 |
</div> |
| 237 |
[% INCLUDE 'intranet-bottom.inc' %] |
484 |
[% INCLUDE 'intranet-bottom.inc' %] |