Bug 5385: POD Cleanups (part 2)
[koha.git] / catalogue / MARCdetail.pl
index f569763..2dc7b1d 100755 (executable)
@@ -13,9 +13,9 @@
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 =head1 NAME
 
@@ -23,6 +23,7 @@ MARCdetail.pl : script to show a biblio in MARC format
 
 =head1 SYNOPSIS
 
+=cut
 
 =head1 DESCRIPTION
 
@@ -39,11 +40,10 @@ the items attached to the biblio
 
 =head1 FUNCTIONS
 
-=over 2
-
 =cut
 
 use strict;
+#use warnings; FIXME - Bug 2505
 
 use C4::Auth;
 use C4::Context;
@@ -55,6 +55,7 @@ use C4::Biblio;
 use C4::Items;
 use C4::Acquisition;
 use C4::Serials;    #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber
+use C4::Search;                # enabled_staff_search_views
 
 
 my $query        = new CGI;
@@ -88,30 +89,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;
@@ -316,6 +308,8 @@ $template->param (
     popup                   => $popup,
     hide_marc               => C4::Context->preference('hide_marc'),
        marcview => 1,
+       z3950_search_params             => C4::Search::z3950_search_args($biblio),
+       C4::Search::enabled_staff_search_views,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;