my @words = split /\s+/, $sSearch;
foreach my $word (@words) {
push @f, $columns[$i];
- push @q, "%$word%";
- push @op, 'like';
push @c, 'and';
+
+ if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location notforloan ) ) {
+ push @q, "$word";
+ push @op, '=';
+ } else {
+ push @q, "%$word%";
+ push @op, 'like';
+ }
}
}
}
flagsrequired => { catalogue => 1 },
});
-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } });
+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { not => undef } });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
if (scalar keys %params > 0) {
}
foreach my $item (@$results) {
- $item->{biblio} = Koha::Biblios->find( $item->{biblionumber} );
- ($item->{biblioitem}) = GetBiblioItemByBiblioNumber($item->{biblionumber});
+ my $biblio = Koha::Biblios->find( $item->{biblionumber} );
+ $item->{biblio} = $biblio;
+ $item->{biblioitem} = $biblio->biblioitem->unblessed;
$item->{status} = $notforloan_map->{$item->{notforloan}};
if (defined $item->{location}) {
$item->{location} = $location_map->{$item->{location}};
};
}
-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { not => undef } });
+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE';
my $ccodes = GetAuthorisedValues($ccode_avcode);
my @ccodes;