Lines 23-30
Link Here
|
23 |
[% END %] |
23 |
[% END %] |
24 |
[% END %] |
24 |
[% END %] |
25 |
|
25 |
|
|
|
26 |
[% SET footerjs = 1 %] |
26 |
[% INCLUDE 'doc-head-open.inc' %] |
27 |
[% INCLUDE 'doc-head-open.inc' %] |
27 |
[% INCLUDE 'greybox.inc' %] |
|
|
28 |
<title>Koha › Catalog › |
28 |
<title>Koha › Catalog › |
29 |
[% IF ( unknownbiblionumber ) %] |
29 |
[% IF ( unknownbiblionumber ) %] |
30 |
Unknown record |
30 |
Unknown record |
Lines 32-347
Link Here
|
32 |
Details for [% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] |
32 |
Details for [% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] |
33 |
[% END %] |
33 |
[% END %] |
34 |
</title> |
34 |
</title> |
35 |
|
35 |
[% INCLUDE 'doc-head-close.inc' %] |
36 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %] |
|
|
37 |
<script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> |
38 |
[% END %] |
39 |
|
40 |
[% INCLUDE 'doc-head-close.inc' %]<script type="text/JavaScript"> |
41 |
//<![CDATA[ |
42 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
43 |
function verify_images() { |
44 |
$("#bookcoverimg").each(function(i){ |
45 |
$(this).find('img').each(function(i){ |
46 |
if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { |
47 |
w = this.width; |
48 |
h = this.height; |
49 |
if ((w == 1) || (h == 1)) { |
50 |
$("#amazon-bookcoverimg").remove(); |
51 |
$(".yui-gb").attr("class","yui-g"); |
52 |
} else if ((this.complete != null) && (!this.complete)) { |
53 |
$("#amazon-bookcoverimg").remove(); |
54 |
$(".yui-gb").attr("class","yui-g"); |
55 |
} |
56 |
} |
57 |
}); |
58 |
if( $(this).find('img').length < 1 ) $(this).remove(); |
59 |
}); |
60 |
$("#editions img").each(function(i){ |
61 |
if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { |
62 |
w = this.width; |
63 |
h = this.height; |
64 |
if ((w == 1) || (h == 1)) { |
65 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
66 |
} else if ((this.complete != null) && (!this.complete)) { |
67 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
68 |
} |
69 |
} |
70 |
}); |
71 |
} |
72 |
|
73 |
function removeLocalImage(imagenumber) { |
74 |
|
75 |
$.ajax({ |
76 |
url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + [% biblionumber %] + "&imagenumber=" + imagenumber, |
77 |
success: function(data) { |
78 |
$(data).each( function(i) { |
79 |
if ( this.deleted == 1 ) { |
80 |
$('#imagenumber-' + this.imagenumber).remove(); |
81 |
} |
82 |
if ( $('ul.thumbnails > li').length == 0 ) { |
83 |
showNoImageMessage(); |
84 |
} |
85 |
}); |
86 |
}, |
87 |
error: function(data) { |
88 |
alert(_("An error occurred on deleting this image")); |
89 |
} |
90 |
}); |
91 |
|
92 |
} |
93 |
|
94 |
function showNoImageMessage() { |
95 |
|
96 |
var no_images_msg = _("No images have been uploaded for this bibliographic record yet."); |
97 |
no_images_msg = '<p>' + no_images_msg + '</p>'; |
98 |
[% IF ( CAN_user_tools_upload_local_cover_images ) %] |
99 |
var please_upload = _("Please select the image file to upload. %sUpload%s").format( |
100 |
"<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ", |
101 |
"</a>"); |
102 |
no_images_msg += "<p id='upload_image'>" + please_upload + '</p>'; |
103 |
[% END %] |
104 |
|
105 |
$('#images').html(no_images_msg); |
106 |
} |
107 |
|
108 |
[% IF StaffDetailItemSelection %] |
109 |
|
110 |
function itemSelectionBuildDeleteLink(div) { |
111 |
var itemnumbers = new Array(); |
112 |
$("input[name='itemnumber'][type='checkbox']:checked", div).each(function() { |
113 |
itemnumbers.push($(this).val()); |
114 |
}); |
115 |
if (itemnumbers.length > 0) { |
116 |
var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1'; |
117 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
118 |
url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]'; |
119 |
$('a.itemselection_action_delete').attr('href', url); |
120 |
} else { |
121 |
return false; |
122 |
} |
123 |
return true |
124 |
} |
125 |
|
126 |
function itemSelectionBuildModifyLink(div) { |
127 |
var itemnumbers = new Array(); |
128 |
$("input[name='itemnumber'][type='checkbox']:checked", div).each(function() { |
129 |
itemnumbers.push($(this).val()); |
130 |
}); |
131 |
if (itemnumbers.length > 0) { |
132 |
var url = '/cgi-bin/koha/tools/batchMod.pl?op=show'; |
133 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
134 |
url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]'; |
135 |
$('a.itemselection_action_modify').attr('href', url); |
136 |
} else { |
137 |
return false; |
138 |
} |
139 |
return true; |
140 |
} |
141 |
|
142 |
function itemSelectionBuildActionLinks(tab) { |
143 |
var div = $("#" + tab); |
144 |
var delete_link_ok = itemSelectionBuildDeleteLink(div); |
145 |
var modify_link_ok = itemSelectionBuildModifyLink(div); |
146 |
if (modify_link_ok || delete_link_ok) { |
147 |
$('.itemselection_actions', div).show(); |
148 |
} else { |
149 |
$('.itemselection_actions', div).hide(); |
150 |
} |
151 |
} |
152 |
|
153 |
$(document).ready(function() { |
154 |
|
155 |
$('table.items_table').each(function() { |
156 |
var div = $(this).parent().attr("id"); |
157 |
itemSelectionBuildActionLinks(div); |
158 |
}); |
159 |
|
160 |
$("input[name='itemnumber'][type='checkbox']").change(function() { |
161 |
var div = $(this).parents('table').parent().parent().attr("id"); |
162 |
itemSelectionBuildActionLinks(div); |
163 |
}); |
164 |
|
165 |
$(".SelectAll").on("click",function(e){ |
166 |
e.preventDefault(); |
167 |
var tab = $(this).data("tab"); |
168 |
$("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true); |
169 |
itemSelectionBuildActionLinks(tab); |
170 |
}); |
171 |
|
172 |
$(".ClearAll").on("click",function(e){ |
173 |
e.preventDefault(); |
174 |
var tab = $(this).data("tab"); |
175 |
$("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false); |
176 |
itemSelectionBuildActionLinks(tab); |
177 |
}); |
178 |
|
179 |
}); |
180 |
[% END %] |
181 |
|
182 |
$(document).ready(function() { |
183 |
$('#bibliodetails').tabs(); |
184 |
[% IF count == 0 %] |
185 |
$('#bibliodetails').tabs("option", "active", 3); |
186 |
[% END %] |
187 |
$('#search-form').focus(); |
188 |
$('.thumbnails > li > a > span.remove').click(function() { |
189 |
var result = confirm(_("Are you sure you want to delete this cover image?")); |
190 |
|
191 |
if ( result == true ) { |
192 |
var imagenumber = $(this).parent().parent().attr('id').split('-')[1]; |
193 |
removeLocalImage(imagenumber); |
194 |
} |
195 |
|
196 |
return false; |
197 |
}); |
198 |
[%# inject no images message %] |
199 |
[% IF ( LocalCoverImages && ! localimages.0 ) %] |
200 |
showNoImageMessage(); |
201 |
[% END %] |
202 |
[% IF LocalCoverImages %] |
203 |
KOHA.LocalCover.GetCoverFromBibnumber(true); |
204 |
[% END %] |
205 |
$("body").on("click",".previewMARC", function(e){ |
206 |
e.preventDefault(); |
207 |
var page = $(this).attr("href"); |
208 |
$("#marcPreview .modal-body").load(page + " table"); |
209 |
$('#marcPreview').modal({show:true}); |
210 |
}); |
211 |
$("#marcPreview").on("hidden", function(){ |
212 |
$("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
213 |
}); |
214 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %] |
215 |
novSelect.loadContentForQuery( |
216 |
{ |
217 |
ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]', |
218 |
ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]', |
219 |
version : '2.1' |
220 |
}, |
221 |
'[% Koha.Preference('NovelistSelectProfile') %]', |
222 |
'[% Koha.Preference('NovelistSelectPassword') %]', |
223 |
function(d){ |
224 |
if ( d.length > 0 ){ //If no content |
225 |
$(".NovelistSelect").show(); |
226 |
} |
227 |
}); |
228 |
[% END %] |
229 |
|
230 |
}); |
231 |
|
232 |
[% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() { |
233 |
verify_images(); |
234 |
});[% END %] |
235 |
//]]> |
236 |
</script> |
237 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
36 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
238 |
[% INCLUDE 'datatables.inc' %] |
|
|
239 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> |
240 |
[% INCLUDE 'browser-strings.inc' %] |
241 |
<!--[if lt IE 9]> |
242 |
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script> |
243 |
<![endif]--> |
244 |
<script type="text/javascript" src="[% interface %]/js/browser.js"></script> |
245 |
<script type="text/javascript"> |
246 |
//<![CDATA[ |
247 |
var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); |
248 |
browser.show(); |
249 |
|
250 |
function activate_filters(id) { |
251 |
var table = $("#" + id + " table"); |
252 |
if (table.length == 1) { |
253 |
filters_row = table.find('thead tr.filters_row'); |
254 |
|
255 |
var aoColumns = []; |
256 |
filters_row.find('th').each(function() { |
257 |
if(this.className === "NoSort"){ |
258 |
aoColumns.push(null); |
259 |
} else { |
260 |
aoColumns.push('text'); |
261 |
} |
262 |
}); |
263 |
|
264 |
if (table.find('thead tr.columnFilter').length == 0) { |
265 |
table.dataTable().columnFilter({ |
266 |
'sPlaceHolder': 'head:after' |
267 |
, 'aoColumns': aoColumns |
268 |
}); |
269 |
filters_row.addClass('columnFilter'); |
270 |
} |
271 |
filters_row.show(); |
272 |
} |
273 |
|
274 |
$('#' + id + '_activate_filters') |
275 |
.html('<i class="fa fa-filter"></i> ' + _("Deactivate filters") ) |
276 |
.unbind('click') |
277 |
.click(function() { |
278 |
deactivate_filters(id); |
279 |
return false; |
280 |
}); |
281 |
} |
282 |
|
283 |
function deactivate_filters(id) { |
284 |
filters_row = $("#" + id + " table").find('thead tr.filters_row'); |
285 |
|
286 |
filters_row.find('input[type="text"]') |
287 |
.val('') // Empty filter text boxes |
288 |
.trigger('keyup') // Filter (display all rows) |
289 |
.trigger('blur'); // Reset value to the column name |
290 |
filters_row.hide(); |
291 |
|
292 |
$('#' + id + '_activate_filters') |
293 |
.html('<i class="fa fa-filter"></i> ' + _("Activate filters") ) |
294 |
.unbind('click') |
295 |
.click(function() { |
296 |
activate_filters(id); |
297 |
return false; |
298 |
}); |
299 |
} |
300 |
|
301 |
$(document).ready(function() { |
302 |
var ids = ['holdings', 'otherholdings']; |
303 |
for (var i in ids) { |
304 |
var id = ids[i]; |
305 |
var table = $('#' + id + ' table'); |
306 |
|
307 |
// Duplicate the table header row for columnFilter |
308 |
thead_row = table.find('thead tr'); |
309 |
clone = thead_row.clone().addClass('filters_row'); |
310 |
clone.find("th.NoSort").html(''); |
311 |
thead_row.before(clone); |
312 |
|
313 |
// Enable sorting |
314 |
table.dataTable($.extend(true, {}, dataTablesDefaults, { |
315 |
'sDom': 't', |
316 |
'bPaginate': false, |
317 |
'bAutoWidth': false, |
318 |
"aoColumnDefs": [ |
319 |
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] } |
320 |
] |
321 |
})); |
322 |
|
323 |
// Show a link to activate filtering |
324 |
link = $('<a>') |
325 |
.attr('href', '#') |
326 |
.attr('id', id + '_activate_filters'); |
327 |
$("." + id + "_table_controls").prepend(link); |
328 |
deactivate_filters(id); |
329 |
} |
330 |
[% IF Koha.Preference('AcquisitionDetails') %] |
331 |
$("#orders").dataTable($.extend(true, {}, dataTablesDefaults, { |
332 |
'sDom': 't', |
333 |
'bPaginate': false, |
334 |
'bAutoWidth': false, |
335 |
"aaSorting": [[ 4, "desc" ]], |
336 |
"aoColumnDefs": [ |
337 |
{ "aTargets": "title-string", "sType": "title-string" } |
338 |
] |
339 |
})); |
340 |
|
341 |
[% END %] |
342 |
}); |
343 |
//]]> |
344 |
</script> |
345 |
</head> |
37 |
</head> |
346 |
|
38 |
|
347 |
<body id="catalog_detail" class="catalog"> |
39 |
<body id="catalog_detail" class="catalog"> |
Lines 1154-1157
function verify_images() {
Link Here
|
1154 |
[% END %] |
846 |
[% END %] |
1155 |
</div> |
847 |
</div> |
1156 |
|
848 |
|
|
|
849 |
[% MACRO jsinclude BLOCK %] |
850 |
[% INCLUDE 'catalog-strings.inc' %] |
851 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/catalog.js"></script> |
852 |
[% INCLUDE 'greybox.inc' %] |
853 |
<script type="text/javascript"> |
854 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
855 |
function verify_images() { |
856 |
$("#bookcoverimg").each(function(i){ |
857 |
$(this).find('img').each(function(i){ |
858 |
if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { |
859 |
w = this.width; |
860 |
h = this.height; |
861 |
if ((w == 1) || (h == 1)) { |
862 |
$("#amazon-bookcoverimg").remove(); |
863 |
$(".yui-gb").attr("class","yui-g"); |
864 |
} else if ((this.complete != null) && (!this.complete)) { |
865 |
$("#amazon-bookcoverimg").remove(); |
866 |
$(".yui-gb").attr("class","yui-g"); |
867 |
} |
868 |
} |
869 |
}); |
870 |
if( $(this).find('img').length < 1 ) $(this).remove(); |
871 |
}); |
872 |
$("#editions img").each(function(i){ |
873 |
if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { |
874 |
w = this.width; |
875 |
h = this.height; |
876 |
if ((w == 1) || (h == 1)) { |
877 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
878 |
} else if ((this.complete != null) && (!this.complete)) { |
879 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
880 |
} |
881 |
} |
882 |
}); |
883 |
} |
884 |
|
885 |
function removeLocalImage(imagenumber) { |
886 |
$.ajax({ |
887 |
url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + biblionumber + "&imagenumber=" + imagenumber, |
888 |
success: function(data) { |
889 |
$(data).each( function(i) { |
890 |
if ( this.deleted == 1 ) { |
891 |
$('#imagenumber-' + this.imagenumber).remove(); |
892 |
} |
893 |
if ( $('ul.thumbnails > li').length == 0 ) { |
894 |
showNoImageMessage(); |
895 |
} |
896 |
}); |
897 |
}, |
898 |
error: function(data) { |
899 |
alert(_("An error occurred on deleting this image")); |
900 |
} |
901 |
}); |
902 |
} |
903 |
|
904 |
function showNoImageMessage() { |
905 |
var no_images_msg = _("No images have been uploaded for this bibliographic record yet."); |
906 |
no_images_msg = '<p>' + no_images_msg + '</p>'; |
907 |
[% IF ( CAN_user_tools_upload_local_cover_images ) %] |
908 |
var please_upload = _("Please select the image file to upload. %sUpload%s").format("<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber + "&filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>"); |
909 |
no_images_msg += "<p id='upload_image'>" + please_upload + '</p>'; |
910 |
[% END %] |
911 |
$('#images').html(no_images_msg); |
912 |
} |
913 |
|
914 |
[% IF StaffDetailItemSelection %] |
915 |
function itemSelectionBuildDeleteLink(div) { |
916 |
var itemnumbers = new Array(); |
917 |
$("input[name='itemnumber'][type='checkbox']:checked", div).each(function() { |
918 |
itemnumbers.push($(this).val()); |
919 |
}); |
920 |
if (itemnumbers.length > 0) { |
921 |
var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1'; |
922 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
923 |
url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]'; |
924 |
$('a.itemselection_action_delete').attr('href', url); |
925 |
} else { |
926 |
return false; |
927 |
} |
928 |
return true |
929 |
} |
930 |
|
931 |
function itemSelectionBuildModifyLink(div) { |
932 |
var itemnumbers = new Array(); |
933 |
$("input[name='itemnumber'][type='checkbox']:checked", div).each(function() { |
934 |
itemnumbers.push($(this).val()); |
935 |
}); |
936 |
if (itemnumbers.length > 0) { |
937 |
var url = '/cgi-bin/koha/tools/batchMod.pl?op=show'; |
938 |
url += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
939 |
url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]'; |
940 |
$('a.itemselection_action_modify').attr('href', url); |
941 |
} else { |
942 |
return false; |
943 |
} |
944 |
return true; |
945 |
} |
946 |
|
947 |
function itemSelectionBuildActionLinks(tab) { |
948 |
var div = $("#" + tab); |
949 |
var delete_link_ok = itemSelectionBuildDeleteLink(div); |
950 |
var modify_link_ok = itemSelectionBuildModifyLink(div); |
951 |
if (modify_link_ok || delete_link_ok) { |
952 |
$('.itemselection_actions', div).show(); |
953 |
} else { |
954 |
$('.itemselection_actions', div).hide(); |
955 |
} |
956 |
} |
957 |
|
958 |
$(document).ready(function() { |
959 |
$('table.items_table').each(function() { |
960 |
var div = $(this).parent().attr("id"); |
961 |
itemSelectionBuildActionLinks(div); |
962 |
}); |
963 |
|
964 |
$("input[name='itemnumber'][type='checkbox']").change(function() { |
965 |
var div = $(this).parents('table').parent().parent().attr("id"); |
966 |
itemSelectionBuildActionLinks(div); |
967 |
}); |
968 |
|
969 |
$(".SelectAll").on("click",function(e){ |
970 |
e.preventDefault(); |
971 |
var tab = $(this).data("tab"); |
972 |
$("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true); |
973 |
itemSelectionBuildActionLinks(tab); |
974 |
}); |
975 |
|
976 |
$(".ClearAll").on("click",function(e){ |
977 |
e.preventDefault(); |
978 |
var tab = $(this).data("tab"); |
979 |
$("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false); |
980 |
itemSelectionBuildActionLinks(tab); |
981 |
}); |
982 |
}); |
983 |
[% END %] |
984 |
|
985 |
$(document).ready(function() { |
986 |
$('#bibliodetails').tabs(); |
987 |
[% IF count == 0 %] |
988 |
$('#bibliodetails').tabs("option", "active", 3); |
989 |
[% END %] |
990 |
$('#search-form').focus(); |
991 |
$('.thumbnails > li > a > span.remove').click(function() { |
992 |
var result = confirm(_("Are you sure you want to delete this cover image?")); |
993 |
|
994 |
if ( result == true ) { |
995 |
var imagenumber = $(this).parent().parent().attr('id').split('-')[1]; |
996 |
removeLocalImage(imagenumber); |
997 |
} |
998 |
|
999 |
return false; |
1000 |
}); |
1001 |
[%# inject no images message %] |
1002 |
[% IF ( LocalCoverImages && ! localimages.0 ) %] |
1003 |
showNoImageMessage(); |
1004 |
[% END %] |
1005 |
[% IF LocalCoverImages %] |
1006 |
KOHA.LocalCover.GetCoverFromBibnumber(true); |
1007 |
[% END %] |
1008 |
$("body").on("click",".previewMARC", function(e){ |
1009 |
e.preventDefault(); |
1010 |
var page = $(this).attr("href"); |
1011 |
$("#marcPreview .modal-body").load(page + " table"); |
1012 |
$('#marcPreview').modal({show:true}); |
1013 |
}); |
1014 |
$("#marcPreview").on("hidden", function(){ |
1015 |
$("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
1016 |
}); |
1017 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %] |
1018 |
novSelect.loadContentForQuery({ |
1019 |
ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]', |
1020 |
ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]', |
1021 |
version : '2.1' |
1022 |
}, |
1023 |
'[% Koha.Preference('NovelistSelectProfile') %]', |
1024 |
'[% Koha.Preference('NovelistSelectPassword') %]', |
1025 |
function(d){ |
1026 |
if ( d.length > 0 ){ //If no content |
1027 |
$(".NovelistSelect").show(); |
1028 |
} |
1029 |
}); |
1030 |
[% END %] |
1031 |
|
1032 |
}); |
1033 |
|
1034 |
[% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() { |
1035 |
verify_images(); |
1036 |
});[% END %] |
1037 |
</script> |
1038 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %] |
1039 |
<script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> |
1040 |
[% END %] |
1041 |
[% INCLUDE 'datatables.inc' %] |
1042 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> |
1043 |
[% INCLUDE 'browser-strings.inc' %] |
1044 |
<script type="text/javascript" src="[% interface %]/js/browser.js"></script> |
1045 |
<script type="text/javascript"> |
1046 |
var browser = KOHA.browser('[% searchid %]', parseInt(biblionumber, 10)); |
1047 |
browser.show(); |
1048 |
|
1049 |
function activate_filters(id) { |
1050 |
var table = $("#" + id + " table"); |
1051 |
if (table.length == 1) { |
1052 |
filters_row = table.find('thead tr.filters_row'); |
1053 |
|
1054 |
var aoColumns = []; |
1055 |
filters_row.find('th').each(function() { |
1056 |
if(this.className === "NoSort"){ |
1057 |
aoColumns.push(null); |
1058 |
} else { |
1059 |
aoColumns.push('text'); |
1060 |
} |
1061 |
}); |
1062 |
|
1063 |
if (table.find('thead tr.columnFilter').length == 0) { |
1064 |
table.dataTable().columnFilter({ |
1065 |
'sPlaceHolder': 'head:after' |
1066 |
, 'aoColumns': aoColumns |
1067 |
}); |
1068 |
filters_row.addClass('columnFilter'); |
1069 |
} |
1070 |
filters_row.show(); |
1071 |
} |
1072 |
|
1073 |
$('#' + id + '_activate_filters') |
1074 |
.html('<i class="fa fa-filter"></i> ' + _("Deactivate filters") ) |
1075 |
.unbind('click') |
1076 |
.click(function() { |
1077 |
deactivate_filters(id); |
1078 |
return false; |
1079 |
}); |
1080 |
} |
1081 |
|
1082 |
function deactivate_filters(id) { |
1083 |
filters_row = $("#" + id + " table").find('thead tr.filters_row'); |
1084 |
|
1085 |
filters_row.find('input[type="text"]') |
1086 |
.val('') // Empty filter text boxes |
1087 |
.trigger('keyup') // Filter (display all rows) |
1088 |
.trigger('blur'); // Reset value to the column name |
1089 |
filters_row.hide(); |
1090 |
|
1091 |
$('#' + id + '_activate_filters') |
1092 |
.html('<i class="fa fa-filter"></i> ' + _("Activate filters") ) |
1093 |
.unbind('click') |
1094 |
.click(function() { |
1095 |
activate_filters(id); |
1096 |
return false; |
1097 |
}); |
1098 |
} |
1099 |
|
1100 |
$(document).ready(function() { |
1101 |
var ids = ['holdings', 'otherholdings']; |
1102 |
for (var i in ids) { |
1103 |
var id = ids[i]; |
1104 |
var table = $('#' + id + ' table'); |
1105 |
|
1106 |
// Duplicate the table header row for columnFilter |
1107 |
thead_row = table.find('thead tr'); |
1108 |
clone = thead_row.clone().addClass('filters_row'); |
1109 |
clone.find("th.NoSort").html(''); |
1110 |
thead_row.before(clone); |
1111 |
|
1112 |
// Enable sorting |
1113 |
table.dataTable($.extend(true, {}, dataTablesDefaults, { |
1114 |
'sDom': 't', |
1115 |
'bPaginate': false, |
1116 |
'bAutoWidth': false, |
1117 |
"aoColumnDefs": [ |
1118 |
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] } |
1119 |
] |
1120 |
})); |
1121 |
|
1122 |
// Show a link to activate filtering |
1123 |
link = $('<a>') |
1124 |
.attr('href', '#') |
1125 |
.attr('id', id + '_activate_filters'); |
1126 |
$("." + id + "_table_controls").prepend(link); |
1127 |
deactivate_filters(id); |
1128 |
} |
1129 |
[% IF Koha.Preference('AcquisitionDetails') %] |
1130 |
$("#orders").dataTable($.extend(true, {}, dataTablesDefaults, { |
1131 |
'sDom': 't', |
1132 |
'bPaginate': false, |
1133 |
'bAutoWidth': false, |
1134 |
"aaSorting": [[ 4, "desc" ]], |
1135 |
"aoColumnDefs": [ |
1136 |
{ "aTargets": "title-string", "sType": "title-string" } |
1137 |
] |
1138 |
})); |
1139 |
[% END %] |
1140 |
}); |
1141 |
</script> |
1142 |
[% END %] |
1157 |
[% INCLUDE 'intranet-bottom.inc' %] |
1143 |
[% INCLUDE 'intranet-bottom.inc' %] |