Bug 17600: Standardize our EXPORT_OK
[srvgit] / C4 / Creators / Template.pm
index d80100e..1636c16 100644 (file)
@@ -2,17 +2,13 @@ package C4::Creators::Template;
 
 use strict;
 use warnings;
-use POSIX qw(ceil);
+use POSIX qw( ceil );
 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('3.07.00.049');
-}
 
 sub _check_params {
     shift if $_[0] =~ m/::/; # this seems a bit hackish
@@ -150,8 +146,8 @@ 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 creator_templates WHERE template_id = ? AND creator = ?";
@@ -169,7 +165,7 @@ sub save {
         foreach my $key (keys %{$self}) {
             next if ($key eq 'template_id') || ($key eq 'template_stat') || ($key eq 'creator');
             push (@params, $self->{$key});
-            $query .= "$key=?, ";
+            $query .= "`$key`=?, ";
         }
         $query = substr($query, 0, (length($query)-2));
         push (@params, $self->{'template_id'}, $self->{'creator'});
@@ -189,7 +185,7 @@ sub save {
         foreach my $key (keys %{$self}) {
             next if $key eq 'template_stat';
             push (@params, $self->{$key});
-            $query .= "$key, ";
+            $query .= "`$key`, ";
         }
         $query = substr($query, 0, (length($query)-2));
         $query .= ") VALUES (";
@@ -344,7 +340,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)
 
@@ -415,11 +411,18 @@ Copyright 2009 Foundations Bible College.
 
 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.
+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 3 of the License, or
+(at your option) any later version.
+
+Koha is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
 
-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.
+You should have received a copy of the GNU General Public License
+along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 =head1 DISCLAIMER OF WARRANTY