Bugzilla – Attachment 72815 Details for
Bug 20346
Patron filtering resulting in new search rather than filtering existing results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20346 - New wording above the patron table on the patron page
Bug-20346---New-wording-above-the-patron-table-on-.patch (text/plain), 5.54 KB, created by
Alex Buckley
on 2018-03-13 20:47:37 UTC
(
hide
)
Description:
Bug 20346 - New wording above the patron table on the patron page
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2018-03-13 20:47:37 UTC
Size:
5.54 KB
patch
obsolete
>From 39374480b0190e072baa041d2912d2cbb7cc2b85 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net,nz> >Date: Mon, 12 Mar 2018 16:56:16 +0000 >Subject: [PATCH] Bug 20346 - New wording above the patron table on the patron > page > >Now the wording of the text above the patron result table is in the >format 'Users found for: <searchtype> <term> >filtered by <filtersearchtype> <filterterm>' > >Test plan: >Same as the two previous patches for this bug, however notice after >applying this patch and perform a search and filter event that the >wording of this text above the patron result table is changed to the >format 'Users found for: <searchtype> <term> >filtered by <filtersearchtype> <filterterm>' > >Sponsored-By: Catalyst IT >--- > .../prog/en/modules/members/member.tt | 66 ++++++++++++++++++---- > 1 file changed, 54 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index f4a2b07..8877521 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -274,6 +274,7 @@ > $("#searchform").on("submit", function(e) { > e.preventDefault(); > search = 1; >+ update_searched(); > dtMemberResults.fnDraw(); > }); > }); >@@ -444,25 +445,66 @@ > } > // Update the string "Results found ..." > function update_searched(){ >- var searched = $("#searchfieldstype_filter").find("option:selected").text(); >- if ( $("#searchmember_filter").val() ) { >- if ( $("#searchtype_filter").val() == 'start_with' ) { >+ var first_query = document.getElementById("searchmember").value; >+ var searchmember = document.getElementById("searchmember_filter").value; >+ var searched = $("#searchfieldstype").find("option:selected").text(); >+ var filtered; >+ >+ //Creating the searched message for the settings set for the search event >+ if ( $("#searchmember").val() ) { >+ if ( $("#searchtype").val() == 'start_with' ) { > searched += _(" starting with "); > } else { > searched += _(" containing "); > } >- searched += "'" + $("#searchmember_filter").val() + "'"; >- } >- if ( $("#firstletter_filter").val() ) { >- searched += _(" begins with ") + "'" + $("#firstletter_filter").val() +"'"; >+ searched += "'" + $("#searchmember").val() + "'"; > } >- if ( $("#categorycode_filter").val() ) { >- searched += _(" with category ") + "'" + $("#categorycode_filter").find("option:selected").text() + "'"; >+ if ( $("#categorycode").val() ) { >+ searched += _(" with category ") + "'" + $("#categorycode").find("option:selected").text() + "'"; > } >- if ( $("#branchcode_filter").val() ) { >- searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text(); >+ if ( $("#branchcode").val() ) { >+ searched += _(" in library ") + $("#branchcode").find("option:selected").text(); > } >- $("#searchpattern").text(searched); >+ >+ //Creating the searched message for the settings set for the filtered event >+ if ( $("#searchmember_filter").val() ) { >+ if ( $("#searchtype_filter").val() == 'start_with' ) { >+ filtered = " starting with "; >+ } else { >+ filtered = " containing "; >+ } >+ filtered += "'" + $("#searchmember_filter").val() + "'"; >+ } >+ if ( $("#firstletter_filter").val() ) { >+ if ( $("#searchmember_filter").val() || $("#categorycode_filter").val() || $("#branchcode_filter").val()) { >+ filtered += " begins with " + "'" + $("#firstletter_filter").val() +"'"; >+ } else { >+ filtered = " begins with " + "'" + $("#firstletter_filter").val() +"'"; >+ } >+ } >+ if ( $("#categorycode_filter").val() ) { >+ if ( $("#searchmember_filter").val() || $("#firstletter_filter").val() || $("#branchcode_filter").val()) { >+ filtered += " with category " + "'" + $("#categorycode_filter").find("option:selected").text() + "'"; >+ } else { >+ filtered = " with category " + "'" + $("#categorycode_filter").find("option:selected").text() + "'"; >+ } >+ } >+ if ( $("#branchcode_filter").val() ) { >+ if ( $("#searchmember_filter").val() || $("#firstletter_filter").val() || $("#categorycode_filter").val()) { >+ filtered += " in library " + $("#branchcode_filter").find("option:selected").text(); >+ } else { >+ filtered = " in library " + $("#branchcode_filter").find("option:selected").text(); >+ } >+ } >+ >+ var searchevent; >+ //Concatenate the searched and filtered messages into a single message >+ if (first_query != searchmember) { >+ searchevent = searched + " filtered by " + filtered; >+ $("#searchpattern").text(searchevent); >+ } else { >+ $("#searchpattern").text(searched); >+ } > } > > // Redraw the table >-- >2.1.4
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 20346
:
72496
|
72520
|
72523
|
72623
|
72624
|
72815
|
73520