[Koha-cvs] koha/export marc.pl [dev_week]
Tumer Garip
tgarip at neu.edu.tr
Tue May 9 11:09:35 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Tumer Garip <tgarip1957 at savannah.gnu.org> 06/05/09 09:09:34
Modified files:
export : marc.pl
Log message:
Export from biblioitems (very fast)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/export/marc.pl.diff?only_with_tag=dev_week&tr1=1.4.2.6&tr2=1.4.2.6.2.1&r1=text&r2=text
Patches:
Index: koha/export/marc.pl
diff -u /dev/null koha/export/marc.pl:1.4.2.6.2.1
--- /dev/null Tue May 9 09:09:34 2006
+++ koha/export/marc.pl Tue May 9 09:09:34 2006
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+use HTML::Template;
+use strict;
+require Exporter;
+use C4::Database;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Output; # contains gettemplate
+use C4::Biblio;
+use CGI;
+use C4::Auth;
+
+my $query = new CGI;
+my $op=$query->param("op");
+if ($op eq "export") {
+ print $query->header('Content-Type: text/marc');
+ my $start_bib = $query->param("start_bib");
+ my $end_bib = $query->param("end_bib");
+ my $dbh=C4::Context->dbh;
+ my $sth;
+ if ($start_bib && $end_bib) {
+ $sth=$dbh->prepare("select marc from biblioitems where biblionumber >=? and biblionumber <=? order by biblionumber");
+ $sth->execute($start_bib,$end_bib);
+ } elsif ($start_bib ) {
+ $sth=$dbh->prepare("select marc from biblioitems where biblionumber >=? order by biblionumber");
+ $sth->execute($start_bib);
+ }else {
+ $sth=$dbh->prepare("select marc from biblioitems order by biblionumber");
+ $sth->execute();
+ }
+ while (my ($marc) = $sth->fetchrow) {
+
+ if ($marc){print $marc;}
+ }
+} else {
+ my ($template, $loggedinuser, $cookie)
+ = get_template_and_user({template_name => "export/marc.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {parameters => 1, management => 1, tools => 1},
+ debug => 1,
+ });
+ output_html_with_http_headers $query, $cookie, $template->output;
+}
+
More information about the Koha-cvs
mailing list