Bug 7719

Summary: Change state of controls based on whether boxes are checked
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: enhancement    
Priority: P5 - low CC: jcamins, paul.poulain, wizzyrea
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 6264    
Attachments: Bug 7719 - Change state of controls based on whether boxes are checked
Bug 7719 - Change state of controls based on whether boxes are checked

Description Owen Leonard 2012-03-14 18:34:13 UTC
Some interfaces in the OPAC have controls which only work if a checkbox has been checked. Examples:

- Placing a hold on multiple items in the cart window or on a list view page
- Adding tags to multiple items in the cart window or on a list view page
- Removing one or more items from the cart window
- Adding one or more items to a list from the cart window

I propose that such controls be disabled by default, and enabled only after a checkbox has been checked.
Comment 1 Owen Leonard 2012-03-14 19:32:22 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2012-03-14 19:58:58 UTC
Created attachment 8208 [details] [review]
Bug 7719 - Change state of controls based on whether boxes are checked

Some OPAC interface controls cannot function unless a checkbox is
checked. Examples:

- Placing a hold on multiple items in the cart window or on a list view page
- Adding tags to multiple items in the cart window or on a list view page
- Removing one or more items from the cart window
- Removing one or more items from a list on the list view page
- Adding one or more items to a list from the cart window

This patch moves these controls into a separate div in which links
are enabled or disabled based on whether checkboxes are checked. It
does so on two pages: The lists view page (when viewing the contents
of a list) and in the cart window.

Links which are in their disabled state should not perform any action.
After checking one or more checkboxes the links should become active
and behave normally.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Works in chrome and firefox (latest). Passes tests.
Comment 3 Jared Camins-Esakov 2012-03-14 20:25:41 UTC
I have one qualm about this- will it degrade gracefully for browsers without javascript enabled?
Comment 4 Owen Leonard 2012-03-15 13:30:47 UTC
> I have one qualm about this- will it degrade gracefully for browsers without
> javascript enabled?

Because the controls perform functions which are only available if JavaScript is enabled this patch causes no additional loss of functionality to users with JS turned off. As with current master, the controls do not appear if JS is turned off. 

I do see a problem where one of my labels still shows up with JS turned off. I'll submit a follow-up.
Comment 5 Ian Walls 2012-03-19 13:17:17 UTC
Template only change, easy to read, fails equally gracefully with JS turned off.
Marking Passed QA
Comment 6 Paul Poulain 2012-03-20 11:05:29 UTC
patch pushed, a nice enhancement that 3.6 users will also enjoy !