From 67dce57e08cafa64aa3c0b3eefad9e3ba203fb86 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 4 Dec 2007 17:40:49 -0600 Subject: [PATCH] labels subdir - Dates.pm integration and warnings fixes. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- labels/label-create-layout.pl | 60 +++++++++++++++-------------------- labels/label-edit-layout.pl | 33 +++++++++---------- labels/label-item-search.pl | 39 ++++++++++------------- labels/label-manager.pl | 12 +++---- 4 files changed, 61 insertions(+), 83 deletions(-) diff --git a/labels/label-create-layout.pl b/labels/label-create-layout.pl index dc5f389d8b..413ecbbb7e 100755 --- a/labels/label-create-layout.pl +++ b/labels/label-create-layout.pl @@ -28,17 +28,11 @@ my $op = $query->param('op'); my $active_template = GetActiveLabelTemplate(); my @label_templates = GetAllLabelTemplates(); -my @printingtypes = get_printingtypes(); +my @printingtypes = get_printingtypes(); my @layouts = get_layouts(); my @barcode_types = get_barcode_types(); my @batches = get_batches(); -if ($op = 'add_layout') { -} - - - - ### $data $template->param( guidebox => 1 ) if ( $data->{'guidebox'} ); @@ -47,33 +41,31 @@ $template->param( "$data->{'barcodetype'}_checked" => 1 ); $template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 ); $template->param( - - op => $op, - active_template => $data->{'active_template'}, - 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_subtitle => $data->{'subtitle'}, - 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'}, + op => $op, + active_template => $data->{'active_template'}, + 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_subtitle => $data->{'subtitle'}, + 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'}, ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 0ed39a8b51..299cd407ad 100755 --- a/labels/label-edit-layout.pl +++ b/labels/label-edit-layout.pl @@ -29,19 +29,19 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $layout = get_layout($layout_id); - my @barcode_types = get_barcode_types($layout_id); -my @printingtypes = get_printingtypes($layout_id); +my $layout = get_layout($layout_id); +my @barcode_types = get_barcode_types($layout_id); +my @printingtypes = get_printingtypes($layout_id); ### @printingtypes ### $layout -my $layoutname = $layout->{'layoutname'}; -my $layout_id = $layout->{'id'}; -my $guidebox = $layout->{'guidebox'}; -my $startlabel = $layout->{'startlabel'}; + $layout_id = $layout->{'id'}; # has it changed since we set it above? --joe +my $layoutname = $layout->{'layoutname'}; +my $guidebox = $layout->{'guidebox'}; +my $startlabel = $layout->{'startlabel'}; my @title = build_text_dropbox( $layout->{'title'} ); -my @subtitle = build_text_dropbox( $layout->{'subtitle'} ); +my @subtitle = build_text_dropbox( $layout->{'subtitle'} ); my @author = build_text_dropbox( $layout->{'author'} ); my @barcode = build_text_dropbox( $layout->{'barcode'} ); my @isbn = build_text_dropbox( $layout->{'isbn'} ); @@ -52,21 +52,18 @@ my @class = build_text_dropbox( $layout->{'class'} ); my @subclass = build_text_dropbox( $layout->{'subclass'} ); my @itemcallnumber = build_text_dropbox( $layout->{'itemcallnumber'} ); - ### @subclass $template->param( - barcode_types => \@barcode_types, - printingtypes => \@printingtypes, - - layoutname => $layoutname, - layout_id => $layout_id, - -guidebox => $guidebox, -startlabel => $startlabel, + barcode_types => \@barcode_types, + printingtypes => \@printingtypes, + layoutname => $layoutname, + layout_id => $layout_id, + guidebox => $guidebox, + startlabel => $startlabel, tx_title => \@title, - tx_subtitle => \@subtitle, + tx_subtitle => \@subtitle, tx_author => \@author, tx_isbn => \@isbn, tx_issn => \@issn, diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index d5d555a592..6f11e69255 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -75,29 +75,24 @@ if ( $op eq "do_search" ) { # $resultsperpage, $orderby ); #use Data::Dumper; -my $searchquery=$marclist[0]; -my ($error, $marcresults) = SimpleSearch($searchquery); - -my $hits = scalar @$marcresults; -my @results; -my $results; - - -for(my $i=0;$i<$hits;$i++) { - my %resultsloop; - my $marcrecord = MARC::File::USMARC::decode($marcresults->[$i]); - my $biblio = TransformMarcToKoha(C4::Context->dbh,$marcrecord,''); - #build the hash for the template. - %resultsloop=%$biblio; - $resultsloop{highlight} = ($i % 2)?(1):(0); -#warn $resultsloop{biblionumber}; - - push @results, \%resultsloop; -} + my $searchquery=$marclist[0]; + my ($error, $marcresults) = SimpleSearch($searchquery); + my $hits = scalar @$marcresults; + my @results; + + for(my $i=0;$i<$hits;$i++) { + my %resultsloop; + my $marcrecord = MARC::File::USMARC::decode($marcresults->[$i]); + my $biblio = TransformMarcToKoha(C4::Context->dbh,$marcrecord,''); + #build the hash for the template. + %resultsloop=%$biblio; + $resultsloop{highlight} = ($i % 2)?(1):(0); + #warn $resultsloop{biblionumber}; + push @results, \%resultsloop; + } my @results2; my $i; for ( $i = 0 ; $i <= ( $hits - 1 ) ; $i++ ) { - my $itemnums = get_itemnumbers_of($results[$i]->{'biblionumber'}); my $iii = $itemnums->{$results[$i]->{'biblionumber'} } ; @@ -178,8 +173,7 @@ for(my $i=0;$i<$hits;$i++) { # items attached to the bibs not thew bibs themselves # my @results2; - my $i; - for ( $i = 0 ; $i <= ( $total - 1 ) ; $i++ ) + for (my $i = 0 ; $i <= ( $total - 1 ) ; $i++ ) { #total-1 coz the array starts at 0 #warn $i; #warn Dumper $results->[$i]{'bibid'}; @@ -188,7 +182,6 @@ for(my $i=0;$i<$hits;$i++) { &ItemInfo( 0, $results->[$i]{'biblionumber'}, $type ); foreach my $item (@item_results) { - #warn Dumper $item; push @results2, $item; } diff --git a/labels/label-manager.pl b/labels/label-manager.pl index 3ce7cfb662..5e53ab6b82 100755 --- a/labels/label-manager.pl +++ b/labels/label-manager.pl @@ -14,16 +14,12 @@ use POSIX; my $dbh = C4::Context->dbh; my $query = new CGI; my $op = $query->param('op'); -my $layout_id = $query->param('layout_id'); -my $layoutname = $query->param('layoutname'); +my $layout_id = $query->param('layout_id'); +my $layoutname = $query->param('layoutname'); my $barcodetype = $query->param('barcodetype'); - - -my $bcn = $query->param('tx_barcode'); -my $author = $query->param('tx_author'); - +my $bcn = $query->param('tx_barcode'); my $title = $query->param('tx_title'); -my $subtitle = $query->param('tx_subtitle'); +my $subtitle = $query->param('tx_subtitle'); my $isbn = $query->param('tx_isbn'); my $issn = $query->param('tx_issn'); my $itemtype = $query->param('tx_itemtype'); -- 2.20.1