[Koha-patches] [PATCH] 3.0.x fix for Bug 5082, Default framework name not translatable
Owen Leonard
oleonard at myacpl.org
Tue Aug 3 15:41:14 CEST 2010
---
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 5b209a6..331f5ee 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 b7809d4..bec846a 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) {
<!-- /TMPL_UNLESS -->
- <p><b>With Framework :<!--TMPL_VAR Name="framework" --></b></p>
+ <p><b>With Framework : <select name="Frameworks" id="Frameworks" onchange="Changefwk(this);">
+ <option value="">Default</option>
+ <!-- TMPL_LOOP NAME="frameworkcodeloop" -->
+ <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value"-->" selected="selected"><!-- TMPL_VAR NAME="frameworktext" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="frameworktext" --></option><!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select></b></p>
<div id="bibliotabs" class="toptabs numbered">
<ul>
--
1.7.0.4
More information about the Koha-patches
mailing list