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(){
72 function confirm_local_deletion() {
73 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone."));
75 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=false';
78 function confirm_remote_deletion() {
79 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the Norwegian national patron database? This cannot be undone."));
81 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=false&deleteremote=true';
84 function confirm_both_deletion() {
85 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."));
87 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=true';
91 [% IF ( is_child ) %]function confirm_updatechild() {
92 var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category? This cannot be undone."));
94 window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
98 function update_child() {
99 [% IF ( CATCODE_MULTI ) %]
100 window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
102 confirm_updatechild();
107 function confirm_reregistration() {
108 var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?"));
110 window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y';
113 function export_barcodes() {
114 window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes');
116 var slip_re = /slip/;
117 function printx_window(print_type) {
118 var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
119 window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow");
122 function searchToHold(){
123 var date = new Date();
124 date.setTime(date.getTime() + (10 * 60 * 1000));
125 $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date });
126 location.href="/cgi-bin/koha/catalogue/search.pl";
131 <div id="toolbar" class="btn-toolbar">
132 [% IF ( CAN_user_borrowers ) %]
133 [% IF ( guarantor ) %]
134 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&categorycode=[% categorycode %]">
136 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">
138 <i class="fa fa-pencil"></i> Edit</a>
141 [% IF ( CAN_user_borrowers ) %]
142 [% IF ( adultborrower AND activeBorrowerRelationship ) %]
143 <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>
145 [% IF ( CAN_user_borrowers ) %]
146 <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>
148 <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>
151 <div class="btn-group">
152 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
153 <ul class="dropdown-menu">
154 [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
155 <li><a id="printslip" href="#">Print slip</a></li>
156 <li><a id="printquickslip" href="#">Print quick slip</a></li>
157 [% IF Borrowers.HasOverdues( borrowernumber ) %]
158 <li><a id="print_overdues" href="#">Print overdues</a></li>
163 [% IF ( CAN_user_reserveforothers ) %]
164 <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
167 <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal" class="btn btn-small"><i class="fa fa-comment-o"></i> Add message</a>
169 <div class="btn-group">
170 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
171 <ul class="dropdown-menu">
172 [% IF ( CAN_user_borrowers ) %]
173 <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li>
175 <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>
177 [% IF ( CAN_user_permissions ) %]
178 <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li>
180 <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>
182 [% IF CAN_user_borrowers && useDischarge %]
183 <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
185 [% IF ( CAN_user_borrowers ) %]
186 [% IF ( NorwegianPatronDBEnable == 1 ) %]
187 <li><a id="deletepatronlocal" href="#">Delete local</a></li>
188 <li><a id="deletepatronremote" href="#">Delete remote</a></li>
189 <li><a id="deletepatronboth" href="#">Delete local and remote</a></li>
191 <li><a id="deletepatron" href="#">Delete</a></li>
194 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
196 [% IF ( is_child ) %]
197 <li><a id="updatechild" href="#">Update child to adult patron</a></li>
199 <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>
201 [% IF Koha.Preference('intranetreadinghistory') %]
202 [%IF ( privacy == 2 ) %]
203 <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>
205 <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li>
213 <div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
214 <div class="modal-body">
215 <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
216 <fieldset id="borrower_messages" class="brief">
217 <legend>Leave a message</legend>
220 <label for="message_type">Add a message for:</label>
221 <select name="message_type" id="message_type">
222 <option value="L">Staff - Internal note</option>
223 <option value="B">OPAC - [% firstname %] [% surname %]</option>
226 [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
229 <label for="type">Predefined notes: </label>
230 <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
231 <option value="">Select note</option>
232 [% FOREACH bor_note IN bor_notes %]
233 <option value="[% bor_note.lib %]">[% bor_note.lib %]</option>
239 <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
242 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
243 <input type="hidden" name="batch" value="[% batch %]" />
244 <input type="hidden" name="branchcode" value="[% LoginBranchcode %]" />
247 <div class="modal-footer">
248 <fieldset class="action">
249 <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>