From 3980e9bf8cc2ca03255d445d080a31da6c7e110f Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Sat, 23 Feb 2008 08:01:02 +1300 Subject: [PATCH] branchoverdues and letter.pl - cleanup, conditionalized warnings, etc. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- circ/branchoverdues.pl | 13 +++++-------- tools/letter.pl | 28 ++++++++++++---------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl index bbc67c6a29..091f874383 100755 --- a/circ/branchoverdues.pl +++ b/circ/branchoverdues.pl @@ -25,14 +25,13 @@ use C4::Dates qw/format_date/; use C4::Overdues; # AddNotifyLine use C4::Biblio; use C4::Koha; -use Mail::Sendmail; -use Getopt::Long; +use C4::Debug; use Date::Calc qw/Today Today_and_Now Now/; =head1 branchoverdues.pl this module is a new interface, allow to the librarian to check all items on overdues (based on the acountlines type 'FU' ) - this interface is filtered by branches (automaticly), and by location (optional) .... + this interface is filtered by branches (automatically), and by location (optional) .... all informations are stocked in the notifys BDD FIXME for this time, we have only four methods to notify : @@ -82,7 +81,7 @@ my $itemnumber = $input->param('itemnumber'); my $method = $input->param('method'); my $overduelevel = $input->param('overduelevel'); my $notifyId = $input->param('notifyId'); -my $location = $input->param('location'); +my $location = $input->param('location'); # now create the line in bdd (notifys) if ( $input->param('action') eq 'add' ) { @@ -90,9 +89,7 @@ if ( $input->param('action') eq 'add' ) { AddNotifyLine( $borrowernumber, $itemnumber, $overduelevel, $method, $notifyId ); } - -# possibility to remove notify line -if ( $input->param('action') eq 'remove' ) { +elsif ( $input->param('action') eq 'remove' ) { my $notify_date = $input->param('notify_date'); my $removenotify = RemoveNotifyLine( $borrowernumber, $itemnumber, $notify_date ); @@ -104,7 +101,7 @@ my $counter = 0; my @getoverdues = GetOverduesForBranch( $default, $location ); use Data::Dumper; -warn "HERE : $default / $location".Dumper(@getoverdues); +$debug and warn "HERE : $default / $location" . Dumper(@getoverdues); # search for location authorised value my ($tag,$subfield) = GetMarcFromKohaField('items.location',''); my $tagslib = &GetMarcStructure(1,''); diff --git a/tools/letter.pl b/tools/letter.pl index de55efa895..5429b24270 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -88,19 +88,16 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); if ($op) { - $template->param( - script_name => $script_name, - $op => 1 - ); # we show only the TMPL_VAR names $op -} -else { - $template->param( - script_name => $script_name, - else => 1 - ); # we show only the TMPL_VAR names $op + $template->param($op => 1); +} else { + $template->param(else => 1); } +# we show only the TMPL_VAR names $op -$template->param( action => $script_name ); +$template->param( + script_name => $script_name, + action => $script_name +); ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record if ( $op eq 'add_form' ) { @@ -116,8 +113,8 @@ if ( $op eq 'add_form' ) { # build field list my @SQLfieldname; - push @SQLfieldname, { 'value' => "LibrarianFirstname", 'text' => 'LibrarianFirstname' }; - push @SQLfieldname, { 'value' => "LibrarianSurname", 'text' => 'LibrarianSurname' }; + push @SQLfieldname, { 'value' => "LibrarianFirstname", 'text' => 'LibrarianFirstname' }; + push @SQLfieldname, { 'value' => "LibrarianSurname", 'text' => 'LibrarianSurname' }; push @SQLfieldname, { 'value' => "LibrarianEmailaddress", 'text' => 'LibrarianEmailaddress' }; my $sth2 = $dbh->prepare("SHOW COLUMNS from branches"); $sth2->execute; @@ -128,7 +125,7 @@ if ( $op eq 'add_form' ) { } # add acquisition specific tables - if ( index( $module, "acquisition" ) > 0 ) { + if ( index( $module, "acquisition" ) > 0 ) { # FIXME: imprecise comparison $sth2 = $dbh->prepare("SHOW COLUMNS from aqbooksellers"); $sth2->execute; push @SQLfieldname, { 'value' => "", 'text' => '---BOOKSELLERS---' }; @@ -150,7 +147,7 @@ if ( $op eq 'add_form' ) { # add issues specific tables } - elsif ( index( $module, "issues" ) > 0 ) { + elsif ( index( $module, "issues" ) > 0 ) { # FIXME: imprecise comparison $sth2 = $dbh->prepare("SHOW COLUMNS from aqbooksellers"); $sth2->execute; push @SQLfieldname, { 'value' => "", 'text' => '---BOOKSELLERS---' }; @@ -186,7 +183,6 @@ if ( $op eq 'add_form' ) { push @SQLfieldname, { 'value' => "", 'text' => '---BIBLIO---' }; while ( ( my $field ) = $sth2->fetchrow_array ) { - push @SQLfieldname, { 'value' => "biblio." . $field, 'text' => "biblio." . $field }; } $sth2 = $dbh->prepare("SHOW COLUMNS from biblioitems"); -- 2.39.2