|
Lines 36-80
Link Here
|
| 36 |
|
36 |
|
| 37 |
[% IF ( op == 'show_form' ) %] |
37 |
[% IF ( op == 'show_form' ) %] |
| 38 |
<h1>Batch patron modification</h1> |
38 |
<h1>Batch patron modification</h1> |
| 39 |
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl"> |
39 |
<form id="patron_batchmod_form" method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl"> |
| 40 |
<fieldset class="rows"> |
40 |
<input type="hidden" name="op" value="show" /> |
| 41 |
<legend>Use a file</legend> |
41 |
<div id="batch_patron_options" class="toptabs"> |
| 42 |
<ol> |
42 |
<ul> |
| 43 |
<li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li> |
|
|
| 44 |
</ol> |
| 45 |
</fieldset> |
| 46 |
|
| 47 |
[% IF patron_lists %] |
| 48 |
<fieldset class="rows"> |
| 49 |
<legend>Or use a patron list</legend> |
| 50 |
<ol> |
| 51 |
<li> |
43 |
<li> |
| 52 |
<label for="patron_list_id">Patron list: </label> |
44 |
<a href="#usecardnumber">By card number</a> |
| 53 |
<select id="patron_list_id" name="patron_list_id"> |
|
|
| 54 |
<option value=""></option> |
| 55 |
[% FOREACH pl IN patron_lists %] |
| 56 |
<option value="[% pl.patron_list_id | html %]">[% pl.name | html %]</option> |
| 57 |
[% END %] |
| 58 |
</select> |
| 59 |
</li> |
45 |
</li> |
| 60 |
</ol> |
|
|
| 61 |
</fieldset> |
| 62 |
[% END %] |
| 63 |
|
| 64 |
<fieldset class="rows"> |
| 65 |
<legend>Or list cardnumbers one by one</legend> |
| 66 |
<ol> |
| 67 |
<li> |
46 |
<li> |
| 68 |
<label for="cardnumberlist">Card number list (one cardnumber per line): </label> |
47 |
<a href="#useborrowernumber">By borrowernumber</a> |
| 69 |
<textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist | html %]</textarea> |
|
|
| 70 |
</li> |
48 |
</li> |
| 71 |
</ol> |
49 |
[% IF patron_lists %] |
|
|
50 |
<li> |
| 51 |
<a href="#uselist">By patron list</a> |
| 52 |
</li> |
| 53 |
[% END %] |
| 54 |
</ul> |
| 55 |
<div id="usecardnumber"> |
| 56 |
<fieldset class="rows"> |
| 57 |
<legend>Use a file of card numbers</legend> |
| 58 |
<ol> |
| 59 |
<li> |
| 60 |
<label for="cardnumberuploadfile">File: </label> <input type="file" id="cardnumberuploadfile" name="cardnumberuploadfile" /> |
| 61 |
<div class="hint">File must contain one card number per line.</div> |
| 62 |
</li> |
| 63 |
</ol> |
| 64 |
</fieldset> |
| 65 |
<fieldset class="rows"> |
| 66 |
<legend>Or list card numbers one by one</legend> |
| 67 |
<ol> |
| 68 |
<li> |
| 69 |
<label for="cardnumberlist">Card number list (one card number per line): </label> |
| 70 |
<textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist | html %]</textarea> |
| 71 |
</li> |
| 72 |
</ol> |
| 73 |
</fieldset> |
| 74 |
<fieldset class="action"> |
| 75 |
<input type="submit" value="Continue" class="button" /> |
| 76 |
<a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> |
| 72 |
</fieldset> |
77 |
</fieldset> |
| 73 |
<input type="hidden" name="op" value="show" /> |
78 |
</div> |
|
|
79 |
<div id="useborrowernumber"> |
| 80 |
<fieldset class="rows"> |
| 81 |
<legend>Use a file of borrowernumbers</legend> |
| 82 |
<ol> |
| 83 |
<li> |
| 84 |
<label for="borrowernumberuploadfile">File: </label> <input type="file" id="borrowernumberuploadfile" name="borrowernumberuploadfile" /> |
| 85 |
<div class="hint">File must contain one borrowernumber per line.</div> |
| 86 |
</li> |
| 87 |
</ol> |
| 88 |
</fieldset> |
| 89 |
<fieldset class="rows"> |
| 90 |
<legend>List borrowernumbers one by one</legend> |
| 91 |
<ol> |
| 92 |
<li> |
| 93 |
<label for="borrowernumberlist">Borrowernumber list (one number per line): </label> |
| 94 |
<textarea rows="10" cols="30" id="borrowernumberlist" name="borrowernumberlist">[% borrowernumberlist | html %]</textarea> |
| 95 |
</li> |
| 96 |
</ol> |
| 97 |
</fieldset> |
| 98 |
<fieldset class="action"> |
| 99 |
<input type="submit" value="Continue" class="button" /> |
| 100 |
<a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> |
| 101 |
</fieldset> |
| 102 |
</div> |
| 103 |
[% IF patron_lists %] |
| 104 |
<div id="uselist"> |
| 105 |
<fieldset class="rows"> |
| 106 |
<legend>Use a patron list</legend> |
| 107 |
<ol> |
| 108 |
<li> |
| 109 |
<label for="patron_list_id">Patron list: </label> |
| 110 |
<select id="patron_list_id" name="patron_list_id"> |
| 111 |
<option value=""> -- Choose a patron list -- </option> |
| 112 |
[% FOREACH pl IN patron_lists %] |
| 113 |
<option value="[% pl.patron_list_id | html %]">[% pl.name | html %]</option> |
| 114 |
[% END %] |
| 115 |
</select> |
| 116 |
</li> |
| 117 |
</ol> |
| 118 |
</fieldset> |
| 74 |
<fieldset class="action"> |
119 |
<fieldset class="action"> |
| 75 |
<input type="submit" value="Continue" class="button" /> |
120 |
<input type="submit" value="Continue" class="button" /> |
| 76 |
<a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> |
121 |
<a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> |
| 77 |
</fieldset> |
122 |
</fieldset> |
|
|
123 |
</div> |
| 124 |
[% END %] |
| 125 |
</div><!-- /#batch_patron_options --> |
| 78 |
</form> |
126 |
</form> |
| 79 |
[% END %] |
127 |
[% END %] |
| 80 |
|
128 |
|
|
Lines 82-88
Link Here
|
| 82 |
[% op = 'noshow' # Change op to prevent display in code below %] |
130 |
[% op = 'noshow' # Change op to prevent display in code below %] |
| 83 |
<h1>Batch patrons modification</h1> |
131 |
<h1>Batch patrons modification</h1> |
| 84 |
<div class="dialog alert"> |
132 |
<div class="dialog alert"> |
| 85 |
<p>No patron card numbers given.</p> |
133 |
<p>No patron card numbers or borrowernumbers given.</p> |
| 86 |
<form action="/cgi-bin/koha/tools/modborrowers.pl" method="get"> |
134 |
<form action="/cgi-bin/koha/tools/modborrowers.pl" method="get"> |
| 87 |
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button> |
135 |
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button> |
| 88 |
</form> |
136 |
</form> |
|
Lines 96-105
Link Here
|
| 96 |
<h1>Batch patrons results</h1> |
144 |
<h1>Batch patrons results</h1> |
| 97 |
[% END %] |
145 |
[% END %] |
| 98 |
[% IF ( notfoundcardnumbers ) %] |
146 |
[% IF ( notfoundcardnumbers ) %] |
| 99 |
<div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div> |
147 |
[% IF ( useborrowernumbers ) -%] |
|
|
148 |
<div class="dialog alert"><p>Warning, the following borrowernumbers were not found:</p></div> |
| 149 |
[% ELSE -%] |
| 150 |
<div class="dialog alert"><p>Warning, the following card numbers were not found:</p></div> |
| 151 |
[% END %] |
| 152 |
|
| 100 |
<table style="margin:auto;"> |
153 |
<table style="margin:auto;"> |
| 101 |
<thead> |
154 |
<thead> |
| 102 |
<tr><th>Cardnumbers not found</th></tr> |
155 |
[% IF ( useborrowernumbers ) -%] |
|
|
156 |
<tr><th>Borrowernumbers not found</th></tr> |
| 157 |
[% ELSE -%] |
| 158 |
<tr><th>Card numbers not found</th></tr> |
| 159 |
[% END %] |
| 103 |
</thead> |
160 |
</thead> |
| 104 |
<tbody> |
161 |
<tbody> |
| 105 |
[% FOREACH notfoundcardnumber IN notfoundcardnumbers %] |
162 |
[% FOREACH notfoundcardnumber IN notfoundcardnumbers %] |
|
Lines 117-123
Link Here
|
| 117 |
[% FOREACH error IN errors %] |
174 |
[% FOREACH error IN errors %] |
| 118 |
[% IF ( error.error == 'can_not_update' ) %] |
175 |
[% IF ( error.error == 'can_not_update' ) %] |
| 119 |
<li>Can not update patron. |
176 |
<li>Can not update patron. |
| 120 |
[% IF ( error.cardnumber ) %] Cardnumber: [% error.cardnumber | html %] [% END %] |
177 |
[% IF ( error.cardnumber ) %] Card number: [% error.cardnumber | html %] [% END %] |
| 121 |
(Borrowernumber: [% error.borrowernumber | html %]) |
178 |
(Borrowernumber: [% error.borrowernumber | html %]) |
| 122 |
</li> |
179 |
</li> |
| 123 |
[% ELSE %] |
180 |
[% ELSE %] |
|
Lines 387-392
Link Here
|
| 387 |
}); |
444 |
}); |
| 388 |
return false; |
445 |
return false; |
| 389 |
}); |
446 |
}); |
|
|
447 |
[% ELSE %] |
| 448 |
$("#batch_patron_options").tabs(); |
| 390 |
[% END %] |
449 |
[% END %] |
| 391 |
|
450 |
|
| 392 |
var values = new Array(); |
451 |
var values = new Array(); |
|
Lines 421-426
Link Here
|
| 421 |
e.preventDefault(); |
480 |
e.preventDefault(); |
| 422 |
del_attributes(this); |
481 |
del_attributes(this); |
| 423 |
}); |
482 |
}); |
|
|
483 |
$("#patron_batchmod_form").on("submit", function(){ |
| 484 |
/* Reset form fields on inactive tabs */ |
| 485 |
var tab = $(this).find('.ui-tabs-active:first a').attr('href'); |
| 486 |
if ( tab == '#usecardnumber' ) { |
| 487 |
$("#borrowernumberuploadfile, #patron_list_id, #borrowernumberlist").val(""); |
| 488 |
} else if ( tab == '#useborrowernumber' ) { |
| 489 |
$("#cardnumberuploadfile, #cardnumberlist, #patron_list_id").val(""); |
| 490 |
} else { // uselist |
| 491 |
$("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val(""); |
| 492 |
} |
| 493 |
}); |
| 424 |
}); |
494 |
}); |
| 425 |
|
495 |
|
| 426 |
function updateAttrValues (select_attr) { |
496 |
function updateAttrValues (select_attr) { |