From 92aec9a694ea8f2a193483aad15725690a2bb4ed Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 14 Dec 2023 14:41:07 -0100 Subject: [PATCH] Bug 35581: Illcomment.pm -> ILL/Comment.pm Illcomments.pm -> ILL/Comments.pm Signed-off-by: David Nind --- Koha/{Illcomment.pm => ILL/Comment.pm} | 8 ++++---- Koha/{Illcomments.pm => ILL/Comments.pm} | 12 ++++++------ Koha/Illrequest.pm | 8 ++++---- ill/ill-requests.pl | 4 ++-- .../{Illcomments.t => Koha/ILL/Comments.t} | 8 ++++---- t/db_dependent/api/v1/ill_requests.t | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) rename Koha/{Illcomment.pm => ILL/Comment.pm} (87%) rename Koha/{Illcomments.pm => ILL/Comments.pm} (81%) rename t/db_dependent/{Illcomments.t => Koha/ILL/Comments.t} (93%) diff --git a/Koha/Illcomment.pm b/Koha/ILL/Comment.pm similarity index 87% rename from Koha/Illcomment.pm rename to Koha/ILL/Comment.pm index 594af5379ce..7bd1f13f870 100644 --- a/Koha/Illcomment.pm +++ b/Koha/ILL/Comment.pm @@ -1,4 +1,4 @@ -package Koha::Illcomment; +package Koha::ILL::Comment; # Copyright Magnus Enger Libriotech 2017 # @@ -23,13 +23,13 @@ use base qw(Koha::Object); =head1 NAME -Koha::Illcomment - Koha Illcomment Object class +Koha::ILL::Comment - Koha Illcomment Object class =head2 Class methods =head3 patron - my $patron = Koha::Illcomment->patron; + my $patron = Koha::ILL::Comment->patron; Return the patron object associated with this comment @@ -46,7 +46,7 @@ sub patron { =head3 _type - my $type = Koha::IllComment->_type; + my $type = Koha::ILL::Comment->_type; Return this object's type diff --git a/Koha/Illcomments.pm b/Koha/ILL/Comments.pm similarity index 81% rename from Koha/Illcomments.pm rename to Koha/ILL/Comments.pm index 01d15884e78..3f9c29c89e1 100644 --- a/Koha/Illcomments.pm +++ b/Koha/ILL/Comments.pm @@ -1,4 +1,4 @@ -package Koha::Illcomments; +package Koha::ILL::Comments; # Copyright Magnus Enger Libriotech 2017 # @@ -19,18 +19,18 @@ package Koha::Illcomments; use Modern::Perl; use Koha::Database; -use Koha::Illcomment; +use Koha::ILL::Comment; use base qw(Koha::Objects); =head1 NAME -Koha::Illcomments - Koha Illcomments Object class +Koha::ILL::Comments - Koha Illcomments Object class =head2 Internal methods =head3 _type - my $type = Koha::IllComments->_type; + my $type = Koha::ILL::Comments->_type; Return this object's type @@ -42,14 +42,14 @@ sub _type { =head3 object_class - my $class = Koha::IllComments->object_class; + my $class = Koha::ILL::Comments->object_class; Return this object's class name =cut sub object_class { - return 'Koha::Illcomment'; + return 'Koha::ILL::Comment'; } =head1 AUTHOR diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 2fc954f1f66..e5dd68bd999 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -30,7 +30,7 @@ use Koha::Cache::Memory::Lite; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Ill; -use Koha::Illcomments; +use Koha::ILL::Comments; use Koha::Illrequestattributes; use Koha::AuthorisedValue; use Koha::Illrequest::Logger; @@ -208,7 +208,7 @@ sub illrequestattributes { sub illcomments { my ( $self ) = @_; - return Koha::Illcomments->_new_from_dbic( + return Koha::ILL::Comments->_new_from_dbic( scalar $self->_result->illcomments ); } @@ -217,13 +217,13 @@ sub illcomments { my $ill_comments = $req->comments; -Returns a I resultset for the linked comments. +Returns a I resultset for the linked comments. =cut sub comments { my ( $self ) = @_; - return Koha::Illcomments->_new_from_dbic( + return Koha::ILL::Comments->_new_from_dbic( scalar $self->_result->comments ); } diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index 235424f3fe3..22ec2d30210 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -25,7 +25,7 @@ use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_and_exit output_html_with_http_headers ); use Koha::Notice::Templates; use Koha::AuthorisedValues; -use Koha::Illcomment; +use Koha::ILL::Comment; use Koha::Illrequests; use Koha::Illrequest; use Koha::ILL::Batches; @@ -409,7 +409,7 @@ if ( $backends_available ) { $template->param( table_actions => encode_json( Koha::Illrequest->get_staff_table_actions ) ); } elsif ( $op eq "save_comment" ) { - my $comment = Koha::Illcomment->new({ + my $comment = Koha::ILL::Comment->new({ illrequest_id => scalar $params->{illrequest_id}, borrowernumber => $patronnumber, comment => scalar $params->{comment}, diff --git a/t/db_dependent/Illcomments.t b/t/db_dependent/Koha/ILL/Comments.t similarity index 93% rename from t/db_dependent/Illcomments.t rename to t/db_dependent/Koha/ILL/Comments.t index 85cc63021c5..742f16af9d6 100755 --- a/t/db_dependent/Illcomments.t +++ b/t/db_dependent/Koha/ILL/Comments.t @@ -32,8 +32,8 @@ use Test::More tests => 9; my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; -use_ok('Koha::Illcomment'); -use_ok('Koha::Illcomments'); +use_ok('Koha::ILL::Comment'); +use_ok('Koha::ILL::Comments'); $schema->storage->txn_begin; @@ -66,13 +66,13 @@ my $illcomment = $builder->build({ # Get all the comments my $comments = $illrq_obj->illcomments; -isa_ok( $comments, 'Koha::Illcomments', "Illcomments" ); +isa_ok( $comments, 'Koha::ILL::Comments', "Illcomments" ); my @comments_list = $comments->as_list(); is( scalar @comments_list, 1, "We have 1 comment" ); # Get the first (and only) comment my $comment = $comments->next(); -isa_ok( $comment, 'Koha::Illcomment', "Illcomment" ); +isa_ok( $comment, 'Koha::ILL::Comment', "Illcomment" ); # Check the different data in the comment is( $comment->illrequest_id, $illrq_obj->illrequest_id, 'illrequest_id getter works' ); diff --git a/t/db_dependent/api/v1/ill_requests.t b/t/db_dependent/api/v1/ill_requests.t index 3e7bb9d681f..7822acc4863 100755 --- a/t/db_dependent/api/v1/ill_requests.t +++ b/t/db_dependent/api/v1/ill_requests.t @@ -209,7 +209,7 @@ subtest 'list() tests' => sub { # x-koha-embed: comments # Create comment my $comment_text = "This is the comment"; - my $comment = $builder->build_object({ class => 'Koha::Illcomments', value => { illrequest_id => $req_1->illrequest_id, comment => $comment_text , borrowernumber => $patron->borrowernumber } } ); + my $comment = $builder->build_object({ class => 'Koha::ILL::Comments', value => { illrequest_id => $req_1->illrequest_id, comment => $comment_text , borrowernumber => $patron->borrowernumber } } ); # Make sure comments come back $t->get_ok("//$userid:$password@/api/v1/ill/requests" => {"x-koha-embed" => "comments"} ) -- 2.30.2