From a0be72d674a9877aeec7d382dc32e4cd831fd22a 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 | 43 +++++++++++++++++++++- virtualshelves/shelves.pl | 1 + 2 files changed, 42 insertions(+), 2 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 dacd451..e6b6952 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,47 @@ [% INCLUDE 'blocking_errors.inc' %] + + +
+
+ [% 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 192580f..d8eff3e 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -351,6 +351,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