branchoverdues and letter.pl - cleanup, conditionalized warnings, etc.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joe Atzberger 2008-02-23 08:01:02 +13:00 committed by Joshua Ferraro
parent b1f620c723
commit 3980e9bf8c
2 changed files with 17 additions and 24 deletions

View File

@ -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,'');

View File

@ -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");