X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=admin%2Fbranch_transfer_limits.pl;h=35b1386388ae8d8d733f976e390deb0ccf59f81d;hb=5e863f93c06e1e67ddbf0c705657ca7d024006f6;hp=455c04ad27325a40e9f08712f391a8f254c49f2f;hpb=6f204fdf96f16340da184aa27142a391871dcc37;p=koha-ffzg.git diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index 455c04ad27..35b1386388 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( DeleteBranchTransferLimits CreateBranchTransferLimit IsBranchTransferAllowed ); my $input = CGI->new; @@ -53,23 +52,13 @@ my $limitType = C4::Context->preference("BranchTransferLimitsType") || "ccode"; my @codes; my @branchcodes; -my $sth; if ( $limitType eq 'ccode' ) { - $sth = $dbh->prepare('SELECT authorised_value AS ccode FROM authorised_values WHERE category = "CCODE"'); + @codes = Koha::AuthorisedValues->search({ category => 'CCODE' })->get_column('authorised_value'); } elsif ( $limitType eq 'itemtype' ) { - $sth = $dbh->prepare('SELECT itemtype FROM itemtypes'); -} -$sth->execute(); -while ( my $row = $sth->fetchrow_hashref ) { - push( @codes, $row->{ $limitType } ); -} - -$sth = $dbh->prepare("SELECT branchcode FROM branches"); -$sth->execute(); -while ( my $row = $sth->fetchrow_hashref ) { - push( @branchcodes, $row->{'branchcode'} ); + @codes = Koha::ItemTypes->search->get_column('itemtype'); } +@branchcodes = Koha::Libraries->search->get_column('branchcode'); ## If Form Data Passed, Update the Database if ( $input->param('updateLimits') ) { DeleteBranchTransferLimits($branchcode);