5 use C4::Circulation::Circ2;
11 # this is a reorganisation of circulation.pl
12 # dividing it up into three scripts......
13 # this will be the first one that chooses branch and printer settings....
16 my $headerbackgroundcolor='#99cc33';
17 my $circbackgroundcolor='#ffffcc';
18 my $circbackgroundcolor='white';
19 my $linecolor1='#ffffcc';
20 my $linecolor2='white';
21 my $backgroundimage="/images/background-mem.gif";
24 my $branches=getbranches(\%env);
25 my $printers=getprinters(\%env);
26 my $branch=$query->param('branch');
27 my $printer=$query->param('printer');
29 ($branch) || ($branch=$query->cookie('branch'));
30 ($printer) || ($printer=$query->cookie('printer'));
34 if ($query->param('selectnewbranchprinter')) {
41 $env{'branchcode'}=$branch;
42 $env{'printer'}=$printer;
43 $env{'queue'}=$printer;
45 # set up select options....
50 foreach (keys %$branches) {
55 ($selected='selected') if ($_ eq $oldbranch);
56 $branchoptions.="<option value=$_ $selected>$branches->{$_}->{'branchname'}\n";
58 foreach (keys %$printers) {
62 ($selected='selected') if ($_ eq $oldprinter);
63 $printeroptions.="<option value=$_ $selected>$printers->{$_}->{'printername'}\n";
66 # if there is only one....
68 if ($printercount==1) {
69 ($printer)=keys %$printers;
71 if ($branchcount==1) {
72 ($branch)=keys %$branches;
75 my $branchcookie=$query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
76 my $printercookie=$query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
79 my ($printerform, $branchform);
80 if ($printercount>1) {
82 <table border=0 cellpadding=5 cellspacing=0 bgcolor='#dddddd' >
83 <tr><td><select name=printer> $printeroptions </select></td></tr>
85 <input type=hidden name=branch value=$printer>
88 my ($printer) = keys %$printers;
90 <input type=hidden name=printer value=$printer>
96 <table border=0 cellpadding=5 cellspacing=0 bgcolor='#dddddd' >
97 <tr><td> <select name=branch> $branchoptions </select> </td></tr>
99 <input type=hidden name=branch value=$branch>
102 my ($branch) = keys %$branches;
104 <input type=hidden name=printer value=$printer>
109 # set header with cookie....
110 print $query->header(-type=>'text/html',-expires=>'now', -cookie=>[$branchcookie,$printercookie]);
114 print startmenu('circulation');
116 if ($branch and $printer) {
119 <FONT SIZE=2 face="arial, helvetica">
120 <a href=circulation.pl?module=issues&branch=$branch&printer=$printer&print>Next Borrower</a> ||
121 <a href=circulation.pl?module=returns&branch=$branch&printer=$printer>Returns</a> ||
122 <a href=branchtransfers.pl>Transfer Book</a></font>
123 <input type=hidden name=module value=issues>
124 <input type=hidden name=branch value=$branch>
125 <input type=hidden name=printer value=$printer>
126 <input type=hidden name=barcode value=" ">
129 <table align=left border=0 cellpadding=5 cellspacing=0 >
130 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage>
131 <font color=black><b>Branch and Printer Settings<b></font>
134 <b>Branch:</b> $branches->{$branch}->{'branchname'} </td><td><b>Printer:</b>$printers->{$printer}->{'printername'}
137 <a href=circulation2.pl?selectnewbranchprinter=1>Select new branch and printer</a>
141 <img src="/images/holder.gif" width=24 height=50 align=left>
143 <table border=0 cellpadding=5 cellspacing=0 bgcolor='#dddddd' align=right>
145 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>
146 <b>Enter borrower card number<br> or partial last name</b></font>
148 <tr><td><input name=findborrower></td></tr>
157 <form method=post action=/cgi-bin/koha/circ/circulation2.pl>
158 <table border=0 cellpadding=5 cellspacing=0>
159 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage>
160 <font color=black><b>Please Set Branch and Printer</b></font></td></tr>
168 <input type="submit" value="Change Settings" type="changesettings">
175 print endmenu('circulation');