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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt (-14 / +54 lines)
Lines 5-10 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
6
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8
<style type="text/css">
9
    #add_patrons_by_search {
10
        display: none;
11
    }
12
    #patron_barcodes_line {
13
        display: none;
14
    }
15
    #patron_barcodes_submit {
16
        display: none;
17
    }
18
    #searchheader {
19
        margin-top: 1em;
20
    }
21
</style>
8
</head>
22
</head>
9
23
10
<body id="patlist_list" class="pat patlist">
24
<body id="patlist_list" class="pat patlist">
Lines 18-42 Link Here
18
        <div class="yui-b">
32
        <div class="yui-b">
19
        <h1>[% list.name |html %]</h1>
33
        <h1>[% list.name |html %]</h1>
20
34
21
        <form action="list.pl" id="add_patrons" method="post">
35
        <form action="list.pl" id="add_patrons" method="post" class="clearfix">
22
            <fieldset>
36
            <fieldset class="rows">
23
                <legend>Add patrons</legend>
37
                <legend>Add patrons</legend>
38
                <ol>
39
                    <li id="patron_search_line">
40
                        <label for="find_patron">Patron search: </label>
41
                        <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
42
                    </li>
43
                    <li id="add_patrons_by_search"><a href="#">
44
                        <span class="label">&nbsp;</span>
45
                        <i class="fa fa-plus"></i> Search for patrons</a></li>
46
                    <li id="add_patrons_by_barcode"><a href="#">
47
                        <span class="label">&nbsp;</span>
48
                        <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
49
                    <li id="patron_barcodes_line">
50
                        <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
51
                        <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
52
                    </li>
53
                </ol>
54
            </fieldset>
55
            <fieldset id="patron_barcodes_submit" class="action">
56
                <input type="submit" value="Submit" />
57
            </fieldset>
24
58
25
                    <label for="find_patron">Patron search: </label>
59
            <div class="clearfix"></div>
26
                    <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
27
                    <div id="find_patron_container"></div>
28
60
29
                <fieldset id="patrons_to_add_fieldset">
61
            <fieldset id="patrons_to_add_fieldset">
30
                    <legend>Patrons to be added</legend>
62
                <legend>Patrons to be added</legend>
31
                    <div id="patrons_to_add"></div>
63
                <div id="patrons_to_add"></div>
32
64
33
                    <fieldset class="action">
65
                <fieldset class="action">
34
                        <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
66
                    <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
35
                        <input type="submit" value="Add patrons" />
67
                    <input type="submit" value="Add patrons" />
36
                        <a href="lists.pl" class="cancel">Cancel</a>
68
                    <a href="lists.pl" class="cancel">Cancel</a>
37
                    </fieldset>
38
                </fieldset>
69
                </fieldset>
39
40
            </fieldset>
70
            </fieldset>
41
        </form>
71
        </form>
42
72
Lines 159-164 Link Here
159
                    return false;
189
                    return false;
160
                }
190
                }
161
            });
191
            });
192
193
            $("#add_patrons_by_barcode a").on("click", function(){
194
                $("#add_patrons_by_barcode, #patron_search_line").hide();
195
                $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
196
            });
197
198
            $("#add_patrons_by_search a").on("click", function(){
199
                $("#add_patrons_by_barcode, #patron_search_line").show();
200
                $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
201
            });
162
        });
202
        });
163
    </script>
203
    </script>
164
[% END %]
204
[% END %]
(-)a/patron_lists/list.pl (-1 / +9 lines)
Lines 24-29 use CGI qw ( -utf8 ); Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
use Koha::List::Patron;
26
use Koha::List::Patron;
27
use List::MoreUtils qw/uniq/;
27
28
28
my $cgi = new CGI;
29
my $cgi = new CGI;
29
30
Lines 40-45 my ( $template, $logged_in_user, $cookie ) = get_template_and_user( Link Here
40
my ($list) =
41
my ($list) =
41
  GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } );
42
  GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } );
42
43
44
my $cardnumbers = $cgi->param('patrons_by_barcode');
45
my @patrons_by_barcode;
46
47
if ( $cardnumbers ){
48
    push my @patrons_by_barcode, uniq( split(/\s\n/, $cardnumbers) );
49
    AddPatronsToList( { list => $list, cardnumbers => \@patrons_by_barcode } );
50
}
51
43
my @patrons_to_add = $cgi->multi_param('patrons_to_add');
52
my @patrons_to_add = $cgi->multi_param('patrons_to_add');
44
if (@patrons_to_add) {
53
if (@patrons_to_add) {
45
    AddPatronsToList( { list => $list, cardnumbers => \@patrons_to_add } );
54
    AddPatronsToList( { list => $list, cardnumbers => \@patrons_to_add } );
46
- 

Return to bug 19837