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

(-)a/Koha/Old/Biblio.pm (+42 lines)
Line 0 Link Here
1
package Koha::Old::Biblio;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Object);
21
22
=head1 NAME
23
24
Koha::Old::Biblio - Koha Old::Biblio Object class
25
26
=head1 API
27
28
=head2 Class methods
29
30
=cut
31
32
=head2 Internal methods
33
34
=head3 _type
35
36
=cut
37
38
sub _type {
39
    return 'Deletedbiblio';
40
}
41
42
1;
(-)a/Koha/Old/Biblioitem.pm (+42 lines)
Line 0 Link Here
1
package Koha::Old::Biblioitem;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Object);
21
22
=head1 NAME
23
24
Koha::Old::Biblioitem - Koha Old::Biblioitem Object class
25
26
=head1 API
27
28
=head2 Class methods
29
30
=cut
31
32
=head2 Internal methods
33
34
=head3 _type
35
36
=cut
37
38
sub _type {
39
    return 'Deletedbiblioitem';
40
}
41
42
1;
(-)a/Koha/Old/Biblioitems.pm (+54 lines)
Line 0 Link Here
1
package Koha::Old::Biblioitems;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Objects);
21
22
use Koha::Old::Biblioitem;
23
24
=head1 NAME
25
26
Koha::Old::Biblioitems - Koha Old::Biblioitem Object set class
27
28
=head1 API
29
30
=head2 Class Methods
31
32
=cut
33
34
=head2 Internal Methods
35
36
=head3 _type
37
38
=cut
39
40
sub _type {
41
    return 'Deletedbiblioitem';
42
}
43
44
=head3 object_class
45
46
Single object class
47
48
=cut
49
50
sub object_class {
51
    return 'Koha::Old::Biblioitem';
52
}
53
54
1;
(-)a/Koha/Old/Biblios.pm (+54 lines)
Line 0 Link Here
1
package Koha::Old::Biblios;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Objects);
21
22
use Koha::Old::Biblio;
23
24
=head1 NAME
25
26
Koha::Old::Biblios - Koha Old::Biblio Object set class
27
28
=head1 API
29
30
=head2 Class Methods
31
32
=cut
33
34
=head2 Internal Methods
35
36
=head3 _type
37
38
=cut
39
40
sub _type {
41
    return 'Deletedbiblio';
42
}
43
44
=head3 object_class
45
46
Single object class
47
48
=cut
49
50
sub object_class {
51
    return 'Koha::Old::Biblio';
52
}
53
54
1;
(-)a/Koha/Old/Item.pm (+42 lines)
Line 0 Link Here
1
package Koha::Old::Item;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Object);
21
22
=head1 NAME
23
24
Koha::Old::Item - Koha Old::Item Object class
25
26
=head1 API
27
28
=head2 Class methods
29
30
=cut
31
32
=head2 Internal methods
33
34
=head3 _type
35
36
=cut
37
38
sub _type {
39
    return 'Deleteditem';
40
}
41
42
1;
(-)a/Koha/Old/Items.pm (+54 lines)
Line 0 Link Here
1
package Koha::Old::Items;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Objects);
21
22
use Koha::Old::Item;
23
24
=head1 NAME
25
26
Koha::Old::Items - Koha Old::Item Object set class
27
28
=head1 API
29
30
=head2 Class Methods
31
32
=cut
33
34
=head2 Internal Methods
35
36
=head3 _type
37
38
=cut
39
40
sub _type {
41
    return 'Deleteditem';
42
}
43
44
=head3 object_class
45
46
Single object class
47
48
=cut
49
50
sub object_class {
51
    return 'Koha::Old::Item';
52
}
53
54
1;
(-)a/Koha/Old/Patron.pm (+42 lines)
Line 0 Link Here
1
package Koha::Old::Patron;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Object);
21
22
=head1 NAME
23
24
Koha::Old::Patron - Koha Old::Patron Object class
25
26
=head1 API
27
28
=head2 Class methods
29
30
=cut
31
32
=head2 Internal methods
33
34
=head3 _type
35
36
=cut
37
38
sub _type {
39
    return 'Deletedborrower';
40
}
41
42
1;
(-)a/Koha/Old/Patrons.pm (+54 lines)
Line 0 Link Here
1
package Koha::Old::Patrons;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Objects);
21
22
use Koha::Old::Patron;
23
24
=head1 NAME
25
26
Koha::Old::Patrons - Koha Old::Patron Object set class
27
28
=head1 API
29
30
=head2 Class Methods
31
32
=cut
33
34
=head2 Internal Methods
35
36
=head3 _type
37
38
=cut
39
40
sub _type {
41
    return 'Deleteborrower';
42
}
43
44
=head3 object_class
45
46
Single object class
47
48
=cut
49
50
sub object_class {
51
    return 'Koha::Old::Patron';
52
}
53
54
1;
(-)a/t/db_dependent/Koha/Old.t (-1 / +55 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2019 Koha Development team
4
#
5
# This file is part of Koha
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Test::More tests => 2;
23
24
use Koha::Database;
25
use Koha::Old::Patrons;
26
use Koha::Old::Biblios;
27
use Koha::Old::Items;
28
29
use t::lib::TestBuilder;
30
31
my $schema = Koha::Database->new->schema;
32
$schema->storage->txn_begin;
33
34
my $builder = t::lib::TestBuilder->new;
35
36
subtest 'Koha::Old::Patrons' => sub {
37
    plan tests => 1;
38
39
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
40
    my $patron_unblessed = $patron->unblessed;
41
    $patron->move_to_deleted;
42
    $patron->delete;
43
    my $deleted_patron = Koha::Old::Patrons->search(
44
        {
45
            borrowernumber => $patron->borrowernumber;
46
        }
47
    )->next;
48
    is_deeply( $deleted_patron->unblessed, $patron_unblessed );
49
};
50
51
subtest 'Koha::Old::Biblios and Koha::Old::Items' => sub {
52
    # Cannot be tested in a meaningful way so far
53
    ok(1);
54
};
55
$schema->storage->txn_rollback;

Return to bug 24150