2 [% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
3 <script type="text/javascript">
5 $(document).ready(function(){
6 [% IF ( CAN_user_borrowers ) %]
7 [% IF ( NorwegianPatronDBEnable == 1 ) %]
8 $("#deletepatronlocal").click(function(){
9 confirm_local_deletion();
10 $(".btn-group").removeClass("open");
13 $("#deletepatronremote").click(function(){
14 confirm_remote_deletion();
15 $(".btn-group").removeClass("open");
18 $("#deletepatronboth").click(function(){
19 confirm_both_deletion();
20 $(".btn-group").removeClass("open");
24 $("#deletepatron").click(function(){
26 $(".btn-group").removeClass("open");
30 $("#renewpatron").click(function(){
31 confirm_reregistration();
32 $(".btn-group").removeClass("open");
35 [% IF ( is_child ) %]$("#updatechild").click(function(){
37 $(".btn-group").removeClass("open");
40 $("#updatechild, #patronflags, #renewpatron, #deletepatron").tooltip();
41 $("#exportcheckins").click(function(){
43 $(".btn-group").removeClass("open");
46 $("#printsummary").click(function(){
47 printx_window("page");
48 $(".btn-group").removeClass("open");
51 $("#printslip").click(function(){
52 printx_window("slip");
53 $(".btn-group").removeClass("open");
56 $("#printquickslip").click(function(){
57 printx_window("qslip");
58 $(".btn-group").removeClass("open");
61 $("#searchtohold").click(function(){
66 function confirm_deletion() {
67 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron? This cannot be undone."));
69 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]';
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>
159 <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
160 <div class="btn-group">
161 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
162 <ul class="dropdown-menu">
163 [% IF ( CAN_user_borrowers ) %]
164 <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li>
166 <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>
168 [% IF ( CAN_user_permissions ) %]
169 <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li>
171 <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>
173 [% IF ( CAN_user_borrowers ) %]
174 [% IF ( NorwegianPatronDBEnable == 1 ) %]
175 <li><a id="deletepatronlocal" href="#">Delete local</a></li>
176 <li><a id="deletepatronremote" href="#">Delete remote</a></li>
177 <li><a id="deletepatronboth" href="#">Delete local and remote</a></li>
179 <li><a id="deletepatron" href="#">Delete</a></li>
182 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
184 [% IF ( is_child ) %]
185 <li><a id="updatechild" href="#">Update child to adult patron</a></li>
187 <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>
189 <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li>