synching deletedborrowers table with borrowers table
[koha.git] / labels / label-templates.pl
blob04570fdc9b33826ad234e8f86770159292fe8ef2
1 #!/usr/bin/perl
3 use strict;
4 use CGI;
5 use C4::Auth;
6 use C4::Context;
7 use C4::Output;
8 use C4::Labels;
9 use HTML::Template::Pro;
10 use POSIX;
12 #use Data::Dumper;
14 my $dbh = C4::Context->dbh;
15 my $query = new CGI;
16 my $op = $query->param('op');
17 my $tmpl_code = $query->param('tmpl_code');
18 my $tmpl_id = $query->param('tmpl_id');
21 my $width = $query->param('width');
22 my $height = $query->param('height');
23 my $topmargin = $query->param('topmargin');
24 my $leftmargin = $query->param('leftmargin');
25 my $columns = $query->param('columns');
26 my $rows = $query->param('rows');
27 my $colgap = $query->param('colgap');
28 my $rowgap = $query->param('rowgap');
30 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32 template_name => "labels/label-templates.tmpl",
33 query => $query,
34 type => "intranet",
35 authnotrequired => 1,
36 flagsrequired => { catalogue => 1 },
37 debug => 1,
42 my @resultsloop;
45 if ( $op eq 'set_active_template' ) {
46 SetActiveTemplate($tmpl_id);
49 elsif ( $op eq 'delete' ) {
50 DeleteTemplate($tmpl_id);
53 elsif ( $op eq 'save' ) {
54 SaveTemplate($tmpl_code);
57 @resultsloop = GetAllLabelTemplates();
59 # little block for displaying active layout/template/batch in templates
60 # ----------
61 my $batch_id = $query->param('batch_id');
62 my $active_layout = get_active_layout();
63 my $active_template = GetActiveLabelTemplate();
64 my $active_layout_name = $active_layout->{'layoutname'};
65 my $active_template_name = $active_template->{'tmpl_code'};
66 # ----------
68 $template->param(
70 batch_id => $batch_id,
71 active_layout_name => $active_layout_name,
72 active_template_name => $active_template_name,
74 resultsloop => \@resultsloop,
77 output_html_with_http_headers $query, $cookie, $template->output;