|
Lines 41-52
my ( $template, $logged_in_user, $cookie ) = get_template_and_user(
Link Here
|
| 41 |
my ($list) = |
41 |
my ($list) = |
| 42 |
GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } ); |
42 |
GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } ); |
| 43 |
|
43 |
|
|
|
44 |
my @existing = $list->patron_list_patrons; |
| 45 |
|
| 44 |
my $cardnumbers = $cgi->param('patrons_by_barcode'); |
46 |
my $cardnumbers = $cgi->param('patrons_by_barcode'); |
| 45 |
my @patrons_by_barcode; |
47 |
my @patrons_by_barcode; |
| 46 |
|
48 |
|
| 47 |
if ( $cardnumbers ){ |
49 |
if ( $cardnumbers ){ |
| 48 |
push my @patrons_by_barcode, uniq( split(/\s\n/, $cardnumbers) ); |
50 |
push my @patrons_by_barcode, uniq( split(/\s\n/, $cardnumbers) ); |
| 49 |
AddPatronsToList( { list => $list, cardnumbers => \@patrons_by_barcode } ); |
51 |
my @results = AddPatronsToList( { list => $list, cardnumbers => \@patrons_by_barcode } ); |
|
|
52 |
my %found = map { $_->borrowernumber->cardnumber => 1 } @results; |
| 53 |
my %exist = map { $_->borrowernumber->cardnumber => 1 } @existing; |
| 54 |
my (@not_found, @existed); |
| 55 |
foreach my $barcode ( @patrons_by_barcode ){ |
| 56 |
push (@not_found, $barcode) unless defined $found{$barcode}; |
| 57 |
push (@existed, $barcode) if defined $exist{$barcode}; |
| 58 |
} |
| 59 |
$template->param( |
| 60 |
not_found => \@not_found, |
| 61 |
existed => \@existed, |
| 62 |
); |
| 50 |
} |
63 |
} |
| 51 |
|
64 |
|
| 52 |
my @patrons_to_add = $cgi->multi_param('patrons_to_add'); |
65 |
my @patrons_to_add = $cgi->multi_param('patrons_to_add'); |
| 53 |
- |
|
|