Bug 7484 - Keeping typed values when searching for authorities
Summary: Keeping typed values when searching for authorities
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin SOMERS
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 16:28 UTC by Adrien SAURAT
Modified: 2015-06-04 23:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7484 - Keeping typed values when searching for authorities (1.86 KB, patch)
2013-07-17 15:33 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Keeping typed values when searching for authorities (1.92 KB, patch)
2013-11-19 14:00 UTC, Paola Rossi
Details | Diff | Splinter Review
Bug 7484 - Keeping typed values when searching for authorities (2.04 KB, patch)
2013-11-21 16:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 7484 - Keeping typed values when searching for authorities (2.27 KB, patch)
2013-11-24 20:30 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adrien SAURAT 2012-01-31 16:28:11 UTC
[MT2545]
Page "Home › Authorities"

1) I'm on the "Search authorities" tab. I select an authority type, then change the active tab. The type change is lost.

2) I'm on a tab and type a search pattern, then change tab, the string is lost.

This behaviour is logical, given the fact that we're using tabs, but it would be more practical to keep the typed informations when the user changes the search mode.
Comment 1 Adrien SAURAT 2012-02-07 09:48:29 UTC
Is there any reason to use tabs here ?
The content is the same for each tab.

Couldn't we make just one form, with a radiobutton to select the type of search?
Something like:
o Search Authorities  o Search Main Heading  o Search All Headings
Comment 2 Fridolin SOMERS 2013-07-17 15:33:45 UTC Comment hidden (obsolete)
Comment 3 I'm just a bot 2013-09-29 05:29:21 UTC
Patch applied cleanly, go forth and signoff
Comment 4 Paola Rossi 2013-10-10 14:00:32 UTC
Page "Home › Authorities"

1) I'm on the "Search authorities" tab. I select an authority type, then change the active tab. The type change is lost.

The type seemes to be lost only if the "second" tab is empty, as it initially is.
If a selection would have been previously made for that "second" tab, it would not be lost.
Now a user can make a selection for a tab, and a different selection for a another tab, and they would be both kept.
All the 4 parts (name/term, verb, data, sort) of a condition set in one of the 3  tab ("main headings" or "all headings" or "keyword" search) are kept exactly the same after moving from this tab to another one, and then coming back to the first tab.

If the user would choose different selections in the 3 tabs, the patch would loose this information.
Comment 5 Fridolin SOMERS 2013-10-23 13:04:57 UTC
(In reply to Paola Rossi from comment #4)
> Page "Home › Authorities"
> 1) I'm on the "Search authorities" tab.
You mean : I'm on the "Search main heading" tab ?

> I select an authority type, then change the active tab. The type change is lost.
I do not reproduce this.
Please test with flush of browser JS cache (Ctrl+F5) after applying the patch.

> If the user would choose different selections in the 3 tabs, the patch would
> loose this information.
Ok but if a user starts in "Search main heading" (1st tab), enters authority type/order/terms/sort and performs a search. No results. He wants to perform a search on "Keyword search" (3rd tab), he must all redo.
Comment 6 I'm just a bot 2013-10-30 07:53:40 UTC
Patch applied cleanly, go forth and signoff
Comment 7 Paola Rossi 2013-11-15 14:06:59 UTC
I apply the patch. 

In spite of comment 1:

>Is there any reason to use tabs here ?
>The content is the same for each tab.
>Couldn't we make just one form, with a radiobutton to select the type of search?
>Something like:
>o Search Authorities  o Search Main Heading  o Search All Headings

no radiobutton appears.
There are still tabs.

So I pass the patch to "In discussion" status.
Comment 8 Fridolin SOMERS 2013-11-18 09:30:05 UTC
(In reply to Paola Rossi from comment #7)
> no radiobutton appears.
> There are still tabs.
Using radiobuttons was an idea of Adrien SAURAT, but the patch does not use them.
See test plan.
Comment 9 Paola Rossi 2013-11-19 14:00:31 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2013-11-21 15:59:52 UTC
I always believed it was not a bug but a feature :)
The patch works as described.
I will amend the patch in order to explicitly declare the 2 new variables.
Comment 11 Jonathan Druart 2013-11-21 16:00:13 UTC Comment hidden (obsolete)
Comment 12 Katrin Fischer 2013-11-24 20:30:01 UTC
Created attachment 23118 [details] [review]
[PASSED QA] Bug 7484 - Keeping typed values when searching for authorities

1) I'm on the "Search authorities" tab. I select an authority type, then change the active tab. The type change is lost.
2) I'm on a tab and type a search pattern, then change tab, the string is lost.
This behaviour is logical, given the fact that we're using tabs, but it would be more practical to keep the typed informations when the user changes the search mode.

This patch add a few JQuery code to synchronise inputs between all tabbed authorities search forms.

Test plan :
- Go to Authorities home page : cgi-bin/koha/authorities/authorities-home.pl
- In toolbar, "Search main heading" is selected
- Change all inputs : authotity type, operator, term, and sort order
- Click on "Search all headings" tab
=>  Inputs are the same has previous tab
- Click on "Keyword search" tab
=>  Inputs are the same has previous tab

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: Explicitly declare 2 new variables used.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works as described, Firebug doesn't show any problems with
the Javascript.
Could be useful for other tabbed searches like the start page
as well.
Comment 13 Galen Charlton 2013-11-27 18:35:45 UTC
Pushed to master.  Thanks, Fridolin!

However, I agree with Adrien that it would be better to use a set of radio buttons for the search type rather than tabs -- it is not quite idiomatic for a tabbed interface to preserve state when switching tabs like this.
Comment 14 Fridolin SOMERS 2013-12-13 14:45:19 UTC
This patch has been pushed to 3.14.x, will be in 3.14.1
Comment 15 Tomás Cohen Arazi 2013-12-23 15:20:57 UTC
This patch has been pushed to 3.12.x, will be in 3.12.8.

Thanks Fridolin!