use Koha::AuthUtils;
use Koha::AuthorisedValues;
use Koha::Email;
-use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments );
+use Koha::Patron::Debarments qw( AddDebarment DelDebarment );
use Koha::Patron::Restriction::Types;
use Koha::Cities;
use Koha::DateUtils qw( dt_from_string );
## Deal with debarments
$template->param(
- debarments => scalar GetDebarments( { borrowernumber => $borrowernumber } ),
- restriction_types => scalar Koha::Patron::Restriction::Types->keyed_on_code()
+ restriction_types => scalar Koha::Patron::Restriction::Types->search()
);
my @debarments_to_remove = $input->multi_param('remove_debarment');
foreach my $d ( @debarments_to_remove ) {
);
my $no_categories = ! $patron_categories->count;
my $categories = {};
-foreach my $patron_category ($patron_categories->as_list ) {
+my @patron_categories = $patron_categories->as_list;
+# When adding a guarantor we don't have a category yet, and only want to choose from the eligible categories
+unless ( !$category || $patron_categories->find( $category->id ) ){
+ $template->param( limited_category => 1 );
+ push @patron_categories, $category;
+}
+foreach my $patron_category ( @patron_categories ) {
push @{ $categories->{ $patron_category->category_type } }, $patron_category;
}
push(@relshipdata, \%row);
}
-my %flags = (
- 'gonenoaddress' => ['gonenoaddress'],
- 'lost' => ['lost']
-);
-
-my @flagdata;
-foreach ( keys(%flags) ) {
- my $key = $_;
- my %row = (
- 'key' => $key,
- 'name' => $flags{$key}[0]
- );
- if ( $data{$key} ) {
- $row{'yes'} = ' checked';
- $row{'no'} = '';
- }
- else {
- $row{'yes'} = '';
- $row{'no'} = ' checked';
- }
- push @flagdata, \%row;
-}
-
# get Branch Loop
# in modify mod: userbranch value comes from borrowers table
# in add mod: userbranch value comes from branches table (ip correspondence)
borrowernumber => $borrowernumber, #register number
relshiploop => \@relshipdata,
btitle=> $default_borrowertitle,
- flagloop => \@flagdata,
modify => $modify,
nok => $nok,#flag to know if an error
NoUpdateLogin => $NoUpdateLogin,