View | Details | Raw Unified | Return to bug 35581
Collapse All | Expand All

(-)a/Koha/Illrequestattribute.pm (-3 / +3 lines)
Lines 1-4 Link Here
1
package Koha::Illrequestattribute;
1
package Koha::ILL::Request::Attribute;
2
2
3
# Copyright PTFS Europe 2016
3
# Copyright PTFS Europe 2016
4
#
4
#
Lines 25-31 use base qw(Koha::Object); Link Here
25
25
26
=head1 NAME
26
=head1 NAME
27
27
28
Koha::Illrequestattribute - Koha Illrequestattribute Object class
28
Koha::ILL::Request::Attribute - Koha Illrequestattribute Object class
29
29
30
=head1 API
30
=head1 API
31
31
Lines 70-76 sub _type { Link Here
70
70
71
=head3 to_api_mapping
71
=head3 to_api_mapping
72
72
73
This method returns the mapping for representing a Koha::Illrequestattribute object
73
This method returns the mapping for representing a Koha::ILL::Request::Attribute object
74
on the API.
74
on the API.
75
75
76
=cut
76
=cut
(-)a/Koha/Illrequestattributes.pm (-5 / +5 lines)
Lines 1-4 Link Here
1
package Koha::Illrequestattributes;
1
package Koha::ILL::Request::Attributes;
2
2
3
# Copyright PTFS Europe 2016
3
# Copyright PTFS Europe 2016
4
#
4
#
Lines 20-32 package Koha::Illrequestattributes; Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Koha::Database;
22
use Koha::Database;
23
use Koha::Illrequestattribute;
23
use Koha::ILL::Request::Attribute;
24
24
25
use base qw(Koha::Objects);
25
use base qw(Koha::Objects);
26
26
27
=head1 NAME
27
=head1 NAME
28
28
29
Koha::Illrequestattributes - Koha Illrequestattributes Object class
29
Koha::ILL::Request::Attributes - Koha Illrequestattributes Object class
30
30
31
=head1 API
31
=head1 API
32
32
Lines 36-42 Koha::Illrequestattributes - Koha Illrequestattributes Object class Link Here
36
36
37
=head3 search
37
=head3 search
38
38
39
my $attributes = Koha::Illrequestattributes->search( $params );
39
my $attributes = Koha::ILL::Request::Attributes->search( $params );
40
40
41
=cut
41
=cut
42
42
Lines 61-67 sub _type { Link Here
61
=cut
61
=cut
62
62
63
sub object_class {
63
sub object_class {
64
    return 'Koha::Illrequestattribute';
64
    return 'Koha::ILL::Request::Attribute';
65
}
65
}
66
66
67
=head1 AUTHOR
67
=head1 AUTHOR
(-)a/Koha/Illrequest.pm (-5 / +5 lines)
Lines 31-37 use Koha::Database; Link Here
31
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
32
use Koha::Exceptions::Ill;
32
use Koha::Exceptions::Ill;
33
use Koha::ILL::Comments;
33
use Koha::ILL::Comments;
34
use Koha::Illrequestattributes;
34
use Koha::ILL::Request::Attributes;
35
use Koha::AuthorisedValue;
35
use Koha::AuthorisedValue;
36
use Koha::Illrequest::Logger;
36
use Koha::Illrequest::Logger;
37
use Koha::Patron;
37
use Koha::Patron;
Lines 197-203 sub statusalias { Link Here
197
sub illrequestattributes {
197
sub illrequestattributes {
198
    deprecated 'illrequestattributes is DEPRECATED in favor of extended_attributes';
198
    deprecated 'illrequestattributes is DEPRECATED in favor of extended_attributes';
199
    my ( $self ) = @_;
199
    my ( $self ) = @_;
200
    return Koha::Illrequestattributes->_new_from_dbic(
200
    return Koha::ILL::Request::Attributes->_new_from_dbic(
201
        scalar $self->_result->illrequestattributes
201
        scalar $self->_result->illrequestattributes
202
    );
202
    );
203
}
203
}
Lines 273-279 sub library { Link Here
273
273
274
    my $extended_attributes = $request->extended_attributes;
274
    my $extended_attributes = $request->extended_attributes;
275
275
276
Returns the linked I<Koha::Illrequestattributes> resultset object.
276
Returns the linked I<Koha::ILL::Request::Attributes> resultset object.
277
277
278
=cut
278
=cut
279
279
Lines 281-288 sub extended_attributes { Link Here
281
    my ( $self ) = @_;
281
    my ( $self ) = @_;
282
282
283
    my $rs = $self->_result->extended_attributes;
283
    my $rs = $self->_result->extended_attributes;
284
    # We call search to use the filters in Koha::Illrequestattributes->search
284
    # We call search to use the filters in Koha::ILL::Request::Attributes->search
285
    return Koha::Illrequestattributes->_new_from_dbic($rs)->search;
285
    return Koha::ILL::Request::Attributes->_new_from_dbic($rs)->search;
286
}
286
}
287
287
288
=head3 status_alias
288
=head3 status_alias
(-)a/Koha/REST/V1/Illrequests.pm (-1 / +1 lines)
Lines 21-27 use Mojo::Base 'Mojolicious::Controller'; Link Here
21
21
22
use C4::Context;
22
use C4::Context;
23
use Koha::Illrequests;
23
use Koha::Illrequests;
24
use Koha::Illrequestattributes;
24
use Koha::ILL::Request::Attributes;
25
use Koha::Libraries;
25
use Koha::Libraries;
26
use Koha::Patrons;
26
use Koha::Patrons;
27
use Koha::Libraries;
27
use Koha::Libraries;
(-)a/Koha/Schema/Result/Illrequestattribute.pm (+8 lines)
Lines 124-127 __PACKAGE__->add_columns( Link Here
124
    '+readonly' => { is_boolean => 1 }
124
    '+readonly' => { is_boolean => 1 }
125
);
125
);
126
126
127
sub koha_object_class {
128
    'Koha::ILL::Request::Attribute';
129
}
130
131
sub koha_objects_class {
132
    'Koha::ILL::Request::Attributes';
133
}
134
127
1;
135
1;
(-)a/t/db_dependent/Illrequests.t (-2 / +2 lines)
Lines 22-28 use File::Basename qw/basename/; Link Here
22
use C4::Circulation qw( AddIssue AddReturn );
22
use C4::Circulation qw( AddIssue AddReturn );
23
23
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::Illrequestattributes;
25
use Koha::ILL::Request::Attributes;
26
use Koha::Illrequest::Config;
26
use Koha::Illrequest::Config;
27
use Koha::Biblios;
27
use Koha::Biblios;
28
use Koha::Patrons;
28
use Koha::Patrons;
Lines 220-226 subtest 'Working with related objects' => sub { Link Here
220
        }
220
        }
221
    );
221
    );
222
222
223
    my $rs = Koha::Illrequestattributes->search( { illrequest_id => $illrq->id } );
223
    my $rs = Koha::ILL::Request::Attributes->search( { illrequest_id => $illrq->id } );
224
224
225
    is( $illrq->extended_attributes->count,
225
    is( $illrq->extended_attributes->count,
226
        $rs->count, "Fetching expected number of Illrequestattributes for our request." );
226
        $rs->count, "Fetching expected number of Illrequestattributes for our request." );
(-)a/t/db_dependent/Koha/ILL/Comments.t (-1 / +1 lines)
Lines 20-26 use Modern::Perl; Link Here
20
use File::Basename qw/basename/;
20
use File::Basename qw/basename/;
21
use Koha::Database;
21
use Koha::Database;
22
use Koha::Illrequests;
22
use Koha::Illrequests;
23
use Koha::Illrequestattributes;
23
use Koha::ILL::Request::Attributes;
24
use Koha::Illrequest::Config;
24
use Koha::Illrequest::Config;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
use t::lib::Mocks;
26
use t::lib::Mocks;
(-)a/t/db_dependent/Illrequestattributes.t (-7 / +6 lines)
Lines 25-32 use t::lib::TestBuilder; Link Here
25
use Test::More tests => 3;
25
use Test::More tests => 3;
26
26
27
my $schema = Koha::Database->new->schema;
27
my $schema = Koha::Database->new->schema;
28
use_ok('Koha::Illrequestattribute');
28
use_ok('Koha::ILL::Request::Attribute');
29
use_ok('Koha::Illrequestattributes');
29
use_ok('Koha::ILL::Request::Attributes');
30
30
31
subtest 'Basic object tests' => sub {
31
subtest 'Basic object tests' => sub {
32
32
Lines 34-52 subtest 'Basic object tests' => sub { Link Here
34
34
35
    $schema->storage->txn_begin;
35
    $schema->storage->txn_begin;
36
36
37
    Koha::Illrequestattributes->search->delete;
37
    Koha::ILL::Request::Attributes->search->delete;
38
38
39
    my $builder = t::lib::TestBuilder->new;
39
    my $builder = t::lib::TestBuilder->new;
40
40
41
    my $illrqattr = $builder->build( { source => 'Illrequestattribute' } );
41
    my $illrqattr = $builder->build( { source => 'Illrequestattribute' } );
42
42
43
    my $illrqattr_obj = Koha::Illrequestattributes->find(
43
    my $illrqattr_obj = Koha::ILL::Request::Attributes->find(
44
        $illrqattr->{illrequest_id},
44
        $illrqattr->{illrequest_id},
45
        $illrqattr->{backend},
45
        $illrqattr->{backend},
46
        $illrqattr->{type}
46
        $illrqattr->{type}
47
    );
47
    );
48
    isa_ok(
48
    isa_ok(
49
        $illrqattr_obj, 'Koha::Illrequestattribute',
49
        $illrqattr_obj, 'Koha::ILL::Request::Attribute',
50
        "Correctly create and load an illrequestattribute object."
50
        "Correctly create and load an illrequestattribute object."
51
    );
51
    );
52
    is(
52
    is(
Lines 69-75 subtest 'Basic object tests' => sub { Link Here
69
    $illrqattr_obj->delete;
69
    $illrqattr_obj->delete;
70
70
71
    is(
71
    is(
72
        Koha::Illrequestattributes->search->count, 0,
72
        Koha::ILL::Request::Attributes->search->count, 0,
73
        "No attributes found after delete."
73
        "No attributes found after delete."
74
    );
74
    );
75
75
76
- 

Return to bug 35581