Bug 2669 - Radio Buttons where there should be checkboxes on Dictionary
Summary: Radio Buttons where there should be checkboxes on Dictionary
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: PC All
: P3 normal (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks: 15557
  Show dependency treegraph
 
Reported: 2008-10-13 04:58 UTC by Nicole C. Engard
Modified: 2017-06-14 22:11 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
radio buttons (61.38 KB, image/png)
2008-10-13 04:59 UTC, Chris Cormack
Details
screenshot (8.33 KB, image/png)
2012-04-03 06:01 UTC, Katrin Fischer
Details
Bug 2669: Change checkboxes to radio buttons on dictionary (5.68 KB, patch)
2016-01-11 11:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 2669: Change checkboxes to radio buttons on dictionary (5.76 KB, patch)
2016-01-11 23:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 2669: Change checkboxes to radio buttons on dictionary (5.92 KB, patch)
2016-01-12 09:51 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 2669: Change checkboxes to radio buttons on dictionary (5.97 KB, patch)
2016-01-15 17:27 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 00:54:29 UTC


---- Reported by nengard@gmail.com 2008-10-13 04:58:56 ----

See attached.  And read this report from a customer:

"I was experimenting with the dictionary and got both radio buttons in an OR statement stuck on- I couldn't get  either of them to turn off. I just didn't save the definition but when you click one radio button to create an OR statement the other button should toggle to off"



---- Additional Comments From nengard@gmail.com 2008-10-13 04:59:20 ----

Created an attachment
radio buttons





---- Additional Comments From nengard@gmail.com 2009-05-18 20:38:00 ----

After looking at the templates I think that this:

<td><input type="radio" name="<!-- TMPL_VAR NAME="name" -->_all" value="all" />All dates</td>
<td>OR</td>
<td><input type="radio" name="dates" value="range" />Date range<br />


has to be changed to this:


<td><input type="radio" name="<!-- TMPL_VAR NAME="name" -->" value="" />All dates</td>
<td>OR</td>
<td><input type="radio" name="<!-- TMPL_VAR NAME="name" -->" value="range" />Date range<br />


But after talking with Chris he seems to think that this will only solve the toggling of the radio buttons and that the code behind it doesn't really work ... so I'm not going to make the change and I'm going to leave it to a more experienced expert :)



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:54 UTC  ---

This bug was previously known as _bug_ 2669 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2669
Imported an attachment (id=782)

Actual time not defined. Setting to 0.0
CC member bchurch@ptfs.com does not have an account here
The original submitter of attachment 782 [details] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Katrin Fischer 2012-04-03 06:01:09 UTC
Created attachment 8794 [details]
screenshot

I tried retesting this on current master, what I did:

1) New definition
2) Module: patrons
3) Registration date
4) Nothing shows up for the 4th step

For other dates like 'Expiry date' the 4th step shows up correctly and shows the wrong behaviour Nicole described.
Comment 2 Marc Véron 2016-01-05 16:12:31 UTC
(In reply to Katrin Fischer from comment #1)
> Created attachment 8794 [details]
> screenshot
> 
> I tried retesting this on current master, what I did:
> 
> 1) New definition
> 2) Module: patrons
> 3) Registration date
> 4) Nothing shows up for the 4th step
> 
> For other dates like 'Expiry date' the 4th step shows up correctly and shows
> the wrong behaviour Nicole described.

With current master 'Expiry date' displays on current master, but the bug as such is still valid.
Comment 3 Jonathan Druart 2016-01-11 11:36:01 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2016-01-11 13:50:11 UTC
(In reply to Jonathan Druart from comment #3)
(...)
> Note that I don't understand what means 'All dates', there is no
> condition generated for the dictionary. We should not have to select a
> field if we don't want to add a condition on it :)

Same findings with my tests: If "All dates" is set, the definition saves with an empty condition. (With and without patch, see dictionary.pl line 152.)

To have a condition saved, "Date range" and at least one of the dates "Start of date range" and/or "End of date range" has to be set.

Conclusion: 
The checkboxes rsp. radio buttons and the condition for their value in dictionary.pl line 152 could be removed.
Comment 5 Aleisha Amohia 2016-01-11 23:12:25 UTC Comment hidden (obsolete)
Comment 6 Marc Véron 2016-01-12 08:48:50 UTC
Jonathan and Aleisha,

Since the radio buttons do not make much sense, couldn't we simply remove them? (See test and conclusion on comment #4)
Comment 7 Jonathan Druart 2016-01-12 09:38:15 UTC
(In reply to Marc Véron from comment #6)
> Jonathan and Aleisha,
> 
> Since the radio buttons do not make much sense, couldn't we simply remove
> them? (See test and conclusion on comment #4)

I would prefer another bug report, it won't be as easy as this patch.
Comment 8 Marc Véron 2016-01-12 09:51:30 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2016-01-15 17:27:39 UTC
Created attachment 46716 [details] [review]
Bug 2669: Change checkboxes to radio buttons on dictionary

On creating new dictionary for report, the choice between "All dates"
and "Date range" should be a real radio button, not 2 radio buttons with
different names (which means they could be selected altogether...)

Note that I don't understand what means 'All dates', there is no
condition generated for the dictionary. We should not have to select a
field if we don't want to add a condition on it :)

Test plan:
Create a new dictionary for the Patron module, then a date field
(dateenrolled or birthdate, etc.)

Confirm that the radio buttons now behave as radio buttons...

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Looks so much nicer too!

Radio buttons display as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Kyle M Hall 2016-01-15 17:28:42 UTC
Another wishlist item: it would be nice of the date range fields only displayed when the date range option is selected, or the date range option is selected automatically if the date range gets filled in my the librarian.
Comment 11 Brendan Gallagher 2016-01-27 02:45:24 UTC
Pushed to Master - Should be in the May 2016 Release.  (Also would be cool to notes Kyle's wish list at the end of this.)
Comment 12 Julian Maurice 2016-01-27 14:25:09 UTC
Patch pushed to 3.22.x, will be in 3.22.3
Comment 13 Frédéric Demians 2016-02-12 06:34:00 UTC
This patch has been pushed to 3.20.x, will be in 3.20.9.