From bcb99be34e2072a7ba367ca02e7c7f69a7f4f9f9 Mon Sep 17 00:00:00 2001
From: Alex Buckley <alexbuckley@catalyst.net.nz>
Date: Wed, 24 Aug 2022 01:01:33 +0000
Subject: [PATCH] Bug 30418: Re-order options of who can edit list contents

The 'Allow changes to contents from' dropdown when creating/edit lists
should be most locked down to least locked down:

1. Nobody
2. Owner only
3. Permitted staff only
4. Staff only
5. Anyone seeing this list

Sponsored-by: Catalyst IT, New Zealand

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
---
 .../prog/en/modules/virtualshelves/shelves.tt   | 17 ++++++++---------
 .../bootstrap/en/modules/opac-shelves.tt        | 10 ++++++----
 2 files changed, 14 insertions(+), 13 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 bffd2231a8e..92b2eb81d09 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ -37,28 +37,27 @@
                 <option value="1">Owner only</option>
             [% END %]
 
-            [% IF shelf.allow_change_from_others %]
-                <option value="2" selected="selected">Anyone seeing this list</option>
+            [% IF shelf.allow_change_from_permitted_staff %]
+                <option value="4" selected="selected">Permitted staff only</option>
             [% ELSE %]
-                <option value="2">Anyone seeing this list</option>
+                <option value="4">Permitted staff only</option>
             [% END %]
-
             [% IF shelf.allow_change_from_staff %]
                 <option value="3" selected="selected">Staff only</option>
             [% ELSE %]
                 <option value="3">Staff only</option>
             [% END %]
 
-            [% IF shelf.allow_change_from_permitted_staff %]
-                <option value="4" selected="selected">Permitted staff only</option>
+            [% IF shelf.allow_change_from_others %]
+                <option value="2" selected="selected">Anyone seeing this list</option>
             [% ELSE %]
-                <option value="4">Permitted staff only</option>
+                <option value="2">Anyone seeing this list</option>
             [% END %]
 
         </select>
-        &emsp; <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
-        &emsp; <span id="staff_remark" style="display:none;color:red;">The Staff only permission has no actual effect while this list is strictly private.</span>
         &emsp; <span id="permitted_staff_remark" style="display:none;color:red;">The Permitted staff only permission has no actual effect while this list is strictly private.</span>
+        &emsp; <span id="staff_remark" style="display:none;color:red;">The Staff only permission has no actual effect while this list is strictly private.</span>
+        &emsp; <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
     </li>
 [% END %]
 </head>
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 5da2a6d427c..01cd3aafcca 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -48,15 +48,17 @@
                 <option value="1">Owner only</option>
             [% END %]
 
-            [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
+            [% IF permitteduser == 1 %][% IF shelf.allow_change_from_permitted_staff %]<option value="4" selected="selected">Permitted staff only</option>[% ELSE %]<option value="4">Permitted staff only</option>[% END %][% END %]
 
             [% IF staffuser == 1 %][% IF shelf.allow_change_from_staff %]<option value="3" selected="selected">Staff only</option>[% ELSE %]<option value="3">Staff only</option>[% END %][% END %]
-            [% IF permitteduser == 1 %][% IF shelf.allow_change_from_permitted_staff %]<option value="4" selected="selected">Permitted staff only</option>[% ELSE %]<option value="4">Permitted staff only</option>[% END %][% END %]
+
+            [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
+
 
         </select>
-        &emsp; <span id="anyone_remark" style="display:none;color:red;">The "Anyone" permission has no actual effect while this list is strictly private.</span>
+        &emsp; <span id="permitted_staff_remark" style="display:none;color:red;">The "Permitted staff only" permission has no actual effect while this list is strictly private.</span>
         &emsp; <span id="staff_remark" style="display:none;color:red;">The "Staff only" permission has no actual effect while this list is strictly private.</span>
-         &emsp; <span id="permitted_staff_remark" style="display:none;color:red;">The "Permitted staff only" permission has no actual effect while this list is strictly private.</span>
+        &emsp; <span id="anyone_remark" style="display:none;color:red;">The "Anyone" permission has no actual effect while this list is strictly private.</span>
     </li>
 [% END %]
 
-- 
2.30.2