Bug 19909 - Show attributes in patron search results
Summary: Show attributes in patron search results
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-03 11:14 UTC by Julian Maurice
Modified: 2020-05-22 21:02 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19909: Show attributes in patron search results (8.18 KB, patch)
2018-01-03 11:15 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 19909: Show attributes in patron search results (8.06 KB, patch)
2018-07-20 12:44 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 19909: Show attributes in patron search results (8.10 KB, patch)
2018-08-03 10:56 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 19909: Show attributes in patron search results (8.14 KB, patch)
2018-08-28 06:26 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 19909: Show attributes in patron search results (6.03 KB, patch)
2020-05-22 13:36 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 19909: Show attributes in patron search results (6.11 KB, patch)
2020-05-22 21:02 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2018-01-03 11:14:29 UTC
This will add a new column (hidden by default) in the results table to
displays all attributes associated to the corresponding patron.
Comment 1 Julian Maurice 2018-01-03 11:15:01 UTC
Created attachment 70243 [details] [review]
Bug 19909: Show attributes in patron search results

Add a new column (hidden by default) in the results table which
displays all attributes associated to the corresponding patron.

New subroutine Koha::Patron::Attribute::display_value that
returns the authorised value description and defaults to the raw value
if the attribute's type is not associated to an authorised value
category

Test plan:
1. Create some patron attribute types, with and without an associated
authorised value category
2. Choose an existing patron and set a value for each attribute
3. Go to patron search and do a search that will return your patron (and
some others to avoid the redirection)
4. Show column 'Extended attributes' by clicking on 'Column visibility'
button
5. Note that all attributes are displayed correctly
6. prove t/db_dependent/Koha/Patron/Attributes.t
Comment 2 Axelle Aix-Marseille Université 2018-03-12 11:16:07 UTC
Patch doesn't apply on sandbox biblibre n°1
Comment 3 Victor Grousset/tuxayo 2018-03-12 11:36:12 UTC
conflicts:
~/d/koha ❯❯❯ git bz apply 19909                                                                                                                                                        ✘ 141 
Bug 19909 - Show attributes in patron search results

70243 - Bug 19909: Show attributes in patron search results

Apply? [(y)es, (n)o, (i)nteractive] y
Application de  Bug 19909: Show attributes in patron search results
Utilisation de l'information de l'index pour reconstruire un arbre de base...
M	C4/Utils/DataTables/Members.pm
M	admin/columns_settings.yml
M	koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
.git/rebase-apply/patch:182: new blank line at EOF.
+
warning: 1 ligne a ajouté des erreurs d'espace.
Retour à un patch de la base et fusion à 3 points...
Fusion automatique de koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
CONFLIT (contenu) : Conflit de fusion dans koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
Fusion automatique de admin/columns_settings.yml
Fusion automatique de C4/Utils/DataTables/Members.pm
error: Échec d'intégration des modifications.
le patch a échoué à 0001 Bug 19909: Show attributes in patron search results
La copie du patch qui a échoué se trouve dans : .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-19909-Show-a
Comment 4 Fridolin SOMERS 2018-07-20 12:44:53 UTC
Created attachment 77161 [details] [review]
Bug 19909: Show attributes in patron search results

Add a new column (hidden by default) in the results table which
displays all attributes associated to the corresponding patron.

New subroutine Koha::Patron::Attribute::display_value that
returns the authorised value description and defaults to the raw value
if the attribute's type is not associated to an authorised value
category

Test plan:
1. Create some patron attribute types, with and without an associated
authorised value category
2. Choose an existing patron and set a value for each attribute
3. Go to patron search and do a search that will return your patron (and
some others to avoid the redirection)
4. Show column 'Extended attributes' by clicking on 'Column visibility'
button
5. Note that all attributes are displayed correctly
6. prove t/db_dependent/Koha/Patron/Attributes.t
Comment 5 Fridolin SOMERS 2018-07-20 12:46:07 UTC
Nice enhancement, rebased master.
Comment 6 sandboxes@biblibre.com 2018-08-03 10:56:12 UTC
Patch tested with a sandbox, by Cab Vinton <bibliwho@gmail.com>
Comment 7 sandboxes@biblibre.com 2018-08-03 10:56:36 UTC
Created attachment 77467 [details] [review]
Bug 19909: Show attributes in patron search results

Add a new column (hidden by default) in the results table which
displays all attributes associated to the corresponding patron.

New subroutine Koha::Patron::Attribute::display_value that
returns the authorised value description and defaults to the raw value
if the attribute's type is not associated to an authorised value
category

Test plan:
1. Create some patron attribute types, with and without an associated
authorised value category
2. Choose an existing patron and set a value for each attribute
3. Go to patron search and do a search that will return your patron (and
some others to avoid the redirection)
4. Show column 'Extended attributes' by clicking on 'Column visibility'
button
5. Note that all attributes are displayed correctly
6. prove t/db_dependent/Koha/Patron/Attributes.t

Signed-off-by: Cab Vinton <bibliwho@gmail.com>
Comment 8 Jonathan Druart 2018-08-06 17:35:53 UTC
(just linking similar stuffs - https://gitlab.com/joubu/Koha/blob/bug_20443/Koha/Patron/Attribute.pm)
Comment 9 Katrin Fischer 2018-08-28 06:26:07 UTC
This is working well for me and is a really nice addition.

Wondering 2 things:
- We got a system preference for turning on/off patron attributes. Should the column not be visible when the pref is turned off? (ExtendedPatronAttributes)
- The display_value method somehow looks not quite right to me. I think this may be what Jonathan was trying to point out in his comment, that there could be another way of doing it. Could you take a look and comment?

I rebased the patch for testing, I will attach the rebased patch.
Comment 10 Katrin Fischer 2018-08-28 06:26:37 UTC
Created attachment 78213 [details] [review]
Bug 19909: Show attributes in patron search results

Add a new column (hidden by default) in the results table which
displays all attributes associated to the corresponding patron.

New subroutine Koha::Patron::Attribute::display_value that
returns the authorised value description and defaults to the raw value
if the attribute's type is not associated to an authorised value
category

Test plan:
1. Create some patron attribute types, with and without an associated
authorised value category
2. Choose an existing patron and set a value for each attribute
3. Go to patron search and do a search that will return your patron (and
some others to avoid the redirection)
4. Show column 'Extended attributes' by clicking on 'Column visibility'
button
5. Note that all attributes are displayed correctly
6. prove t/db_dependent/Koha/Patron/Attributes.t

Signed-off-by: Cab Vinton <bibliwho@gmail.com>
Comment 11 Julian Maurice 2020-05-22 13:36:45 UTC
Created attachment 105267 [details] [review]
Bug 19909: Show attributes in patron search results

Add a new column (hidden by default) in the results table which
displays all attributes associated to the corresponding patron.

Test plan:
1. Enable ExtendedPatronAttributes
2. Create some patron attribute types, with and without an associated
authorised value category
3. Choose an existing patron and set a value for each attribute
4. Go to patron search and do a search that will return your patron (and
some others to avoid the redirection)
5. Show column 'Extended attributes' by clicking on 'Column visibility'
button
6. Note that all attributes are displayed correctly
7. prove t/db_dependent/Koha/Patron/Attributes.t
8. Disable syspref ExtendedPatronAttributes and verify that the column
   is not displayed

Signed-off-by: Cab Vinton <bibliwho@gmail.com>
Comment 12 Julian Maurice 2020-05-22 13:43:44 UTC
(In reply to Katrin Fischer from comment #9)
> This is working well for me and is a really nice addition.
> 
> Wondering 2 things:
> - We got a system preference for turning on/off patron attributes. Should
> the column not be visible when the pref is turned off?
> (ExtendedPatronAttributes)

I added checks for this syspref. The column should be hidden now when syspref is disabled

> - The display_value method somehow looks not quite right to me. I think this
> may be what Jonathan was trying to point out in his comment, that there
> could be another way of doing it. Could you take a look and comment?

I removed it. There is now a 'description' method which does the same thing.
Comment 13 Lucas Gass 2020-05-22 21:02:49 UTC
Created attachment 105281 [details] [review]
Bug 19909: Show attributes in patron search results

Add a new column (hidden by default) in the results table which
displays all attributes associated to the corresponding patron.

Test plan:
1. Enable ExtendedPatronAttributes
2. Create some patron attribute types, with and without an associated
authorised value category
3. Choose an existing patron and set a value for each attribute
4. Go to patron search and do a search that will return your patron (and
some others to avoid the redirection)
5. Show column 'Extended attributes' by clicking on 'Column visibility'
button
6. Note that all attributes are displayed correctly
7. prove t/db_dependent/Koha/Patron/Attributes.t
8. Disable syspref ExtendedPatronAttributes and verify that the column
   is not displayed

Signed-off-by: Cab Vinton <bibliwho@gmail.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>