From a7cb6a9a3813f41aab4371ba350c78044a60faac Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sat, 30 Oct 2010 01:52:50 -0400 Subject: [PATCH] Fix for Bug 5082 - Not translatable name of default framework 'Default' in MARCdetail.tmpl This patch also fixes an unreported bug where switching from any other framework to 'Default' would bring up no MARC data. Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack (cherry picked from commit b0e29e5595f5d92cbd9a66ab306652a01d6382ed) Signed-off-by: Chris Nighswonger --- catalogue/MARCdetail.pl | 37 +++++++------------ .../prog/en/modules/catalogue/MARCdetail.tmpl | 7 +++- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 65475674e0..b543d75e76 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -90,30 +90,21 @@ 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; +# Getting the list of all frameworks +# get framework list +my $frameworks = getframeworks; +my @frameworkcodeloop; +foreach my $thisframeworkcode ( keys %$frameworks ) { + my %row = ( + value => $thisframeworkcode, + frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, + ); + if ($frameworkcode eq $thisframeworkcode){ + $row{'selected'}= 1; + } + push @frameworkcodeloop, \%row; } -$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); +$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 b5dd80b842..8880f8b7be 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 :

    -- 2.39.5