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

(-)a/Koha/AuthorisedValue.pm (+13 lines)
Lines 158-163 sub _avb_resultset { Link Here
158
    $self->{_avb_resultset};
158
    $self->{_avb_resultset};
159
}
159
}
160
160
161
=head3 GetCatAuthValues
162
$sth = Koha::AuthorisedValue->GetCatAuthValues($dbh);
163
164
This subroutine retrieves and returns all authorised_values (in the authorised_values table where the category=CCODE) in a column named ccode
165
=cut
166
167
sub GetCatAuthValues {
168
    my ($self, $dbh) = @_;
169
    my $sth = $dbh->prepare('SELECT authorised_value AS ccode FROM authorised_values WHERE category = "CCODE"');
170
    $sth->execute();
171
    return $sth;
172
}
173
161
=head3 type
174
=head3 type
162
175
163
=cut
176
=cut
(-)a/Koha/ItemType.pm (+15 lines)
Lines 81-86 sub translated_descriptions { Link Here
81
    } @translated_descriptions ];
81
    } @translated_descriptions ];
82
}
82
}
83
83
84
=head3 GetItemTypes
85
my $sth = Koha::ItemType->GetItemTypes($dbh);
86
87
This subroutine retreives and returns all itemtype values in the itemtypes table.
88
89
=cut
90
91
sub GetItemTypes {
92
    my ($self, $dbh) = @_;
93
    my $sth = $dbh->prepare('SELECT itemtype FROM itemtypes');
94
    $sth->execute();
95
    return $sth;
96
}
97
98
84
=head3 type
99
=head3 type
85
100
86
=cut
101
=cut
(-)a/Koha/Libraries.pm (+17 lines)
Lines 52-57 sub search_filtered { Link Here
52
    return $self->SUPER::search( $params, $attributes );
52
    return $self->SUPER::search( $params, $attributes );
53
}
53
}
54
54
55
56
=head3 GetBranchcodes
57
my $sth = Koha::Libraries->GetBranchCodes($dbh);
58
59
This subroutine retrieves and returns all branchcode values in the branches table to the branch_transfer_limits.pl administrative script.
60
61
=cut
62
63
sub GetBranchCodes {
64
    my ($self, $dbh) = @_;
65
    my $query = qq{ SELECT branchcode FROM branches };
66
    my $sth = $dbh->prepare($query);
67
    $sth->execute();
68
    return $sth;
69
}
70
71
55
=head3 type
72
=head3 type
56
73
57
=cut
74
=cut
(-)a/admin/branch_transfer_limits.pl (-9 / +11 lines)
Lines 27-32 use C4::Context; Link Here
27
use C4::Output;
27
use C4::Output;
28
use C4::Koha;
28
use C4::Koha;
29
use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit };
29
use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit };
30
use Koha::Libraries;
30
31
31
my $input = new CGI;
32
my $input = new CGI;
32
33
Lines 57-73 my @branchcodes; Link Here
57
58
58
my $sth;
59
my $sth;
59
if ( $limitType eq 'ccode' ) {
60
if ( $limitType eq 'ccode' ) {
60
	$sth = $dbh->prepare('SELECT authorised_value AS ccode FROM authorised_values WHERE category = "CCODE"');
61
    $sth = Koha::AuthorisedValue->GetCatAuthValues($dbh);
62
    while ( my $row = $sth->fetchrow_hashref ) {
63
        push( @codes, $row->{ $limitType } );
64
    }
61
} elsif ( $limitType eq 'itemtype' ) {
65
} elsif ( $limitType eq 'itemtype' ) {
62
	$sth = $dbh->prepare('SELECT itemtype FROM itemtypes');
66
    $sth = Koha::ItemType->GetItemTypes($dbh);
63
}
67
    while ( my $row = $sth->fetchrow_hashref ) {
64
$sth->execute();
68
        push( @codes, $row->{ $limitType } );
65
while ( my $row = $sth->fetchrow_hashref ) {
69
    }
66
	push( @codes, $row->{ $limitType } );
67
}
70
}
68
71
69
$sth = $dbh->prepare("SELECT branchcode FROM branches");
72
70
$sth->execute();
73
my $sth = Koha::Libraries->GetBranchCodes($dbh);
71
while ( my $row = $sth->fetchrow_hashref ) {
74
while ( my $row = $sth->fetchrow_hashref ) {
72
	push( @branchcodes, $row->{'branchcode'} );
75
	push( @branchcodes, $row->{'branchcode'} );
73
}
76
}
74
- 

Return to bug 18247