From 199c1a7cc494a13f7fb61514a2368f6e970b28e9 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 30 Apr 2021 03:36:08 +0000 Subject: [PATCH] Bug 26346: Updated Edit list hint message When a user creates a list with category = 'private' and Allow changes to contents from = 'Staff only' they will see hint message referring to the staff permission option. Test plan: 1. Follow the test plan in the previous commit 2. Create a new list in the staff client, select 'Category'='Private', 'Allow changes to contents from'='Staff only' 3. Notice 'The Staff only permission has no actual effect while this list is strictly private' message hint is displayed 4. Change 'Category'='Public' and notice the hint is removed 5. Switch back to 'Category'='Private' and 'Allow changes to contents from'='Anyone' 6. Notice the 'The Anyone permission has no actual effect while this list is strictly private.' 7. Repeat steps 2-6 in the OPAC Sponsored-by: Horowhenua Library Trust, New Zealand --- .../prog/en/modules/virtualshelves/shelves.tt | 16 ++++++++++++++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 7790d2fda6..1e393292a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -39,6 +39,7 @@   +   [% END %] @@ -811,16 +812,27 @@ if( perms < 2 ) { $("#anyone_remark").hide(); + $("#staff_remark").hide(); } else if( category==1 ) { - // If we move to Private (without shares), show Anyone remark + // If we move to Private (without shares), show either: + // Anyone remark if Anyone can change the list + // Or Staff remark is Staff only can change the list // Note: the number of shares is not tested real-time [% IF !shelf.is_shared %] - $("#anyone_remark").show(); + if( perms== 2) { + $("#anyone_remark").show(); + $("#staff_remark").hide(); + } else if ( perms==3 ) { + $("#anyone_remark").hide(); + $("#staff_remark").show(); + } [% ELSE %] $("#anyone_remark").hide(); + $("#staff_remark").hide(); [% END %] } else { // category==2 $("#anyone_remark").hide(); + $("#staff_remark").hide(); } } [% IF op == 'view' %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 3bdb18b641..adfe9598ee 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -53,6 +53,7 @@   +   [% END %] @@ -1102,16 +1103,26 @@ function AdjustRemark() { if( perms < 2 ) { $("#anyone_remark").hide(); + $("#staff_remark".hide(); } else if( category==1 ) { - // If we move to Private (without shares), show Anyone remark + // If we move to Private (without shares), show one of the following: + // Anyone remark, if anyone can change the list + // Staff remark, if only Staff can change the list // Note: the number of shares is not tested real-time [% IF !shelf.is_shared %] - $("#anyone_remark").show(); + if ( perms==2 ) { + $("#anyone_remark").show(); + $("#staff_remark").hide(); + } else if ( perms==3 ) { + $("#anyone_remark").hide(); + $("#staff_remark").show(); [% ELSE %] $("#anyone_remark").hide(); + $("#staff_remark").hide(); [% END %] } else { // category==2 $("#anyone_remark").hide(); + $("#staff_remark").hide(); } } -- 2.11.0