From 8daca4918eb59d15ac71f6185d3005dec61099f8 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Thu, 6 Jul 2017 20:49:44 +0100 Subject: [PATCH] Bug 7374: Can't upload icon for auth values This patch allows the upload of a remote image to the authorised values policies. --- admin/authorised_values.pl | 9 ++++++++- .../prog/en/modules/admin/authorised_values.tt | 22 +++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index 272ed00..87a729f 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -28,6 +28,7 @@ use C4::Output; use Koha::AuthorisedValues; use Koha::AuthorisedValueCategories; use Koha::Libraries; +use Koha::Localizations; my $input = new CGI; my $id = $input->param('id'); @@ -98,8 +99,14 @@ if ($op eq 'add_form') { } elsif ($op eq 'add') { my $new_authorised_value = $input->param('authorised_value'); my $new_category = $input->param('category'); + my $image = $input->param('image') || q||; my $imageurl = $input->param( 'imageurl' ) || ''; - $imageurl = '' if $imageurl =~ /removeImage/; + my $imageurl = + $image eq 'removeImage' ? '' + : ( + $image eq 'remoteImage' ? $input->param('remoteImage') + : $image + ); my $duplicate_entry = 0; my @branches = grep { $_ ne q{} } $input->multi_param('branches'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 5aee840..c105f4e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -126,6 +126,7 @@ $(document).ready(function() { [% FOREACH imageset IN imagesets %] [% IF ( imageset.imagesetactive ) %]
  • [% ELSE %]
  • [% END %][% imageset.imagesetname %]
  • [% END %] + [% IF itemtype.image_location('intranet').match('^http') %]
  • [% ELSE %]
  • [% END %]Remote image
  • [% END %] - + +
    + +
    +
    + + [% END %]
    -- 2.1.4