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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-28 / +35 lines)
Lines 1-15 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% INCLUDE 'doc-head-open.inc'%]
2
[% INCLUDE 'doc-head-open.inc'%]
3
<title>Koha &rsaquo; Tools &rsaquo; [% IF ( del ) %]Batch item deletion[% ELSE %]Batch item modification[% END %] </title>
3
<title>Koha &rsaquo; Tools &rsaquo; Batch patron modification</title>
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'calendar.inc' %]
5
[% INCLUDE 'calendar.inc' %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script type="text/JavaScript" language="JavaScript">
7
<script type="text/JavaScript">
8
//<![CDATA[
8
//<![CDATA[
9
        var patron_attributes_lib = new Array();
9
        var patron_attributes_lib = new Array();
10
        var patron_attributes_values = new Array();
10
        var patron_attributes_values = new Array();
11
        $(document).ready(function() {
11
        $(document).ready(function() {
12
            $("#borrowerst").tablesorter();
12
            $("#borrowerst").tablesorter({
13
                [% IF ( op == 'show' ) %]headers: { 0: { sorter: false}},[% END %]
14
                widgets : ['zebra'],
15
                sortList: [[1,0]]
16
            });
13
17
14
            $("#selectallbutton").click(function() {
18
            $("#selectallbutton").click(function() {
15
                $("#borrowerst").find("input:checkbox").each(function() {
19
                $("#borrowerst").find("input:checkbox").each(function() {
Lines 53-59 Link Here
53
            var information_category_node = $(select_attr).parent().parent().find('span.information_category');
57
            var information_category_node = $(select_attr).parent().parent().find('span.information_category');
54
            information_category_node.html("");
58
            information_category_node.html("");
55
            if ( category.length > 0 ) {
59
            if ( category.length > 0 ) {
56
                information_category_node.html('This attribute will be only applied to the borrower\'s category "' + category + '"');
60
                information_category_node.html(_("This attribute will be only applied to the patron\'s category") +' "' + category + '"');
57
            }
61
            }
58
            if ( type == 'select' ) {
62
            if ( type == 'select' ) {
59
                var options = '<option value = ""></option>';
63
                var options = '<option value = ""></option>';
Lines 70-76 Link Here
70
            var li_node = $("li.attributes:last");
74
            var li_node = $("li.attributes:last");
71
            var li_clone = $(li_node).clone();
75
            var li_clone = $(li_node).clone();
72
            if ( $(li_clone).find("a.delete").length == 0 ) {
76
            if ( $(li_clone).find("a.delete").length == 0 ) {
73
                $(li_clone).append('[<a href="#" title="Delete" class="delete" onclick="del_attributes(this);return false;">X</a>]');
77
                $(li_clone).append('<a href="#" title="Delete" class="clear-field" onclick="del_attributes(this);return false;">Delete</a>');
74
            }
78
            }
75
            $(li_clone).find('select[name="patron_attributes"]').change(function() {
79
            $(li_clone).find('select[name="patron_attributes"]').change(function() {
76
                updateAttrValues(this);
80
                updateAttrValues(this);
Lines 106-112 Link Here
106
<div id="breadcrumbs">
110
<div id="breadcrumbs">
107
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
111
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
108
    <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
112
    <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
109
    <a href="/cgi-bin/koha/tools/modborrowers.pl">Patrons modification</a>
113
    <a href="/cgi-bin/koha/tools/modborrowers.pl">Batch patron modification</a>
110
</div>
114
</div>
111
115
112
<div id="doc3" class="yui-t2">
116
<div id="doc3" class="yui-t2">
Lines 114-120 Link Here
114
        <div id="yui-main">
118
        <div id="yui-main">
115
            <div class="yui-b">
119
            <div class="yui-b">
116
                [% IF ( op == 'show_form' ) %]
120
                [% IF ( op == 'show_form' ) %]
117
                <h1>Batch patrons modification</h1>
121
                <h1>Batch patron modification</h1>
118
                <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl">
122
                <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl">
119
                    <fieldset class="rows">
123
                    <fieldset class="rows">
120
                    <legend>Use a file</legend>
124
                    <legend>Use a file</legend>
Lines 124-130 Link Here
124
                        <legend>Or list cardnumbers one by one</legend>
128
                        <legend>Or list cardnumbers one by one</legend>
125
                        <ol>
129
                        <ol>
126
                            <li>
130
                            <li>
127
                              <label for="cardnumberlist">Carnumber list (one cardnumber per line): </label>
131
                              <label for="cardnumberlist">Card number list (one cardnumber per line): </label>
128
                              <textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist %]</textarea>
132
                              <textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist %]</textarea>
129
                            </li>
133
                            </li>
130
                        </ol>
134
                        </ol>
Lines 163-169 Link Here
163
                            <ul class="warnings">
167
                            <ul class="warnings">
164
                            [% FOREACH error IN errors %]
168
                            [% FOREACH error IN errors %]
165
                                [% IF ( error.error == 'can_not_update' ) %]
169
                                [% IF ( error.error == 'can_not_update' ) %]
166
                                    <li>Can not update borrower with borrowernumber [% error.borrowernumber %]</li>
170
                                    <li>Can not update patron with borrowernumber [% error.borrowernumber %]</li>
167
                                [% ELSE %]
171
                                [% ELSE %]
168
                                    <li>[% error.error %]</li>
172
                                    <li>[% error.error %]</li>
169
                                [% END %]
173
                                [% END %]
Lines 188-201 Link Here
188
                                                [% IF ( op == 'show' ) %]
192
                                                [% IF ( op == 'show' ) %]
189
                                                    <th>&nbsp;</th>
193
                                                    <th>&nbsp;</th>
190
                                                [% END %]
194
                                                [% END %]
195
                                                <th>Card number</th>
191
                                                <th>Surname</th>
196
                                                <th>Surname</th>
192
                                                <th>Firstname</th>
197
                                                <th>Firstname</th>
193
                                                <th>Branchname</th>
198
                                                <th>Library</th>
194
                                                <th>Categorycode</th>
199
                                                <th>Category</th>
195
                                                <th>Cardnumber</th>
200
                                                <th>Registration date</th>
196
                                                <th>dateenrolled</th>
201
                                                <th>Expiry date</th>
197
                                                <th>dateexpiry</th>
202
                                                <th>Restricted</th>
198
                                                <th>debarred</th>
199
                                                [% FOREACH attrh IN attributes_header %]
203
                                                [% FOREACH attrh IN attributes_header %]
200
                                                    <th>[% attrh.attribute %]</th>
204
                                                    <th>[% attrh.attribute %]</th>
201
                                                [% END %]
205
                                                [% END %]
Lines 207-217 Link Here
207
                                                    [% IF ( op == 'show' ) %]
211
                                                    [% IF ( op == 'show' ) %]
208
                                                        <td><input type="checkbox" name="borrowernumber" value="[% borrower.borrowernumber %]" checked="checked" /></td>
212
                                                        <td><input type="checkbox" name="borrowernumber" value="[% borrower.borrowernumber %]" checked="checked" /></td>
209
                                                    [% END %]
213
                                                    [% END %]
214
                                                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">[% borrower.cardnumber %]</a></td>
210
                                                    <td>[% borrower.surname %]</td>
215
                                                    <td>[% borrower.surname %]</td>
211
                                                    <td>[% borrower.firstname %]</td>
216
                                                    <td>[% borrower.firstname %]</td>
212
                                                    <td>[% borrower.branchname %]</td>
217
                                                    <td>[% borrower.branchname %]</td>
213
                                                    <td>[% borrower.categorycode %]</td>
218
                                                    <td>[% borrower.categorycode %]</td>
214
                                                    <td>[% borrower.cardnumber %]</td>
215
                                                    <td>[% borrower.dateenrolled | $KohaDates %]</td>
219
                                                    <td>[% borrower.dateenrolled | $KohaDates %]</td>
216
                                                    <td>[% borrower.dateexpiry | $KohaDates %]</td>
220
                                                    <td>[% borrower.dateexpiry | $KohaDates %]</td>
217
                                                    <td>[% borrower.debarred | $KohaDates %]</td>
221
                                                    <td>[% borrower.debarred | $KohaDates %]</td>
Lines 237-243 Link Here
237
                                    <ol>
241
                                    <ol>
238
                                        [% FOREACH field IN fields %]
242
                                        [% FOREACH field IN fields %]
239
                                        <li>
243
                                        <li>
240
                                            <label style="width:20em;">
244
                                            [% IF ( field.mandatory ) %]
245
                                            <label for="[% field.name %]" class="required">
246
                                            [% ELSE %]
247
                                            <label for="[% field.name %]">
248
                                            [% END %]
241
                                            [% SWITCH ( field.name ) %]
249
                                            [% SWITCH ( field.name ) %]
242
                                                [% CASE 'surname' %]
250
                                                [% CASE 'surname' %]
243
                                                Surname:
251
                                                Surname:
Lines 269-279 Link Here
269
                                                <input type="checkbox" title="Check to delete this field" name="disable_input" value="[% field.name %]" />
277
                                                <input type="checkbox" title="Check to delete this field" name="disable_input" value="[% field.name %]" />
270
                                            [% END %]
278
                                            [% END %]
271
                                            [% IF ( field.type == 'text' ) %]
279
                                            [% IF ( field.type == 'text' ) %]
272
                                                <input type="text" name="[% field.name %]" value="" />
280
                                                <input type="text" name="[% field.name %]" id="[% field.name %]" value="" />
273
                                            [% END %]
281
                                            [% END %]
274
                                            [% IF ( field.type == 'select' ) %]
282
                                            [% IF ( field.type == 'select' ) %]
275
                                                [% IF field.option.size %]
283
                                                [% IF field.option.size %]
276
                                                    <select name="[% field.name %]" >
284
                                                    <select class="bfield" name="[% field.name %]" id="[% field.name %]">
277
                                                        [% FOREACH opt IN field.option %]
285
                                                        [% FOREACH opt IN field.option %]
278
                                                            <option value="[% opt.value %]">[% opt.lib %]</option>
286
                                                            <option value="[% opt.value %]">[% opt.lib %]</option>
279
                                                        [% END %]
287
                                                        [% END %]
Lines 284-306 Link Here
284
                                            [% END %]
292
                                            [% END %]
285
                                            [% IF ( field.type == 'date' ) %]
293
                                            [% IF ( field.type == 'date' ) %]
286
                                                <input type="text" name="[% field.name %]" id="[% field.name %]" value="" size="10" maxlength="10" readonly="readonly" class="datepicker" />
294
                                                <input type="text" name="[% field.name %]" id="[% field.name %]" value="" size="10" maxlength="10" readonly="readonly" class="datepicker" />
287
                                                <a href="#" onclick="clearDate('[% field.name %]');return false;">X</a>
295
                                                <a href="#" class="clear-field" onclick="clearDate('[% field.name %]');return false;">Clear</a>
288
                                                [% END %]
296
                                                [% END %]
289
                                        </li>
297
                                        </li>
290
                                        [% END %]
298
                                        [% END %]
291
                                        [% IF ( patron_attributes_codes ) %]
299
                                        [% IF ( patron_attributes_codes ) %]
292
                                            <li class="attributes">
300
                                            <li class="attributes">
293
                                                <label style="width:20em;">Attribute:
301
                                                <label for="patron_attributes">Attribute:</label>
294
                                                    <select name="patron_attributes">
302
                                                    <select name="patron_attributes" id="patron_attributes">
295
                                                        [% FOREACH pac IN patron_attributes_codes %]
303
                                                        [% FOREACH pac IN patron_attributes_codes %]
296
                                                            <option value="[% pac.attribute_code %]" data-type="[% pac.type %]" data-category="[% pac.category_lib %]">[% pac.attribute_lib %]</option>
304
                                                            <option value="[% pac.attribute_code %]" data-type="[% pac.type %]" data-category="[% pac.category_lib %]">[% pac.attribute_lib %]</option>
297
                                                        [% END %]
305
                                                        [% END %]
298
                                                    </select>
306
                                                    </select>
299
                                                </label>
300
                                                <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
307
                                                <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
301
                                                <span class="patron_attributes_value"></span>
308
                                                <span class="patron_attributes_value"></span>
302
                                                <a href="#" title="Add an attribute" onclick="add_attributes(); return false;">+</a>
309
                                                <a href="#" class="clone-field" title="Add an attribute" onclick="add_attributes(); return false;">New</a>
303
                                                <span class="information_category"></span>
310
                                                <span class="information_category hint"></span>
304
                                            </li>
311
                                            </li>
305
                                        [% END %]
312
                                        [% END %]
306
                                    </ol>
313
                                    </ol>
Lines 314-321 Link Here
314
                        [% END %]
321
                        [% END %]
315
                [% END %]
322
                [% END %]
316
                [% IF ( op == 'show_results' ) %]
323
                [% IF ( op == 'show_results' ) %]
317
                    <br/>
324
                <p>
318
                    <a href="/cgi-bin/koha/tools/modborrowers.pl" title="new Batch patrons modification">new Batch patrons modification</a>
325
                    <a href="/cgi-bin/koha/tools/modborrowers.pl" title="New batch patrons modification">New batch patron modification</a>
326
                </p>
319
                [% END %]
327
                [% END %]
320
            </div>
328
            </div>
321
            </div>
329
            </div>
322
- 

Return to bug 8986