| Lines 108-113
          my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_v
      
      
        Link Here | 
        
          | 108 | $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); | 108 | $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); | 
        
          | 109 | my $withdrawn_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; | 109 | my $withdrawn_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; | 
        
          | 110 |  | 110 |  | 
            
              |  |  | 111 | $mss = Koha::MarcSubfieldStructures->search( | 
            
              | 112 |     { | 
            
              | 113 |         frameworkcode    => '', kohafield => 'items.damaged', | 
            
              | 114 |         authorised_value => [ -and => { '!=' => undef }, { '!=' => '' } ] | 
            
              | 115 |     } | 
            
              | 116 | ); | 
            
              | 117 | my $damaged_values = $mss->count ? GetAuthorisedValues( $mss->next->authorised_value ) : []; | 
            
              | 118 |  | 
        
          | 111 | if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => 'items.new_status' } )->count ) { | 119 | if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => 'items.new_status' } )->count ) { | 
        
          | 112 |     $template->param( has_new_status => 1 ); | 120 |     $template->param( has_new_status => 1 ); | 
        
          | 113 | } | 121 | } | 
  
    | Lines 120-133
          if ( defined $format ) {
      
      
        Link Here | 
        
          | 120 |         filters => [], | 128 |         filters => [], | 
        
          | 121 |     }; | 129 |     }; | 
        
          | 122 |  | 130 |  | 
          
            
              | 123 |     foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) { | 131 |     foreach my $p ( | 
            
              | 124 |         if (my @q = $cgi->multi_param($p)) { | 132 |         qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn damaged)) | 
            
              | 125 |             if ($q[0] ne '') { | 133 |     { | 
            
              |  |  | 134 |         if ( my @q = $cgi->multi_param($p) ) { | 
            
              | 135 |             if ( $q[0] ne '' ) { | 
        
          | 126 |                 my $f = { | 136 |                 my $f = { | 
        
          | 127 |                     field => $p, | 137 |                     field => $p, | 
        
          | 128 |                     query => \@q, | 138 |                     query => \@q, | 
        
          | 129 |                 }; | 139 |                 }; | 
          
            
              | 130 |                 if (my $op = scalar $cgi->param($p . '_op')) { | 140 |                 if ( my $op = scalar $cgi->param( $p . '_op' ) ) { | 
        
          | 131 |                     $f->{operator} = $op; | 141 |                     $f->{operator} = $op; | 
        
          | 132 |                 } | 142 |                 } | 
        
          | 133 |                 push @{ $filter->{filters} }, $f; | 143 |                 push @{ $filter->{filters} }, $f; | 
  
    | Lines 174-180
          if ( defined $format ) {
      
      
        Link Here | 
        
          | 174 |     push @{ $filter->{filters} }, $f; | 184 |     push @{ $filter->{filters} }, $f; | 
        
          | 175 |  | 185 |  | 
        
          | 176 |     # Yes/No parameters | 186 |     # Yes/No parameters | 
          
            
              | 177 |     foreach my $p (qw( damaged new_status )) { | 187 |     foreach my $p (qw( new_status )) { | 
        
          | 178 |         my $v = $cgi->param($p) // ''; | 188 |         my $v = $cgi->param($p) // ''; | 
        
          | 179 |         my $f = { | 189 |         my $f = { | 
        
          | 180 |             field => $p, | 190 |             field => $p, | 
  
    | Lines 183-192
          if ( defined $format ) {
      
      
        Link Here | 
        
          | 183 |         if ( $p eq 'new_status' ) { | 193 |         if ( $p eq 'new_status' ) { | 
        
          | 184 |             $f->{ifnull} = 0; | 194 |             $f->{ifnull} = 0; | 
        
          | 185 |         } | 195 |         } | 
          
            
              | 186 |         if ($v eq 'yes') { | 196 |         if ( $v eq 'yes' ) { | 
        
          | 187 |             $f->{operator} = '!='; | 197 |             $f->{operator} = '!='; | 
        
          | 188 |             push @{ $filter->{filters} }, $f; | 198 |             push @{ $filter->{filters} }, $f; | 
          
            
              | 189 |         } elsif ($v eq 'no') { | 199 |         } elsif ( $v eq 'no' ) { | 
        
          | 190 |             $f->{operator} = '='; | 200 |             $f->{operator} = '='; | 
        
          | 191 |             push @{ $filter->{filters} }, $f; | 201 |             push @{ $filter->{filters} }, $f; | 
        
          | 192 |         } | 202 |         } | 
  
    | Lines 309-314
          foreach my $value (@$withdrawn_values) {
      
      
        Link Here | 
        
          | 309 |     }; | 319 |     }; | 
        
          | 310 | } | 320 | } | 
        
          | 311 |  | 321 |  | 
            
              |  |  | 322 | my @damageds; | 
            
              | 323 | foreach my $value (@$damaged_values) { | 
            
              | 324 |     push @damageds, { | 
            
              | 325 |         value => $value->{authorised_value}, | 
            
              | 326 |         label => $value->{lib}, | 
            
              | 327 |     }; | 
            
              | 328 | } | 
            
              | 329 |  | 
        
          | 312 | my @items_search_fields = GetItemSearchFields(); | 330 | my @items_search_fields = GetItemSearchFields(); | 
        
          | 313 |  | 331 |  | 
        
          | 314 | my $authorised_values = {}; | 332 | my $authorised_values = {}; | 
  
    | Lines 324-329
          $template->param(
      
      
        Link Here | 
        
          | 324 |     ccodes => \@ccodes, | 342 |     ccodes => \@ccodes, | 
        
          | 325 |     itemlosts => \@itemlosts, | 343 |     itemlosts => \@itemlosts, | 
        
          | 326 |     withdrawns => \@withdrawns, | 344 |     withdrawns => \@withdrawns, | 
            
              |  |  | 345 |     damageds => \@damageds, | 
        
          | 327 |     items_search_fields => \@items_search_fields, | 346 |     items_search_fields => \@items_search_fields, | 
        
          | 328 |     authorised_values_json => to_json($authorised_values), | 347 |     authorised_values_json => to_json($authorised_values), | 
        
          | 329 | ); | 348 | ); |