Lines 1-7
Link Here
|
1 |
<div id="toolbar"> |
1 |
<script type="text/javascript"> |
2 |
<script type="text/javascript"> |
2 |
//<![CDATA[ |
3 |
//<![CDATA[ |
3 |
$(document).ready(function(){ |
4 |
[% IF ( CAN_user_borrowers ) %] |
4 |
[% IF ( CAN_user_borrowers ) %] |
|
|
5 |
$("#deletepatron").click(function(){ |
6 |
confirm_deletion(); |
7 |
$(".btn-group").removeClass("open"); |
8 |
return false; |
9 |
}); |
10 |
$("#renewpatron").click(function(){ |
11 |
confirm_reregistration(); |
12 |
$(".btn-group").removeClass("open"); |
13 |
return false; |
14 |
}); |
15 |
[% IF ( is_child ) %]$("#updatechild").click(function(){ |
16 |
update_child(); |
17 |
$(".btn-group").removeClass("open"); |
18 |
});[% END %] |
19 |
[% END %] |
20 |
|
21 |
$("#exportcheckins").click(function(){ |
22 |
export_barcodes(); |
23 |
$(".btn-group").removeClass("open"); |
24 |
return false; |
25 |
}); |
26 |
$("#printsummary").click(function(){ |
27 |
printx_window("page"); |
28 |
$(".btn-group").removeClass("open"); |
29 |
return false; |
30 |
}); |
31 |
$("#printslip").click(function(){ |
32 |
printx_window("slip"); |
33 |
$(".btn-group").removeClass("open"); |
34 |
return false; |
35 |
}); |
36 |
$("#printquickslip").click(function(){ |
37 |
printx_window("qslip"); |
38 |
$(".btn-group").removeClass("open"); |
39 |
return false; |
40 |
}); |
41 |
$("#searchtohold").click(function(){ |
42 |
searchToHold(); |
43 |
return false; |
44 |
}) |
45 |
}); |
5 |
function confirm_deletion() { |
46 |
function confirm_deletion() { |
6 |
var is_confirmed = window.confirm(_("Are you sure you want to delete this patron? This cannot be undone.")); |
47 |
var is_confirmed = window.confirm(_("Are you sure you want to delete this patron? This cannot be undone.")); |
7 |
if (is_confirmed) { |
48 |
if (is_confirmed) { |
Lines 17-136
function confirm_deletion() {
Link Here
|
17 |
} |
58 |
} |
18 |
|
59 |
|
19 |
function update_child() { |
60 |
function update_child() { |
20 |
[% IF ( CATCODE_MULTI ) %] |
61 |
[% IF ( CATCODE_MULTI ) %] |
21 |
window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes'); |
62 |
window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes'); |
22 |
[% ELSE %] |
63 |
[% ELSE %] |
23 |
confirm_updatechild(); |
64 |
confirm_updatechild(); |
|
|
65 |
[% END %] |
66 |
} |
24 |
[% END %] |
67 |
[% END %] |
25 |
}[% ELSE %][% END %] |
|
|
26 |
|
68 |
|
27 |
function confirm_reregistration() { |
69 |
function confirm_reregistration() { |
28 |
var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?")); |
70 |
var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?")); |
29 |
if (is_confirmed) { |
71 |
if (is_confirmed) { |
30 |
window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&destination=[% destination %]&reregistration=y'; |
72 |
window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&desintation=[% destination %]&reregistration=y'; |
31 |
} |
73 |
} |
32 |
} |
74 |
} |
33 |
function export_barcodes() { |
75 |
function export_barcodes() { |
34 |
window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes'); |
76 |
window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes'); |
35 |
} |
77 |
} |
36 |
[% END %] |
78 |
var slip_re = /slip/; |
37 |
|
79 |
function printx_window(print_type) { |
38 |
// prepare DOM for YUI Toolbar |
80 |
var handler = print_type.match(slip_re) ? "printslip" : "moremember"; |
39 |
|
81 |
window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow"); |
40 |
$(document).ready(function() { |
82 |
return false; |
41 |
$("#printslip,#patronflags,#deletepatron").parent().remove(); |
83 |
} |
42 |
$("#moremenuc,#printmenuc,#searchtoholdc").empty(); |
84 |
function searchToHold(){ |
43 |
yuiToolbar(); |
85 |
var date = new Date(); |
44 |
}); |
86 |
date.setTime(date.getTime() + (10 * 60 * 1000)); |
45 |
|
87 |
$.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date }); |
46 |
// YUI Toolbar Functions |
88 |
location.href="/cgi-bin/koha/catalogue/search.pl"; |
47 |
var slip_re = /slip/; |
89 |
} |
48 |
function printx_window(print_type) { |
90 |
//]]> |
49 |
var handler = print_type.match(slip_re) ? "printslip" : "moremember"; |
91 |
</script> |
50 |
window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow"); |
|
|
51 |
return false; |
52 |
} |
53 |
function searchToHold(){ |
54 |
var date = new Date(); |
55 |
date.setTime(date.getTime() + (10 * 60 * 1000)); |
56 |
$.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date }); |
57 |
location.href="/cgi-bin/koha/catalogue/search.pl"; |
58 |
} |
59 |
function yuiToolbar() { |
60 |
var printmenu = [ |
61 |
{ text: _("Print summary"), onclick: {fn: function(){printx_window("page")}} }, |
62 |
{ text: _("Print slip"), onclick: {fn: function(){printx_window("slip")}} }, |
63 |
{ text: _("Print quick slip"), onclick: {fn: function(){printx_window("qslip")}} } |
64 |
]; |
65 |
|
66 |
var moremenu = [ |
67 |
{ text: _("Renew patron"), [% UNLESS CAN_user_borrowers %]disabled: true, [% END %] onclick: { fn: confirm_reregistration } }, |
68 |
{ text: _("Set permissions"), url: "/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]"[% UNLESS CAN_user_permissions %], disabled: true[% END %]}, |
69 |
{ text: _("Delete"), [% UNLESS CAN_user_borrowers %]disabled: true, [% END %] onclick: { fn: confirm_deletion } }, |
70 |
{ text: _("Update child to adult patron")[% IF is_child && CAN_user_borrowers %], onclick: { fn: update_child }[% ELSE %], disabled: true[% END %]}, |
71 |
{ text: _("Export today's checked in barcodes"), [% UNLESS CAN_user_borrowers %]disabled: true, [% END %] onclick: { fn: export_barcodes }} |
72 |
]; |
73 |
|
74 |
new YAHOO.widget.Button({ |
75 |
type: "menu", |
76 |
label: _("Print"), |
77 |
name: "printmenubutton", |
78 |
menu: printmenu, |
79 |
container: "printmenuc" |
80 |
}); |
81 |
new YAHOO.widget.Button({ |
82 |
id: "searchtohold", |
83 |
type: "button", |
84 |
label: _("Search to hold"), |
85 |
container: "searchtoholdc", |
86 |
onclick: {fn: searchToHold } |
87 |
}); |
88 |
new YAHOO.widget.Button({ |
89 |
type: "menu", |
90 |
label: _("More"), |
91 |
name: "moremenubutton", |
92 |
menu: moremenu, |
93 |
container: "moremenuc" |
94 |
}); |
95 |
|
96 |
[% IF ( CAN_user_borrowers ) %][% IF ( adultborrower ) %]new YAHOO.widget.Button("addchild");[% END %] |
97 |
new YAHOO.widget.Button("editpatron"); |
98 |
new YAHOO.widget.Button("changepassword"); |
99 |
new YAHOO.widget.Button("duplicate");[% END %] |
100 |
new YAHOO.widget.Button("printslip"); |
101 |
new YAHOO.widget.Button("printpage"); |
102 |
} |
103 |
|
92 |
|
104 |
//]]> |
93 |
<div id="toolbar" class="btn-toolbar"> |
105 |
</script> |
|
|
106 |
<ul class="toolbar"> |
107 |
[% IF ( CAN_user_borrowers ) %] |
94 |
[% IF ( CAN_user_borrowers ) %] |
108 |
[% IF ( category_type ) %] |
95 |
[% IF ( category_type ) %] |
109 |
[% IF ( guarantor ) %] |
96 |
[% IF ( guarantor ) %] |
110 |
<li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&category_type=[% category_type %]"> |
97 |
<a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&category_type=[% category_type %]"> |
111 |
[% ELSE %] |
98 |
[% ELSE %] |
112 |
<li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]"> |
99 |
<a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]"> |
113 |
[% END %]Edit</a></li> |
100 |
[% END %] |
|
|
101 |
<i class="icon-pencil"></i> Edit</a> |
114 |
[% ELSE %] <!-- try with categorycode if no category_type --> |
102 |
[% ELSE %] <!-- try with categorycode if no category_type --> |
115 |
[% IF ( categorycode ) %] |
103 |
[% IF ( categorycode ) %] |
116 |
<li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">Edit</a></li> |
104 |
<a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]"><i class="icon-pencil"></i> Edit</a> |
117 |
[% ELSE %] <!-- if no categorycode, set category_type to A by default --> |
105 |
[% ELSE %] <!-- if no categorycode, set category_type to A by default --> |
118 |
<li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&category_type=A">Edit</a></li> |
106 |
<a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&category_type=A"><i class="icon-pencil"></i> Edit</a> |
119 |
[% END %] |
107 |
[% END %] |
120 |
[% END %] |
108 |
[% END %] |
121 |
[% IF ( adultborrower AND activeBorrowerRelationship ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %] |
|
|
122 |
<li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change password</a></li> |
123 |
<li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a></li> |
124 |
[% END %] |
109 |
[% END %] |
125 |
<li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=page">Print summary</a></li> |
110 |
|
126 |
<li><a id="printslip" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=slip">Print slip</a></li> |
111 |
[% IF ( CAN_user_borrowers ) %] |
127 |
<li id="searchtoholdc"><a id="searchtohold" href="#">Search to hold</a></li> |
112 |
[% IF ( adultborrower AND activeBorrowerRelationship ) %] |
128 |
[% IF ( CAN_user_borrowers ) %]<li id="moremenuc"><a id="renewpatron" href="/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber=[% borrowernumber %]">Renew account</a></li>[% END %] |
113 |
<a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C"><i class="icon-plus"></i> Add child</a> |
129 |
[% IF ( CAN_user_permissions ) %] |
114 |
[% END %] |
130 |
[% IF ( CAN_user_staffaccess ) %] |
115 |
[% IF ( CAN_user_borrowers ) %] |
131 |
<li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li> |
116 |
<a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="icon-lock"></i> Change password</a> |
132 |
[% END %] |
117 |
[% END %] |
133 |
[% END %] |
118 |
[% END %] |
134 |
[% IF ( CAN_user_staffaccess ) %]<li><a id="deletepatron" href="#" onclick="confirm_deletion();">Delete</a></li>[% END %] |
|
|
135 |
|
119 |
|
136 |
</ul></div> |
120 |
<a id="duplicate" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]"><i class="icon-copy"></i>Duplicate</a> |
|
|
121 |
<div class="btn-group"> |
122 |
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-print"></i> Print <span class="caret"></span></button> |
123 |
<ul class="dropdown-menu"> |
124 |
[% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %] |
125 |
<li><a id="printslip" href="#">Print slip</a></li> |
126 |
<li><a id="printquickslip" href="#">Print quick slip</a></li> |
127 |
</ul> |
128 |
</div> |
129 |
<a id="searchtohold" class="btn btn-small" href="#"><i class="icon-search"></i> Search to hold</a> |
130 |
<div class="btn-group"> |
131 |
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button> |
132 |
<ul class="dropdown-menu"> |
133 |
[% IF ( CAN_user_borrowers ) %] |
134 |
<li><a id="renewpatron" href="/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber=[% borrowernumber %]">Renew patron</a></li> |
135 |
[% ELSE %] |
136 |
<li class="disabled"><a id="renewpatron" href="#">Renew patron</a></li> |
137 |
[% END %] |
138 |
[% IF ( CAN_user_permissions ) %] |
139 |
<li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li> |
140 |
[% ELSE %] |
141 |
<li class="disabled"><a id="patronflags" href="#">Set permissions</a></li> |
142 |
[% END %] |
143 |
[% IF ( CAN_user_borrowers ) %] |
144 |
<li><a id="deletepatron" href="#">Delete</a></li> |
145 |
[% ELSE %] |
146 |
<li class="disabled"><a id="deletepatron" href="#">Delete</a></li> |
147 |
[% END %] |
148 |
[% IF ( is_child ) %] |
149 |
<li><a id="updatechild" href="#">Update child to adult patron</a></li> |
150 |
[% ELSE %] |
151 |
<li class="disabled"><a id="updatechild" href="#">Update child to adult patron</a></li></li> |
152 |
[% END %] |
153 |
<li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li> |
154 |
</ul> |
155 |
</div> |
156 |
</div> |