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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt (+28 lines)
Lines 32-37 Link Here
32
        <div class="yui-b">
32
        <div class="yui-b">
33
        <h1>[% list.name |html %]</h1>
33
        <h1>[% list.name |html %]</h1>
34
34
35
        [% IF ( not_found.size > 0 ) %]
36
        <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
37
        <table style="margin:auto;">
38
            <thead>
39
                <tr><th>Cardnumbers not found</th></tr>
40
            </thead>
41
            <tbody>
42
            [% FOREACH nf IN not_found %]
43
                <tr><td>[% nf |html %]</td></td>
44
            [% END %]
45
            </tbody>
46
        </table>
47
        [% END %]
48
49
        [% IF ( existed.size > 0 ) %]
50
        <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
51
        <table style="margin:auto;">
52
            <thead>
53
                <tr><th>Cardnumbers already in list</th></tr>
54
            </thead>
55
            <tbody>
56
            [% FOREACH ed IN existed %]
57
                <tr><td>[% ed |html %]</td></td>
58
            [% END %]
59
            </tbody>
60
        </table>
61
        [% END %]
62
35
        <form action="list.pl" id="add_patrons" method="post" class="clearfix">
63
        <form action="list.pl" id="add_patrons" method="post" class="clearfix">
36
            <fieldset class="rows">
64
            <fieldset class="rows">
37
                <legend>Add patrons</legend>
65
                <legend>Add patrons</legend>
(-)a/patron_lists/list.pl (-2 / +14 lines)
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
- 

Return to bug 19837