Bugzilla – Attachment 160427 Details for
Bug 35581
ILL Koha classes are not consistent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35581: Koha/Illrequest/Workflow.pm -> Koha/ILL/Request/Workflow.pm
Bug-35581-KohaIllrequestWorkflowpm---KohaILLReques.patch (text/plain), 11.90 KB, created by
David Nind
on 2024-01-02 19:10:49 UTC
(
hide
)
Description:
Bug 35581: Koha/Illrequest/Workflow.pm -> Koha/ILL/Request/Workflow.pm
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-01-02 19:10:49 UTC
Size:
11.90 KB
patch
obsolete
>From 2933d0aab3328e82dfb29b7ed9ea6002e7cd57e6 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 14 Dec 2023 15:20:48 -0100 >Subject: [PATCH] Bug 35581: Koha/Illrequest/Workflow.pm -> > Koha/ILL/Request/Workflow.pm > >Koha/Illrequest/Workflow/Availability.pm -> Koha/ILL/Request/Workflow/Availability.pm >Koha/Illrequest/Workflow/TypeDisclaimer.pm -> Koha/ILL/Request/Workflow/TypeDisclaimer.pm > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/{Illrequest => ILL/Request}/Workflow.pm | 10 +++++----- > .../Request}/Workflow/Availability.pm | 12 ++++++------ > .../Request}/Workflow/TypeDisclaimer.pm | 8 ++++---- > ill/ill-requests.pl | 12 ++++++------ > opac/opac-illrequests.pl | 8 ++++---- > t/db_dependent/Illrequest/Availability.t | 10 +++++----- > t/db_dependent/Illrequest/TypeDisclaimer.t | 10 +++++----- > 7 files changed, 35 insertions(+), 35 deletions(-) > rename Koha/{Illrequest => ILL/Request}/Workflow.pm (85%) > rename Koha/{Illrequest => ILL/Request}/Workflow/Availability.pm (89%) > rename Koha/{Illrequest => ILL/Request}/Workflow/TypeDisclaimer.pm (95%) > >diff --git a/Koha/Illrequest/Workflow.pm b/Koha/ILL/Request/Workflow.pm >similarity index 85% >rename from Koha/Illrequest/Workflow.pm >rename to Koha/ILL/Request/Workflow.pm >index d0bc2564f2..726ecdc3e6 100644 >--- a/Koha/Illrequest/Workflow.pm >+++ b/Koha/ILL/Request/Workflow.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequest::Workflow; >+package Koha::ILL::Request::Workflow; > > # Copyright 2023 PTFS Europe Ltd > # >@@ -28,7 +28,7 @@ use Koha::Plugins; > > =head1 NAME > >-Koha::Illrequest::Workflow - Koha ILL Workflow parent class >+Koha::ILL::Request::Workflow - Koha ILL Workflow parent class > > =head1 SYNOPSIS > >@@ -44,9 +44,9 @@ This class contains methods do be used by ILL workflow stages > > =head3 new > >- my $availability = Koha::Illrequest::Workflow::Availability->new( $params, 'opac' ) >+ my $availability = Koha::ILL::Request::Workflow::Availability->new( $params, 'opac' ) > >-Create a new Koha::Illrequest::Workflow child class object. >+Create a new Koha::ILL::Request::Workflow child class object. > We store the metadata and ui_context > > =cut >@@ -65,7 +65,7 @@ sub new { > > =head3 prep_metadata > >- my $prepared = Koha::Illrequest::Workflow->prep_metadata($metadata); >+ my $prepared = Koha::ILL::Request::Workflow->prep_metadata($metadata); > > Given our metadata, return a string representing that metadata that can be > passed in a URL (encoded in JSON then Base64 encoded) >diff --git a/Koha/Illrequest/Workflow/Availability.pm b/Koha/ILL/Request/Workflow/Availability.pm >similarity index 89% >rename from Koha/Illrequest/Workflow/Availability.pm >rename to Koha/ILL/Request/Workflow/Availability.pm >index 4fd75a48a9..acbb4cca95 100644 >--- a/Koha/Illrequest/Workflow/Availability.pm >+++ b/Koha/ILL/Request/Workflow/Availability.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequest::Workflow::Availability; >+package Koha::ILL::Request::Workflow::Availability; > > # Copyright 2019 PTFS Europe Ltd > # >@@ -21,13 +21,13 @@ use Modern::Perl; > > use JSON; > >-use base qw(Koha::Illrequest::Workflow); >+use base qw(Koha::ILL::Request::Workflow); > > use Koha::Plugins; > > =head1 NAME > >-Koha::Illrequest::Workflow::Availability - Koha ILL Availability Searching >+Koha::ILL::Request::Workflow::Availability - Koha ILL Availability Searching > > =head1 SYNOPSIS > >@@ -46,7 +46,7 @@ that can be used to search for item availability > =head3 get_services > > my $services = >- Koha::Illrequest::Workflow::Availability->get_services($params); >+ Koha::ILL::Request::Workflow::Availability->get_services($params); > > Given our metadata, iterate plugins with the right method and > check if they can service our request and, if so, return an arrayref >@@ -82,7 +82,7 @@ sub get_services { > =head3 show_availability > > my $show_availability = >- Koha::Illrequest::Workflow::Availability->show_availability($params); >+ Koha::ILL::Request::Workflow::Availability->show_availability($params); > > Given $params, return true if availability should be shown > >@@ -112,7 +112,7 @@ sub show_availability { > =head3 availability_template_params > > my $availability_template_params = >- Koha::Illrequest::Workflow::Availability->availability_template_params( >+ Koha::ILL::Request::Workflow::Availability->availability_template_params( > $params); > > Given $params, return true if availability should be shown >diff --git a/Koha/Illrequest/Workflow/TypeDisclaimer.pm b/Koha/ILL/Request/Workflow/TypeDisclaimer.pm >similarity index 95% >rename from Koha/Illrequest/Workflow/TypeDisclaimer.pm >rename to Koha/ILL/Request/Workflow/TypeDisclaimer.pm >index dea466d9be..636318da48 100644 >--- a/Koha/Illrequest/Workflow/TypeDisclaimer.pm >+++ b/Koha/ILL/Request/Workflow/TypeDisclaimer.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequest::Workflow::TypeDisclaimer; >+package Koha::ILL::Request::Workflow::TypeDisclaimer; > > # Copyright 2023 PTFS Europe Ltd > # >@@ -21,7 +21,7 @@ use Modern::Perl; > > use POSIX qw( strftime ); > >-use base qw(Koha::Illrequest::Workflow); >+use base qw(Koha::ILL::Request::Workflow); > > =head1 NAME > >@@ -129,7 +129,7 @@ sub after_request_created { > value => strftime( "%Y-%m-%dT%H:%M:%S", localtime( time() ) ), > readonly => 0 > }; >- Koha::Illrequestattribute->new($type_disclaimer_date)->store; >+ Koha::ILL::Request::Attribute->new($type_disclaimer_date)->store; > > my $type_disclaimer_value = { > illrequest_id => $request->illrequest_id, >@@ -137,7 +137,7 @@ sub after_request_created { > value => $params->{type_disclaimer_value}, > readonly => 0 > }; >- Koha::Illrequestattribute->new($type_disclaimer_value)->store; >+ Koha::ILL::Request::Attribute->new($type_disclaimer_value)->store; > } > > =head3 _get_type_disclaimer_info >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index 4134b26f34..052a465c06 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -28,8 +28,8 @@ use Koha::AuthorisedValues; > use Koha::ILL::Comment; > use Koha::Illrequests; > use Koha::ILL::Batches; >-use Koha::Illrequest::Workflow::Availability; >-use Koha::Illrequest::Workflow::TypeDisclaimer; >+use Koha::ILL::Request::Workflow::Availability; >+use Koha::ILL::Request::Workflow::TypeDisclaimer; > use Koha::Libraries; > use Koha::Token; > use Koha::Plugins; >@@ -131,9 +131,9 @@ if ( $backends_available ) { > > # Before request creation operations - Preparation > my $availability = >- Koha::Illrequest::Workflow::Availability->new( $params, 'staff' ); >+ Koha::ILL::Request::Workflow::Availability->new( $params, 'staff' ); > my $type_disclaimer = >- Koha::Illrequest::Workflow::TypeDisclaimer->new( $params, 'staff' ); >+ Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'staff' ); > > # ILLCheckAvailability operation > if ($availability->show_availability($request)) { >@@ -325,7 +325,7 @@ if ( $backends_available ) { > # Prepare availability searching, if required > # Get the definition for the z39.50 plugin > if ( C4::Context->preference('ILLCheckAvailability') ) { >- my $availability = Koha::Illrequest::Workflow::Availability->new( >+ my $availability = Koha::ILL::Request::Workflow::Availability->new( > { > name => 'ILL availability - z39.50', > %{$request->metadata} >@@ -556,7 +556,7 @@ sub get_ill_availability { > } > } > >- my $availability = Koha::Illrequest::Workflow::Availability->new($id_types); >+ my $availability = Koha::ILL::Request::Workflow::Availability->new($id_types); > return $availability->get_services({ > ui_context => 'staff' > }); >diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl >index 5173b8da6c..83e4bbefbb 100755 >--- a/opac/opac-illrequests.pl >+++ b/opac/opac-illrequests.pl >@@ -31,8 +31,8 @@ use Koha::Illrequest::Config; > use Koha::Illrequests; > use Koha::Libraries; > use Koha::Patrons; >-use Koha::Illrequest::Workflow::Availability; >-use Koha::Illrequest::Workflow::TypeDisclaimer; >+use Koha::ILL::Request::Workflow::Availability; >+use Koha::ILL::Request::Workflow::TypeDisclaimer; > > my $query = CGI->new; > >@@ -120,9 +120,9 @@ if ( $op eq 'list' ) { > > # Before request creation operations - Preparation > my $availability = >- Koha::Illrequest::Workflow::Availability->new( $params, 'opac' ); >+ Koha::ILL::Request::Workflow::Availability->new( $params, 'opac' ); > my $type_disclaimer = >- Koha::Illrequest::Workflow::TypeDisclaimer->new( $params, 'opac' ); >+ Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'opac' ); > > # ILLCheckAvailability operation > if ($availability->show_availability($request)) { >diff --git a/t/db_dependent/Illrequest/Availability.t b/t/db_dependent/Illrequest/Availability.t >index a8d98c9f72..8482c30a9d 100755 >--- a/t/db_dependent/Illrequest/Availability.t >+++ b/t/db_dependent/Illrequest/Availability.t >@@ -25,7 +25,7 @@ use Test::MockObject; > use t::lib::TestBuilder; > use t::lib::Mocks; > >-use Koha::Illrequest::Workflow::Availability; >+use Koha::ILL::Request::Workflow::Availability; > use Koha::Database; > > my $schema = Koha::Database->new->schema; >@@ -33,7 +33,7 @@ $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; > >-use_ok('Koha::Illrequest::Workflow::Availability'); >+use_ok('Koha::ILL::Request::Workflow::Availability'); > > my $metadata = { > title => 'This is a title', >@@ -48,9 +48,9 @@ foreach my $key ( keys %{$metadata} ) { > } > > my $availability = >- Koha::Illrequest::Workflow::Availability->new( $sorted, 'staff' ); >+ Koha::ILL::Request::Workflow::Availability->new( $sorted, 'staff' ); > >-isa_ok( $availability, 'Koha::Illrequest::Workflow::Availability' ); >+isa_ok( $availability, 'Koha::ILL::Request::Workflow::Availability' ); > > is( > $availability->prep_metadata($sorted), >@@ -85,7 +85,7 @@ t::lib::Mocks::mock_preference( 'ILLCheckAvailability', 1 ); > > # Mock not empty availability services > my $availability_module = >- Test::MockModule->new('Koha::Illrequest::Workflow::Availability'); >+ Test::MockModule->new('Koha::ILL::Request::Workflow::Availability'); > $availability_module->mock( 'get_services', [ { name => 'service' } ] ); > > my $req_1 = $builder->build_object( >diff --git a/t/db_dependent/Illrequest/TypeDisclaimer.t b/t/db_dependent/Illrequest/TypeDisclaimer.t >index 402bb5002e..123a865772 100755 >--- a/t/db_dependent/Illrequest/TypeDisclaimer.t >+++ b/t/db_dependent/Illrequest/TypeDisclaimer.t >@@ -25,7 +25,7 @@ use Test::MockObject; > use t::lib::TestBuilder; > use t::lib::Mocks; > >-use Koha::Illrequest::Workflow::TypeDisclaimer; >+use Koha::ILL::Request::Workflow::TypeDisclaimer; > use Koha::Database; > > my $schema = Koha::Database->new->schema; >@@ -33,7 +33,7 @@ $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; > >-use_ok('Koha::Illrequest::Workflow::TypeDisclaimer'); >+use_ok('Koha::ILL::Request::Workflow::TypeDisclaimer'); > > my $metadata = { > title => 'This is a title', >@@ -48,9 +48,9 @@ foreach my $key ( keys %{$metadata} ) { > } > > my $type_disclaimer = >- Koha::Illrequest::Workflow::TypeDisclaimer->new( $sorted, 'staff' ); >+ Koha::ILL::Request::Workflow::TypeDisclaimer->new( $sorted, 'staff' ); > >-isa_ok( $type_disclaimer, 'Koha::Illrequest::Workflow::TypeDisclaimer' ); >+isa_ok( $type_disclaimer, 'Koha::ILL::Request::Workflow::TypeDisclaimer' ); > > is( > $type_disclaimer->prep_metadata($sorted), >@@ -108,7 +108,7 @@ is( $type_disclaimer->show_type_disclaimer($request), > > # Mock ILLModuleDisclaimerByType with invalid YAML > my $type_disclaimer_module = >- Test::MockModule->new('Koha::Illrequest::Workflow::TypeDisclaimer'); >+ Test::MockModule->new('Koha::ILL::Request::Workflow::TypeDisclaimer'); > $type_disclaimer_module->mock( '_get_type_disclaimer_sys_pref', {} ); > > is( $type_disclaimer->show_type_disclaimer($request), >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35581
:
159863
|
159864
|
159865
|
159866
|
159867
|
159868
|
159869
|
159870
|
159871
|
159872
|
159873
|
160422
|
160423
|
160424
|
160425
|
160426
|
160427
|
160428
|
160429
|
160430
|
160431
|
160432
|
160620
|
160622
|
162020
|
162021
|
162022
|
162023
|
162024
|
162025
|
162026
|
162027
|
162028
|
162029
|
162030
|
162031
|
162032
|
162817
|
162818
|
162819
|
162820
|
162821
|
162822
|
162823
|
162824
|
162825
|
162826
|
162827
|
162828
|
162829
|
162880
|
162881
|
162882
|
162883
|
162884
|
162885
|
162886
|
162887
|
162888
|
162889
|
162890
|
162891
|
162892
|
163803
|
163804
|
163805
|
163806
|
163807
|
163808
|
163809
|
163810
|
163811
|
163812
|
163813
|
163814
|
163815
|
163816
|
164069
|
164070
|
164071
|
164072
|
164073
|
164074
|
164075
|
164076
|
164077
|
164078
|
164079
|
164080
|
164081
|
164082
|
165448