2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Patron lists › [% list.name %] › Add patrons</title>
4 [% INCLUDE 'doc-head-close.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
9 <script type="text/javascript">
11 $(document).ready(function() {
12 $('#patrons_to_add_fieldset').hide();
14 $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, {
16 null,null,null,null,null,null,null,{ "sType": "title-string" },null
19 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
23 $( "#find_patron" ).autocomplete({
24 source: "/cgi-bin/koha/circ/ysearch.pl",
26 select: function( event, ui ) {
27 AddPatron( ui.item.firstname + " " + ui.item.surname, ui.item.cardnumber );
31 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
32 return $( "<li></li>" )
33 .data( "ui-autocomplete-item", item )
34 .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
38 $("body").on("click",".removePatron",function(e){
40 var divid = $(this).parent().attr("id");
41 var cardnumber = divid.replace("borrower_","");
42 RemovePatron(cardnumber);
45 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
47 $("#CheckAll").click(function(e){
49 checkBoxes.each(function(){
50 $(this).prop("checked",1);
53 $("#CheckNone").click(function(e){
55 checkBoxes.each(function(){
56 $(this).prop("checked",0);
60 $("#remove_patrons").submit(function(){
61 var checkedItems = $("input:checked");
62 if ($(checkedItems).size() == 0) {
63 alert(_("You must select one or more patrons to remove"));
66 $(checkedItems).parents('tr').addClass("warn");
67 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
70 $(checkedItems).parents('tr').removeClass("warn");
76 function AddPatron( name, cardnumber ) {
77 div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' class='removePatron'> " + _("Remove") + " </a> ) <input type='hidden' name='patrons_to_add' value='" + cardnumber + "' /></div>";
78 $('#patrons_to_add').append( div );
80 $('#find_patron').val('').focus();
82 $('#patrons_to_add_fieldset').show( 800 );
85 function RemovePatron( cardnumber ) {
86 $( '#borrower_' + cardnumber ).remove();
88 if ( ! $('#patrons_to_add').html() ) {
89 $('#patrons_to_add_fieldset').hide( 800 );
98 [% INCLUDE 'header.inc' %]
99 [% INCLUDE 'cat-search.inc' %]
100 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="lists.pl">Patron lists</a> › <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% list.id %]">[% list.name %]</a> › Add patrons</div>
103 <div class="yui-main">
104 <h1>[% list.name %]</h1>
106 <form action="list.pl" id="add_patrons" method="post">
108 <legend>Add patrons</legend>
110 <label for="find_patron">Patron search: </label>
111 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
112 <div id="find_patron_container"></div>
114 <fieldset id="patrons_to_add_fieldset">
115 <legend>Patrons to be added</legend>
116 <div id="patrons_to_add"></div>
118 <fieldset class="action">
119 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
120 <input type="submit" value="Add patrons" />
121 <a href="lists.pl" class="cancel">Cancel</a>
128 <form action="list.pl" id="remove_patrons" method="post">
130 <div id="searchheader">
131 <span class="checkall"><a id="CheckAll" href="#">Select all</a></span> |
132 <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span> |
133 <div class="btn-group">
134 <button class="btn btn-mini list-remove" type="submit"><i class="icon-remove-sign"></i> Remove selected</button>
138 <table id="patron-list-table">
154 [% FOREACH p IN list.patron_list_patrons %]
156 <td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td>
158 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]">
159 [% p.borrowernumber.cardnumber %]
162 <td>[% p.borrowernumber.firstname %]</td>
163 <td>[% p.borrowernumber.surname %]</td>
165 [% p.borrowernumber.address %]
166 [% p.borrowernumber.address2 %]
167 [% p.borrowernumber.city %]
168 [% p.borrowernumber.state %]
169 [% p.borrowernumber.country %]
171 <td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td>
172 <td>[% p.borrowernumber.branchcode.branchname %]</td>
173 <td><span title="[% p.borrowernumber.dateexpiry %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
174 <td>[% p.borrowernumber.borrowernotes %]</td>
180 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
181 <input type="submit" value="Remove selected patrons" />
185 [% INCLUDE 'intranet-bottom.inc' %]