Lines 8-22
Link Here
|
8 |
<script type="text/javascript"> |
8 |
<script type="text/javascript"> |
9 |
//<![CDATA[ |
9 |
//<![CDATA[ |
10 |
|
10 |
|
|
|
11 |
var search = 1; |
11 |
$(document).ready(function(){ |
12 |
$(document).ready(function(){ |
12 |
$("#info").hide(); |
13 |
$("#info").hide(); |
13 |
$("#error").hide(); |
14 |
$("#error").hide(); |
|
|
15 |
|
16 |
[% IF view != "show_results" %] |
17 |
$("#searchresults").hide(); |
18 |
search = 0; |
19 |
[% END %] |
20 |
|
21 |
$("#searchmember_filter").on('keyup', function(){ |
22 |
filter(); |
23 |
}); |
14 |
// Apply DataTables on the results table |
24 |
// Apply DataTables on the results table |
15 |
dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, { |
25 |
dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, { |
16 |
'bServerSide': true, |
26 |
'bServerSide': true, |
17 |
'sAjaxSource': "/cgi-bin/koha/svc/members/search", |
27 |
'sAjaxSource': "/cgi-bin/koha/svc/members/search", |
18 |
'fnServerData': function(sSource, aoData, fnCallback) { |
28 |
'fnServerData': function(sSource, aoData, fnCallback) { |
|
|
29 |
if ( ! search ) { |
30 |
return; |
31 |
} |
19 |
aoData.push({ |
32 |
aoData.push({ |
|
|
33 |
'name': 'searchmember', |
34 |
'value': $("#searchmember_filter").val() |
35 |
}, |
36 |
{ |
20 |
'name': 'template_path', |
37 |
'name': 'template_path', |
21 |
'value': 'acqui/tables/members_results.tt', |
38 |
'value': 'acqui/tables/members_results.tt', |
22 |
} |
39 |
} |
Lines 50-62
$(document).ready(function(){
Link Here
|
50 |
[% ELSE %] |
67 |
[% ELSE %] |
51 |
'sPaginationType': 'full_numbers', |
68 |
'sPaginationType': 'full_numbers', |
52 |
"iDisplayLength": [% Koha.Preference('PatronsPerPage') %], |
69 |
"iDisplayLength": [% Koha.Preference('PatronsPerPage') %], |
53 |
"bProcessing": true, |
|
|
54 |
[% END %] |
70 |
[% END %] |
|
|
71 |
'bFilter': false, |
55 |
'bProcessing': true, |
72 |
'bProcessing': true, |
56 |
})); |
73 |
})); |
57 |
dtMemberResults.fnAddFilters("filter", 750); |
74 |
dtMemberResults.fnAddFilters("filter", 750); |
58 |
}); |
75 |
}); |
59 |
|
76 |
|
|
|
77 |
var delay = (function(){ |
78 |
var timer = 0; |
79 |
return function(callback, ms){ |
80 |
clearTimeout (timer); |
81 |
timer = setTimeout(callback, ms); |
82 |
}; |
83 |
})(); |
84 |
|
85 |
function filter() { |
86 |
search = 1; |
87 |
|
88 |
$("#searchresults").show(); |
89 |
|
90 |
if ( $("#searchmember_filter").val().length > 0 ) { |
91 |
delay(function(){ |
92 |
dtMemberResults.fnDraw(); |
93 |
}, 1000); |
94 |
} |
95 |
|
96 |
return false; |
97 |
} |
98 |
|
60 |
// modify parent window owner element |
99 |
// modify parent window owner element |
61 |
function add_user(borrowernumber, borrowername) { |
100 |
function add_user(borrowernumber, borrowername) { |
62 |
var p = window.opener; |
101 |
var p = window.opener; |
Lines 81-86
$(document).ready(function(){
Link Here
|
81 |
<div class="yui-g"> |
120 |
<div class="yui-g"> |
82 |
|
121 |
|
83 |
<h3>Search for patron</h3> |
122 |
<h3>Search for patron</h3> |
|
|
123 |
|
124 |
<label for="searchmember_filter">Search:</label> |
125 |
<input type="text" id="searchmember_filter" value="[% searchmember %]"/> |
126 |
|
84 |
[% IF patrons_with_acq_perm_only %] |
127 |
[% IF patrons_with_acq_perm_only %] |
85 |
<div class="hint">Only staff with superlibrarian or acquisitions permissions (or order_manage permission if granular permissions are enabled) are returned in the search results</div> |
128 |
<div class="hint">Only staff with superlibrarian or acquisitions permissions (or order_manage permission if granular permissions are enabled) are returned in the search results</div> |
86 |
[% END %] |
129 |
[% END %] |
Lines 88-105
$(document).ready(function(){
Link Here
|
88 |
<div id="info" class="dialog message"></div> |
131 |
<div id="info" class="dialog message"></div> |
89 |
<div id="error" class="dialog alert"></div> |
132 |
<div id="error" class="dialog alert"></div> |
90 |
|
133 |
|
91 |
<table id="memberresultst"> |
134 |
<div id="searchresults"> |
92 |
<thead> |
135 |
<table id="memberresultst"> |
93 |
<tr> |
136 |
<thead> |
94 |
<th>Card</th> |
137 |
<tr> |
95 |
<th>Name</th> |
138 |
<th>Card</th> |
96 |
<th>Library</th> |
139 |
<th>Name</th> |
97 |
<th>Category</th> |
140 |
<th>Library</th> |
98 |
<th> </th> |
141 |
<th>Category</th> |
99 |
</tr> |
142 |
<th> </th> |
100 |
</thead> |
143 |
</tr> |
101 |
<tbody></tbody> |
144 |
</thead> |
102 |
</table> |
145 |
<tbody></tbody> |
|
|
146 |
</table> |
147 |
</div> |
103 |
|
148 |
|
104 |
<div id="closewindow"><a href="#" class="close">Close</a></div> |
149 |
<div id="closewindow"><a href="#" class="close">Close</a></div> |
105 |
</div> |
150 |
</div> |
106 |
- |
|
|