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).
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.
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.
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.
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.
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.
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 :(
Patch tested with a sandbox, by Séverine Queune <severine.queune@bulac.fr>
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>
(In reply to Séverine Queune from comment #6) > Thanks a lot Jonathan !! Thank you for testing!
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)
Created attachment 63388 [details] [review] Bug 18370: Use splice instead of splice
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>
Created attachment 63409 [details] [review] Bug 18370: Use splice instead of splice Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Pushed to master for 17.05, thanks Jonathan!
These patches have been pushed to 16.11.x and will be in 16.11.08.
Pushed to 3.22.x for 3.22.21
Pushed to 16.05.x, for 16.05.13 release