Bugzilla – Attachment 33192 Details for
Bug 12648
Link patrons to an order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12648: Hide the result search on load
Bug-12648-Hide-the-result-search-on-load.patch (text/plain), 4.61 KB, created by
Jonathan Druart
on 2014-11-04 10:39:12 UTC
(
hide
)
Description:
Bug 12648: Hide the result search on load
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-11-04 10:39:12 UTC
Size:
4.61 KB
patch
obsolete
>From 802e9228a08fd320f0d1ac306290972bbcbba53e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 1 Oct 2014 11:17:48 +0200 >Subject: [PATCH] Bug 12648: Hide the result search on load > >When no search has been done yet, it's not necessary to display the >result list. >--- > acqui/add_user_search.pl | 1 + > .../prog/en/modules/acqui/add_user_search.tt | 71 ++++++++++++++++++---- > 2 files changed, 59 insertions(+), 13 deletions(-) > >diff --git a/acqui/add_user_search.pl b/acqui/add_user_search.pl >index 63c7f22..e44f623 100755 >--- a/acqui/add_user_search.pl >+++ b/acqui/add_user_search.pl >@@ -51,5 +51,6 @@ my $search_patrons_with_acq_perm_only = > > $template->param( > patrons_with_acq_perm_only => $search_patrons_with_acq_perm_only, >+ view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", > ); > output_html_with_http_headers( $input, $cookie, $template->output ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/add_user_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/add_user_search.tt >index a61a5be..2a7233f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/add_user_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/add_user_search.tt >@@ -8,15 +8,32 @@ > <script type="text/javascript"> > //<![CDATA[ > >+var search = 1; > $(document).ready(function(){ > $("#info").hide(); > $("#error").hide(); >+ >+ [% IF view != "show_results" %] >+ $("#searchresults").hide(); >+ search = 0; >+ [% END %] >+ >+ $("#searchmember_filter").on('keyup', function(){ >+ filter(); >+ }); > // Apply DataTables on the results table > dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, { > 'bServerSide': true, > 'sAjaxSource': "/cgi-bin/koha/svc/members/search", > 'fnServerData': function(sSource, aoData, fnCallback) { >+ if ( ! search ) { >+ return; >+ } > aoData.push({ >+ 'name': 'searchmember', >+ 'value': $("#searchmember_filter").val() >+ }, >+ { > 'name': 'template_path', > 'value': 'acqui/tables/members_results.tt', > } >@@ -50,13 +67,35 @@ $(document).ready(function(){ > [% ELSE %] > 'sPaginationType': 'full_numbers', > "iDisplayLength": [% Koha.Preference('PatronsPerPage') %], >- "bProcessing": true, > [% END %] >+ 'bFilter': false, > 'bProcessing': true, > })); > dtMemberResults.fnAddFilters("filter", 750); > }); > >+var delay = (function(){ >+ var timer = 0; >+ return function(callback, ms){ >+ clearTimeout (timer); >+ timer = setTimeout(callback, ms); >+ }; >+})(); >+ >+function filter() { >+ search = 1; >+ >+ $("#searchresults").show(); >+ >+ if ( $("#searchmember_filter").val().length > 0 ) { >+ delay(function(){ >+ dtMemberResults.fnDraw(); >+ }, 1000); >+ } >+ >+ return false; >+} >+ > // modify parent window owner element > function add_user(borrowernumber, borrowername) { > var p = window.opener; >@@ -81,6 +120,10 @@ $(document).ready(function(){ > <div class="yui-g"> > > <h3>Search for patron</h3> >+ >+ <label for="searchmember_filter">Search:</label> >+ <input type="text" id="searchmember_filter" value="[% searchmember %]"/> >+ > [% IF patrons_with_acq_perm_only %] > <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> > [% END %] >@@ -88,18 +131,20 @@ $(document).ready(function(){ > <div id="info" class="dialog message"></div> > <div id="error" class="dialog alert"></div> > >- <table id="memberresultst"> >- <thead> >- <tr> >- <th>Card</th> >- <th>Name</th> >- <th>Library</th> >- <th>Category</th> >- <th> </th> >- </tr> >- </thead> >- <tbody></tbody> >- </table> >+ <div id="searchresults"> >+ <table id="memberresultst"> >+ <thead> >+ <tr> >+ <th>Card</th> >+ <th>Name</th> >+ <th>Library</th> >+ <th>Category</th> >+ <th> </th> >+ </tr> >+ </thead> >+ <tbody></tbody> >+ </table> >+ </div> > > <div id="closewindow"><a href="#" class="close">Close</a></div> > </div> >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12648
:
30024
|
30025
|
30026
|
30027
|
30988
|
30989
|
30990
|
30991
|
31273
|
31960
|
31961
|
32230
|
33186
|
33187
|
33188
|
33189
|
33190
|
33191
|
33192
|
33193
|
34224
|
34225
|
34226
|
34227
|
34228
|
34229
|
34230
|
34231
|
34477
|
34487
|
34488
|
34489
|
34490
|
34491
|
34492
|
34493
|
34494
|
34495
|
35056
|
35058
|
35059
|
35060
|
35061
|
35062
|
35063
|
35064
|
35065
|
35066
|
36795
|
36796
|
36797
|
36798
|
36799
|
36800
|
36801
|
36802
|
36803
|
36804
|
36805
|
36807
|
36810
|
36817