Bug 17316: Do not display the list's name if the user does not have permission -...
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 20 Sep 2016 09:03:42 +0000 (10:03 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Sun, 25 Sep 2016 13:13:58 +0000 (13:13 +0000)
Same as previous patch but for the staff interface

Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
virtualshelves/shelves.pl

index be58db0..8d7a482 100644 (file)
@@ -29,7 +29,7 @@
 <div id="toolbar" class="btn-toolbar">
     <div class="btn-group"><a id="newshelf" class="btn btn-small" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=add_form&amp;referer=[% op %]"><i class="fa fa-plus"></i> New list</a></div>
 
-    [% IF op == 'view' %]
+    [% IF shelf AND op == 'view' %]
         [% IF can_manage_shelf %]
         <div class="btn-group">
             <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-pencil"></i> Edit <span class="caret"></span></button>
index 4982909..62b17a0 100644 (file)
@@ -113,7 +113,7 @@ $(document).ready(function(){
 });
 [% END %]
 
-[% IF op == 'view' %]
+[% IF shelf AND op == 'view' %]
 $(document).ready(function(){
     [% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %]
     $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-remove\"></i>"+_(" Clear all")+"<\/a>");
index 100af44..11a90ae 100755 (executable)
@@ -297,6 +297,7 @@ if ( $op eq 'view' ) {
             }
         } else {
             push @messages, { type => 'error', code => 'unauthorized_on_view' };
+            undef $shelf;
         }
     } else {
         push @messages, { type => 'error', code => 'does_not_exist' };