3 [% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
4 <script type="text/javascript">
6 $(document).ready(function(){
7 [% IF ( CAN_user_borrowers ) %]
8 [% IF ( NorwegianPatronDBEnable == 1 ) %]
9 $("#deletepatronlocal").click(function(){
10 confirm_local_deletion();
11 $(".btn-group").removeClass("open");
14 $("#deletepatronremote").click(function(){
15 confirm_remote_deletion();
16 $(".btn-group").removeClass("open");
19 $("#deletepatronboth").click(function(){
20 confirm_both_deletion();
21 $(".btn-group").removeClass("open");
25 $("#deletepatron").click(function(){
27 $(".btn-group").removeClass("open");
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_deletion() {
73 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron? This cannot be undone."));
75 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]';
78 function confirm_local_deletion() {
79 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone."));
81 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=false';
84 function confirm_remote_deletion() {
85 var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the Norwegian national patron database? This cannot be undone."));
87 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=false&deleteremote=true';
90 function confirm_both_deletion() {
91 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."));
93 window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=true';
97 [% IF ( is_child ) %]function confirm_updatechild() {
98 var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category? This cannot be undone."));
100 window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
104 function update_child() {
105 [% IF ( CATCODE_MULTI ) %]
106 window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
108 confirm_updatechild();
113 function confirm_reregistration() {
114 var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?"));
116 window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y';
119 function export_barcodes() {
120 window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes');
122 var slip_re = /slip/;
123 function printx_window(print_type) {
124 var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
125 window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow");
128 function searchToHold(){
129 var date = new Date();
130 date.setTime(date.getTime() + (10 * 60 * 1000));
131 $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date });
132 location.href="/cgi-bin/koha/catalogue/search.pl";
137 <div id="toolbar" class="btn-toolbar">
138 [% IF ( CAN_user_borrowers ) %]
139 [% IF ( guarantor ) %]
140 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&categorycode=[% categorycode %]">
142 <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">
144 <i class="fa fa-pencil"></i> Edit</a>
147 [% IF ( CAN_user_borrowers ) %]
148 [% IF ( adultborrower AND activeBorrowerRelationship ) %]
149 <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>
151 [% IF ( CAN_user_borrowers ) %]
152 <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>
154 <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>
157 <div class="btn-group">
158 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
159 <ul class="dropdown-menu">
160 [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
161 <li><a id="printslip" href="#">Print slip</a></li>
162 <li><a id="printquickslip" href="#">Print quick slip</a></li>
163 [% IF Borrowers.HasOverdues( borrowernumber ) %]
164 <li><a id="print_overdues" href="#">Print overdues</a></li>
169 [% IF ( CAN_user_reserveforothers ) %]
170 <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
173 <div class="btn-group">
174 <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
175 <ul class="dropdown-menu">
176 [% IF ( CAN_user_borrowers ) %]
177 <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&destination=[% destination %]&reregistration=y">Renew patron</a></li>
179 <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>
181 [% IF ( CAN_user_permissions ) %]
182 <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li>
184 <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>
186 [% IF ( CAN_user_borrowers ) %]
187 [% IF ( NorwegianPatronDBEnable == 1 ) %]
188 <li><a id="deletepatronlocal" href="#">Delete local</a></li>
189 <li><a id="deletepatronremote" href="#">Delete remote</a></li>
190 <li><a id="deletepatronboth" href="#">Delete local and remote</a></li>
192 <li><a id="deletepatron" href="#">Delete</a></li>
195 <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
197 [% IF ( is_child ) %]
198 <li><a id="updatechild" href="#">Update child to adult patron</a></li>
200 <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>
202 [% IF Koha.Preference('intranetreadinghistory') %]
203 [%IF ( privacy == 2 ) %]
204 <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>
206 <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li>