Bug 27193

Summary: Set focus for cursor to patron attribute type code input box when creating new patron attributes
Product: Koha Reporter: Barbara Johnson <barbara.johnson>
Component: TemplatesAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: ellawipatene, gmcharlt, jonathan.druart, kyle
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 31411    
Attachments: Bug 27193 - Set focus for cursor to patron attribute type code input box when creating new patron attributes
Bug 27193: Set focus for cursor to patron attribute type code input box when creating new patron attributes
Bug 27195: Set focus for cursor to city input box when creating new cities
Bug 27193 - Set focus for cursor to patron attribute type code input box when creating new patron attributes
Bug 27193: Set focus for cursor to patron attribute type code input box when creating new patron attributes
Bug 27193: Set focus on first input when adding a new patron attribute
Bug 27193: Set focus on first input when adding a new patron attribute
Bug 27193: Set focus on first input when adding a new patron attribute

Description Barbara Johnson 2020-12-10 16:15:16 UTC
When adding a new patron attribute type on patron-attr-types.pl you have to click in the patron attribute type code input box, which is a required field, so that you can enter text.  It would be more efficient to set the focus for the cursor to always be in the patron attribute type code input box so that you could just begin typing and eliminate an extra click.
Comment 1 Ella 2021-01-19 01:31:08 UTC
Created attachment 115274 [details] [review]
Bug 27193 - Set focus for cursor to patron attribute type code input box when creating new patron attributes

1. (Before attaching the patch) Go into administration
2. Go to Patron attribute types - then 'New patron attribute type'
3. Without the patch, the cursor should not automatically focus on the
first container 'Patron attribute type code'
4. Install patch
5. Redo steps 1&2
6. If the patch worked, then the cursor should automatically focus to
the first container 'Patron attribute type code'

Sponsored.by: Catalyst IT
Comment 2 Jonathan Druart 2021-01-19 09:06:02 UTC
Hello Ella,
The commit message of your patch must start with "Bug 27193: ". Can you resubmit please?
Comment 3 Ella 2021-01-19 20:23:09 UTC
Created attachment 115347 [details] [review]
Bug 27193: Set focus for cursor to patron attribute type code input box when creating new patron attributes

1. (Before attaching the patch) Go into administration
2. Go to Patron attribute types - then 'New patron attribute type'
3. Without the patch, the cursor should not automatically focus on the
first container 'Patron attribute type code'
4. Install patch
5. Redo steps 1&2
6. If the patch worked, then the cursor should automatically focus to
the first container 'Patron attribute type code'

Sponsored.by: Catalyst IT
Comment 4 PTFS Europe Sandboxes 2021-01-19 21:48:38 UTC
Created attachment 115366 [details] [review]
Bug 27195: Set focus for cursor to city input box when creating new cities

(Before downloading the patch)
    1. Go to administration
    2. Go to cities
    3. Click on add new city
    4. See if the cursor automatically focuses to the first city
    container (It shouldn't).
    5. Apply patch
    6. Repeat steps 1-4
    7. If the cursor automatically focuses in the first city container,
    the patch has worked!

Sponsored-by: Catalyst IT

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 5 PTFS Europe Sandboxes 2021-01-19 21:48:41 UTC
Created attachment 115367 [details] [review]
Bug 27193 - Set focus for cursor to patron attribute type code input box when creating new patron attributes

1. (Before attaching the patch) Go into administration
2. Go to Patron attribute types - then 'New patron attribute type'
3. Without the patch, the cursor should not automatically focus on the
first container 'Patron attribute type code'
4. Install patch
5. Redo steps 1&2
6. If the patch worked, then the cursor should automatically focus to
the first container 'Patron attribute type code'

Sponsored.by: Catalyst IT

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 6 Kyle M Hall (khall) 2021-01-21 19:58:09 UTC
Created attachment 115616 [details] [review]
Bug 27193: Set focus for cursor to patron attribute type code input box when creating new patron attributes

1. (Before attaching the patch) Go into administration
2. Go to Patron attribute types - then 'New patron attribute type'
3. Without the patch, the cursor should not automatically focus on the
first container 'Patron attribute type code'
4. Install patch
5. Redo steps 1&2
6. If the patch worked, then the cursor should automatically focus to
the first container 'Patron attribute type code'

Sponsored.by: Catalyst IT

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Jonathan Druart 2021-01-22 13:09:08 UTC
Focus must be put using the "focus" class instead.
Comment 8 Katrin Fischer 2022-08-18 19:49:14 UTC
Created attachment 139416 [details] [review]
Bug 27193: Set focus on first input when adding a new patron attribute

When adding a new patron attribute, the focus/cursor should be
in the first input field of the form: Patron attribute type code

To test:
* Add a new patron attribute - cursur is in no field
* Apply patch
* Add another new patron attribute - cursor is now in
  the first input field: Patron attribute type code
Comment 9 Katrin Fischer 2022-08-18 19:52:18 UTC
I've implemented the solution from comment#7 using the CSS class. As this is a one line change all in all it replaces Ella's patch. I am sorry to lose the contribution, but not sure about a better option here. :(
Comment 10 ByWater Sandboxes 2022-08-18 20:42:02 UTC
Created attachment 139424 [details] [review]
Bug 27193: Set focus on first input when adding a new patron attribute

When adding a new patron attribute, the focus/cursor should be
in the first input field of the form: Patron attribute type code

To test:
* Add a new patron attribute - cursur is in no field
* Apply patch
* Add another new patron attribute - cursor is now in
  the first input field: Patron attribute type code

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 11 Kyle M Hall (khall) 2022-09-02 14:40:30 UTC
Created attachment 140158 [details] [review]
Bug 27193: Set focus on first input when adding a new patron attribute

When adding a new patron attribute, the focus/cursor should be
in the first input field of the form: Patron attribute type code

To test:
* Add a new patron attribute - cursur is in no field
* Apply patch
* Add another new patron attribute - cursor is now in
  the first input field: Patron attribute type code

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Tomás Cohen Arazi (tcohen) 2022-09-07 20:46:06 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!