Lines 1-3
Link Here
|
|
|
1 |
[% SET footerjs = 1 %] |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
|
3 |
|
3 |
[% BLOCK ServerType %] |
4 |
[% BLOCK ServerType %] |
Lines 16-94
Link Here
|
16 |
|
17 |
|
17 |
[% IF op == 'list' %] |
18 |
[% IF op == 'list' %] |
18 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
19 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
19 |
[% INCLUDE 'datatables.inc' %] |
|
|
20 |
[% END %] |
20 |
[% END %] |
21 |
|
|
|
22 |
<script type="text/javascript"> |
23 |
//<![CDATA[ |
24 |
[% IF ( add_form ) %] |
25 |
$(document).ready(function(){ |
26 |
// Update selects for syntax, encoding and recordtype |
27 |
[% IF server %] |
28 |
$("#syntax").val('[% server.syntax %]'); |
29 |
$("#encoding").val('[% server.encoding %]'); |
30 |
$("#recordtype").val('[% server.recordtype %]'); |
31 |
[% END %] |
32 |
// Disable recordtype (and default to bib) for non-Z3950 servers until auth is supported |
33 |
[% UNLESS (server.servertype||type) == 'zed' %] |
34 |
$("#recordtype").prop('disabled',true); |
35 |
[% END %] |
36 |
$( "#serverentry" ).validate({ |
37 |
rules: { |
38 |
servername: { required: true }, |
39 |
host: { required: true }, |
40 |
port: { |
41 |
required: true, |
42 |
number: true |
43 |
}, |
44 |
db: { required: true }, |
45 |
rank: { number: true }, |
46 |
timeout: { number: true } |
47 |
} |
48 |
}); |
49 |
$("#serverentry").submit(function( event ) { |
50 |
// first test if show_sru_fields exists |
51 |
if( $('#show_sru_fields').length && $('#show_sru_fields').val()=='' && !confirm( _("No SRU search field mappings have been defined. This means that all field searches will go through the whole record. Continue?"))) { |
52 |
return false; |
53 |
} |
54 |
// copy show_sru_fields to hidden counterpart |
55 |
$('#sru_fields').val( $('#show_sru_fields').val() ); |
56 |
// enable recordtype to include field in post |
57 |
$('#recordtype').prop('disabled',false); |
58 |
}); |
59 |
$("#servername").on("blur",function(){ |
60 |
toUC(this); |
61 |
}); |
62 |
$("#modify_sru_fields").on("click",function(){ |
63 |
ModMapping(); |
64 |
}); |
65 |
}); |
66 |
function ModMapping () { |
67 |
var map= $('#show_sru_fields').val(); |
68 |
window.open('/cgi-bin/koha/admin/sru_modmapping.pl?mapping='+map,'popup','width=800,height=400,resizable=yes,toolbar=false,scrollbars=yes,top'); |
69 |
} |
70 |
[% ELSE %] |
71 |
$(document).ready(function() { |
72 |
$("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, { |
73 |
"aoColumnDefs": [ |
74 |
{ "aTargets": [2,3,4,7,8,9,10,11], "bSortable": false, "bSearchable": false }, |
75 |
], |
76 |
"sPaginationType": "four_button" |
77 |
})); |
78 |
$(".delete").on("click",function(e){ |
79 |
var servername = $(this).data("servername"); |
80 |
if( confirm( _("Are you sure you want to delete server %s?").format(servername) ) ) { |
81 |
return true; |
82 |
} else { |
83 |
e.preventDefault(); |
84 |
} |
85 |
}); |
86 |
}); |
87 |
[% END %] |
88 |
//]]> |
89 |
</script> |
90 |
|
91 |
</head> |
21 |
</head> |
|
|
22 |
|
92 |
<body id="admin_z3950servers" class="admin"> |
23 |
<body id="admin_z3950servers" class="admin"> |
93 |
[% INCLUDE 'header.inc' %] |
24 |
[% INCLUDE 'header.inc' %] |
94 |
[% INCLUDE 'z3950-admin-search.inc' %] |
25 |
[% INCLUDE 'z3950-admin-search.inc' %] |
Lines 265-268
Link Here
|
265 |
[% INCLUDE 'admin-menu.inc' %] |
196 |
[% INCLUDE 'admin-menu.inc' %] |
266 |
</div> |
197 |
</div> |
267 |
</div> |
198 |
</div> |
|
|
199 |
|
200 |
[% MACRO jsinclude BLOCK %] |
201 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> |
202 |
[% IF op == 'list' %] |
203 |
[% INCLUDE 'datatables.inc' %] |
204 |
[% END %] |
205 |
|
206 |
<script type="text/javascript"> |
207 |
[% IF ( add_form ) %] |
208 |
$(document).ready(function(){ |
209 |
// Update selects for syntax, encoding and recordtype |
210 |
[% IF server %] |
211 |
$("#syntax").val('[% server.syntax %]'); |
212 |
$("#encoding").val('[% server.encoding %]'); |
213 |
$("#recordtype").val('[% server.recordtype %]'); |
214 |
[% END %] |
215 |
// Disable recordtype (and default to bib) for non-Z3950 servers until auth is supported |
216 |
[% UNLESS (server.servertype||type) == 'zed' %] |
217 |
$("#recordtype").prop('disabled',true); |
218 |
[% END %] |
219 |
$( "#serverentry" ).validate({ |
220 |
rules: { |
221 |
servername: { required: true }, |
222 |
host: { required: true }, |
223 |
port: { |
224 |
required: true, |
225 |
number: true |
226 |
}, |
227 |
db: { required: true }, |
228 |
rank: { number: true }, |
229 |
timeout: { number: true } |
230 |
} |
231 |
}); |
232 |
$("#serverentry").submit(function( event ) { |
233 |
// first test if show_sru_fields exists |
234 |
if( $('#show_sru_fields').length && $('#show_sru_fields').val()=='' && !confirm( _("No SRU search field mappings have been defined. This means that all field searches will go through the whole record. Continue?"))) { |
235 |
return false; |
236 |
} |
237 |
// copy show_sru_fields to hidden counterpart |
238 |
$('#sru_fields').val( $('#show_sru_fields').val() ); |
239 |
// enable recordtype to include field in post |
240 |
$('#recordtype').prop('disabled',false); |
241 |
}); |
242 |
$("#servername").on("blur",function(){ |
243 |
toUC(this); |
244 |
}); |
245 |
$("#modify_sru_fields").on("click",function(){ |
246 |
ModMapping(); |
247 |
}); |
248 |
}); |
249 |
function ModMapping () { |
250 |
var map= $('#show_sru_fields').val(); |
251 |
window.open('/cgi-bin/koha/admin/sru_modmapping.pl?mapping='+map,'popup','width=800,height=400,resizable=yes,toolbar=false,scrollbars=yes,top'); |
252 |
} |
253 |
[% ELSE %] |
254 |
$(document).ready(function() { |
255 |
$("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, { |
256 |
"aoColumnDefs": [ |
257 |
{ "aTargets": [2,3,4,7,8,9,10,11], "bSortable": false, "bSearchable": false }, |
258 |
], |
259 |
"sPaginationType": "four_button" |
260 |
})); |
261 |
$(".delete").on("click",function(e){ |
262 |
var servername = $(this).data("servername"); |
263 |
if( confirm( _("Are you sure you want to delete server %s?").format(servername) ) ) { |
264 |
return true; |
265 |
} else { |
266 |
e.preventDefault(); |
267 |
} |
268 |
}); |
269 |
}); |
270 |
[% END %] |
271 |
</script> |
272 |
[% END %] |
268 |
[% INCLUDE 'intranet-bottom.inc' %] |
273 |
[% INCLUDE 'intranet-bottom.inc' %] |
269 |
- |
|
|