[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4/Circulation Issues.pm,1.3,1.4
From: |
Andrew Arensburger |
Subject: |
[Koha-cvs] CVS: koha/C4/Circulation Issues.pm,1.3,1.4 |
Date: |
Sat, 12 Oct 2002 23:20:24 -0700 |
Update of /cvsroot/koha/koha/C4/Circulation
In directory usw-pr-cvs1:/tmp/cvs-serv21981
Modified Files:
Issues.pm
Log Message:
Added magic RCS comment.
Added some FIXME comments.
Deleted unused variables.
Added POD.
Removed unused finalizer.
Index: Issues.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Issues.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Issues.pm 5 Oct 2002 09:54:32 -0000 1.3
--- Issues.pm 13 Oct 2002 06:20:22 -0000 1.4
***************
*** 1,8 ****
! package C4::Circulation::Issues; #asummes C4/Circulation/Issues
#package to deal with Issues
#written 3/11/99 by address@hidden
-
# Copyright 2000-2002 Katipo Communications
#
--- 1,9 ----
! package C4::Circulation::Issues;
!
! # $Id$
#package to deal with Issues
#written 3/11/99 by address@hidden
# Copyright 2000-2002 Katipo Communications
#
***************
*** 22,25 ****
--- 23,29 ----
# Suite 330, Boston, MA 02111-1307 USA
+ # FIXME - AFAICT the only function here that's still being used is
+ # &formatitem, and I'm not convinced that it's really being used.
+
use strict;
require Exporter;
***************
*** 39,85 ****
use C4::Format;
use C4::Input;
! use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
$VERSION = 0.01;
!
@ISA = qw(Exporter);
@EXPORT = qw(&Issue &formatitem);
- %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
- # your exported package globals go here,
- # as well as any optionally exported functions
-
- @EXPORT_OK = qw($Var1 %Hashit);
-
-
- # non-exported package globals go here
- use vars qw(@more $stuff);
-
- # initalize package globals, first exported ones
-
- my $Var1 = '';
- my %Hashit = ();
-
- # then the others (which are still accessible as $Some::Module::stuff)
- my $stuff = '';
- my @more = ();
-
- # all file-scoped lexicals must be created before
- # the functions below that use them.
-
- # file-private lexicals go here
- my $priv_var = '';
- my %secret_hash = ();
-
- # here's a file-private function as a closure,
- # callable as &$priv_func; it cannot be prototyped.
- my $priv_func = sub {
- # stuff goes here.
- };
-
- # make all your functions, whether exported or not;
-
sub Issue {
my ($env) = @_;
--- 43,77 ----
use C4::Format;
use C4::Input;
! use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
!
! =head1 NAME
!
! C4::Circulation::Issues - Miscellaneous functions related to Koha issues
!
! =head1 SYNOPSIS
!
! use C4::Circulation::Issues;
!
! =head1 DESCRIPTION
!
! This module provides a function for pretty-printing an item being
! issued.
!
! =head1 FUNCTIONS
!
! =over 2
!
! =cut
! #'
!
@ISA = qw(Exporter);
@EXPORT = qw(&Issue &formatitem);
+ # FIXME - This is only used in C4::Circmain and C4::Circulation, both
+ # of which look obsolete. Is this function obsolete as well?
+ # If not, this needs a POD.
sub Issue {
my ($env) = @_;
***************
*** 122,126 ****
}
!
sub processitems {
#process a users items
--- 114,119 ----
}
! # FIXME - Not exported, but called by "telnet/borrwraper.pl".
! # Presumably this function is obsolete.
sub processitems {
#process a users items
***************
*** 172,192 ****
}
sub formatitem {
my ($env,$item,$datedue,$charge) = @_;
my $line = $datedue." ".$item->{'barcode'}." ".$item->{'title'}.":
".$item->{'author'};
my $iclass = $item->{'itemtype'};
if ($item->{'dewey'} > 0) {
my $dewey = $item->{'dewey'};
$dewey =~ s/0*$//;
$dewey =~ s/\.$//;
! $iclass = $iclass.$dewey.$item->{'subclass'};
};
my $llen = 65 - length($iclass);
my $line = fmtstr($env,$line,"L".$llen);
! my $line = $line." $iclass ";
! my $line = $line.fmtdec($env,$charge,"22");
return $line;
}
!
sub issueitem{
my ($env,$dbh,$itemnum,$bornum,$items)address@hidden;
--- 165,215 ----
}
+ =item formatitem
+
+ $line = &formatitem($env, $item, $datedue, $charge);
+
+ Pretty-prints a description of an item being issued, and returns the
+ pretty-printed string.
+
+ C<$env> is effectively ignored.
+
+ C<$item> is a reference-to-hash whose keys are fields from the items
+ table in the Koha database.
+
+ C<$datedue> is a string that will be prepended to the output.
+
+ C<$charge> is a number that will be appended to the output.
+
+ The return value C<$line> is a string of the form
+
+ I<$datedue $barcode $title: $author $type$dewey$subclass $charge>
+
+ where those values that are not passed in as arguments are obtained
+ from C<$item>.
+
+ =cut
+ #'
sub formatitem {
my ($env,$item,$datedue,$charge) = @_;
my $line = $datedue." ".$item->{'barcode'}." ".$item->{'title'}.":
".$item->{'author'};
+ # FIXME - Use string interpolation or sprintf()
my $iclass = $item->{'itemtype'};
+ # FIXME - The Dewey code is a string, not a number.
if ($item->{'dewey'} > 0) {
my $dewey = $item->{'dewey'};
$dewey =~ s/0*$//;
$dewey =~ s/\.$//;
! $iclass = $iclass.$dewey.$item->{'subclass'}; # FIXME - .=
};
my $llen = 65 - length($iclass);
my $line = fmtstr($env,$line,"L".$llen);
! # FIXME - Use sprintf() instead of &fmtstr.
! my $line = $line." $iclass "; # FIXME - .=
! my $line = $line.fmtdec($env,$charge,"22"); # FIXME - .=
return $line;
}
!
! # Only used internally
! # FIXME - Only used by &processitems, which appears to be obsolete.
sub issueitem{
my ($env,$dbh,$itemnum,$bornum,$items)address@hidden;
***************
*** 263,266 ****
--- 286,290 ----
my $msgtxt = chr(7)."Res for $resborrower->{'cardnumber'},";
$msgtxt = $msgtxt." $resborrower->{'initials'}
$resborrower->{'surname'}";
+ # FIXME - .=
my $ans = msg_ny($env,$msgtxt,"Allow issue?");
if ($ans eq "N") {
***************
*** 318,321 ****
--- 342,347 ----
}
+ # FIXME - A virtually identical function appears in
+ # C4::Circulation::Circ2. Pick one and stick with it.
sub createcharge {
my ($env,$dbh,$itemno,$bornum,$charge) = @_;
***************
*** 331,335 ****
!
sub updateissues{
# issue the book
--- 357,361 ----
! # Only used internally
sub updateissues{
# issue the book
***************
*** 380,383 ****
--- 406,411 ----
# &C4::Circulation::Circ2::calc_charges.
# Pick one and stick with it.
+
+ # Only used internally
sub calc_charges {
# calculate charges due
***************
*** 410,412 ****
}
! END { } # module clean-up code here (global destructor)
--- 438,449 ----
}
! 1;
! __END__
!
! =back
!
! =head1 AUTHOR
!
! Koha Developement team <address@hidden>
!
! =cut
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4/Circulation Issues.pm,1.3,1.4,
Andrew Arensburger <=