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