Bug 27458

Summary: Set focus for cursor to Credit type code field when creating new credit type
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: TemplatesAssignee: Amy King <amyking386>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: amyking386, andrew, barbara.johnson, caroline.cyr-la-rose, fridolin.somers, jonathan.druart, koha-bugs, martin.renvoize, oleonard, testopia, victor
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.03,20.05.09
Circulation function:
Attachments: Bug 27458 Focus cursor to credit type code when creating new type.
Bug 27458: Sets cursor to focus credit type code when creating new type.
Bug 27458: cursor focueses to credit type field using class="focus"
Bug 27458: cursor focueses to credit type field class="required focus"
Bug 27458: cursor focueses to credit type field class="required focus"
Bug 27458: cursor focueses to credit type field class="required focus"
Bug 27458: Set focus for cursor to Credit type code field

Description Katrin Fischer 2021-01-17 16:16:28 UTC
When creating a new credit type in administration, it would be nice if the cursor was in the first form field "Credit type code ".

See bug 27192 for a similar one.
Comment 1 Amy King 2021-01-19 01:35:36 UTC
Created attachment 115276 [details] [review]
Bug 27458 Focus cursor to credit type code when creating new type.

Test plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field.
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credit type code field.
Comment 2 Jonathan Druart 2021-01-19 09:07:06 UTC
Hi Amy, thanks for your patch!

The commit message must start with "Bug 27458: ". Can you resubmit please?
Comment 3 Amy King 2021-01-19 20:19:19 UTC
Created attachment 115344 [details] [review]
Bug 27458: Sets cursor to focus credit type code when creating new type.

Test plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field.
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credit type code field.
Comment 4 Katrin Fischer 2021-01-19 23:09:42 UTC
Hi Amy, 

could you take a look at the bug linked in the first comment? The solution there is a little different using a class="focus" to the input element. I think that would be a more standardized way of doing this!

There are also 2 patches here currently, you can obsolete them by going on details > edit details > obsolete or by using git bz. :)
Comment 5 Amy King 2021-01-20 01:01:39 UTC
Created attachment 115377 [details] [review]
Bug 27458: cursor focueses to credit type field using class="focus"

Test Plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note hoe the cursor does not focus on Credit type code field
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credity type code field
Comment 6 Barbara Johnson 2021-01-20 17:42:02 UTC
I have tried this twice and am not seeing the cursor automatically placed in the credit type code field.
Comment 7 Owen Leonard 2021-01-20 19:05:31 UTC
There is already a class attribute on that <input> tag, so the new "focus" value should be added to it, e.g. 'class="required focus"'
Comment 8 Amy King 2021-01-20 20:57:37 UTC
Created attachment 115459 [details] [review]
Bug 27458: cursor focueses to credit type field class="required focus"

Test Plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credity type code field
Comment 9 PTFS Europe Sandboxes 2021-01-20 22:11:19 UTC
Created attachment 115468 [details] [review]
Bug 27458: cursor focueses to credit type field class="required focus"

Test Plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credity type code field

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 10 Barbara Johnson 2021-01-20 22:18:59 UTC
It works!
Comment 11 Martin Renvoize (ashimema) 2021-01-21 10:40:15 UTC
Created attachment 115522 [details] [review]
Bug 27458: cursor focueses to credit type field class="required focus"

Test Plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credity type code field

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize (ashimema) 2021-01-21 10:40:44 UTC
Great work Amy, thanks for your contribution.

All works as expected, Passing QA
Comment 13 Jonathan Druart 2021-01-21 14:43:13 UTC
Created attachment 115554 [details] [review]
Bug 27458: Set focus for cursor to Credit type code field

Test Plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credity type code field

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

JD amended patch: Edit commit title
Comment 14 Jonathan Druart 2021-01-21 15:25:42 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 15 Fridolin Somers 2021-01-25 15:29:23 UTC
Pushed to 20.11.x for 20.11.03
Comment 16 Andrew Fuerste-Henry 2021-02-03 21:43:50 UTC
Pushed to 20.05.x for 20.05.09
Comment 17 Victor Grousset/tuxayo 2021-02-03 22:48:57 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.
Comment 18 Victor Grousset/tuxayo 2021-02-03 22:52:45 UTC
> Feel free to ask if it's needed.

actually credit_types.tt didn't exist in 19.11