Bug 19129

Summary: Clean up templates for organisation patrons in staff
Product: Koha Reporter: Francois Charbonnier <francois.charbonnier>
Component: PatronsAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, katrin.fischer, kyle.m.hall, kyle, philippe.blouin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 19129 - Clean up Details tab for Organisation patrons
Bug 19129 - Clean up Details tab for Organisation patrons
Bug 19129 - Clean up Details tab for Organisation patrons
Bug 19129 - Follow-up - Add changes to patron duplicate warning
[SIGNED-OFF] Bug 19129 - Clean up Details tab for Organisation patrons
[SIGNED-OFF] Bug 19129 - Follow-up - Add changes to patron duplicate warning
Bug 19129 - Clean up Details tab for Organisation patrons
Bug 19129 - Follow-up - Add changes to patron duplicate warning

Description Francois Charbonnier 2017-08-16 15:45:25 UTC
I noticed this on 16.05 and 16.11.

If a patron categorycode is I, the patron detail page is broken.

Test plan :

1. Create a a new patron category. Use "I" as a category code.
2. Go to patron detail page
3. Change the patron category for this new one. Save.
4. The patron detail page is broken.
Comment 1 Katrin Fischer 2017-08-17 20:12:17 UTC
I think there might be a confusion of variables - I is also the code for the category type of Institutional = Organisation patrons. I will investigate a bit.
Comment 2 Katrin Fischer 2017-08-17 21:28:55 UTC
Created attachment 66152 [details] [review]
Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion by introducint a new
  variable 'is_organisation' instead of using 'I'.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)
Comment 3 Katrin Fischer 2017-08-17 21:39:32 UTC
Created attachment 66153 [details] [review]
Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion by introducint a new
  variable 'is_organisation' instead of using 'I'.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)
Comment 4 Katrin Fischer 2017-08-17 22:21:16 UTC
Created attachment 66155 [details] [review]
Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion between categorycode and
  categorytype.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)
Comment 5 Katrin Fischer 2017-08-17 22:21:20 UTC
Created attachment 66156 [details] [review]
Bug 19129 - Follow-up - Add changes to patron duplicate warning

Adds logic from the previous fix to the brief patron summary
shown when checking a possible patron duplicate.

Bonus: Also fixes missing patron category description there.

To Test:
- Add 2 patrons
- Add a patron with the same surname and firstname as an
  existing patron in order to trigger the duplicate message
- Click "View existing patron"
- Verify display is correct when existing patron is
  - an organisation
  - not an organisation
- Verify that the patron category description shows
Comment 6 Aleisha Amohia 2017-08-20 23:46:32 UTC
Created attachment 66257 [details] [review]
[SIGNED-OFF] Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion between categorycode and
  categorytype.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 7 Aleisha Amohia 2017-08-20 23:47:23 UTC
Created attachment 66258 [details] [review]
[SIGNED-OFF] Bug 19129 - Follow-up - Add changes to patron duplicate warning

Adds logic from the previous fix to the brief patron summary
shown when checking a possible patron duplicate.

Bonus: Also fixes missing patron category description there.

To Test:
- Add 2 patrons
- Add a patron with the same surname and firstname as an
  existing patron in order to trigger the duplicate message
- Click "View existing patron"
- Verify display is correct when existing patron is
  - an organisation
  - not an organisation
- Verify that the patron category description shows

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 8 Kyle M Hall 2017-09-01 11:42:20 UTC
Created attachment 66713 [details] [review]
Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion between categorycode and
  categorytype.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2017-09-01 11:42:28 UTC
Created attachment 66714 [details] [review]
Bug 19129 - Follow-up - Add changes to patron duplicate warning

Adds logic from the previous fix to the brief patron summary
shown when checking a possible patron duplicate.

Bonus: Also fixes missing patron category description there.

To Test:
- Add 2 patrons
- Add a patron with the same surname and firstname as an
  existing patron in order to trigger the duplicate message
- Click "View existing patron"
- Verify display is correct when existing patron is
  - an organisation
  - not an organisation
- Verify that the patron category description shows

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Jonathan Druart 2017-09-01 16:08:52 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 11 Fridolin Somers 2017-10-03 09:08:58 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 12 Katrin Fischer 2017-10-05 21:30:32 UTC
Doesn't apply cleanly - will need more work.
Comment 13 Katrin Fischer 2017-11-15 20:33:57 UTC
I don't have the time to rebase patches for 16.11.x. Closing.