Bug 17981: Add a 'letter' param to GetPreparedLetter
[koha.git] / C4 / Creators / Template.pm
index 6e94335..ee504d7 100644 (file)
@@ -7,12 +7,9 @@ use autouse 'Data::Dumper' => qw(Dumper);
 
 use C4::Context;
 use C4::Debug;
-use C4::Creators::Profile 1.000000;
-use C4::Creators::Lib 1.000000 qw(get_unit_values);
+use C4::Creators::Profile;
+use C4::Creators::Lib qw(get_unit_values);
 
-BEGIN {
-    use version; our $VERSION = qv('1.0.0_1');
-}
 
 sub _check_params {
     shift if $_[0] =~ m/::/; # this seems a bit hackish
@@ -150,11 +147,11 @@ sub delete {
         push @query_params, $opts{'template_id'}, $opts{'creator'};
     }
     if (scalar(@query_params) < 2) {   # If there is no template id or creator type then we cannot delete it
-        warn sprintf('%s : Cannot delete template as the template id is invalid or non-existant.', $call_type) if !$query_params[0];
-        warn sprintf('%s : Cannot delete template as the creator type is invalid or non-existant.', $call_type) if !$query_params[1];
+        warn sprintf('%s : Cannot delete template as the template id is invalid or non-existent.', $call_type) if !$query_params[0];
+        warn sprintf('%s : Cannot delete template as the creator type is invalid or non-existent.', $call_type) if !$query_params[1];
         return -1;
     }
-    my $query = "DELETE FROM " . $opts{'table_name'} . " WHERE template_id = ? AND creator = ?";
+    my $query = "DELETE FROM creator_templates WHERE template_id = ? AND creator = ?";
     my $sth = C4::Context->dbh->prepare($query);
     $sth->execute(@query_params);
     $self->{'template_stat'} = 0;
@@ -271,7 +268,6 @@ sub get_next_label_pos {
         $current_label->{'llx'} = $self->get_attr('left_margin');
         if ($current_label->{'row_count'} eq $self->get_attr('rows')) {
             $new_page = 1;
-            #$pdf->Page(); # after invoking this method, the calling script should check row, col and if they are both one then insert a new pdf page
             $current_label->{'lly'} = ($self->get_attr('page_height') - $self->get_attr('top_margin') - $self->get_attr('label_height'));
             $current_label->{'row_count'} = 1;
         }
@@ -345,7 +341,7 @@ CM      = SI Centimeters (28.3464567 points per)
         my $template = C4::Labels::Template->new(profile_id => 1, page_width => 8.5, page_height => 11.0, units => 'INCH'); # Creates and returns a new template object using
             the supplied values to override the defaults
 
-    B<NOTE:> This template is I<not> written to the database untill save() is invoked. You have been warned!
+    B<NOTE:> This template is I<not> written to the database until save() is invoked. You have been warned!
 
 =head2 retrieve(template_id => $template_id)
 
@@ -419,8 +415,8 @@ 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.
 
-You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-Suite 330, Boston, MA  02111-1307 USA
+You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
+Fifth Floor, Boston, MA 02110-1301 USA.
 
 =head1 DISCLAIMER OF WARRANTY