X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=labels%2Flabel-edit-layout.pl;h=470092d90e8ccb1a1391568703cb1c6eafb89ac4;hb=552a64864878f8ad99543111dbbde4fe5a7be12c;hp=5bb8fc640417b189e3c8283637d2e719bffe0879;hpb=a46714b1d7afb5bec1f40503e26cb7c1d61d400a;p=koha_fer diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 5bb8fc6404..470092d90e 100755 --- a/labels/label-edit-layout.pl +++ b/labels/label-edit-layout.pl @@ -14,9 +14,9 @@ # 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., 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. use strict; use warnings; @@ -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::Labels::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( @@ -122,26 +122,26 @@ elsif ($op eq 'save') { $cgi->param('format_string', $format_string); } my @params = ( - barcode_type => $cgi->param('barcode_type'), - printing_type => $cgi->param('printing_type'), - layout_name => $cgi->param('layout_name'), + barcode_type => $cgi->param('barcode_type') || 'CODE39', + printing_type => $cgi->param('printing_type') || 'BAR', + layout_name => $cgi->param('layout_name') || 'DEFAULT', guidebox => ($cgi->param('guidebox') ? 1 : 0), - font => $cgi->param('font'), - font_size => $cgi->param('font_size'), + font => $cgi->param('font') || 'TR', + font_size => $cgi->param('font_size') || 3, callnum_split => ($cgi->param('callnum_split') ? 1 : 0), - text_justify => $cgi->param('text_justify'), - format_string => $cgi->param('format_string'), + text_justify => $cgi->param('text_justify') || 'L', + format_string => $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, callnumber', ); if ($layout_id) { # if a label_id was passed in, this is an update to an existing layout $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id); $layout->set_attr(@params); - $layout->save(); + $layout_id = $layout->save(); } else { # if no label_id, this is a new layout so insert it $layout = C4::Labels::Layout->new(@params); - $layout->save(); + $layout_id = $layout->save(); } - print $cgi->redirect("label-manage.pl?label_element=layout"); + print $cgi->redirect("label-manage.pl?label_element=layout" . ($layout_id == -1 ? "&element_id=$layout_id&op=$op&error=1" : '')); exit; } else { # if we get here, this is a new layout