From 4cfbf45e355b5d80881e88711a2873824c3bb3b1 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 26 Mar 2008 06:01:33 -0400 Subject: [PATCH] Work on adding patron search to patron card generation feature. Signed-off-by: Joshua Ferraro --- .../en/includes/tools-labels-batches-toolbar.inc | 13 +++++++------ .../prog/en/modules/labels/label-manager.tmpl | 16 ++++++++-------- labels/label-manager.pl | 13 +++++++++---- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-labels-batches-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-labels-batches-toolbar.inc index d8a218ff72..34d7cff022 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-labels-batches-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-labels-batches-toolbar.inc @@ -1,4 +1,4 @@ - +
    -
  • ); return false;">Add item(s) to batch
  • +
  • ,""); return false;">Add item(s) to batch
  • &type=">Delete current batch
  • &type=">Remove duplicate barcodes
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl index d154e56de4..6b1b6f3eaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl @@ -1,11 +1,11 @@ -Koha › <!-- TMPL_IF EXPR="(batch_type eq 'labels')" -->Labels<!-- TMPL_ELSIF EXPR="(batch_type eq 'patroncards')" -->Patron Cards<!-- /TMPL_IF --> +Koha › <!-- TMPL_IF EXPR="(type eq 'labels')" -->Labels<!-- TMPL_ELSIF EXPR="(type eq 'patroncards')" -->Patron Cards<!-- /TMPL_IF --> - +
    @@ -19,7 +19,7 @@ - +

    Items to be Printed for Batch ( items)

    @@ -40,7 +40,7 @@
    - +

    Patron Cards to be Printed for Batch ( items)

    @@ -61,10 +61,10 @@
    - + - +
    @@ -102,7 +102,7 @@
    - +
    @@ -140,7 +140,7 @@
    - +
    diff --git a/labels/label-manager.pl b/labels/label-manager.pl index 2e74cd3f7d..50d81359e5 100755 --- a/labels/label-manager.pl +++ b/labels/label-manager.pl @@ -7,7 +7,7 @@ use C4::Labels; use C4::Output; use HTML::Template::Pro; #use POSIX qw(ceil); -#use Data::Dumper; +use Data::Dumper; #use Smart::Comments; use vars qw($debug); @@ -40,7 +40,8 @@ my $startlabel = $query->param('startlabel'); my $printingtype = $query->param('printingtype'); my $guidebox = $query->param('guidebox'); my $fontsize = $query->param('fontsize'); -my @itemnumber = $query->param('itemnumber'); +my @itemnumber = $query->param('itemnumber') if ($query->param('type') eq 'labels'); +my @itemnumber = $query->param('borrowernumber') if ($query->param('type') eq 'patroncards'); my $batch_type = $query->param('type'); # little block for displaying active layout/template/batch in templates @@ -109,9 +110,13 @@ elsif ( $op eq 'add_layout' ) { # FIXME: The trinary conditionals here really need to be replaced with a more robust form of db abstraction -fbcit elsif ( $op eq 'add' ) { # add item - my $query2 = "INSERT INTO $batch_type ( " . (($batch_type eq 'labels') ? 'itemnumber' : 'borrowernumber') . ", batch_id ) values ( ?,? )"; + warn "op \'add\': batch id = $batch_id, type = $batch_type"; + my $query2 = "INSERT INTO $batch_type ( " . (($batch_type eq 'labels') ? 'itemnumber' : 'borrowernumber') . ", batch_id ) values ( ?,? )"; + warn "op \'add\' \$query2=$query2"; my $sth2 = $dbh->prepare($query2); + warn Dumper($itemnumber); for my $inum (@itemnumber) { + warn "INSERTing " . (($batch_type eq 'labels') ? 'itemnumber' : 'borrowernumber') . ":$inum for batch $batch_id"; $sth2->execute($inum, $batch_id); } $sth2->finish; @@ -176,7 +181,7 @@ if (scalar @messages) { $template->param(message_loop => \@complex); } $template->param( - batch_type => $batch_type, + type => $batch_type, batch_id => $batch_id, batch_count => scalar @resultsloop, active_layout_name => $active_layout_name,