From 92e08965ae38c5476c1a0306b8c23253897b1578 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 19 Apr 2017 02:33:02 +0000 Subject: [PATCH] Bug 17218: Stop DB user from clicking 'New list' button To test: 1) Log in as DB user 2) Go to Lists -> New list 3) Attempt to create a new list 4) Notice that you are only stopped once you've submitted the form 5) Go back to lists, apply patch and refresh page 6) Notice the 'New list' button is now disabled 7) Click it and confirm alert shows up Sponsored-by: Catalyst IT --- .../prog/en/includes/virtualshelves-toolbar.inc | 20 ++++++++++++++++---- virtualshelves/shelves.pl | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc index 0f034dc..a47e1db 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc @@ -1,8 +1,16 @@
- - +
+ [% IF loggedinuser == 0 %] + New list + [% ELSE %] + New list + [% END %] +
[% IF shelf AND op == 'view' %] [% IF can_manage_shelf %]
diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index c328869..8e5d3a5 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -324,6 +324,7 @@ $template->param( messages => \@messages, category => $category, print => scalar $query->param('print') || 0, + loggedinuser => $loggedinuser, csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ], ); -- 2.1.4