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 },
21 "sPaginationType": "four_button"
24 $( "#find_patron" ).autocomplete({
25 source: "/cgi-bin/koha/circ/ysearch.pl",
27 select: function( event, ui ) {
28 AddPatron( ui.item.firstname + " " + ui.item.surname, ui.item.cardnumber );
32 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
33 return $( "<li></li>" )
34 .data( "ui-autocomplete-item", item )
35 .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
39 $("body").on("click",".removePatron",function(e){
41 var divid = $(this).parent().attr("id");
42 var cardnumber = divid.replace("borrower_","");
43 RemovePatron(cardnumber);
46 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
48 $("#CheckAll").click(function(e){
50 checkBoxes.each(function(){
51 $(this).prop("checked",1);
54 $("#CheckNone").click(function(e){
56 checkBoxes.each(function(){
57 $(this).prop("checked",0);
61 $("#remove_patrons").submit(function(){
62 var checkedItems = $("input:checked");
63 if ($(checkedItems).size() == 0) {
64 alert(_("You must select one or more patrons to remove"));
67 $(checkedItems).parents('tr').addClass("warn");
68 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
71 $(checkedItems).parents('tr').removeClass("warn");
77 function AddPatron( name, cardnumber ) {
78 div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' class='removePatron'> " + _("Remove") + " </a> ) <input type='hidden' name='patrons_to_add' value='" + cardnumber + "' /></div>";
79 $('#patrons_to_add').append( div );
81 $('#find_patron').val('').focus();
83 $('#patrons_to_add_fieldset').show( 800 );
86 function RemovePatron( cardnumber ) {
87 $( '#borrower_' + cardnumber ).remove();
89 if ( ! $('#patrons_to_add').html() ) {
90 $('#patrons_to_add_fieldset').hide( 800 );
99 [% INCLUDE 'header.inc' %]
100 [% INCLUDE 'cat-search.inc' %]
101 <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>
104 <div class="yui-main">
105 <h1>[% list.name %]</h1>
107 <form action="list.pl" id="add_patrons" method="post">
109 <legend>Add patrons</legend>
111 <label for="find_patron">Patron search: </label>
112 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
113 <div id="find_patron_container"></div>
115 <fieldset id="patrons_to_add_fieldset">
116 <legend>Patrons to be added</legend>
117 <div id="patrons_to_add"></div>
119 <fieldset class="action">
120 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
121 <input type="submit" value="Add patrons" />
122 <a href="lists.pl" class="cancel">Cancel</a>
129 <form action="list.pl" id="remove_patrons" method="post">
131 <div id="searchheader">
132 <span class="checkall"><a id="CheckAll" href="#">Select all</a></span> |
133 <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span> |
134 <div class="btn-group">
135 <button class="btn btn-mini list-remove" type="submit"><i class="icon-remove-sign"></i> Remove selected</button>
139 <table id="patron-list-table">
155 [% FOREACH p IN list.patron_list_patrons %]
157 <td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td>
159 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]">
160 [% p.borrowernumber.cardnumber %]
163 <td>[% p.borrowernumber.firstname %]</td>
164 <td>[% p.borrowernumber.surname %]</td>
166 [% p.borrowernumber.address %]
167 [% p.borrowernumber.address2 %]
168 [% p.borrowernumber.city %]
169 [% p.borrowernumber.state %]
170 [% p.borrowernumber.country %]
172 <td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td>
173 <td>[% p.borrowernumber.branchcode.branchname %]</td>
174 <td><span title="[% p.borrowernumber.dateexpiry %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
175 <td>[% p.borrowernumber.borrowernotes %]</td>
181 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
182 <input type="submit" value="Remove selected patrons" />
186 [% INCLUDE 'intranet-bottom.inc' %]