From 60b6e1ee3a9cef42345b87b081acfab29e1aced7 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 Signed-off-by: Katrin Fischer --- .../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 d3aea7e..6c2e37f 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -327,6 +327,7 @@ $template->param( category => $category, print => scalar $query->param('print') || 0, csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ], + loggedinuser => $loggedinuser, ); output_html_with_http_headers $query, $cookie, $template->output; -- 2.1.4