@@ -, +, @@ if the permissions combo changes accordingly. --- .../prog/en/modules/virtualshelves/shelves.tt | 22 +++++++++++++++++++++- .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 22 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -306,6 +306,26 @@ function placeHold () { return false; } } + +function AdjustPerms() { + var category = $("#category").val(); + var count_perms = $("#allow_changes_from option").length; + + // If we move to Private, remove Anyone if we did not have shares + // Note: the number of shares is not tested real-time (just template var) + if( category == 1 ) { + [% IF !shelf.is_shared %] + $("#allow_changes_from option[value='2']").remove(); + [% END %] + } + // But if we move to Public, we may need to add it (again) + else if( category == 2 && count_perms == 2 ) { + $("#allow_changes_from").append( $('[% ELSE %][% END %]
  • - [% IF shelf.is_private %] [% ELSE %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -579,7 +579,7 @@ [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
  • - [% IF shelf.is_private %] [% ELSE %] @@ -954,6 +954,26 @@ function Check(f) { alert(alertString2); } } + +function AdjustPerms() { + var category = $("#category").val(); + var count_perms = $("#allow_changes_from option").length; + + // If we move to Private, remove Anyone if we did not have shares + // Note: the number of shares is not tested real-time (just template var) + if( category == 1 ) { + [% IF !shelf.is_shared %] + $("#allow_changes_from option[value='2']").remove(); + [% END %] + } + // But if we move to Public, we may need to add it (again) + else if( category == 2 && count_perms == 2 ) { + $("#allow_changes_from").append( $('