@@ -, +, @@
permissions. Is the remark shown or hidden accordingly?
Note: Include a test with OpacAllowPublicListCreation enabled.
You should never see the remark.
---
.../prog/en/modules/virtualshelves/shelves.tt | 31 +++++++++++++++++++--
.../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 32 ++++++++++++++++++++--
2 files changed, 57 insertions(+), 6 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ -12,7 +12,7 @@
[% BLOCK list_permissions %]
-
[% END %]
@@ -217,6 +217,12 @@ $(document).ready(function(){
});
[% END %]
+[% IF shelf AND op == 'edit_form' %]
+$(document).ready(function(){
+ AdjustRemark();
+});
+[% END %]
+
/**
* This function checks if the adequate number of records are checked for merging
*/
@@ -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 %]