4 [% USE AuthorisedValues %]
5 [% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
6 <script type="text/javascript">
8 $(document).ready(function(){
9 [% IF ( CAN_user_borrowers ) %]
10 [% IF ( NorwegianPatronDBEnable == 1 ) %]
11 $("#deletepatronlocal").click(function(){
12 confirm_local_deletion();
13 $(".btn-group").removeClass("open");
16 $("#deletepatronremote").click(function(){
17 confirm_remote_deletion();
18 $(".btn-group").removeClass("open");
21 $("#deletepatronboth").click(function(){
22 confirm_both_deletion();
23 $(".btn-group").removeClass("open");
27 $("#deletepatron").click(function(){
28 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber | url%]';
31 $("#renewpatron").click(function(){
32 confirm_reregistration();
33 $(".btn-group").removeClass("open");
36 [% IF ( is_child ) %]$("#updatechild").click(function(){
38 $(".btn-group").removeClass("open");
41 $("#updatechild, #patronflags, #renewpatron, #deletepatron, #exportbarcodes").tooltip();
42 $("#exportcheckins").click(function(){
44 $(".btn-group").removeClass("open");
47 $("#printsummary").click(function(){
48 printx_window("page");
49 $(".btn-group").removeClass("open");
52 $("#printslip").click(function(){
53 printx_window("slip");
54 $(".btn-group").removeClass("open");
57 $("#printquickslip").click(function(){
58 printx_window("qslip");
59 $(".btn-group").removeClass("open");
62 $("#print_overdues").click(function(){
63 window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=[% borrowernumber %]", "printwindow");
64 $(".btn-group").removeClass("open");
67 $("#searchtohold").click(function(){
71 $("#select_patron_messages").on("change",function(){
72 $("#borrower_message").val( $(this).val() );
75 function confirm_local_deletion() {
76 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone."));
78 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=false';
81 function confirm_remote_deletion() {
82 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the Norwegian national patron database? This cannot be undone."));
84 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=false&deleteremote=true';
87 function confirm_both_deletion() {
88 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron both from the local database and from the Norwegian national patron database? This cannot be undone."));
90 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=true';
94 [% IF ( is_child ) %]function confirm_updatechild() {
95 var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category? This cannot be undone."));
97 window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
101 function update_child() {
102 [% IF ( CATCODE_MULTI ) %]
103 window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
105 confirm_updatechild();
110 function confirm_reregistration() {
111 var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?"));
113 window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y';
116 function export_barcodes() {
117 window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes');
119 var slip_re = /slip/;
120 function printx_window(print_type) {
121 var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
122 window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow");
125 function searchToHold(){
126 var date = new Date();
127 date.setTime(date.getTime() + (10 * 60 * 1000));
128 $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date });
129 location.href="/cgi-bin/koha/catalogue/search.pl";
134 <div id="toolbar" class="btn-toolbar">
135 [% IF ( CAN_user_borrowers ) %]
136 [% IF ( guarantor ) %]
137 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&categorycode=[% categorycode %]">
139 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">
141 <i class="fa fa-pencil"></i> Edit</a>
144 [% IF ( CAN_user_borrowers ) %]
145 [% IF ( adultborrower AND activeBorrowerRelationship ) %]
146 <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]"><i class="fa fa-plus"></i> Add child</a>
148 [% IF ( CAN_user_borrowers ) %]
149 <a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="fa fa-lock"></i> Change password</a>
151 <a id="duplicate" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]"><i class="fa fa-copy"></i> Duplicate</a>
154 <div class="btn-group">
155 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
156 <ul class="dropdown-menu">
157 [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
158 <li><a id="printslip" href="#">Print slip</a></li>
159 <li><a id="printquickslip" href="#">Print quick slip</a></li>
160 [% IF Borrowers.HasOverdues( borrowernumber ) %]
161 <li><a id="print_overdues" href="#">Print overdues</a></li>
166 [% IF ( CAN_user_reserveforothers ) %]
167 <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
170 <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal" class="btn btn-small"><i class="fa fa-comment-o"></i> Add message</a>
172 <div class="btn-group">
173 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
174 <ul class="dropdown-menu">
175 [% IF ( CAN_user_borrowers ) %]
176 <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li>
178 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to renew patrons" id="renewpatron" href="#">Renew patron</a></li>
180 [% IF ( CAN_user_permissions ) %]
181 <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li>
183 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to set permissions" id="patronflags" href="#">Set permissions</a></li>
185 [% IF CAN_user_borrowers && useDischarge %]
186 <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
188 [% IF ( CAN_user_borrowers ) %]
189 [% IF ( NorwegianPatronDBEnable == 1 ) %]
190 <li><a id="deletepatronlocal" href="#">Delete local</a></li>
191 <li><a id="deletepatronremote" href="#">Delete remote</a></li>
192 <li><a id="deletepatronboth" href="#">Delete local and remote</a></li>
194 <li><a id="deletepatron" href="#">Delete</a></li>
197 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
199 [% IF ( is_child ) %]
200 <li><a id="updatechild" href="#">Update child to adult patron</a></li>
202 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li></li>
204 [% IF Koha.Preference('intranetreadinghistory') %]
205 [%IF ( privacy == 2 ) %]
206 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Not allowed by patron's privacy settings" id="exportbarcodes" href="#">Export today's checked in barcodes</a></li>
208 <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li>
216 <div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
217 <div class="modal-body">
218 <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
219 <fieldset id="borrower_messages" class="brief">
220 <legend>Leave a message</legend>
223 <label for="message_type">Add a message for:</label>
224 <select name="message_type" id="message_type">
225 <option value="L">Staff - Internal note</option>
226 <option value="B">OPAC - [% firstname %] [% surname %]</option>
229 [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
232 <label for="select_patron_messages">Predefined notes: </label>
233 <select name="type" id="select_patron_messages">
234 <option value="">Select note</option>
235 [% FOREACH bor_note IN bor_notes %]
236 <option value="[% bor_note.lib %]">[% bor_note.lib %]</option>
242 <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
245 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
246 <input type="hidden" name="batch" value="[% batch %]" />
247 <input type="hidden" name="branchcode" value="[% LoginBranchcode %]" />
250 <div class="modal-footer">
251 <fieldset class="action">
252 <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>