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(){
29 $(".btn-group").removeClass("open");
33 $("#renewpatron").click(function(){
34 confirm_reregistration();
35 $(".btn-group").removeClass("open");
38 [% IF ( is_child ) %]$("#updatechild").click(function(){
40 $(".btn-group").removeClass("open");
43 $("#updatechild, #patronflags, #renewpatron, #deletepatron, #exportbarcodes").tooltip();
44 $("#exportcheckins").click(function(){
46 $(".btn-group").removeClass("open");
49 $("#printsummary").click(function(){
50 printx_window("page");
51 $(".btn-group").removeClass("open");
54 $("#printslip").click(function(){
55 printx_window("slip");
56 $(".btn-group").removeClass("open");
59 $("#printquickslip").click(function(){
60 printx_window("qslip");
61 $(".btn-group").removeClass("open");
64 $("#print_overdues").click(function(){
65 window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=[% borrowernumber %]", "printwindow");
66 $(".btn-group").removeClass("open");
69 $("#searchtohold").click(function(){
74 function confirm_deletion() {
75 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron? This cannot be undone."));
77 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]';
80 function confirm_local_deletion() {
81 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone."));
83 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=false';
86 function confirm_remote_deletion() {
87 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the Norwegian national patron database? This cannot be undone."));
89 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=false&deleteremote=true';
92 function confirm_both_deletion() {
93 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."));
95 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=true';
99 [% IF ( is_child ) %]function confirm_updatechild() {
100 var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category? This cannot be undone."));
102 window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
106 function update_child() {
107 [% IF ( CATCODE_MULTI ) %]
108 window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
110 confirm_updatechild();
115 function confirm_reregistration() {
116 var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?"));
118 window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y';
121 function export_barcodes() {
122 window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes');
124 var slip_re = /slip/;
125 function printx_window(print_type) {
126 var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
127 window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow");
130 function searchToHold(){
131 var date = new Date();
132 date.setTime(date.getTime() + (10 * 60 * 1000));
133 $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date });
134 location.href="/cgi-bin/koha/catalogue/search.pl";
139 <div id="toolbar" class="btn-toolbar">
140 [% IF ( CAN_user_borrowers ) %]
141 [% IF ( guarantor ) %]
142 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&categorycode=[% categorycode %]">
144 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">
146 <i class="fa fa-pencil"></i> Edit</a>
149 [% IF ( CAN_user_borrowers ) %]
150 [% IF ( adultborrower AND activeBorrowerRelationship ) %]
151 <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>
153 [% IF ( CAN_user_borrowers ) %]
154 <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>
156 <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>
159 <div class="btn-group">
160 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
161 <ul class="dropdown-menu">
162 [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
163 <li><a id="printslip" href="#">Print slip</a></li>
164 <li><a id="printquickslip" href="#">Print quick slip</a></li>
165 [% IF Borrowers.HasOverdues( borrowernumber ) %]
166 <li><a id="print_overdues" href="#">Print overdues</a></li>
171 [% IF ( CAN_user_reserveforothers ) %]
172 <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
175 <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal" class="btn btn-small"><i class="fa fa-comment-o"></i> Add message</a>
177 <div class="btn-group">
178 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
179 <ul class="dropdown-menu">
180 [% IF ( CAN_user_borrowers ) %]
181 <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li>
183 <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>
185 [% IF ( CAN_user_permissions ) %]
186 <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li>
188 <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>
190 [% IF CAN_user_borrowers && useDischarge %]
191 <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
193 [% IF ( CAN_user_borrowers ) %]
194 [% IF ( NorwegianPatronDBEnable == 1 ) %]
195 <li><a id="deletepatronlocal" href="#">Delete local</a></li>
196 <li><a id="deletepatronremote" href="#">Delete remote</a></li>
197 <li><a id="deletepatronboth" href="#">Delete local and remote</a></li>
199 <li><a id="deletepatron" href="#">Delete</a></li>
202 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
204 [% IF ( is_child ) %]
205 <li><a id="updatechild" href="#">Update child to adult patron</a></li>
207 <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>
209 [% IF Koha.Preference('intranetreadinghistory') %]
210 [%IF ( privacy == 2 ) %]
211 <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>
213 <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li>
221 <div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
222 <div class="modal-body">
223 <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
224 <fieldset id="borrower_messages" class="brief">
225 <legend>Leave a message</legend>
228 <label for="message_type">Add a message for:</label>
229 <select name="message_type" id="message_type">
230 <option value="L">Staff - Internal note</option>
231 <option value="B">OPAC - [% firstname %] [% surname %]</option>
234 [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
237 <label for="type">Predefined notes: </label>
238 <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
239 <option value="">Select note</option>
240 [% FOREACH bor_note IN bor_notes %]
241 <option value="[% bor_note.lib %]">[% bor_note.lib %]</option>
247 <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
250 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
251 <input type="hidden" name="branchcode" value="[% LoginBranchcode %]" />
254 <div class="modal-footer">
255 <fieldset class="action">
256 <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>