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....
35 my $oldbranch = $branch;
36 my $oldprinter = $printer;
42 $env{'branchcode'}=$branch;
43 $env{'printer'}=$printer;
44 $env{'queue'}=$printer;
46 # set up select options....
51 foreach (keys %$branches) {
53 (next) unless ($branches->{$_}->{'IS'});
56 ($selected='selected') if ($_ eq $oldbranch);
57 $branchoptions.="<option value=$_ $selected>$branches->{$_}->{'branchname'}\n";
59 foreach (keys %$printers) {
63 ($selected='selected') if ($_ eq $oldprinter);
64 $printeroptions.="<option value=$_ $selected>$printers->{$_}->{'printername'}\n";
67 # if there is only one....
69 if ($printercount==1) {
70 ($printer)=keys %$printers;
72 if ($branchcount==1) {
73 ($branch)=keys %$branches;
76 # set up printer and branch selection forms....
77 my ($printerform, $branchform);
78 if ($printercount>1) {
80 <select name=printer> $printeroptions </select>
83 my ($printer) = keys %$printers;
88 <select name=branch> $branchoptions </select>
91 my ($branch) = keys %$branches;
96 #############################################################################################
97 # Start writing page....
98 # set header with cookie....
100 print $query->header();
103 print startmenu('circulation');
106 <FONT SIZE=6><em>Circulation: Select Printer and Branch Settings</em></FONT><br>
109 <form method=post action=/cgi-bin/koha/circ/circulation.pl>
110 <table border=1 cellpadding=5 cellspacing=0>
111 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage>
112 <font color=black><b>Please Set Branch and Printer</b></font></td></tr>
120 <input type="hidden" name="setcookies" value=1>
121 <input type="submit" value="Submit" type="changesettings">
128 print endmenu('circulation');