X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=labels%2Flabel-home.pl;h=28acd1dc3b3f2558da59b297f225bd171f387c70;hb=e343165cf6a32ffa13f192c2961ed5a63c0202f1;hp=844cc4f4a1d4040129b7b3b9f67e161e09dbb60a;hpb=112faa65c939780ff4f134b24d2e63f2fb54a241;p=koha_fer diff --git a/labels/label-home.pl b/labels/label-home.pl index 844cc4f4a1..28acd1dc3b 100755 --- a/labels/label-home.pl +++ b/labels/label-home.pl @@ -1,21 +1,36 @@ #!/usr/bin/perl +# +# Copyright 2006 Katipo Communications. +# 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 +# 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. use strict; +use warnings; + use CGI; -use C4::Auth; -use C4::Output; -use C4::Labels; -use C4::Output; -use C4::Context; -use HTML::Template; -# use Smart::Comments; +use C4::Auth qw(get_template_and_user); +use C4::Output qw(output_html_with_http_headers); -my $query = new CGI; +my $cgi = new CGI; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "labels/label-home.tmpl", - query => $query, + query => $cgi, type => "intranet", authnotrequired => 0, flagsrequired => { catalogue => 1 }, @@ -23,73 +38,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -# little block for displaying active layout/template/batch in templates -# ---------- -my $batch_id = $query->param('batch_id'); -my $active_layout = get_active_layout(); -my $active_template = GetActiveLabelTemplate(); -my $active_layout_name = $active_layout->{'layoutname'}; -my $active_template_name = $active_template->{'tmpl_code'}; -# ---------- - - -my $data = get_label_options(); -my $op = $query->param('op'); -my $layout_id = $query->param('layout_id'); - -my @label_templates = GetAllLabelTemplates(); -my @printingtypes = get_printingtypes(); -my @layouts = get_layouts(); -my @barcode_types = get_barcode_types(); -my @batches = get_batches(); - -if ($op = 'delete_layout') { -delete_layout($layout_id); -} - - - - -### $data - -$template->param( guidebox => 1 ) if ( $data->{'guidebox'} ); -$template->param( "papertype_$data->{'papertype'}" => 1 ); -$template->param( "$data->{'barcodetype'}_checked" => 1 ); -$template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 ); - -$template->param( - op => $op, - active_layout_name => $active_layout_name, - active_template_name => $active_template_name, - - label_templates => \@label_templates, - barcode_types => \@barcode_types, - printingtypes => \@printingtypes, -layout_loop => \@layouts, - -batches => \@batches, - id => $data->{'id'}, - barcodetype => $data->{'barcodetype'}, - papertype => $data->{'papertype'}, - - tx_author => $data->{'author'}, - tx_barcode => $data->{'barcode'}, - tx_title => $data->{'title'}, - tx_isbn => $data->{'isbn'}, - tx_issn => $data->{'issn'}, - tx_itemtype => $data->{'itemtype'}, - tx_dewey => $data->{'dewey'}, - tx_class => $data->{'class'}, - tx_subclass => $data->{'subclass'}, - tx_itemcallnumber => $data->{'itemcallnumber'}, - - startlabel => $data->{'startlabel'}, - fontsize => $active_template->{'fontsize'}, - - intranetcolorstylesheet => - C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), -); - -output_html_with_http_headers $query, $cookie, $template->output; +output_html_with_http_headers $cgi, $cookie, $template->output;