| 
      
            Lines 144-159
          elsif ( $op eq "checkout" ) {
      
      
        Link Here
      
     | 
  
        
          | 144 | 
                  0,  | 
          144 | 
                  0,  | 
        
        
          | 145 | 
                  C4::Context->preference("AllowItemsOnHoldCheckoutSCO") | 
          145 | 
                  C4::Context->preference("AllowItemsOnHoldCheckoutSCO") | 
        
        
          | 146 | 
              );  | 
          146 | 
              );  | 
        
          
            
              | 147 | 
                  $confirm_required = scalar keys %$needconfirm;  | 
              147 | 
                  my $issue_error;  | 
            
            
               | 
               | 
              148 | 
                  if ( $confirm_required = scalar keys %$needconfirm ) { | 
            
            
              | 149 | 
                      for my $error ( qw( UNKNOWN_BARCODE max_loans_allowed ISSUED_TO_ANOTHER NO_MORE_RENEWALS NOT_FOR_LOAN DEBT WTHDRAWN RESTRICTED RESERVED ITEMNOTSAMEBRANCH EXPIRED DEBARRED CARD_LOST GNA INVALID_DATE UNKNOWN_BARCODE TOO_MANY DEBT_GUARANTEES USERBLOCKEDOVERDUE PATRON_CANT PREVISSUE NOT_FOR_LOAN_FORCING ITEM_LOST) ) { | 
            
            
              | 150 | 
                          if ( $needconfirm->{$error} ) { | 
            
            
              | 151 | 
                              $issue_error = $error;  | 
            
            
              | 152 | 
                              $confirmed = 0;  | 
            
            
              | 153 | 
                              last;  | 
            
            
              | 154 | 
                          }  | 
            
            
              | 155 | 
                      }  | 
            
            
              | 156 | 
                  }  | 
            
        
          | 148 | 
           | 
          157 | 
           | 
        
        
          | 149 | 
              #warn "confirm_required: " . $confirm_required ;  | 
          158 | 
              #warn "confirm_required: " . $confirm_required ;  | 
        
        
          | 150 | 
              if (scalar keys %$impossible) { | 
          159 | 
              if (scalar keys %$impossible) { | 
        
        
          | 151 | 
           | 
          160 | 
           | 
        
          
            
              | 152 | 
                      #  warn "impossible: numkeys: " . scalar (keys(%$impossible));  | 
              161 | 
                      my $issue_error = (keys %$impossible)[0]; # FIXME This is wrong, we assume only one error and keys are not ordered  | 
            
            
              | 153 | 
                      #warn join " ", keys %$impossible;  | 
               | 
               | 
            
            
              | 154 | 
                      my $issue_error = (keys %$impossible)[0];  | 
            
        
          | 155 | 
           | 
          162 | 
           | 
        
            
              | 156 | 
                      # FIXME  we assume only one error.  | 
               | 
               | 
            
        
          | 157 | 
                  $template->param(  | 
          163 | 
                  $template->param(  | 
        
        
          | 158 | 
                      impossible                => $issue_error,  | 
          164 | 
                      impossible                => $issue_error,  | 
        
        
          | 159 | 
                      "circ_error_$issue_error" => 1,  | 
          165 | 
                      "circ_error_$issue_error" => 1,  | 
        
  
    | 
      
            Lines 187-195
          elsif ( $op eq "checkout" ) {
      
      
        Link Here
      
     | 
  
        
          | 187 | 
                  }  | 
          193 | 
                  }  | 
        
        
          | 188 | 
              } elsif ( $confirm_required && !$confirmed ) { | 
          194 | 
              } elsif ( $confirm_required && !$confirmed ) { | 
        
        
          | 189 | 
                  #warn "failed confirmation";  | 
          195 | 
                  #warn "failed confirmation";  | 
        
            
              | 190 | 
                      my $issue_error = (keys %$needconfirm)[0];  | 
               | 
               | 
            
        
          | 191 | 
                  $template->param(  | 
          196 | 
                  $template->param(  | 
        
          
            
              | 192 | 
                          impossible                => (keys %$needconfirm)[0],  | 
              197 | 
                          impossible                => 1,  | 
            
        
          | 193 | 
                      "circ_error_$issue_error" => 1,  | 
          198 | 
                      "circ_error_$issue_error" => 1,  | 
        
        
          | 194 | 
                      hide_main                 => 1,  | 
          199 | 
                      hide_main                 => 1,  | 
        
        
          | 195 | 
                  );  | 
          200 | 
                  );  | 
        
            
              | 196 | 
              -   | 
               | 
               |