Bug 16889: Remove C4::Items::columns and use Koha::Items->columns instead
Test plan: Add new rule to the "Automatic item modifications by age" tools (tools/automatic_item_modification_by_age.pl) and make sure the columns of the items table are correctly displayed. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
c97e04e8e7
commit
e6aa7d65da
18
C4/Items.pm
18
C4/Items.pm
|
|
@ -37,7 +37,7 @@ use Data::Dumper; # used as part of logging item record changes, not just for
|
|||
use Koha::DateUtils qw/dt_from_string/;
|
||||
use Koha::Database;
|
||||
|
||||
use Koha::Database;
|
||||
use Koha::Items;
|
||||
use Koha::SearchEngine;
|
||||
use Koha::SearchEngine::Search;
|
||||
|
||||
|
|
@ -3046,20 +3046,6 @@ sub PrepareItemrecordDisplay {
|
|||
};
|
||||
}
|
||||
|
||||
=head2 columns
|
||||
|
||||
my @columns = C4::Items::columns();
|
||||
|
||||
Returns an array of items' table columns on success,
|
||||
and an empty array on failure.
|
||||
|
||||
=cut
|
||||
|
||||
sub columns {
|
||||
my $rs = Koha::Database->new->schema->resultset('Item');
|
||||
return $rs->result_source->columns;
|
||||
}
|
||||
|
||||
=head2 biblioitems_columns
|
||||
|
||||
my @columns = C4::Items::biblioitems_columns();
|
||||
|
|
@ -3081,7 +3067,7 @@ sub ToggleNewStatus {
|
|||
|
||||
my $dbh = C4::Context->dbh;
|
||||
my @errors;
|
||||
my @item_columns = map { "items.$_" } C4::Items::columns;
|
||||
my @item_columns = map { "items.$_" } Koha::Items->columns;
|
||||
my @biblioitem_columns = map { "biblioitems.$_" } C4::Items::biblioitems_columns;
|
||||
my $report;
|
||||
for my $rule ( @rules ) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ use C4::Items;
|
|||
use C4::Output;
|
||||
use C4::Koha;
|
||||
|
||||
use Koha::Items;
|
||||
|
||||
my $cgi = new CGI;
|
||||
|
||||
# open template
|
||||
|
|
@ -106,7 +108,7 @@ if ( $@ ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
my @item_fields = map { "items.$_" } C4::Items::columns;
|
||||
my @item_fields = map { "items.$_" } Koha::Items->columns;
|
||||
my @biblioitem_fields = map { "biblioitems.$_" } C4::Items::biblioitems_columns;
|
||||
$template->param(
|
||||
op => $op,
|
||||
|
|
|
|||
Loading…
Reference in New Issue