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 2b32ca0be7..f26acd45e1 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ -12,7 +12,7 @@
[% BLOCK list_permissions %]
-
[% END %]
@@ -215,6 +215,12 @@ $(document).ready(function(){
}
});
});
+[% END %]
+
+[% IF shelf AND op == 'edit_form' %]
+$(document).ready(function(){
+ AdjustRemark();
+});
[% END %]
/**
@@ -305,6 +311,25 @@ function placeHold () {
return false;
}
}
+
+function AdjustRemark() {
+ var category = $("#category").val();
+ var perms = $("#allow_changes_from").val();
+
+ if( perms < 2 ) {
+ $("#anyone_remark").hide();
+ } else if( category==1 ) {
+ // If we move to Private (without shares), show Anyone remark
+ // Note: the number of shares is not tested real-time
+ [% IF !shelf.is_shared %]
+ $("#anyone_remark").show();
+ [% ELSE %]
+ $("#anyone_remark").hide();
+ [% END %]
+ } else { // category==2
+ $("#anyone_remark").hide();
+ }
+}
//]]>
@@ -556,7 +581,7 @@ function placeHold () {
[% IF shelf.sortfield == "itemcallnumber" %][% ELSE %][% END %]
-
+
[% IF shelf.is_private %]
[% ELSE %]
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 f6922f158c..0417531f12 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -13,7 +13,7 @@
[% BLOCK list_permissions %]
-
+
[% IF shelf.allow_change_from_owner %][% ELSE %][% END %]
@@ -26,7 +26,7 @@
[% IF shelf.allow_change_from_others %][% ELSE %][% END %]
-
+
[% END %]
@@ -578,7 +578,7 @@
[% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
-
+
[% IF shelf.is_private %]
[% ELSE %]
@@ -934,6 +934,8 @@ $(function() {
window.print();
setTimeout('window.close()', 1);
[% END %]
+
+ AdjustRemark();
}); // document.ready
function Check(f) {
@@ -953,6 +955,30 @@ function Check(f) {
alert(alertString2);
}
}
+
+function AdjustRemark() {
+ var category;
+ if( $("#category").length > 0 ) {
+ category = $("#category").val();
+ } else {
+ category = [% category %];
+ }
+ var perms = $("#allow_changes_from").val();
+
+ if( perms < 2 ) {
+ $("#anyone_remark").hide();
+ } else if( category==1 ) {
+ // If we move to Private (without shares), show Anyone remark
+ // Note: the number of shares is not tested real-time
+ [% IF !shelf.is_shared %]
+ $("#anyone_remark").show();
+ [% ELSE %]
+ $("#anyone_remark").hide();
+ [% END %]
+ } else { // category==2
+ $("#anyone_remark").hide();
+ }
+}
//]]>
[% END %]