7 [%# Prevent XFS attacks -%]
11 var antiClickjack = document.getElementById("antiClickjack");
12 antiClickjack.parentNode.removeChild(antiClickjack);
14 top.location = self.location;
19 [% Asset.js("lib/jquery/jquery-2.2.3.min.js") | $raw %]
20 [% Asset.js("lib/jquery/jquery-migrate-1.3.0.min.js") | $raw %]
21 [% Asset.js("lib/jquery/jquery-ui-1.11.4.min.js") | $raw %]
22 [% Asset.js("lib/shortcut/shortcut.js") | $raw %]
23 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
24 [% Asset.js("lib/js-cookie/js.cookie-2.2.1.min.js") | $raw %]
25 [% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
26 [% Asset.js("lib/bootstrap/bootstrap.min.js") | $raw %]
27 [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
29 [% Asset.js("js/staff-global.js") | $raw %]
31 [% INCLUDE 'validator-strings.inc' %]
32 [% IF ( IntranetUserJS ) %]
33 <!-- js_includes.inc: IntranetUserJS -->
35 [% IntranetUserJS | $raw %]
37 <!-- / js_includes.inc: IntranetUserJS -->
40 <!-- js_includes.inc -->
41 [% IF ( Koha.Preference('virtualshelves') || Koha.Preference('intranetbookbag') ) %]
42 [% Asset.js("js/basket.js") | $raw %]
45 [% IF LocalCoverImages %]
46 [% Asset.js("js/localcovers.js") | $raw %]
49 [% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %]
52 var AUDIO_ALERT_PATH = '[% interface | html %]/[% theme | html %]/sound/';
53 var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
55 $( document ).ready(function() {
57 for ( var k in AUDIO_ALERTS ) {
58 var alert = AUDIO_ALERTS[k];
59 if ( $( alert.selector ).length ) {
60 playSound( alert.sound );
69 [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
70 [% IF ( PatronAutoComplete ) %]
72 // PatronAutoComplete && CAN_user_circulate_circulate_remaining_permissions
73 var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
74 var loggedInClass = "";
75 $(document).ready(function(){
76 var obj = $( "#findborrower" ).autocomplete({
77 source: "/cgi-bin/koha/circ/ysearch.pl",
79 select: function( event, ui ) {
80 window.location.href = ui.item.link;
82 }).data( "ui-autocomplete" );
84 obj._renderItem = function( ul, item ) {
85 item.link = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + item.borrowernumber;
87 if( item.cardnumber != "" ){
88 // Display card number in parentheses if it exists
89 cardnumber = " (" + item.cardnumber + ") ";
91 var itemString = "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + cardnumber.escapeHtml() + " <small>";
93 if( item.branchcode == loggedInLibrary ){
94 loggedInClass = "ac-currentlibrary";
99 if( item.dateofbirth ) {
100 itemString += ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" )
101 + "<span class=\"age_years\"> (" + ( item.age ? item.age.escapeHtml() : "" ) + " " + _("years") + ")</span>, ";
103 itemString += ( item.address ? item.address.escapeHtml() : "" ) + " "
104 + ( item.city ? item.city.escapeHtml() : "" ) + " "
105 + ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
106 + ( item.country ? item.country.escapeHtml() : "" )
108 itemString += " <span class=\"ac-library\">" + item.branchname + "</span> " + "</a>";
109 return $( "<li></li>" )
110 .addClass( loggedInClass )
111 .data( "ui-autocomplete-item", item )
112 .append( itemString )
120 [% IF ( PatronAutoComplete ) %]
122 // PatronAutoComplete
123 var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
124 var loggedInClass = "";
125 $(document).ready(function(){
126 var obj = $( "#searchmember" ).autocomplete({
127 source: "/cgi-bin/koha/circ/ysearch.pl",
129 select: function( event, ui ) {
130 window.location.href = ui.item.link;
132 }).data( "ui-autocomplete" );
134 obj._renderItem = function( ul, item ) {
135 item.link = "/cgi-bin/koha/members/moremember.pl?borrowernumber=" + item.borrowernumber;
137 if( item.cardnumber != "" ){
138 // Display card number in parentheses if it exists
139 cardnumber = " (" + item.cardnumber + ") ";
141 if( item.branchcode == loggedInLibrary ){
142 loggedInClass = "ac-currentlibrary";
146 return $( "<li></li>" )
147 .addClass( loggedInClass )
148 .data( "ui-autocomplete-item", item )
150 "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", "
151 + ( item.firstname ? item.firstname.escapeHtml() : "" )
152 + cardnumber.escapeHtml()
154 + ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) + " "
155 + ( item.address ? item.address.escapeHtml() : "" ) + " "
156 + ( item.city ? item.city.escapeHtml() : "" ) + " "
157 + ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
158 + ( item.country ? item.country.escapeHtml() : "" ) + " "
159 + "<span class=\"ac-library\">"
160 + ( item.branchname ? item.branchname.escapeHtml() : "" )
170 <!-- / js_includes.inc -->