[Koha-cvs] koha/C4 Labels.pm [rel_2_2]
Mason James
szrj1m at yahoo.com
Mon Oct 2 00:03:07 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch: rel_2_2
Changes by: Mason James <sushi> 06/10/01 22:03:07
Modified files:
C4 : Labels.pm
Log message:
commenting out dummy test values for ean13 and 9 barcodes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.2&r2=1.3.2.3
Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -b -r1.3.2.2 -r1.3.2.3
--- Labels.pm 1 Aug 2006 00:02:52 -0000 1.3.2.2
+++ Labels.pm 1 Oct 2006 22:03:07 -0000 1.3.2.3
@@ -21,7 +21,7 @@
require Exporter;
use vars qw($VERSION @ISA @EXPORT);
-#use Data::Dumper;
+use Data::Dumper;
use PDF::Reuse;
@@ -41,7 +41,8 @@
@EXPORT = qw(
&get_label_options &get_label_items
&build_circ_barcode &draw_boundaries
- &drawbox
+ &drawbox &GetActiveLabelTemplate
+ &GetAllLabelTemplates
);
=item get_label_options;
@@ -63,6 +64,35 @@
return $conf_data;
}
+
+sub GetActiveLabelTemplate {
+ my $dbh = C4::Context->dbh;
+ my $query = " SELECT * FROM labels_templates where active = 1 limit 1";
+ my $sth = $dbh->prepare($query);
+ $sth->execute();
+ my $active_tmpl = $sth->fetchrow_hashref;
+ $sth->finish;
+ return $active_tmpl;
+}
+
+sub GetAllLabelTemplates {
+ my $dbh = C4::Context->dbh;
+ # get the actual items to be printed.
+ my @data;
+ my $query = " Select * from labels_templates ";
+ my $sth = $dbh->prepare($query);
+ $sth->execute();
+ my @resultsloop;
+ while ( my $data = $sth->fetchrow_hashref ) {
+ push( @resultsloop, $data );
+ }
+ $sth->finish;
+
+#warn Dumper @resultsloop;
+ return @resultsloop;
+}
+
+
=item get_label_items;
$options = get_label_items()
@@ -124,12 +154,12 @@
if ( $barcodetype eq 'EAN13' ) {
- #testing EAN13 barcodes hack
- $value = $value . '000000000';
- $value =~ s/-//;
- $value = substr( $value, 0, 12 );
+ # testing EAN13 barcodes hack
+ # $value = $value . '000000000';
+ # $value =~ s/-//;
+ # $value = substr( $value, 0, 12 );
+ # warn $value;
- #warn $value;
eval {
PDF::Reuse::Barcode::EAN13(
x => ( $x_pos_circ + 27 ),
@@ -180,13 +210,12 @@
elsif ( $barcodetype eq 'Matrix2of5' ) {
#warn "MATRIX ELSE:";
-
#testing MATRIX25 barcodes hack
# $value = $value.'000000000';
$value =~ s/-//;
# $value = substr( $value, 0, 12 );
- #warn $value;
+ # warn $value;
eval {
PDF::Reuse::Barcode::Matrix2of5(
@@ -211,12 +240,11 @@
elsif ( $barcodetype eq 'EAN8' ) {
- #testing ean8 barcodes hack
- $value = $value . '000000000';
- $value =~ s/-//;
- $value = substr( $value, 0, 8 );
-
- #warn $value;
+ # testing ean8 barcodes hack
+ # $value = $value . '000000000';
+ # $value =~ s/-//;
+ # $value = substr( $value, 0, 8 );
+ # warn $value;
#warn "EAN8 ELSEIF";
eval {
More information about the Koha-cvs
mailing list