Lines 35-41
use DateTime::Format::MySQL;
Link Here
|
35 |
use Data::Dumper; # used as part of logging item record changes, not just for |
35 |
use Data::Dumper; # used as part of logging item record changes, not just for |
36 |
# debugging; so please don't remove this |
36 |
# debugging; so please don't remove this |
37 |
use Koha::DateUtils qw/dt_from_string/; |
37 |
use Koha::DateUtils qw/dt_from_string/; |
38 |
use C4::SQLHelper qw(GetColumns); |
38 |
|
|
|
39 |
use Koha::Database; |
39 |
|
40 |
|
40 |
use vars qw($VERSION @ISA @EXPORT); |
41 |
use vars qw($VERSION @ISA @EXPORT); |
41 |
|
42 |
|
Lines 2596-2604
sub _SearchItems_build_where_fragment {
Link Here
|
2596 |
}; |
2597 |
}; |
2597 |
} |
2598 |
} |
2598 |
} else { |
2599 |
} else { |
2599 |
my @columns = GetColumns('items'); |
2600 |
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; |
2600 |
push @columns, GetColumns('biblio'); |
2601 |
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; |
2601 |
push @columns, GetColumns('biblioitems'); |
2602 |
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; |
2602 |
my @operators = qw(= != > < >= <= like); |
2603 |
my @operators = qw(= != > < >= <= like); |
2603 |
my $field = $filter->{field}; |
2604 |
my $field = $filter->{field}; |
2604 |
if ( (0 < grep /^$field$/, @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
2605 |
if ( (0 < grep /^$field$/, @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
Lines 2725-2733
sub SearchItems {
Link Here
|
2725 |
$query .= qq{ WHERE $where_str }; |
2726 |
$query .= qq{ WHERE $where_str }; |
2726 |
} |
2727 |
} |
2727 |
|
2728 |
|
2728 |
my @columns = GetColumns('items'); |
2729 |
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; |
2729 |
push @columns, GetColumns('biblio'); |
2730 |
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; |
2730 |
push @columns, GetColumns('biblioitems'); |
2731 |
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; |
2731 |
my $sortby = (0 < grep {$params->{sortby} eq $_} @columns) |
2732 |
my $sortby = (0 < grep {$params->{sortby} eq $_} @columns) |
2732 |
? $params->{sortby} : 'itemnumber'; |
2733 |
? $params->{sortby} : 'itemnumber'; |
2733 |
my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC'; |
2734 |
my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC'; |