use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Context;
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers output_and_exit_if_error output_and_exit );
use Koha::Patrons;
use Koha::Patron::Categories;
use Koha::Patrons;
-# use Smart::Comments;
-
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "members/update-child.tt",
query => $input,
type => "intranet",
- authnotrequired => 0,
flagsrequired => { borrowers => 'edit_borrowers' },
- debug => 1,
}
);
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
-my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+my $patron_categories = Koha::Patron::Categories->search_with_library_limits({ category_type => 'A' }, {order_by => ['categorycode']});
if ( $op eq 'multi' ) {
# FIXME - what are the possible upgrade paths? C -> A , C -> S ...
# currently just allowing C -> A
# But we should not hit that with a normal use of the interface
die "You are doing something wrong updating this child" unless $adult_category;
- $_->delete() for $patron->guarantor_relationships();
+ $_->delete() for $patron->guarantor_relationships->as_list;
$patron->categorycode($adult_category->categorycode);
$patron->store;