my $invocant = shift;
my %opts = @_;
my $type = ref($invocant) || $invocant;
- my $query = "SELECT * FROM printers_profile WHERE profile_id = ?";
+ my $query = "SELECT * FROM printers_profile WHERE profile_id = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($opts{profile_id});
if ($sth->err) {
warn sprintf('%s : Cannot delete layout as the profile id is invalid or non-existant.', $call_type);
return -1;
}
- my $query = "DELETE FROM printers_profile WHERE profile_id = ?";
+ my $query = "DELETE FROM printers_profile WHERE profile_id = ?";
my $sth = C4::Context->dbh->prepare($query);
# $sth->{'TraceLevel'} = 3;
$sth->execute($query_param);
=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.
#=head2 draw_boundaries
#
# sub draw_boundaries ($llx_spine, $llx_circ1, $llx_circ2,
-# $lly, $spine_width, $label_height, $circ_width)
+# $lly, $spine_width, $label_height, $circ_width)
#
#This sub draws boundary lines where the label outlines are, to aid in printer testing, and debugging.
#
<!-- /TMPL_LOOP -->
</select>
</li>
- <li>
+ <li>
<fieldset>
<legend>Bibliographic Data to Print</legend>
<ol>
<!-- /TMPL_LOOP -->
</div>
</li>
- <!-- TMPL_IF NAME="layout_string" -->
+ <!-- TMPL_UNLESS NAME="layout_string" -->
<li class="radio"><input type="radio" id="layout_choice_list" name="layout_choice" value="layout_string" checked="checked" /> <label for="layout_choice_list">List Fields</label></li>
<!-- TMPL_ELSE -->
<li class="radio"><input type="radio" id="layout_choice_list" name="layout_choice" value="layout_string" /> <label for="layout_choice_list">List Fields</label></li>
- <!-- /TMPL_IF -->
+ <!-- /TMPL_UNLESS -->
<li> <fieldset id="layout_string" class="brief">
<label for="format_string">Data Fields</label>
<input type="text" name="format_string" id="format_string" size="80" value="<!-- TMPL_VAR ESCAPE='HTML' NAME="format_string" -->" />
</div>
</fieldset></li>
</ol>
- </fieldset>
+ </fieldset>
</li>
<li>
<label for="guidebox">Draw Guide Boxes</label>
# Parts 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
my $op = $cgi->param('op') || $ARGV[0] || '';
my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || $ARGV[1] || '';
+my $layout_choice = $cgi->param('layout_choice') || '';
my $layout = '';
sub _set_selected {
}
elsif ($op eq 'save') {
my $format_string = '';
- if ($cgi->param('layout_choice') eq 'layout_table') { # translate the field table into a format_string
+ if ($layout_choice eq 'layout_table') { # translate the field table into a format_string
my @layout_table = ();
foreach my $cgi_param ($cgi->param()) {
if (($cgi_param =~ m/^(.*)_tbl$/) && ($cgi->param($cgi_param))) {
font_size => $layout->get_attr('font_size'),
callnum_split => $layout->get_attr('callnum_split'),
format_string => $layout->get_attr('format_string'),
+ layout_string => 1, # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN
);
output_html_with_http_headers $cgi, $cookie, $template->output;
# Parts 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
);
my $op = $cgi->param('op');
+warn "operation = $op\n";
my $template_id = $cgi->param('template_id') || $cgi->param('element_id');
my $label_template = undef;
my $profile_list = undef;
else { # if no label_id, this is a new layout so insert it
$label_template = C4::Labels::Template->new(@params);
my $template_id = $label_template->save();
- my $profile = C4::Labels::Profile->retrieve(profile_id => $cgi->param('profile_id'));
- $profile->set_attr(template_id => $template_id) if $template_id != $profile->get_attr('template_id');
- $profile->save();
+ if ($cgi->param('profile_id')) {
+ my $profile = C4::Labels::Profile->retrieve(profile_id => $cgi->param('profile_id'));
+ $profile->set_attr(template_id => $template_id) if $template_id != $profile->get_attr('template_id');
+ $profile->save();
+ }
}
print $cgi->redirect("label-manage.pl?label_element=template");
exit;