[Koha-patches] [PATCH] [SIGNED-OFF 4/4] Fix for Bug 5082 - Not translatable name of default framework 'Default' in MARCdetail.tmpl

Galen Charlton gmcharlt at gmail.com
Sat Oct 30 07:52:50 CEST 2010


From: Owen Leonard <oleonard at myacpl.org>

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 <gmcharlt at gmail.com>
---
 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 6547567..b543d75 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 b5dd80b..8880f8b 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



More information about the Koha-patches mailing list