[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4/Circulation Circ2.pm,1.48,1.49
From: |
Ambrose Li |
Subject: |
[Koha-cvs] CVS: koha/C4/Circulation Circ2.pm,1.48,1.49 |
Date: |
Tue, 04 Feb 2003 22:29:00 -0800 |
Update of /cvsroot/koha/koha/C4/Circulation
In directory sc8-pr-cvs1:/tmp/cvs-serv14239/C4/Circulation
Modified Files:
Circ2.pm
Log Message:
Implemented fixes for bug 170
1. Circ2::returnbook will throw an exception if $branch is undef
2. branch/printer-getting code is modularized into getbranch and getprinter
with correct logic from circulation.pl (temporarily put into Circ2.pm)
3. circulation.pl and returns.pl modified to use above functions
Noted correct tab sizes for the files; returns.pl partially reformatted to
conform to the dominant correct tab size
Handle non-latin1 charsets for returns.pl
Index: Circ2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -r1.48 -r1.49
*** Circ2.pm 24 Oct 2002 20:09:29 -0000 1.48
--- Circ2.pm 5 Feb 2003 06:28:56 -0000 1.49
***************
*** 1,2 ****
--- 1,5 ----
+ # -*- tab-width: 8 -*-
+ # Please use 8-character tabs for this file (indents are every 4 characters)
+
package C4::Circulation::Circ2;
***************
*** 65,68 ****
--- 68,72 ----
@ISA = qw(Exporter);
@EXPORT = qw(&getbranches &getprinters &getpatroninformation
+ &getbranch &getprinter
¤tissues &getissues &getiteminformation &findborrower
&issuebook &returnbook &find_reserves &transferbook &decode
***************
*** 149,152 ****
--- 153,175 ----
}
+ # FIXME - This function doesn't feel as if it belongs here. It should
+ # go in some generic or administrative module, not in circulation.
+ sub getbranch ($$) {
+ my($query, $branches) = @_; # get branch for this query from branches
+ my $branch = $query->param('branch');
+ ($branch) || ($branch = $query->cookie('branch'));
+ ($branches->{$branch}) || ($branch=(keys %$branches)[0]);
+ return $branch;
+ }
+
+ # FIXME - Perhaps this really belongs in C4::Print?
+ sub getprinter ($$) {
+ my($query, $printers) = @_; # get printer for this query from printers
+ my $printer = $query->param('printer');
+ ($printer) || ($printer = $query->cookie('printer'));
+ ($printers->{$printer}) || ($printer = (keys %$printers)[0]);
+ return $printer;
+ }
+
=item getpatroninformation
***************
*** 978,981 ****
--- 1001,1005 ----
my $messages;
my $doreturn = 1;
+ die '$branch not defined' unless defined $branch; # just in case (bug 170)
# get information on item
my ($iteminformation) = getiteminformation(\%env, 0, $barcode);
***************
*** 1043,1047 ****
# Not exported
# FIXME - This is only used in &returnbook. Why make it into a
! # separate function?
sub doreturn {
my ($brn, $itm) = @_;
--- 1067,1071 ----
# Not exported
# FIXME - This is only used in &returnbook. Why make it into a
! # separate function? (is this a recognizable step in the return process? -
acli)
sub doreturn {
my ($brn, $itm) = @_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4/Circulation Circ2.pm,1.48,1.49,
Ambrose Li <=
- Prev by Date:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/zh-TW/parameters admin-home.tmpl,1.1,1.2 aqbookfund.tmpl,1.1,1.2 aqbudget.tmpl,1.1,1.2
- Next by Date:
[Koha-cvs] CVS: koha/circ circulation.pl,1.46,1.47 returns.pl,1.25,1.26
- Previous by thread:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/zh-TW/parameters admin-home.tmpl,1.1,1.2 aqbookfund.tmpl,1.1,1.2 aqbudget.tmpl,1.1,1.2
- Next by thread:
[Koha-cvs] CVS: koha/circ circulation.pl,1.46,1.47 returns.pl,1.25,1.26
- Index(es):