From f4bf61ce1bf408e31e2a7b5c325a531f6de877b6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 3 Aug 2010 09:41:14 -0400 Subject: [PATCH] 3.0.x fix for Bug 5082, Default framework name not translatable --- catalogue/MARCdetail.pl | 40 ++++++++----------- .../prog/en/modules/catalogue/MARCdetail.tmpl | 7 +++- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 5b209a65f6..331f5ee735 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -89,30 +89,22 @@ my $itemcount = GetItemsCount($biblionumber); $template->param( count => $itemcount, bibliotitle => $biblio->{title}, ); -#Getting the list of all frameworks -my $queryfwk = - $dbh->prepare("select frameworktext, frameworkcode from biblio_framework"); -$queryfwk->execute; -my %select_fwk; -my @select_fwk; -my $curfwk; -push @select_fwk, "Default"; -$select_fwk{"Default"} = "Default"; - -while ( my ( $description, $fwk ) = $queryfwk->fetchrow ) { - push @select_fwk, $fwk; - $select_fwk{$fwk} = $description; -} -$curfwk=$frameworkcode; -my $framework=CGI::scrolling_list( -name => 'Frameworks', - -id => 'Frameworks', - -default => $curfwk, - -OnChange => 'Changefwk(this);', - -values => \@select_fwk, - -labels => \%select_fwk, - -size => 1, - -multiple => 0 ); -$template->param(framework => $framework); +# Getting the list of all frameworks +# get framework list +my $frameworks = getframeworks; +my @frameworkcodeloop; +foreach my $thisframeworkcode ( keys %$frameworks ) { + warn $thisframeworkcode; + my %row = ( + value => $thisframeworkcode, + frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, + ); + if ($frameworkcode eq $thisframeworkcode){ + $row{'selected'}="selected=\"selected\""; + } + push @frameworkcodeloop, \%row; +} +$template->param( frameworkcodeloop => \@frameworkcodeloop ); # fill arrays my @loop_data = (); my $tag; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl index b7809d46bb..bec846af9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl @@ -36,7 +36,12 @@ function Changefwk(FwkList) { -

With Framework :

+

With Framework :