From da41053a3b299e06f64f2c4a97b735bb74997a60 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 2 Mar 2021 10:18:34 +0100 Subject: [PATCH] Bug 8976: Use existing Koha::Authority::Subfield[s] --- Koha/AuthSubfieldStructure.pm | 46 ------------------------ Koha/AuthSubfieldStructures.pm | 58 ------------------------------- admin/auth_subfields_structure.pl | 14 ++++---- 3 files changed, 7 insertions(+), 111 deletions(-) delete mode 100644 Koha/AuthSubfieldStructure.pm delete mode 100644 Koha/AuthSubfieldStructures.pm diff --git a/Koha/AuthSubfieldStructure.pm b/Koha/AuthSubfieldStructure.pm deleted file mode 100644 index 93f90a0c9c..0000000000 --- a/Koha/AuthSubfieldStructure.pm +++ /dev/null @@ -1,46 +0,0 @@ -package Koha::AuthSubfieldStructure; - -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use Modern::Perl; - -use Carp; - -use Koha::Database; - -use base qw(Koha::Object); - -=head1 NAME - -Koha::AuthSubfieldStructure - Koha AuthSubfieldStructure Object class - -=head1 API - -=head2 Class methods - -=cut - -=head2 Internal methods - -=head3 _type - -=cut - -sub _type { - return 'AuthSubfieldStructure'; -} - -1; diff --git a/Koha/AuthSubfieldStructures.pm b/Koha/AuthSubfieldStructures.pm deleted file mode 100644 index 4995cb7f59..0000000000 --- a/Koha/AuthSubfieldStructures.pm +++ /dev/null @@ -1,58 +0,0 @@ -package Koha::AuthSubfieldStructures; - -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use Modern::Perl; - -use Carp; - -use Koha::Database; - -use Koha::AuthSubfieldStructure; - -use base qw(Koha::Objects); - -=head1 NAME - -Koha::AuthSubfieldStructures - Koha AuthSubfieldStructure Object set class - -=head1 API - -=head2 Class methods - -=cut - -=head2 Internal methods - -=cut - -=head3 _type - -=cut - -sub _type { - return 'AuthSubfieldStructure'; -} - -=head3 object_class - -=cut - -sub object_class { - return 'Koha::AuthSubfieldStructure'; -} - -1; diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index 2639f90275..817bf59d09 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -26,7 +26,7 @@ use C4::Koha; use Koha::Authority::Types; use Koha::AuthorisedValues; -use Koha::AuthSubfieldStructures; +use Koha::Authority::Subfields; use List::MoreUtils qw( uniq ); @@ -104,7 +104,7 @@ if ($op eq 'add_form') { closedir DIR; my @loop_data; - my $asses = Koha::AuthSubfieldStructures->search({ tagfield => $tagfield, authtypecode => $authtypecode}, {order_by => 'display_order'})->unblessed; + my $asses = Koha::Authority::Subfields->search({ tagfield => $tagfield, authtypecode => $authtypecode}, {order_by => 'display_order'})->unblessed; my $i; for my $ass ( @$asses ) { my %row_data = %$ass; @@ -181,7 +181,7 @@ if ($op eq 'add_form') { my $hidden = $ohidden[$i]; #collate from 3 hiddens; my $isurl = $input->param("isurl$i")?1:0; if ($liblibrarian) { - my $ass = Koha::AuthSubfieldStructures->find( + my $ass = Koha::Authority::Subfields->find( { authtypecode => $authtypecode, tagfield => $tagfield, @@ -209,7 +209,7 @@ if ($op eq 'add_form') { $ass->update($attributes); } else { - Koha::AuthSubfieldStructure->new( + Koha::Authority::Subfield->new( { authtypecode => $authtypecode, tagfield => $tagfield, @@ -229,7 +229,7 @@ if ($op eq 'add_form') { # called by default form, used to confirm deletion of data in DB } elsif ( $op eq 'delete_confirm' ) { - my $ass = Koha::AuthSubfieldStructures->find( + my $ass = Koha::Authority::Subfields->find( { authtypecode => $authtypecode, tagfield => $tagfield, @@ -242,7 +242,7 @@ elsif ( $op eq 'delete_confirm' ) { ); } elsif ( $op eq 'delete_confirmed' ) { - Koha::AuthSubfieldStructures->find( + Koha::Authority::Subfields->find( { authtypecode => $authtypecode, tagfield => $tagfield, @@ -253,7 +253,7 @@ elsif ( $op eq 'delete_confirmed' ) { exit; } else { # DEFAULT - my $ass = Koha::AuthSubfieldStructures->search( + my $ass = Koha::Authority::Subfields->search( { tagfield => { -like => "$tagfield%" }, authtypecode => $authtypecode, -- 2.20.1