5 use C4::Circulation::Circ2;
11 # this is a reorganisation of circulationold.pl
12 # dividing it up into three scripts......
13 # this will be the first one that chooses branch and printer settings....
15 #general design stuff...
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";
23 # try to get the branch and printer settings from the http....
26 my $branches=getbranches(\%env);
27 my $printers=getprinters(\%env);
28 my $branch=$query->param('branch');
29 my $printer=$query->param('printer');
31 ($branch) || ($branch=$query->cookie('branch'));
32 ($printer) || ($printer=$query->cookie('printer'));
34 # is you force a selection....
37 if ($query->param('selectnewbranchprinter')) {
44 $env{'branchcode'}=$branch;
45 $env{'printer'}=$printer;
46 $env{'queue'}=$printer;
48 # set up select options....
53 foreach (keys %$branches) {
57 ($selected='selected') if ($_ eq $oldbranch);
58 $branchoptions.="<option value=$_ $selected>$branches->{$_}->{'branchname'}\n";
60 foreach (keys %$printers) {
64 ($selected='selected') if ($_ eq $oldprinter);
65 $printeroptions.="<option value=$_ $selected>$printers->{$_}->{'printername'}\n";
68 # if there is only one....
70 if ($printercount==1) {
71 ($printer)=keys %$printers;
73 if ($branchcount==1) {
74 ($branch)=keys %$branches;
78 my $branchcookie=$query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
79 my $printercookie=$query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
82 # set up printer and branch selection forms....
83 my ($printerform, $branchform);
84 if ($printercount>1) {
86 <table border=1 cellpadding=5 cellspacing=0 bgcolor='#dddddd' >
87 <tr><td><select name=printer> $printeroptions </select></td></tr>
89 <input type=hidden name=branch value=$printer>
92 my ($printer) = keys %$printers;
94 <input type=hidden name=printer value=$printer>
100 <table border=1 cellpadding=5 cellspacing=0 bgcolor='#dddddd' >
101 <tr><td> <select name=branch> $branchoptions </select> </td></tr>
103 <input type=hidden name=branch value=$branch>
106 my ($branch) = keys %$branches;
108 <input type=hidden name=printer value=$printer>
112 #############################################################################################
113 # Start writing page....
114 # set header with cookie....
115 print $query->header(-type=>'text/html',-expires=>'now', -cookie=>[$branchcookie,$printercookie]);
118 print startmenu('circulation');
120 # if the settings are already set...
121 # Page has links through to the other circulation modules....
122 if ($branch and $printer) {
124 <p align=left><FONT SIZE=6><em>Circulation: Issues</em></FONT></p>
126 <FONT SIZE=2 face="arial, helvetica">
127 <a href=circulationold.pl?module=issues&branch=$branch&printer=$printer&print>Next Borrower</a> ||
128 <a href=returns.pl?&branch=$branch&printer=$printer>Returns</a> ||
129 <a href=branchtransfers.pl>Transfer Book</a></font>
130 <input type=hidden name=module value=issues>
131 <input type=hidden name=branch value=$branch>
132 <input type=hidden name=printer value=$printer>
133 <input type=hidden name=barcode value=" ">
136 <table align=left border=1 cellpadding=5 cellspacing=0 >
137 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage>
138 <font color=black><b>Branch and Printer Settings<b></font>
141 <b>Branch:</b> $branches->{$branch}->{'branchname'} </td><td><b>Printer:</b>$printers->{$printer}->{'printername'}
142 </td></tr><tr><td colspan=2>
143 <a href=circulation.pl?selectnewbranchprinter=1>Select new branch and printer</a>
148 <table border=1 cellpadding=5 cellspacing=0 bgcolor='#dddddd' align=right>
149 <form method=post action=/cgi-bin/koha/circ/circulationold.pl>
150 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>
151 <b>Enter borrower card number<br> or partial last name</b></font>
153 <tr><td><input name=findborrower></td></tr>
154 <input type=hidden name=module value=issues>
155 <input type=hidden name=branch value=$branch>
156 <input type=hidden name=printer value=$printer>
157 <input type=hidden name=barcode value=" ">
164 # To change the settings....
167 <FONT SIZE=6><em>Circulation: Select Printer and Branch Settings</em></FONT><br>
169 <form method=post action=/cgi-bin/koha/circ/circulation.pl>
170 <table border=1 cellpadding=5 cellspacing=0>
171 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage>
172 <font color=black><b>Please Set Branch and Printer</b></font></td></tr>
180 <input type="submit" value="Change Settings" type="changesettings">
187 print endmenu('circulation');