+foreach my $item (@$items) {
+ my $label = C4::Labels::Label->new(
+ batch_id => $batch_id,
+ item_number => $item->{'item_number'},
+ format_string => $layout->get_attr('format_string'),
+ );
+ my $csv_fields = $label->csv_data();
+ if ($csv->combine(@$csv_fields)) {
+ print $csv->string() . "\n";
+ }
+ else {
+ warn sprintf('Text::CSV_XS->combine() returned the following error: %s', $csv->error_input);
+ }
+}
+
+__END__
+
+=head1 NAME
+
+labels/label-create-csv.pl - A script for creating a csv export of labels and label batches in Koha
+
+=head1 ABSTRACT
+
+This script provides the means of producing a csv of labels for items either individually, in groups, or in batches from within Koha.
+
+=head1 AUTHOR
+
+Chris Nighswonger <cnighswonger AT foundations DOT edu>
+
+=head1 COPYRIGHT
+
+Copyright 2009 Foundations Bible College.
+
+=head1 LICENSE
+
+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.