Skip to content

Commit

Permalink
Bug 16889: Remove C4::Items::biblioitems_columns and use Koha::Biblio…
Browse files Browse the repository at this point in the history
…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 biblioitems table are correctly displayed in the 'Conditions'
dropdown list.

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>
  • Loading branch information
joubu authored and kylemhall committed Jul 15, 2016
1 parent e6aa7d6 commit dc78583
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
17 changes: 2 additions & 15 deletions C4/Items.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +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::Biblioitems;
use Koha::Items;
use Koha::SearchEngine;
use Koha::SearchEngine::Search;
Expand Down Expand Up @@ -3046,20 +3047,6 @@ sub PrepareItemrecordDisplay {
};
}

=head2 biblioitems_columns
my @columns = C4::Items::biblioitems_columns();
Returns an array of biblioitems' table columns on success,
and an empty array on failure.
=cut

sub biblioitems_columns {
my $rs = Koha::Database->new->schema->resultset('Biblioitem');
return $rs->result_source->columns;
}

sub ToggleNewStatus {
my ( $params ) = @_;
my @rules = @{ $params->{rules} };
Expand All @@ -3068,7 +3055,7 @@ sub ToggleNewStatus {
my $dbh = C4::Context->dbh;
my @errors;
my @item_columns = map { "items.$_" } Koha::Items->columns;
my @biblioitem_columns = map { "biblioitems.$_" } C4::Items::biblioitems_columns;
my @biblioitem_columns = map { "biblioitems.$_" } Koha::Biblioitems->columns;
my $report;
for my $rule ( @rules ) {
my $age = $rule->{age};
Expand Down
3 changes: 2 additions & 1 deletion tools/automatic_item_modification_by_age.pl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ =head1 DESCRIPTION
use C4::Koha;

use Koha::Items;
use Koha::Biblioitems;

my $cgi = new CGI;

Expand Down Expand Up @@ -109,7 +110,7 @@ =head1 DESCRIPTION
}

my @item_fields = map { "items.$_" } Koha::Items->columns;
my @biblioitem_fields = map { "biblioitems.$_" } C4::Items::biblioitems_columns;
my @biblioitem_fields = map { "biblioitems.$_" } Koha::Biblioitems->columns;
$template->param(
op => $op,
messages => \@messages,
Expand Down

0 comments on commit dc78583

Please sign in to comment.