From b9ee6194bf25176438c38b45b3d9b0f139c4b1f7 Mon Sep 17 00:00:00 2001 From: finlayt Date: Thu, 14 Mar 2002 01:04:00 +0000 Subject: [PATCH] This is the begining of a process of dividing up circulation.pl This script deals with the branch and printer selection stuff --- circ/circulation.pl | 1 + circ/circulation2.pl | 177 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100755 circ/circulation2.pl diff --git a/circ/circulation.pl b/circ/circulation.pl index f2e24fdb8d..c70ef4b2a9 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -153,6 +153,7 @@ EOF print endmenu('circulation'); print endpage(); + sub default { print << "EOF"; Issues diff --git a/circ/circulation2.pl b/circ/circulation2.pl new file mode 100755 index 0000000000..6e1eebcb87 --- /dev/null +++ b/circ/circulation2.pl @@ -0,0 +1,177 @@ +#!/usr/bin/perl + +use strict; +use CGI qw/:standard/; +use C4::Circulation::Circ2; +use C4::Output; +use C4::Print; +use DBI; + + +# this is a reorganisation of circulation.pl +# dividing it up into three scripts...... +# this will be the first one that chooses branch and printer settings.... + +my %env; +my $headerbackgroundcolor='#99cc33'; +my $circbackgroundcolor='#ffffcc'; +my $circbackgroundcolor='white'; +my $linecolor1='#ffffcc'; +my $linecolor2='white'; +my $backgroundimage="/images/background-mem.gif"; + +my $query=new CGI; +my $branches=getbranches(\%env); +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 $oldbranch; +my $oldprinter; +if ($query->param('selectnewbranchprinter')) { + $oldbranch=$branch; + $oldprinter=$printer; + $branch=''; + $printer=''; +} + +$env{'branchcode'}=$branch; +$env{'printer'}=$printer; +$env{'queue'}=$printer; + +# set up select options.... +my $branchcount=0; +my $printercount=0; +my $branchoptions; +my $printeroptions; +foreach (keys %$branches) { + (next) unless ($_); + (next) if (/^TR$/); + $branchcount++; + my $selected=''; + ($selected='selected') if ($_ eq $oldbranch); + $branchoptions.="