From 98119c69515676044b075196a7bc40c9d3a03803 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Fri, 18 Jul 2014 22:51:22 -0300 Subject: [PATCH] [SIGNED-OFF] Bug 766: Remove CGI::scrollinglist from marctagstructure.pl Content-Type: text/plain; charset="utf-8" This patch removes the only instance in this file. Don't know if the feature is of some utility, seems that does not work (no use of auth values as indicators on MARC editor) To test: 1. Apply the patch 2. Go to Administration > MARC frameworks 3. Clic on MARC structure of any fw 4. Clic Edit on any tag 5. On tag editor check the pulldown 'Authorised value', that was replaced 6. Check for regressions: select a value, save, verify the value, change again, etc. Note: removed a SELECT, using now C4::Koha::GetAuthorisedValueCategories Do not we need an AuthorisedValues.pm? (on C4 or Koha) Signed-off-by: Owen Leonard --- admin/marctagstructure.pl | 21 +++++++------------- .../prog/en/modules/admin/marctagstructure.tt | 12 ++++++++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index 3ff48b4..c914442 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -100,20 +100,13 @@ if ($op eq 'add_form') { $sth->execute($searchfield,$frameworkcode); $data=$sth->fetchrow_hashref; } - my $sth = $dbh->prepare("select distinct category from authorised_values"); - $sth->execute; - my @authorised_values; - push @authorised_values,""; - while ((my $category) = $sth->fetchrow_array) { - push @authorised_values, $category; - } - my $authorised_value = CGI::scrolling_list(-name=>'authorised_value', - -values=> \@authorised_values, - -size=>1, - -id=>"authorised_value", - -multiple=>0, - -default => $data->{'authorised_value'}, - ); + + my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()}; # function returns array ref, dereferencing + unshift @authorised_values, ""; # put empty value first + my $authorised_value = { + values => \@authorised_values, + default => $data->{'authorised_value'}, + }; if ($searchfield) { $template->param(searchfield => $searchfield); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt index 80f3748..219389d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt @@ -92,7 +92,17 @@ $(document).ready(function() { [% END %] -
  • [% authorised_value %] (if you select a value here, the indicators will be limited to the authorized value list)
  • +
  • + + (if you select a value here, the indicators will be limited to the authorized value list)
  • -- 1.7.9.5