fixed a little bug with cookies and setting the branch and printer settings.
authorfinlayt <finlayt>
Sat, 18 May 2002 05:37:26 +0000 (05:37 +0000)
committerfinlayt <finlayt>
Sat, 18 May 2002 05:37:26 +0000 (05:37 +0000)
circ/circulation.pl
circ/selectbranchprinter.pl

index 3168b54..6ba6914 100755 (executable)
@@ -30,12 +30,11 @@ my $printer = $query->param("printer");
 ($printer) || ($printer=$query->cookie('printer')) ;
 
 #set up cookie.....
+my $info = '';
 my $branchcookie;
 my $printercookie;
-unless ($query->cookie('branch')) {
+if ($query->param('setcookies')) {
     $branchcookie = $query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
-}
-unless ($query->cookie('printer')) {
     $printercookie = $query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
 }
 
@@ -324,7 +323,6 @@ EOF
 # make the issued books table.....
 my $todaysissues='';
 my $previssues='';
-my $info='';
 if ($borrower) {
     my $issueslist = getissues($borrower);
     my $tcolor = '';
index 1307340..30dcc16 100644 (file)
@@ -50,6 +50,7 @@ my $branchoptions;
 my $printeroptions;
 foreach (keys %$branches) {
     (next) unless ($_);
+    (next) unless ($branches->{$_}->{'IS'});
     $branchcount++;
     my $selected='';
     ($selected='selected') if ($_ eq $oldbranch);
@@ -116,7 +117,8 @@ $branchform
 $printerform
 </td></tr>
 </table>
-<input type="submit" value="Change Settings" type="changesettings">
+<input type="hidden" name="setcookies" value=1>
+<input type="submit" value="Submit" type="changesettings">
 </form>
 </center>