+# -*- tab-width: 8 -*-
+# Please use 8-character tabs for this file (indents are every 4 characters)
+
package C4::Circulation::Circ2;
# $Id$
@ISA = qw(Exporter);
@EXPORT = qw(&getbranches &getprinters &getpatroninformation
+ &getbranch &getprinter
¤tissues &getissues &getiteminformation &findborrower
&issuebook &returnbook &find_reserves &transferbook &decode
&calc_charges);
return (\%printers);
}
+# 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
($borrower, $flags) = &getpatroninformation($env, $borrowernumber,
my %env;
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);
if (not $iteminformation) {
# Updates items.datelastseen for the item.
# Not exported
# FIXME - This is only used in &returnbook. Why make it into a
-# separate function?
+# separate function? (is this a recognizable step in the return process? - acli)
sub doreturn {
my ($brn, $itm) = @_;
my $dbh = C4::Context->dbh;
#!/usr/bin/perl
+# Please use 8-character tabs for this file (indents are every 4 characters)
#written 8/5/2002 by Finlay
#script to execute issuing of books
my $query = new CGI;
-my $branch = $query->param("branch");
-my $printer = $query->param("printer");
-
-($branch) || ($branch=$query->cookie('branch')) ;
-($printer) || ($printer=$query->cookie('printer')) ;
-
-($branches->{$branch}) || ($branch=(keys %$branches)[0]);
-($printers->{$printer}) || ($printer=(keys %$printers)[0]);
-
+my $branch = getbranch($query, $branches);
+my $printer = getprinter($query, $printers);
#set up cookie.....
}
remoteprint($env,\@issues,$borrower);
}
+
+# Local Variables:
+# tab-width: 8
+# End:
#!/usr/bin/perl
+# Please use 8-character tabs for this file (indents are 4 spaces)
#written 11/3/2002 by Finlay
#script to execute returns of books
use C4::Print;
use C4::Reserves2;
use C4::Auth;
+use C4::Interface::CGI::Output;
use HTML::Template;
my $branches = getbranches();
my $printers = getprinters(\%env);
-my $branch = $query->param("branch");
-my $printer = $query->param("printer");
-
-($branch) || ($branch=$query->cookie('branch')) ;
-($printer) || ($printer=$query->cookie('printer')) ;
-
-my $genbrname=$branches->{$branch}->{'branchname'};
-my $genprname=$printers->{$printer}->{'printer'};
+my $branch = getbranch($query, $branches);
+my $printer = getprinter($query, $printers);
#
# Some code to handle the error if there is no branch or printer setting.....
}
$template->param(riloop => \@riloop);
-$template->param( genbrname => $genbrname,
- genprname => $genprname,
- branch => $branch,
- printer => $printer,
- hdrbckgdcolor => $headerbackgroundcolor,
- bckgdimg => $backgroundimage,
- errmsgloop => \@errmsgloop
- );
+$template->param( genbrname => $branches->{$branch}->{'branchname'},
+ genprname => $printers->{$printer}->{'printername'},
+ branch => $branch,
+ printer => $printer,
+ hdrbckgdcolor => $headerbackgroundcolor,
+ bckgdimg => $backgroundimage,
+ errmsgloop => \@errmsgloop
+ );
# actually print the page!
-print $query->header(), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
sub cuecatbarcodedecode {
my ($barcode) = @_;
} else {
return $barcode;
}}
+
+# Local Variables:
+# tab-width: 8
+# End: