[Koha-patches] [PATCH] Bringing label, patroncard, and creator modules into conformity with the rest of C4 style.
Chris Nighswonger
cnighswonger at foundations.edu
Mon Feb 8 21:15:02 CET 2010
---
C4/Creators.pm | 28 ++++++++++++++++++++++++++++
C4/Creators/Lib.pm | 32 ++++++++++++++++----------------
C4/Labels.pm | 13 +++++++++++++
C4/Labels/Lib.pm | 28 ++++++++++++++--------------
C4/Patroncards.pm | 24 ++++++++++++++++++++++++
C4/Patroncards/Lib.pm | 16 ++++++++--------
labels/label-create-csv.pl | 9 +++------
labels/label-create-pdf.pl | 11 ++++-------
labels/label-create-xml.pl | 9 +++------
labels/label-edit-batch.pl | 4 ++--
labels/label-edit-layout.pl | 4 ++--
labels/label-edit-profile.pl | 4 ++--
labels/label-edit-template.pl | 5 ++---
labels/label-manage.pl | 7 ++-----
patroncards/card-print.pl | 4 ++--
patroncards/create-pdf.pl | 7 ++-----
patroncards/edit-batch.pl | 4 ++--
patroncards/edit-layout.pl | 4 ++--
patroncards/edit-template.pl | 5 ++---
patroncards/image-manage.pl | 4 ++--
patroncards/manage.pl | 13 ++++++++-----
patroncards/print.pl | 4 ++--
22 files changed, 145 insertions(+), 94 deletions(-)
create mode 100644 C4/Creators.pm
create mode 100644 C4/Labels.pm
create mode 100644 C4/Patroncards.pm
diff --git a/C4/Creators.pm b/C4/Creators.pm
new file mode 100644
index 0000000..c9538e2
--- /dev/null
+++ b/C4/Creators.pm
@@ -0,0 +1,28 @@
+package C4::Creators;
+
+BEGIN {
+ use version; our $VERSION = qv('1.0.0_1');
+ use vars qw(@EXPORT, @ISA);
+ @ISA = qw(Exporter);
+ our @EXPORT = qw(get_all_templates
+ get_all_layouts
+ get_all_profiles
+ get_all_image_names
+ get_batch_summary
+ get_label_summary
+ get_card_summary
+ get_barcode_types
+ get_label_types
+ get_font_types
+ get_text_justification_types
+ get_output_formats
+ get_column_names
+ get_table_names
+ get_unit_values
+ html_table
+ );
+ use C4::Creators::Lib 1.000000;
+ use C4::Creators::PDF 1.000000;
+}
+
+1;
diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm
index 0b9e5b7..9b24833 100644
--- a/C4/Creators/Lib.pm
+++ b/C4/Creators/Lib.pm
@@ -28,22 +28,22 @@ use C4::Debug;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
use base qw(Exporter);
- our @EXPORT_OK = qw(get_all_templates
- get_all_layouts
- get_all_profiles
- get_all_image_names
- get_batch_summary
- get_label_summary
- get_card_summary
- get_barcode_types
- get_label_types
- get_font_types
- get_text_justification_types
- get_output_formats
- get_column_names
- get_table_names
- get_unit_values
- html_table
+ our @EXPORT = qw(get_all_templates
+ get_all_layouts
+ get_all_profiles
+ get_all_image_names
+ get_batch_summary
+ get_label_summary
+ get_card_summary
+ get_barcode_types
+ get_label_types
+ get_font_types
+ get_text_justification_types
+ get_output_formats
+ get_column_names
+ get_table_names
+ get_unit_values
+ html_table
);
}
diff --git a/C4/Labels.pm b/C4/Labels.pm
new file mode 100644
index 0000000..43fa99d
--- /dev/null
+++ b/C4/Labels.pm
@@ -0,0 +1,13 @@
+package C4::Labels;
+
+BEGIN {
+ use version; our $VERSION = qv('1.0.0_1');
+
+ use C4::Labels::Batch 1.000000;
+ use C4::Labels::Label 1.000000;
+ use C4::Labels::Layout 1.000000;
+ use C4::Labels::Profile 1.000000;
+ use C4::Labels::Template 1.000000;
+}
+
+1;
diff --git a/C4/Labels/Lib.pm b/C4/Labels/Lib.pm
index 2dde0a2..5d2611d 100644
--- a/C4/Labels/Lib.pm
+++ b/C4/Labels/Lib.pm
@@ -28,20 +28,20 @@ use C4::Debug;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
use base qw(Exporter);
- our @EXPORT_OK = qw(get_all_templates
- get_all_layouts
- get_all_profiles
- get_batch_summary
- get_label_summary
- get_barcode_types
- get_label_types
- get_font_types
- get_text_justification_types
- get_label_output_formats
- get_column_names
- get_table_names
- get_unit_values
- html_table
+ our @EXPORT = qw(get_all_templates
+ get_all_layouts
+ get_all_profiles
+ get_batch_summary
+ get_label_summary
+ get_barcode_types
+ get_label_types
+ get_font_types
+ get_text_justification_types
+ get_label_output_formats
+ get_column_names
+ get_table_names
+ get_unit_values
+ html_table
);
}
diff --git a/C4/Patroncards.pm b/C4/Patroncards.pm
new file mode 100644
index 0000000..cc20c2c
--- /dev/null
+++ b/C4/Patroncards.pm
@@ -0,0 +1,24 @@
+package C4::Patroncards;
+
+BEGIN {
+ use version; our $VERSION = qv('1.0.0_1');
+ use vars qw(@EXPORT, @ISA);
+ @ISA = qw(Exporter);
+ our @EXPORT = qw(unpack_UTF8
+ text_alignment
+ leading
+ box
+ get_borrower_attributes
+ put_image
+ get_image
+ rm_image
+ );
+ use C4::Patroncards::Batch 1.000000;
+ use C4::Patroncards::Layout 1.000000;
+ use C4::Patroncards::Lib 1.000000;
+ use C4::Patroncards::Patroncard 1.000000;
+ use C4::Patroncards::Profile 1.000000;
+ use C4::Patroncards::Template 1.000000;
+}
+
+1;
diff --git a/C4/Patroncards/Lib.pm b/C4/Patroncards/Lib.pm
index b0061ae..8462887 100644
--- a/C4/Patroncards/Lib.pm
+++ b/C4/Patroncards/Lib.pm
@@ -28,14 +28,14 @@ use C4::Debug;
BEGIN {
use version; our $VERSION = qv('1.0.0_1');
use base qw(Exporter);
- our @EXPORT_OK = qw(unpack_UTF8
- text_alignment
- leading
- box
- get_borrower_attributes
- put_image
- get_image
- rm_image
+ our @EXPORT = qw(unpack_UTF8
+ text_alignment
+ leading
+ box
+ get_borrower_attributes
+ put_image
+ get_image
+ rm_image
);
}
diff --git a/labels/label-create-csv.pl b/labels/label-create-csv.pl
index f7f396c..10593d1 100755
--- a/labels/label-create-csv.pl
+++ b/labels/label-create-csv.pl
@@ -8,11 +8,8 @@ use Text::CSV_XS;
use Data::Dumper;
use C4::Debug;
-use C4::Labels::Batch 1.000000;
-use C4::Labels::Template 1.000000;
-use C4::Labels::Layout 1.000000;
-use C4::Creators::PDF 1.000000;
-use C4::Labels::Label 1.000000;
+use C4::Creators 1.000000;
+use C4::Label 1.000000;
=head
@@ -96,7 +93,7 @@ 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.
diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl
index 64bd85e..6f6de62 100755
--- a/labels/label-create-pdf.pl
+++ b/labels/label-create-pdf.pl
@@ -6,11 +6,8 @@ use warnings;
use CGI;
use C4::Debug;
-use C4::Labels::Batch 1.000000;
-use C4::Labels::Template 1.000000;
-use C4::Labels::Layout 1.000000;
-use C4::Creators::PDF 1.000000;
-use C4::Labels::Label 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
@@ -97,7 +94,7 @@ else {
LABEL_ITEMS:
foreach my $item (@{$items}) {
my ($barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor) = 0,0,0,0;
- if ($layout->get_attr('printing_type') eq 'ALT') { # we process the ALT style printing type here because it is not an atomic printing type
+ if ($layout->get_attr('printing_type') eq 'ALT') { # we process the ALT style printing type here because it is not an atomic printing type
my $label_a = C4::Labels::Label->new(
batch_id => $batch_id,
item_number => $item->{'item_number'},
@@ -210,7 +207,7 @@ 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.
diff --git a/labels/label-create-xml.pl b/labels/label-create-xml.pl
index 4b7cdde..563c221 100755
--- a/labels/label-create-xml.pl
+++ b/labels/label-create-xml.pl
@@ -8,11 +8,8 @@ use XML::Simple;
use Data::Dumper;
use C4::Debug;
-use C4::Labels::Batch 1.000000;
-use C4::Labels::Template 1.000000;
-use C4::Labels::Layout 1.000000;
-use C4::Creators::PDF 1.000000;
-use C4::Labels::Label 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
=head
@@ -105,7 +102,7 @@ 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.
diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl
index 1240a26..83793e4 100755
--- a/labels/label-edit-batch.pl
+++ b/labels/label-edit-batch.pl
@@ -27,8 +27,8 @@ use CGI;
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
use C4::Branch qw(get_branch_code_from_name);
-use C4::Creators::Lib 1.000000 qw(get_label_summary html_table);
-use C4::Labels::Batch 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl
index 9b41e4a..1884e72 100755
--- a/labels/label-edit-layout.pl
+++ b/labels/label-edit-layout.pl
@@ -27,8 +27,8 @@ use Text::CSV_XS;
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Creators::Lib 1.000000 qw(get_barcode_types get_label_types get_font_types get_text_justification_types);
-use C4::Labels::Layout 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/labels/label-edit-profile.pl b/labels/label-edit-profile.pl
index e83d8f5..376ce7b 100755
--- a/labels/label-edit-profile.pl
+++ b/labels/label-edit-profile.pl
@@ -25,8 +25,8 @@ use CGI;
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Creators::Lib 1.000000 qw(get_all_templates get_unit_values);
-use C4::Labels::Profile 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl
index 40540d6..7a245b3 100755
--- a/labels/label-edit-template.pl
+++ b/labels/label-edit-template.pl
@@ -25,9 +25,8 @@ use CGI;
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Creators::Lib 1.000000 qw(get_all_profiles get_unit_values);
-use C4::Labels::Template 1.000000;
-use C4::Labels::Profile 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/labels/label-manage.pl b/labels/label-manage.pl
index 9ef23f0..04d1ac8 100755
--- a/labels/label-manage.pl
+++ b/labels/label-manage.pl
@@ -28,11 +28,8 @@ use Data::Dumper;
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
use autouse 'C4::Branch' => qw(get_branch_code_from_name);
-use C4::Creators::Lib 1.000000 qw(get_all_templates get_all_layouts get_all_profiles get_batch_summary html_table);
-use C4::Labels::Layout 1.000000;
-use C4::Labels::Template 1.000000;
-use C4::Labels::Profile 1.000000;
-use C4::Labels::Batch 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/patroncards/card-print.pl b/patroncards/card-print.pl
index 26c0cd1..c6fee54 100755
--- a/patroncards/card-print.pl
+++ b/patroncards/card-print.pl
@@ -25,8 +25,8 @@ use Data::Dumper;
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Labels::Lib 1.000000 qw(get_all_templates get_all_layouts get_label_output_formats);
-use C4::Labels::Batch 1.000000;
+use C4::Creators 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/patroncards/create-pdf.pl b/patroncards/create-pdf.pl
index 830334d..748c33f 100755
--- a/patroncards/create-pdf.pl
+++ b/patroncards/create-pdf.pl
@@ -29,11 +29,8 @@ use autouse 'Data::Dumper' => qw(Dumper);
use C4::Debug;
use C4::Context;
use autouse 'C4::Members' => qw(GetPatronImage GetMember);
-use C4::Creators::PDF 1.000000;
-use C4::Patroncards::Batch 1.000000;
-use C4::Patroncards::Template 1.000000;
-use C4::Patroncards::Layout 1.000000;
-use C4::Patroncards::Patroncard 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
my $cgi = new CGI;
diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl
index 3db898c..184c7bc 100755
--- a/patroncards/edit-batch.pl
+++ b/patroncards/edit-batch.pl
@@ -28,8 +28,8 @@ use autouse 'Data::Dumper' => qw(Dumper);
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
use C4::Branch qw(get_branch_code_from_name);
-use C4::Creators::Lib 1.000000 qw(get_card_summary html_table);
-use C4::Patroncards::Batch 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/patroncards/edit-layout.pl b/patroncards/edit-layout.pl
index 7b05f6c..09edf42 100755
--- a/patroncards/edit-layout.pl
+++ b/patroncards/edit-layout.pl
@@ -28,8 +28,8 @@ use autouse 'Data::Dumper' => qw(Dumper);
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Creators::Lib 1.000000 qw(get_barcode_types get_label_types get_font_types get_text_justification_types get_unit_values get_all_image_names);
-use C4::Patroncards::Layout 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl
index b6bdaf6..4893868 100755
--- a/patroncards/edit-template.pl
+++ b/patroncards/edit-template.pl
@@ -26,9 +26,8 @@ use autouse 'Data::Dumper' => qw(Dumper);
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Creators::Lib 1.000000 qw(get_all_profiles get_unit_values);
-use C4::Patroncards::Template 1.000000;
-use C4::Patroncards::Profile 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/patroncards/image-manage.pl b/patroncards/image-manage.pl
index f167782..e4bd286 100755
--- a/patroncards/image-manage.pl
+++ b/patroncards/image-manage.pl
@@ -12,8 +12,8 @@ use C4::Context;
use C4::Auth;
use C4::Output;
use C4::Debug;
-use C4::Creators::Lib 1.000000 qw(html_table);
-use C4::Patroncards::Lib 1.000000 qw(put_image get_image rm_image);
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
my $cgi = CGI->new;
diff --git a/patroncards/manage.pl b/patroncards/manage.pl
index 7026b34..b9eda3e 100755
--- a/patroncards/manage.pl
+++ b/patroncards/manage.pl
@@ -28,11 +28,14 @@ use autouse 'Data::Dumper' => qw(Dumper);
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
use autouse 'C4::Branch' => qw(get_branch_code_from_name);
-use C4::Creators::Lib 1.000000 qw(get_all_templates get_all_layouts get_all_profiles get_batch_summary html_table);
-use C4::Patroncards::Layout 1.000000;
-use C4::Patroncards::Template 1.000000;
-use C4::Patroncards::Profile 1.000000;
-use C4::Labels::Batch 1.000000;
+#use C4::Creators::Lib 1.000000 qw(get_all_templates get_all_layouts get_all_profiles get_batch_summary html_table);
+#use C4::Patroncards::Layout 1.000000;
+#use C4::Patroncards::Template 1.000000;
+#use C4::Patroncards::Profile 1.000000;
+#use C4::Labels::Batch 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
+use C4::Labels 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
diff --git a/patroncards/print.pl b/patroncards/print.pl
index 31f78d1..b604da2 100755
--- a/patroncards/print.pl
+++ b/patroncards/print.pl
@@ -25,8 +25,8 @@ use autouse 'Data::Dumper' => qw(Dumper);
use C4::Auth qw(get_template_and_user);
use C4::Output qw(output_html_with_http_headers);
-use C4::Creators::Lib 1.000000 qw(get_all_templates get_all_layouts get_output_formats);
-use C4::Patroncards::Batch 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
my $cgi = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
--
1.6.0.4
More information about the Koha-patches
mailing list