[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/barcodes label-print-csv.pl [dev_week]
From: |
Mason James |
Subject: |
[Koha-cvs] koha/barcodes label-print-csv.pl [dev_week] |
Date: |
Mon, 21 Jan 2008 23:59:11 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Mason James <sushi> 08/01/21 23:59:11
Added files:
barcodes : label-print-csv.pl
Log message:
script to generate csv output of barcodes, to be used with 3rd-party
barcode apps.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-print-csv.pl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1
Patches:
Index: label-print-csv.pl
===================================================================
RCS file: label-print-csv.pl
diff -N label-print-csv.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ label-print-csv.pl 21 Jan 2008 23:59:11 -0000 1.1.2.1
@@ -0,0 +1,84 @@
+#!/usr/bin/perl
+
+use strict;
+use CGI;
+use C4::Labels;
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Context;
+use HTML::Template;
+use POSIX;
+
+use Text::CSV_XS;
+
+#use Smart::Comments '###';
+
+my $htdocs_path = C4::Context->config('intrahtdocs');
+my $cgi = new CGI;
+
+print $cgi->header( -type => 'application/pdf', -attachment => 'barcode.csv' );
+
+# get the printing settings
+my $template = GetActiveLabelTemplate();
+my $conf_data = get_label_options();
+
+#my $batch_id = $cgi->param('batch_id');
+my $batch_id = 1;
+##### $batch_id;
+
+my @resultsloop = get_label_items($batch_id);
+
+my $barcodetype = $conf_data->{'barcodetype'};
+my $printingtype = $conf_data->{'printingtype'};
+my $guidebox = $conf_data->{'guidebox'};
+my $start_label = $conf_data->{'startlabel'};
+
+my $fontsize = $template->{'fontsize'};
+my $fontsize = 6;
+
+my $units = $template->{'units'};
+
+my $unitvalue = GetUnitsValue($units);
+
+my $tmpl_code = $template->{'tmpl_code'};
+my $tmpl_desc = $template->{'tmpl_desc'};
+
+my $batch_count = get_batch_count($batch_id);
+
+my $margin = $top_margin;
+my $str;
+my $item;
+my ( $i, $i2 ); # loop counters
+
+#
+# main foreach loop
+#
+
+my $csv = Text::CSV_XS->new( { eol => "\n", } );
+
+my @fields = qw ( itemcallnumber replacementpricedate homebranch
+ callnum_author title barcode_homebranch media.number date_acquired
library_name);
+
+my $status = $csv->print( $cgi, address@hidden );
+
+foreach $item (@resultsloop) {
+
+ my $callnum_author = $item->{'itemcallnumber'} . ' ' . $item->{'author'};
+
+ my @fields = (
+ $item->{'itemcallnumber'},
+ $item->{'replacementpricedate'},
+ $item->{'homebranch'},
+ $callnum_author,
+ $item->{'title'},
+ "$item->{'barcode'} $item->{'homebranch'}",
+ '530a',
+ '952b',
+ 'Athens County Public Library'
+ );
+
+ my $status = $csv->print( $cgi, address@hidden );
+
+}
+
- [Koha-cvs] koha/barcodes label-print-csv.pl [dev_week],
Mason James <=