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

(-)a/Koha/PatronCategories.pm (-4 / +4 lines)
Lines 1-4 Link Here
1
package Koha::PatronCategories;
1
package Koha::Patron::Categories;
2
2
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
Lines 21-33 use Carp; Link Here
21
21
22
use Koha::Database;
22
use Koha::Database;
23
23
24
use Koha::PatronCategory;
24
use Koha::Patron::Category;
25
25
26
use base qw(Koha::Objects);
26
use base qw(Koha::Objects);
27
27
28
=head1 NAME
28
=head1 NAME
29
29
30
Koha::PatronCategories - Koha PatronCategory Object set class
30
Koha::Patron::Categories - Koha Patron Category Object set class
31
31
32
=head1 API
32
=head1 API
33
33
Lines 44-50 sub type { Link Here
44
}
44
}
45
45
46
sub object_class {
46
sub object_class {
47
    return 'Koha::PatronCategory';
47
    return 'Koha::Patron::Category';
48
}
48
}
49
49
50
1;
50
1;
(-)a/Koha/PatronCategory.pm (-2 / +2 lines)
Lines 1-4 Link Here
1
package Koha::PatronCategory;
1
package Koha::Patron::Category;
2
2
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
Lines 27-33 use base qw(Koha::Object); Link Here
27
27
28
=head1 NAME
28
=head1 NAME
29
29
30
Koha::PatronCategory - Koha PatronCategory Object class
30
Koha::Patron;;Category - Koha Patron;;Category Object class
31
31
32
=head1 API
32
=head1 API
33
33
(-)a/admin/categorie.pl (-8 / +7 lines)
Lines 29-35 use C4::Form::MessagingPreferences; Link Here
29
use Koha::Borrowers;
29
use Koha::Borrowers;
30
use Koha::Database;
30
use Koha::Database;
31
use Koha::DateUtils;
31
use Koha::DateUtils;
32
use Koha::PatronCategories;
32
use Koha::Patron::Categories;
33
33
34
my $input         = new CGI;
34
my $input         = new CGI;
35
my $searchfield   = $input->param('description') // q||;
35
my $searchfield   = $input->param('description') // q||;
Lines 51-57 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
51
if ( $op eq 'add_form' ) {
51
if ( $op eq 'add_form' ) {
52
    my ( $category, $selected_branches );
52
    my ( $category, $selected_branches );
53
    if ($categorycode) {
53
    if ($categorycode) {
54
        $category          = Koha::PatronCategories->find($categorycode);
54
        $category          = Koha::Patron::Categories->find($categorycode);
55
        $selected_branches = $category->branch_limitations;
55
        $selected_branches = $category->branch_limitations;
56
    }
56
    }
57
57
Lines 100-106 elsif ( $op eq 'add_validate' ) { Link Here
100
    }
100
    }
101
101
102
    if ($is_a_modif) {
102
    if ($is_a_modif) {
103
        my $category = Koha::PatronCategories->find( $categorycode );
103
        my $category = Koha::Patron::Categories->find( $categorycode );
104
        $category->categorycode($categorycode);
104
        $category->categorycode($categorycode);
105
        $category->description($description);
105
        $category->description($description);
106
        $category->enrolmentperiod($enrolmentperiod);
106
        $category->enrolmentperiod($enrolmentperiod);
Lines 125-131 elsif ( $op eq 'add_validate' ) { Link Here
125
        }
125
        }
126
    }
126
    }
127
    else {
127
    else {
128
        my $category = Koha::PatronCategory->new({
128
        my $category = Koha::Patron::Category->new({
129
            categorycode => $categorycode,
129
            categorycode => $categorycode,
130
            description => $description,
130
            description => $description,
131
            enrolmentperiod => $enrolmentperiod,
131
            enrolmentperiod => $enrolmentperiod,
Lines 166-172 elsif ( $op eq 'delete_confirm' ) { Link Here
166
        categorycode => $categorycode
166
        categorycode => $categorycode
167
    })->count;
167
    })->count;
168
168
169
    my $category = Koha::PatronCategories->find($categorycode);
169
    my $category = Koha::Patron::Categories->find($categorycode);
170
170
171
    $template->param(
171
    $template->param(
172
        category => $category,
172
        category => $category,
Lines 177-183 elsif ( $op eq 'delete_confirm' ) { Link Here
177
elsif ( $op eq 'delete_confirmed' ) {
177
elsif ( $op eq 'delete_confirmed' ) {
178
    my $categorycode = uc( $input->param('categorycode') );
178
    my $categorycode = uc( $input->param('categorycode') );
179
179
180
    my $category = Koha::PatronCategories->find( $categorycode );
180
    my $category = Koha::Patron::Categories->find( $categorycode );
181
    my $deleted = eval { $category->delete; };
181
    my $deleted = eval { $category->delete; };
182
182
183
    if ( $@ or not $deleted ) {
183
    if ( $@ or not $deleted ) {
Lines 190-196 elsif ( $op eq 'delete_confirmed' ) { Link Here
190
}
190
}
191
191
192
if ( $op eq 'list' ) {
192
if ( $op eq 'list' ) {
193
    my $categories = Koha::PatronCategories->search(
193
    my $categories = Koha::Patron::Categories->search(
194
        {
194
        {
195
            description => { -like => "$searchfield%" }
195
            description => { -like => "$searchfield%" }
196
        },
196
        },
197
- 

Return to bug 14836