'format_string',
'layout_xml', # FIXME: all layouts should be stored in xml format to greatly simplify handling -chris_n
'creator',
+ 'units',
+ 'start_label',
);
if (scalar(@_) >1) {
my %given_params = @_;
return $exit_code;
}
+use constant PRESET_FIELDS => [qw(title author isbn issn itemtype barcode itemcallnumber)];
sub new {
my $invocant = shift;
my $self = '';
my $type = ref($invocant) || $invocant;
if (grep {$_ eq 'Labels'} @_) {
$self = {
+ layout_xml => '',
+ units => 'POINT',
+ start_label => 1,
barcode_type => 'CODE39',
printing_type => 'BAR',
layout_name => 'DEFAULT',
font_size => 3,
callnum_split => 0,
text_justify => 'L',
- format_string => 'title, author, isbn, issn, itemtype, barcode, callnumber',
+ format_string => join(', ', @{ PRESET_FIELDS() }),
@_,
};
}
my %opts = @_;
my $type = ref($invocant) || $invocant;
my $query = "SELECT * FROM creator_layouts WHERE layout_id = ? AND creator = ?";
- #warn "QUERY: $query\n"; #XXX Remove
- #warn "PARAMS: layout_id=" . $opts{'layout_id'} . " creator=" . $opts{'creator'} . "\n"; #XXX Remove
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{'layout_id'}, $opts{'creator'});
if ($sth->err) {
my $string = '';
my $strwidth = 0;
my $col_count = 0;
- my $textlimit = $params{'label_width'} - ( 3 * $params{'left_text_margin'});
+ my $textlimit = $params{'label_width'} - (( 3 * $params{'left_text_margin'} ) || 13.5 );
while ($strwidth < $textlimit) {
$string .= '0';
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