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