Lines 1-6
Link Here
|
1 |
[% USE raw %] |
1 |
[% USE raw %] |
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
3 |
[% USE AudioAlerts %] |
3 |
[% USE AudioAlerts %] |
|
|
4 |
[% USE Branches %] |
4 |
[% USE To %] |
5 |
[% USE To %] |
5 |
[% USE Koha %] |
6 |
[% USE Koha %] |
6 |
[%# Prevent XFS attacks -%] |
7 |
[%# Prevent XFS attacks -%] |
Lines 69-74
Link Here
|
69 |
[% IF ( PatronAutoComplete ) %] |
70 |
[% IF ( PatronAutoComplete ) %] |
70 |
<script> |
71 |
<script> |
71 |
// PatronAutoComplete && CAN_user_circulate_circulate_remaining_permissions |
72 |
// PatronAutoComplete && CAN_user_circulate_circulate_remaining_permissions |
|
|
73 |
var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]'; |
74 |
var loggedInClass = ""; |
72 |
$(document).ready(function(){ |
75 |
$(document).ready(function(){ |
73 |
var obj = $( "#findborrower" ).autocomplete({ |
76 |
var obj = $( "#findborrower" ).autocomplete({ |
74 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
77 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
Lines 86-91
Link Here
|
86 |
cardnumber = " (" + item.cardnumber + ") "; |
89 |
cardnumber = " (" + item.cardnumber + ") "; |
87 |
} |
90 |
} |
88 |
var itemString = "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + cardnumber.escapeHtml() + " <small>"; |
91 |
var itemString = "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + cardnumber.escapeHtml() + " <small>"; |
|
|
92 |
|
93 |
if( item.branchcode == loggedInLibrary ){ |
94 |
loggedInClass = "ac-currentlibrary"; |
95 |
} else { |
96 |
loggedInClass = ""; |
97 |
} |
98 |
|
89 |
if( item.dateofbirth ) { |
99 |
if( item.dateofbirth ) { |
90 |
itemString += ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) |
100 |
itemString += ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) |
91 |
+ "<span class=\"age_years\"> (" + ( item.age ? item.age.escapeHtml() : "" ) + " " + _("years") + ")</span>, "; |
101 |
+ "<span class=\"age_years\"> (" + ( item.age ? item.age.escapeHtml() : "" ) + " " + _("years") + ")</span>, "; |
Lines 95-101
Link Here
|
95 |
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " " |
105 |
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " " |
96 |
+ ( item.country ? item.country.escapeHtml() : "" ) |
106 |
+ ( item.country ? item.country.escapeHtml() : "" ) |
97 |
+ "</small></a>"; |
107 |
+ "</small></a>"; |
|
|
108 |
itemString += " <span class=\"ac-library\">" + item.branchcode + "</span> " + "</a>"; |
98 |
return $( "<li></li>" ) |
109 |
return $( "<li></li>" ) |
|
|
110 |
.addClass( loggedInClass ) |
99 |
.data( "ui-autocomplete-item", item ) |
111 |
.data( "ui-autocomplete-item", item ) |
100 |
.append( itemString ) |
112 |
.append( itemString ) |
101 |
.appendTo( ul ); |
113 |
.appendTo( ul ); |
Lines 108-113
Link Here
|
108 |
[% IF ( PatronAutoComplete ) %] |
120 |
[% IF ( PatronAutoComplete ) %] |
109 |
<script> |
121 |
<script> |
110 |
// PatronAutoComplete |
122 |
// PatronAutoComplete |
|
|
123 |
var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]'; |
124 |
var loggedInClass = ""; |
111 |
$(document).ready(function(){ |
125 |
$(document).ready(function(){ |
112 |
var obj = $( "#searchmember" ).autocomplete({ |
126 |
var obj = $( "#searchmember" ).autocomplete({ |
113 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
127 |
source: "/cgi-bin/koha/circ/ysearch.pl", |
Lines 124-130
Link Here
|
124 |
// Display card number in parentheses if it exists |
138 |
// Display card number in parentheses if it exists |
125 |
cardnumber = " (" + item.cardnumber + ") "; |
139 |
cardnumber = " (" + item.cardnumber + ") "; |
126 |
} |
140 |
} |
|
|
141 |
if( item.branchcode == loggedInLibrary ){ |
142 |
loggedInClass = "ac-currentlibrary"; |
143 |
} else { |
144 |
loggedInClass = ""; |
145 |
} |
127 |
return $( "<li></li>" ) |
146 |
return $( "<li></li>" ) |
|
|
147 |
.addClass( loggedInClass ) |
128 |
.data( "ui-autocomplete-item", item ) |
148 |
.data( "ui-autocomplete-item", item ) |
129 |
.append( |
149 |
.append( |
130 |
"<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " |
150 |
"<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " |
Lines 135-141
Link Here
|
135 |
+ ( item.address ? item.address.escapeHtml() : "" ) + " " |
155 |
+ ( item.address ? item.address.escapeHtml() : "" ) + " " |
136 |
+ ( item.city ? item.city.escapeHtml() : "" ) + " " |
156 |
+ ( item.city ? item.city.escapeHtml() : "" ) + " " |
137 |
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " " |
157 |
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " " |
138 |
+ ( item.country ? item.country.escapeHtml() : "" ) |
158 |
+ ( item.country ? item.country.escapeHtml() : "" ) + " " |
|
|
159 |
+ "<span class=\"ac-library\">" |
160 |
+ ( item.branchcode ? item.branchcode.escapeHtml() : "" ) |
161 |
+ "</span>" |
139 |
+ "</small>" |
162 |
+ "</small>" |
140 |
+ "</a>" ) |
163 |
+ "</a>" ) |
141 |
.appendTo( ul ); |
164 |
.appendTo( ul ); |