|
Lines 1-25
Link Here
|
| 1 |
[% USE KohaDates %] |
1 |
[% USE KohaDates %] |
| 2 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
| 3 |
<title>Koha › Patron lists › New list</title> |
3 |
<title>Koha › Patron lists › [% list.name %]</title> |
| 4 |
[% INCLUDE 'doc-head-close.inc' %] |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
| 5 |
|
5 |
|
| 6 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
6 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
| 7 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> |
7 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> |
| 8 |
[% INCLUDE 'datatables-strings.inc' %] |
8 |
[% INCLUDE 'datatables-strings.inc' %] |
| 9 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
9 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
|
|
10 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
| 10 |
|
11 |
|
| 11 |
<script type="text/javascript"> |
12 |
<script type="text/javascript"> |
| 12 |
//<![CDATA[ |
13 |
//<![CDATA[ |
| 13 |
$(document).ready(function() { |
14 |
$(document).ready(function() { |
| 14 |
$('#patrons_to_add_fieldset').hide(); |
15 |
$('#patrons_to_add_fieldset').hide(); |
| 15 |
|
16 |
|
| 16 |
$('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults)); |
17 |
$('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, { |
| 17 |
|
18 |
"aaSorting": [[ 1, "asc" ]], |
|
|
19 |
"aoColumnDefs": [ |
| 20 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
| 21 |
], |
| 22 |
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]] |
| 23 |
})); |
| 18 |
$( "#find_patron" ).autocomplete({ |
24 |
$( "#find_patron" ).autocomplete({ |
| 19 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
25 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
| 20 |
minLength: 3, |
26 |
minLength: 3, |
| 21 |
select: function( event, ui ) { |
27 |
select: function( event, ui ) { |
| 22 |
AddPatron( ui.item.firstname + " " + ui.item.surname, ui.item.cardnumber ); |
28 |
AddPatron( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber ); |
| 23 |
return false; |
29 |
return false; |
| 24 |
} |
30 |
} |
| 25 |
}) |
31 |
}) |
|
Lines 29-51
$(document).ready(function() {
Link Here
|
| 29 |
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) |
35 |
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) |
| 30 |
.appendTo( ul ); |
36 |
.appendTo( ul ); |
| 31 |
}; |
37 |
}; |
|
|
38 |
$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>"); |
| 39 |
$("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>"); |
| 40 |
$("#CheckAll").click(function(){ |
| 41 |
$(".checkboxed").checkCheckboxes(); |
| 42 |
return false; |
| 43 |
}); |
| 44 |
$("#CheckNone").click(function(){ |
| 45 |
$(".checkboxed").unCheckCheckboxes(); |
| 46 |
return false; |
| 47 |
}); |
| 48 |
$("#patrons_to_add_fieldset").on("click", ".remove_patron", function(event) { |
| 49 |
console.log(event.target.nodeName); |
| 50 |
$(event.target).parent().remove(); |
| 51 |
if ( ! $('#patrons_to_add').html() ) { |
| 52 |
$('#patrons_to_add_fieldset').hide( ); |
| 53 |
} |
| 54 |
}); |
| 32 |
}); |
55 |
}); |
| 33 |
|
56 |
|
| 34 |
function AddPatron( name, cardnumber ) { |
57 |
function AddPatron( name, cardnumber ) { |
| 35 |
div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='javascript:void()' onclick='RemovePatron(" + cardnumber + ");'> Remove </a> ) <input type='hidden' name='patrons_to_add' value='" + cardnumber + "' /></div>"; |
58 |
div = "<p>" + name + " ( <a href=\"#\" class=\"remove_patron\"> " + _("Remove") + " </a> ) <input type='hidden' name='patrons_to_add' value='" + cardnumber + "' /></p>"; |
| 36 |
$('#patrons_to_add').append( div ); |
59 |
$('#patrons_to_add').append( div ); |
| 37 |
|
60 |
|
| 38 |
$('#find_patron').val('').focus(); |
61 |
$('#find_patron').val('').focus(); |
| 39 |
|
62 |
|
| 40 |
$('#patrons_to_add_fieldset').show( 800 ); |
63 |
$('#patrons_to_add_fieldset').show( ); |
| 41 |
} |
|
|
| 42 |
|
| 43 |
function RemovePatron( cardnumber ) { |
| 44 |
$( '#borrower_' + cardnumber ).remove(); |
| 45 |
|
| 46 |
if ( ! $('#patrons_to_add').html() ) { |
| 47 |
$('#patrons_to_add_fieldset').hide( 800 ); |
| 48 |
} |
| 49 |
} |
64 |
} |
| 50 |
//]]> |
65 |
//]]> |
| 51 |
</script> |
66 |
</script> |
|
Lines 55-67
function RemovePatron( cardnumber ) {
Link Here
|
| 55 |
<body> |
70 |
<body> |
| 56 |
[% INCLUDE 'header.inc' %] |
71 |
[% INCLUDE 'header.inc' %] |
| 57 |
[% INCLUDE 'cat-search.inc' %] |
72 |
[% INCLUDE 'cat-search.inc' %] |
| 58 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="lists.pl">Patron lists</a> › Add patrons</div> |
73 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="lists.pl">Patron lists</a> › [% list.name %]</div> |
| 59 |
|
74 |
|
| 60 |
<div class="yui-t7"> |
75 |
<div class="yui-t7"> |
| 61 |
<div class="yui-main"> |
76 |
<div class="yui-main"> |
| 62 |
<h1>[% list.name %]</h1> |
77 |
<h1>[% list.name %]</h1> |
| 63 |
|
78 |
|
| 64 |
<form action="list.pl" method="post"> |
79 |
<div id="toolbar" class="btn-toolbar"> |
|
|
80 |
<div class="btn-group"> |
| 81 |
<a class="btn btn-small" href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% list.id %]"><i class="icon-pencil"></i> Edit list</a> |
| 82 |
</div> |
| 83 |
<div class="btn-group"> |
| 84 |
<a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% list.id %]&op=show" class="btn btn-small">Batch modify</a> |
| 85 |
</div> |
| 86 |
</div> |
| 87 |
|
| 88 |
<form action="list.pl" method="post" class="checkboxed"> |
| 89 |
<input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" /> |
| 65 |
<fieldset> |
90 |
<fieldset> |
| 66 |
<legend>Add patrons</legend> |
91 |
<legend>Add patrons</legend> |
| 67 |
|
92 |
|
|
Lines 72-132
function RemovePatron( cardnumber ) {
Link Here
|
| 72 |
<fieldset id="patrons_to_add_fieldset"> |
97 |
<fieldset id="patrons_to_add_fieldset"> |
| 73 |
<legend>Patrons to be added</legend> |
98 |
<legend>Patrons to be added</legend> |
| 74 |
<div id="patrons_to_add"></div> |
99 |
<div id="patrons_to_add"></div> |
|
|
100 |
<fieldset class="action"> |
| 101 |
<input type="submit" value="Add patrons" /> |
| 102 |
<a href="lists.pl" class="cancel">Cancel</a> |
| 103 |
</fieldset> |
| 75 |
</fieldset> |
104 |
</fieldset> |
| 76 |
|
|
|
| 77 |
</fieldset> |
105 |
</fieldset> |
| 78 |
|
106 |
|
| 79 |
<p> |
107 |
[% UNLESS ( list.patron_list_patrons ) %] |
| 80 |
<input type="submit" class="btn" value="Update" /> |
108 |
<div class="dialog message"> |
| 81 |
<a href="lists.pl" class="cancel">Cancel</a> |
109 |
<p>There are no patrons on this list.</p> |
| 82 |
</p> |
110 |
</div> |
| 83 |
|
111 |
[% ELSE %] |
| 84 |
<table id="patron-list-table"> |
112 |
<div id="searchheader"> |
| 85 |
<thead> |
113 |
<div id="selection_ops"> |
| 86 |
<tr> |
114 |
<span class="checkall"></span> | |
| 87 |
<th><i title="Remove patron from list" class="icon-trash"></i></th> |
115 |
<span class="clearall"></span> |
| 88 |
<th>Card</th> |
116 |
<div class="btn-group"> |
| 89 |
<th>Firstname</th> |
117 |
<button type="submit" class="btn btn-mini list-remove"><i class="icon-remove-sign"></i> Remove selected</button> |
| 90 |
<th>Surname</th> |
118 |
</div> |
| 91 |
<th>Address</th> |
119 |
</div> |
| 92 |
<th>Category</th> |
120 |
</div> |
| 93 |
<th>Library</th> |
121 |
|
| 94 |
<th>Expires on</th> |
122 |
<table id="patron-list-table"> |
| 95 |
<th>Circ notes</th> |
123 |
<thead> |
| 96 |
</tr> |
|
|
| 97 |
</thead> |
| 98 |
|
| 99 |
<tbody> |
| 100 |
[% FOREACH p IN list.patron_list_patrons %] |
| 101 |
<tr> |
124 |
<tr> |
| 102 |
<td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td> |
125 |
<th> </th> |
| 103 |
<td> |
126 |
<th>Card</th> |
| 104 |
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]"> |
127 |
<th>Last name</th> |
| 105 |
[% p.borrowernumber.cardnumber %] |
128 |
<th>First name</th> |
| 106 |
</a> |
129 |
<th>Address</th> |
| 107 |
</td> |
130 |
<th>Category</th> |
| 108 |
<td>[% p.borrowernumber.firstname %]</td> |
131 |
<th>Library</th> |
| 109 |
<td>[% p.borrowernumber.surname %]</td> |
132 |
<th>Expires on</th> |
| 110 |
<td> |
133 |
<th>Circ notes</th> |
| 111 |
[% p.borrowernumber.address %] |
|
|
| 112 |
[% p.borrowernumber.address2 %] |
| 113 |
[% p.borrowernumber.city %] |
| 114 |
[% p.borrowernumber.state %] |
| 115 |
[% p.borrowernumber.country %] |
| 116 |
</td> |
| 117 |
<td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td> |
| 118 |
<td>[% p.borrowernumber.branchcode.branchname %]</td> |
| 119 |
<td>[% p.borrowernumber.dateexpiry | $KohaDates %]</td> |
| 120 |
<td>[% p.borrowernumber.borrowernotes %]</td> |
| 121 |
</tr> |
134 |
</tr> |
| 122 |
[% END %] |
135 |
</thead> |
| 123 |
</tbody> |
136 |
|
| 124 |
</table> |
137 |
<tbody> |
| 125 |
|
138 |
[% FOREACH p IN list.patron_list_patrons %] |
| 126 |
<input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" /> |
139 |
<tr> |
| 127 |
<input type="submit" class="btn" value="Update" /> |
140 |
<td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td> |
| 128 |
<a href="lists.pl" class="cancel">Cancel</a> |
141 |
<td> |
|
|
142 |
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]"> |
| 143 |
[% p.borrowernumber.cardnumber %] |
| 144 |
</a> |
| 145 |
</td> |
| 146 |
<td>[% p.borrowernumber.surname %]</td> |
| 147 |
<td>[% p.borrowernumber.firstname %]</td> |
| 148 |
<td> |
| 149 |
[% p.borrowernumber.address %] |
| 150 |
[% p.borrowernumber.address2 %] |
| 151 |
[% p.borrowernumber.city %] |
| 152 |
[% p.borrowernumber.state %] |
| 153 |
[% p.borrowernumber.zipcode %] |
| 154 |
[% p.borrowernumber.country %] |
| 155 |
</td> |
| 156 |
<td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td> |
| 157 |
<td>[% p.borrowernumber.branchcode.branchname %]</td> |
| 158 |
<td>[% p.borrowernumber.dateexpiry | $KohaDates %]</td> |
| 159 |
<td>[% p.borrowernumber.borrowernotes %]</td> |
| 160 |
</tr> |
| 161 |
[% END %] |
| 162 |
</tbody> |
| 163 |
</table> |
| 164 |
[% END %] |
| 129 |
</form> |
165 |
</form> |
| 130 |
</div> |
166 |
</div> |
| 131 |
</div> |
167 |
|
| 132 |
[% INCLUDE 'intranet-bottom.inc' %] |
168 |
[% INCLUDE 'intranet-bottom.inc' %] |