Bug 30098: Only redirect from patron search if single result is on first page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / member.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE TablesSettings %]
5 [% USE Branches %]
6 [% USE Categories %]
7 [% SET footerjs = 1 %]
8 [% PROCESS 'patronfields.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Patrons[% IF ( searching ) %] &rsaquo; Search results[% END %] &rsaquo; Koha</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="pat_member" class="pat">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'patron-search.inc' %]
17
18 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
19     <ol>
20         <li>
21             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22         </li>
23         [% IF ( searching ) %]
24             <li>
25                 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
26             </li>
27             <li>
28                 <a href="#" aria-current="page">
29                     Search results
30                 </a>
31             </li>
32         [% ELSE %]
33             <li>
34                 <a href="#" aria-current="page">
35                     Patrons
36                 </a>
37             </li>
38         [% END %]
39     </ol>
40 </nav>
41
42 <div class="main container-fluid">
43     <div class="row">
44         <div class="col-sm-10 col-sm-push-2">
45             <main>
46
47           [% IF CAN_user_tools_manage_patron_lists %]
48             <div id="patron_list_dialog" class="dialog message">
49               Added <span class="patrons-length"></span> patrons to <a></a>.
50             </div>
51           [% END %]
52
53           [% INCLUDE 'patron-toolbar.inc' %]
54           [% INCLUDE 'noadd-warnings.inc' %]
55
56           <div class="browse">
57             Browse by last name:
58             [% FOREACH letter IN alphabet.split(' ') %]
59                 <a href="#" class="filterByLetter">[% letter | html %]</a>
60             [% END %]
61           </div>
62
63           [% IF CAN_user_borrowers_edit_borrowers && pending_borrower_modifications %]
64             <div class="pending-info" id="patron_updates_pending">
65               <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
66               <span class="number_box"><a href="/cgi-bin/koha/members/members-update.pl">[% pending_borrower_modifications | html %]</a></span>
67             </div>
68           [% END %]
69
70           <div id="searchresults">
71             <h3>Patrons found for: <span id="searchpattern">[% IF searchmember %] for '[% searchmember | html %]'[% END %]</span></h3>
72             [% IF CAN_user_tools_manage_patron_lists || CAN_user_borrowers_edit_borrowers %]
73               <div class="searchheader fh-fixedHeader" id="searchheader">
74                   <div>
75                       <a href="#" class="btn btn-link" id="select_all"><i class="fa fa-check"></i> Select all</a>
76                       |
77                       <a href="#" class="btn btn-link" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
78                     [% IF CAN_user_tools_manage_patron_lists %]
79
80                     [% END %]
81
82                     [% IF CAN_user_tools_manage_patron_lists %]
83                         <div id="patronlist-dropdown" class="btn-group">
84                             <button id="patronlist-menu" type="button" class="btn btn-sm btn-default dropdown-toggle patron-edits disabled" disabled="disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
85                                 Add to patron list <span class="caret"></span>
86                             </button>
87                             <ul class="dropdown-menu">
88                                 [% IF patron_lists %]
89                                     [% FOREACH pl IN patron_lists %]
90                                         <li><a href="#" class="patron-list-add" data-listid="[% pl.patron_list_id | html %]">[% pl.name | html %]</a></li>
91                                     [% END %]
92                                 [% END %]
93                                 <li role="separator" class="divider"></li>
94                                 <li><a href="#" class="patron-list-add" data-listid="new">New list</a></li>
95                             </ul>
96                         </div>
97                     [% END %]
98
99                     [% IF CAN_user_borrowers_edit_borrowers %]
100                           <button id="merge-patrons" class="btn btn-sm btn-default disabled" disabled="disabled" type="submit"><i class="fa fa-compress" aria-hidden="true"></i> Merge selected patrons</button>
101                     [% END %]
102                   </div>
103                 </div>
104             [% END %]
105
106             <table id="memberresultst">
107               <thead>
108                 <tr>
109                 [% IF CAN_user_borrowers_edit_borrowers || CAN_user_tools_manage_patron_lists %]
110                   <th class="noExport">&nbsp;</th>
111                 [% END %]
112                   <th>Card</th>
113                   <th>Name</th>
114                   <th>Date of birth</th>
115                   <th>Category</th>
116                   <th>Library</th>
117                   <th>Expires on</th>
118                   <th>OD/Checkouts</th>
119                   <th>Fines</th>
120                   <th>Circ note</th>
121                   <th class="noExport">&nbsp;</th>
122                 </tr>
123               </thead>
124               <tbody></tbody>
125             </table>
126           </div>
127
128             </main>
129         </div> <!-- /.col-sm-10.col-sm-push-2 -->
130
131         <div class="col-sm-2 col-sm-pull-10">
132             <aside>
133                 <form method="get" id="searchform">
134                   <input type="hidden" id="firstletter_filter" value="" />
135                   <fieldset class="brief">
136                     <h3>Search patrons</h3>
137                     <ol>
138                       <li>
139                         <label for="searchmember_filter">Search for:</label>
140                         <input type="text" id="searchmember_filter" value="[% searchmember | html %]"/>
141                       </li>
142                       <li>
143                         <label for="searchfieldstype_filter">Search field:</label>
144                         <select name="searchfieldstype" id="searchfieldstype_filter">
145                             [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %]
146                             [% default_fields = [ 'standard', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
147                             [% search_options = default_fields.merge(pref_fields).unique %]
148                             [% FOREACH s_o IN search_options %]
149                                 [% display_name = PROCESS patron_fields name=s_o %]
150                                 [% NEXT IF !display_name %]
151                                 [% IF searchfieldstype == s_o %]
152                                     <option selected="selected" value=[% s_o | html %]>[% display_name | $raw %]</option>
153                                 [% ELSE %]
154                                     <option value=[% s_o | html %]>[% display_name | $raw %]</option>
155                                 [% END %]
156                             [% END %]
157                         </select>
158                       </li>
159                       <li>
160                         <label for="searchtype_filter">Search type:</label>
161                         <select name="searchtype" id="searchtype_filter">
162                           [% IF searchtype == "start_with" %]
163                             <option value='start_with' selected="selected">Starts with</option>
164                             <option value="contain">Contains</option>
165                           [% ELSE %]
166                             <option value='start_with'>Starts with</option>
167                             <option value="contain" selected="selected">Contains</option>
168                           [% END %]
169                         </select>
170                       </li>
171                       <li>
172                         <label for="categorycode_filter">Patron category:</label>
173                         [% SET categories = Categories.all() %]
174                         <select id="categorycode_filter">
175                           <option value="">Any</option>
176                           [% FOREACH cat IN categories %]
177                             [% IF cat.categorycode == categorycode_filter %]
178                     <option selected="selected" value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
179                             [% ELSE %]
180                     <option value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
181
182                             [% END %]
183                           [% END %]
184                         </select>
185                       </li>
186                       <li>
187                         <label for="branchcode_filter">Library:</label>
188                         [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
189                         <select id="branchcode_filter">
190                           [% IF branches.size != 1 %]
191                             <option value="">Any</option>
192                           [% END %]
193                           [% PROCESS options_for_libraries libraries => branches %]
194                         </select>
195                       </li>
196                     </ol>
197                     <fieldset class="action">
198                       <input type="submit" value="Search" />
199                       <input type="button" value="Clear" id="clear_search" />
200                     </fieldset>
201                   </fieldset>
202                 </form>
203             </aside>
204         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
205     </div> <!-- /.row -->
206
207     <!-- New Patron List Modal -->
208     <div class="modal" id="new-patron-list" tabindex="-1" role="dialog" aria-labelledby="new-patron-listLabel">
209         <div class="modal-dialog" role="document">
210             <div class="modal-content">
211                 <div class="modal-header">
212                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
213                     <h4 class="modal-title" id="new-patron-listLabel">Add patrons to a new patron list</h4>
214                 </div>
215                 <form id="new-patron-list_form">
216                     <div class="modal-body">
217                         <div class="form-group">
218                             <label for="new_patron_list" class="required">Patron list name: </label>
219                             <input class="form-control required" type="text" name="new_patron_list" id="new_patron_list" required="required" />
220                             <input type="hidden" name="add_to_patron_list" id="add_to_patron_list" />
221                             <span class="required">Required</span>
222                         </div>
223                     </div> <!-- /.modal-body -->
224                     <div class="modal-footer">
225                         <button type="submit" id="add_to_patron_list_submit" class="btn btn-default approve">Submit</button>
226                         <button type="button" class="btn btn-default deny" data-dismiss="modal">Cancel</button>
227                     </div> <!-- /.modal-footer -->
228                 </form> <!-- /#new-patron-list_form -->
229             </div> <!-- /.modal-content -->
230         </div> <!-- /.modal-dialog -->
231     </div> <!-- /#new-patron-list -->
232
233 [% MACRO jsinclude BLOCK %]
234     [% INCLUDE 'datatables.inc' %]
235     [% INCLUDE 'columns_settings.inc' %]
236     [% INCLUDE 'str/members-menu.inc' %]
237     [% Asset.js("lib/hc-sticky.js") | $raw %]
238     [% Asset.js("js/members-menu.js") | $raw %]
239     <script>
240         var singleBranchMode = '[% singleBranchMode | html %]';
241         var dtMemberResults;
242         var search = 1;
243         /* popstate event triggered by forward and back button. Need to refresh search */
244         window.addEventListener('popstate', (event) => {
245             getSearchByLocation( false );
246         });
247
248         $(document).ready(function() {
249             $('#merge-patrons').prop('disabled', true);
250             $('#memberresultst').on('change', 'input.selection', function() {
251                 if ( $('.selection:checked').length > 1 ) {
252                     /* More than one checkbox has been checked */
253                     $('#merge-patrons').prop('disabled', false).removeClass("disabled");
254                     $("#patronlist-menu").removeClass("disabled").prop("disabled", false);
255                 } else if ( $('.selection:checked').length == 1 ) {
256                     /* At least one checkbox has been checked */
257                     $('#merge-patrons').prop('disabled', true).addClass("disabled");
258                     $("#patronlist-menu").removeClass("disabled").prop("disabled", false);
259                 } else {
260                     /* No checkbox has been checked */
261                     $('#merge-patrons').prop('disabled', true).addClass("disabled");
262                     $("#patronlist-menu").addClass("disabled").prop("disabled", true);
263                 }
264             });
265
266             $('#merge-patrons').on('click', function() {
267                 var merge_patrons_url = 'merge-patrons.pl?' + $('.selection:checked')
268                     .map(function() {
269                        return "id=" + $(this).val()
270                     }).get().join('&');
271                 window.location.href = merge_patrons_url;
272             });
273
274             $("#patronlist-dropdown").on("click", ".patron-list-add", function(e){
275                 e.preventDefault();
276
277                 if ( $("#memberresultst input:checkbox:checked").length == 0 ) {
278                     alert( _("You have not selected any patrons to add to a list!") );
279                     $(".btn-group").removeClass("open"); /* Close button menu */
280                     return false;
281                 }
282
283                 var listid = $(this).data("listid");
284                 $("#add_to_patron_list").val( listid );
285                 if( listid == "new" ){
286                     /* #add_to_patron_list value "new" in the modal form will tell API to create a new list */
287                     $("#new-patron-list").modal("show");
288                 } else {
289                     /* Ajax submit the patrons to list */
290
291                     patronListAdd();
292                 }
293             })
294
295             /* Submit selected patrons to a list via AJAX */
296             $("#new-patron-list_form").on('submit', function(e){
297                 e.preventDefault();
298                 /* Upon submitting modal patron list add form... */
299                 if ( $('#new_patron_list').val() ) {
300                     $(".patron-list-add").each(function() {
301                         /* Check each list name in the menu of patron lists */
302                         /* If submitted list name matches... */
303                         if ( $(this).text() == $('#new_patron_list').val() ) {
304                             alert( _("You already have a list with that name!") );
305                             return false;
306                         }
307                     });
308                 } else {
309                     alert( _("You must give your new patron list a name!") );
310                     return false;
311                 }
312                 $("#new-patron-list").modal("hide");
313                 patronListAdd();
314             });
315
316             $(".filterByLetter").on("click",function(e){
317                 e.preventDefault();
318                 filterByFirstLetterSurname( $(this).text(), true );
319             });
320             $("#select_all").on("click",function(e){
321                 e.preventDefault();
322                 $(".selection").prop("checked", true).change();
323             });
324             $("#clear_all").on("click",function(e){
325                 e.preventDefault();
326                 $(".selection").prop("checked", false).change();
327             });
328             $("#clear_search").on("click",function(e){
329                 e.preventDefault();
330                 clearFilters(true);
331             });
332             $("#searchform").on("submit", filter);
333
334             [% IF searchmember %]
335                 $("#searchmember_filter").val("[% searchmember | html %]");
336             [% END %]
337             [% IF searchfieldstype %]
338                 $("searchfieldstype_filter").val("[% searchfieldstype | html %]");
339             [% END %]
340             [% IF searchtype %]
341                 $("#searchtype_filter").val("[% searchtype | html %]");
342             [% END %]
343             [% IF categorycode %]
344                 $("#categorycode_filter").val("[% categorycode_filter | html %]");
345             [% END %]
346             [% IF branchcode %]
347                 $("#branchcode_filter").val("[% branchcode_filter | html %]");
348             [% END %]
349
350             [% IF view != "show_results" %]
351                 search = 0;
352             [% ELSE %]
353                 $("#searchresults").show();
354             [% END %]
355
356             // Build the aLengthMenu
357             var aLengthMenu = [
358                 [% PatronsPerPage | html %], 10, 20, 50, 100, -1
359             ];
360             jQuery.unique(aLengthMenu);
361             aLengthMenu.sort(function( a, b ){
362                 // Put "All" at the end
363                 if ( a == -1 ) {
364                     return 1;
365                 } else if ( b == -1 ) {
366                     return -1;
367                 }
368                 return parseInt(a) < parseInt(b) ? -1 : 1;}
369             );
370             var aLengthMenuLabel = [];
371             $(aLengthMenu).each(function(){
372                 if ( this == -1 ) {
373                     // Label for -1 is "All"
374                     aLengthMenuLabel.push(_("All"));
375                 } else {
376                     aLengthMenuLabel.push(this);
377                 }
378             });
379
380             // Apply DataTables on the results table
381             var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %];
382             [% UNLESS CAN_user_borrowers_edit_borrowers OR CAN_user_tools_manage_patron_lists %]
383                 [%# Remove the first column if we do not display the checkbox %]
384                 columns_settings.splice(0, 1);
385             [% END %]
386             dtMemberResults = KohaTable("memberresultst", {
387                 'bServerSide': true,
388                 'sAjaxSource': "/cgi-bin/koha/svc/members/search",
389                 'fnServerData': function(sSource, aoData, fnCallback) {
390                     if ( ! search ) {
391                         return;
392                     }
393                     aoData.push({
394                         'name': 'searchmember',
395                         'value': $("#searchmember_filter").val()
396                     },{
397                         'name': 'firstletter',
398                         'value': $("#firstletter_filter").val()
399                     },{
400                         'name': 'searchfieldstype',
401                         'value': $("#searchfieldstype_filter").val()
402                     },{
403                         'name': 'searchtype',
404                         'value': $("#searchtype_filter").val()
405                     },{
406                         'name': 'categorycode',
407                         'value': $("#categorycode_filter").val()
408                     },{
409                         'name': 'branchcode',
410                         'value': $("#branchcode_filter").val()
411                     },{
412                         'name': 'name_sorton',
413                         'value': 'borrowers.surname borrowers.firstname'
414                     },{
415                         'name': 'cardnumber_sorton',
416                         'value': 'borrowers.cardnumber',
417                     },{
418                         'name': 'dateofbirth_sorton',
419                         'value': 'borrowers.dateofbirth',
420                     },{
421                         'name': 'dateexpiry_sorton',
422                         'value': 'borrowers.dateexpiry',
423                     },{
424                         'name': 'category_sorton',
425                         'value': 'categories.description',
426                     },{
427                         'name': 'branch_sorton',
428                         'value': 'branches.branchname'
429                     },{
430                         'name': 'borrowernotes_sorton',
431                         'value': 'borrowers.borrowernotes'
432                     },{
433                         'name': 'template_path',
434                         'value': 'members/tables/members_results.tt',
435                     });
436                     $.ajax({
437                         'dataType': 'json',
438                         'type': 'POST',
439                         'url': sSource,
440                         'data': aoData,
441                         'success': function(json){
442                             // redirect if there is only 1 result.
443                             if ( json.aaData.length == 1 && aoData.iDisplayStart == 0 ) {
444                                 var borrowernumber = json.aaData[0].borrowernumber;
445                                 /* Overwrite history state of firstletter search since only one result was returned; This prevents a loop upon clicking back */
446                                 history.replaceState( {}, null, window.location.href.split("?" )[0]);
447                                 [% IF circsearch == 1 %]
448                                     [% SET redirect = "circ/circulation" %]
449                                 [% ELSE %]
450                                     [% SET redirect = "members/moremember" %]
451                                 [% END %]
452                                 document.location.href="/cgi-bin/koha/[% redirect | $raw %].pl?borrowernumber="+borrowernumber;
453                                 return false;
454                             }
455                             fnCallback(json);
456                         }
457                     });
458                 },
459                 'aoColumns':[
460                     [% IF CAN_user_borrowers_edit_borrowers || CAN_user_tools_manage_patron_lists %]
461                       { 'mDataProp': 'dt_borrowernumber', 'bSortable': false },
462                     [% END %]
463                     { 'mDataProp': 'dt_cardnumber' },
464                     { 'mDataProp': 'dt_name' },
465                     { 'mDataProp': 'dt_dateofbirth' },
466                     { 'mDataProp': 'dt_category' },
467                     {
468                         'mDataProp': function ( oObj ) {
469                             if( !singleBranchMode &&  oObj.dt_branch == "[% Branches.GetLoggedInBranchname | html %]" ){
470                                 return "<span class=\"currentlibrary\">" + oObj.dt_branch + "</span>";
471                             } else {
472                                 return oObj.dt_branch;
473                             }
474                         }
475                     },
476                     { 'mDataProp': 'dt_dateexpiry' },
477                     { 'mDataProp': 'dt_od_checkouts', 'bSortable': false },
478                     { 'mDataProp': 'dt_fines', 'bSortable': false },
479                     { 'mDataProp': 'dt_borrowernotes' },
480                     { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
481                 ],
482                 'bFilter': false,
483                 'bAutoWidth': false,
484                 [% IF CAN_user_borrowers_edit_borrowers || CAN_user_tools_manage_patron_lists %]
485                     'aaSorting': [[2, 'asc']],
486                 [% ELSE %]
487                     'aaSorting': [[1, 'asc']],
488                 [% END %]
489                 "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
490                 'sPaginationType': 'full_numbers',
491                 "iDisplayLength": [% PatronsPerPage | html %],
492                 "bProcessing": true,
493                 "initComplete": function(settings, json) {
494                     Sticky = $("#searchheader");
495                     Sticky.hcSticky({
496                         stickTo: "#searchresults",
497                         stickyClass: "floating"
498                     });
499                 }
500             }, columns_settings);
501             update_searched();
502             /* Initial page load doesn't trigger the popstate event, so we explicitly call this */
503             getSearchByLocation( false );
504
505         });
506
507         function patronListAdd(){
508             var borrowernumbers = [];
509             $("#memberresultst").find("input:checkbox:checked").each(function(){
510                 borrowernumbers.push($(this).val());
511             });
512             var data = {
513                 add_to_patron_list: $("#add_to_patron_list").val(),
514                 new_patron_list: $("#new_patron_list").val(),
515                 borrowernumbers: borrowernumbers
516             };
517             $.ajax({
518                 data: data,
519                 type: 'POST',
520                 url: '/cgi-bin/koha/svc/members/add_to_list',
521                 success: function(data) {
522                     $("#patron_list_dialog").show();
523                     $("#patron_list_dialog > span.patrons-length").html(data.patrons_added_to_list);
524                     $("#patron_list_dialog > a").attr("href", "/cgi-bin/koha/patron_lists/list.pl?patron_list_id=" + data.patron_list.patron_list_id);
525                     $("#patron_list_dialog > a").html(data.patron_list.name);
526
527                     if ( $('#add_to_patron_list').val() == 'new' ) {
528                         /* Add a new entry to the menu */
529                         $("#patronlist-dropdown .divider").before('<li><a class="patron-list-add" href="#" data-listid="' + data.patron_list.patron_list_id + '">' + data.patron_list.name + '</li>');
530                     }
531                 },
532                 error: function() {
533                     alert( _("An error occurred. Patron list could not be updated.") );
534                 }
535             });
536             return true;
537         }
538
539         function getSearchByLocation( setstate ){
540             /* Check to see if the URL contains a search parameter */
541             if( location.search != ""){
542                 var params = new URLSearchParams( location.search );
543                 var firstletter = params.get("firstletter");
544                 /* Check to see if search is a first letter param */
545                 if( firstletter ){
546                     /* Trigger function to return search results by letter */
547                     filterByFirstLetterSurname( firstletter, setstate );
548                 }
549             }
550         }
551
552         // Update the string "Results found ..."
553         function update_searched(){
554             var searched = $("#searchfieldstype_filter").find("option:selected").text();
555             if ( $("#searchmember_filter").val() ) {
556                 if ( $("#searchtype_filter").val() == 'start_with' ) {
557                     searched += _(" starting with ");
558                 } else {
559                     searched += _(" containing ");
560                 }
561                 searched += "'" + $("#searchmember_filter").val() + "'";
562             }
563             if ( $("#firstletter_filter").val() ) {
564                 searched += _(" begins with ") + "'" + $("#firstletter_filter").val() +"'";
565             }
566             if ( $("#categorycode_filter").val() ) {
567                 searched += _(" with category ") + "'" + $("#categorycode_filter").find("option:selected").text() + "'";
568             }
569             if ( $("#branchcode_filter").val() ) {
570                 searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text();
571             }
572             $("#searchpattern").text(searched);
573         }
574
575         // Redraw the table
576         function filter() {
577             $("#firstletter_filter").val('');
578             update_searched();
579             search = 1;
580             $("#searchresults").show();
581             dtMemberResults.fnDraw();
582             return false;
583         }
584
585         $('#memberresultst tbody').on('click','td',function(e){
586             var $checkbox = $(this).find("input[type=checkbox]");
587             if (e.target.type != "checkbox") {
588                 $checkbox.prop('checked', !$checkbox.prop("checked"));
589                 $checkbox.change();
590             }
591         });
592
593         // User has clicked on the Clear button
594         function clearFilters(redraw) {
595             $("#searchform select").val('');
596             $("#firstletter_filter").val('');
597             $("#searchmember_filter").val('');
598             if(redraw) {
599                 /* remove any search string added by firstletter search */
600                 history.pushState( {}, null, window.location.href.split("?" )[0]);
601                 update_searched();
602                 search = 0;
603                 $("#searchresults").hide();
604                 dtMemberResults.fnDraw();
605             }
606         }
607
608         // User has clicked on a letter
609         function filterByFirstLetterSurname( letter, setstate ) {
610             clearFilters(false);
611             $("#firstletter_filter").val(letter);
612             if( setstate ){
613                 history.pushState( null, null, "?firstletter=" + letter );
614             }
615             update_searched();
616             search = 1;
617             $("#searchresults").show();
618             dtMemberResults.fnDraw();
619         }
620     </script>
621 [% END %]
622
623 [% INCLUDE 'intranet-bottom.inc' %]