Bug 18370 - Columns settings patrons>id=memberresultst : display bug
Summary: Columns settings patrons>id=memberresultst : display bug
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-03 12:25 UTC by Séverine Queune
Modified: 2017-12-07 22:20 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18370: Columns visibility on patron search - Hide the correct column (1.64 KB, patch)
2017-04-03 14:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18370: Columns visibility on patron search - Hide the correct column (1.84 KB, patch)
2017-04-05 08:59 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 18370: Use splice instead of splice (1.11 KB, patch)
2017-05-11 15:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18370: Columns visibility on patron search - Hide the correct column (1.85 KB, patch)
2017-05-12 07:10 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 18370: Use splice instead of splice (1.17 KB, patch)
2017-05-12 07:10 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Séverine Queune 2017-04-03 12:25:10 UTC
When checking box on Patrons > id=memberresultst (menu Administration > Column settings), displays are different if a superadmin is connected or if it's an other user, on the staff interface.
For exemple :
 - when "Fines" is checked, a super admin doesn't see the column "Fines" but an other user sees the "Fines" but not the "Circ notes" column.
 - when "Circ_notes" is checked, a superadmin doesn't see the column but an other user sees it.

Seen on different versions of Koha (3.20, 16.05, 16.11).
Comment 1 Jonathan Druart 2017-04-03 14:55:29 UTC
Created attachment 61797 [details] [review]
Bug 18370: Columns visibility on patron search - Hide the correct column

When a column is hidden by default on the patron search result table,
if the logged in user does not have the "tools > manage_patron_lists"
permission, the wrong column will be hidden.

Test plan:
Edit the column visibility detail for "Patrons > id=memberresultst"
Set "Fines" hidden by default
Search for patrons
=> Without this patch, if the logged in user does not have the
manage_patron_lists permission, the wrong column will be
hidden/displayed.
Comment 2 Séverine Queune 2017-04-03 15:33:20 UTC
Display is ok for the "Fines " column for both type of user.

"Circ notes" is still visible for a no-superadmin user even when it's checked.
It's hidden when both "Fines" and "Circ_notes" are checked but in this case, "Fines" is visible.
Comment 3 Jonathan Druart 2017-04-03 16:02:14 UTC
Hum, seems ok to me.
How did you test, on a sandbox? If that the case, please send me the url to compare the permissions.
Comment 4 Séverine Queune 2017-04-04 07:26:09 UTC
Yes it was the Biblibre's sandbox n°4.
http://pro.demo1605-koha.test.biblibre.eu/cgi-bin/koha/mainpage.pl

I used test//test as a superadmin user and 4941//4941 as a no-superadmin user.
Currently on this sandbox, "Fines" and "Circ_Notes" are checked but when I use the user 4941, only the "Circ notes" is hidden.
Comment 5 Jonathan Druart 2017-04-04 17:44:42 UTC
Séverine, the link you gave is not the sandbox 4, sounds like it's a 16.05 version install, so without the patch I guess.
Comment 6 Séverine Queune 2017-04-05 08:57:57 UTC
Sorry about the link, I was working on different Koha...
There was still a display problem on sandbox #4 this morning.
I tried to aply the patch again and it seems to work !
Thanks a lot Jonathan !!
Ans sorry again about my careless mistake :(
Comment 7 Biblibre Sandboxes 2017-04-05 08:59:25 UTC
Patch tested with a sandbox, by Séverine Queune <severine.queune@bulac.fr>
Comment 8 Biblibre Sandboxes 2017-04-05 08:59:46 UTC
Created attachment 61870 [details] [review]
Bug 18370: Columns visibility on patron search - Hide the correct column

When a column is hidden by default on the patron search result table,
if the logged in user does not have the "tools > manage_patron_lists"
permission, the wrong column will be hidden.

Test plan:
Edit the column visibility detail for "Patrons > id=memberresultst"
Set "Fines" hidden by default
Search for patrons
=> Without this patch, if the logged in user does not have the
manage_patron_lists permission, the wrong column will be
hidden/displayed.

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Comment 9 Jonathan Druart 2017-04-05 14:04:37 UTC
(In reply to Séverine Queune from comment #6)

> Thanks a lot Jonathan !!

Thank you for testing!
Comment 10 Julian Maurice 2017-05-11 12:18:12 UTC
Comment on attachment 61870 [details] [review]
Bug 18370: Columns visibility on patron search - Hide the correct column

Review of attachment 61870 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
@@ +163,5 @@
>      // Apply DataTables on the results table
>      var columns_settings = [% ColumnsSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) %];
> +    [% UNLESS CAN_user_tools_manage_patron_lists %]
> +        [%# Remove the first column if we do not display the checkbox %]
> +        columns_settings = columns_settings.slice(1, -1);

slice(1, -1) removes the first and the last elements of the array
slice(1) is what you want.
An even better solution is to use Array.splice, because it modifies directly the array (and it's faster)
Comment 11 Jonathan Druart 2017-05-11 15:37:53 UTC
Created attachment 63388 [details] [review]
Bug 18370: Use splice instead of splice
Comment 12 Julian Maurice 2017-05-12 07:10:07 UTC
Created attachment 63408 [details] [review]
Bug 18370: Columns visibility on patron search - Hide the correct column

When a column is hidden by default on the patron search result table,
if the logged in user does not have the "tools > manage_patron_lists"
permission, the wrong column will be hidden.

Test plan:
Edit the column visibility detail for "Patrons > id=memberresultst"
Set "Fines" hidden by default
Search for patrons
=> Without this patch, if the logged in user does not have the
manage_patron_lists permission, the wrong column will be
hidden/displayed.

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 13 Julian Maurice 2017-05-12 07:10:13 UTC
Created attachment 63409 [details] [review]
Bug 18370: Use splice instead of splice

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 14 Kyle M Hall 2017-05-12 12:55:37 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 15 Katrin Fischer 2017-05-14 09:56:31 UTC
These patches have been pushed to 16.11.x and will be in 16.11.08.
Comment 16 Julian Maurice 2017-05-22 10:49:34 UTC
Pushed to 3.22.x for 3.22.21
Comment 17 Mason James 2017-05-24 02:36:54 UTC
Pushed to 16.05.x, for 16.05.13 release