koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/z3950 displayfrombreeding.pl [rel_2_2]


From: Mason James
Subject: [Koha-cvs] koha/z3950 displayfrombreeding.pl [rel_2_2]
Date: Thu, 07 Jun 2007 02:57:54 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Mason James <sushi>     07/06/07 02:57:54

Added files:
        z3950          : displayfrombreeding.pl 

Log message:
        ryan's script to display marc record from breeding table

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/z3950/displayfrombreeding.pl?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.2.1

Patches:
Index: displayfrombreeding.pl
===================================================================
RCS file: displayfrombreeding.pl
diff -N displayfrombreeding.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ displayfrombreeding.pl      7 Jun 2007 02:57:54 -0000       1.1.2.1
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+
+# $Id: displayfrombreeding.pl,v 1.1.2.1 2007/06/07 02:57:54 sushi Exp $
+
+# Script for handling import of MARC data into Koha db
+#   and Z39.50 lookups
+
+# Koha library project  www.koha.org
+
+# Licensed under the GPL
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# 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
+
+use strict;
+
+# standard or CPAN modules used
+use CGI qw(:standard);
+use DBI;
+
+# Koha modules used
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use HTML::Template;
+use C4::Auth;
+use C4::Breeding;
+
+use MARC::Record;
+
+use Data::Dumper;
+
+my $userid = $ENV{'REMOTE_USER'};
+
+my $input       = new CGI;
+my $breeding_id = $input->param('id');
+
+my $dbh = C4::Context->dbh;
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "import/display_marc.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { parameters => 1, management => 1, tools => 1 },
+        debug           => 1,
+    }
+);
+
+$template->param( SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, );
+my $sth;
+
+if ($breeding_id) {
+    $sth = $dbh->prepare('select marc from marc_breeding where id=?');
+    $sth->execute($breeding_id);
+}
+my ($rawmarc) = $sth->fetchrow_array();
+my $record = MARC::File::USMARC::decode($rawmarc);
+
+my $formatted = $record->as_formatted;
+
+$template->param( MARC_FORMATTED => $formatted );
+
+output_html_with_http_headers $input, $cookie, $template->output;
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]