Lines 1-107
Link Here
|
|
|
1 |
[% USE ColumnsSettings %] |
2 |
[% SET footerjs = 1 %] |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
<title>Koha › Tools › OAI-PMH harvester</title> |
4 |
<title>Koha › Tools › OAI-PMH harvester</title> |
3 |
[% INCLUDE 'doc-head-close.inc' %] |
5 |
[% INCLUDE 'doc-head-close.inc' %] |
4 |
[% INCLUDE 'datatables.inc' %] |
|
|
5 |
[% dashboard_page = '/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl' %] |
6 |
[% dashboard_page = '/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl' %] |
6 |
[% request_page = '/cgi-bin/koha/tools/oai-pmh-harvester/request.pl' %] |
7 |
[% request_page = '/cgi-bin/koha/tools/oai-pmh-harvester/request.pl' %] |
7 |
<script type="text/javascript"> |
|
|
8 |
//<![CDATA[ |
9 |
$(document).ready(function() { |
10 |
$('#dashboard-items').tabs(); |
11 |
[% IF ( result.start.defined || result.stop.defined || result.delete.defined ) %] |
12 |
$('#dashboard-items').tabs("option","active",1); |
13 |
[% END %] |
14 |
|
15 |
var saved_table = $('#saved-table').DataTable({}); |
16 |
var submitted_table = $('#submitted-table').DataTable({}); |
17 |
var history_table = $('#history-table').DataTable({ |
18 |
serverSide: true, |
19 |
searching: true, |
20 |
processing: true, |
21 |
ajax: { |
22 |
"url": '/cgi-bin/koha/svc/oai-pmh-harvester/history', |
23 |
contentType: 'application/json', |
24 |
type: 'POST', |
25 |
data: function ( d ) { |
26 |
return JSON.stringify( d ); |
27 |
}, |
28 |
dataSrc: function (json){ |
29 |
var recordsTotal = json.recordsTotal; |
30 |
if(recordsTotal){ |
31 |
$('#import_count').text( "("+recordsTotal+")" ); |
32 |
} |
33 |
return json.data; |
34 |
} |
35 |
}, |
36 |
columns: [ |
37 |
{ data: 'import_oai_id', }, |
38 |
{ data: 'repository', }, |
39 |
{ data: 'header_identifier', }, |
40 |
{ data: 'header_datestamp', }, |
41 |
{ |
42 |
data: 'header_status', render: function (data, type, full, meta){ |
43 |
var display_string = _("Active"); |
44 |
if (data == "deleted"){ |
45 |
display_string = _("Deleted"); |
46 |
} |
47 |
return display_string; |
48 |
} |
49 |
}, |
50 |
{ |
51 |
data: 'status', render: function (data, type, full, meta){ |
52 |
var display_string = data; |
53 |
if (data == "added"){ |
54 |
display_string = _("Added"); |
55 |
} |
56 |
else if (data == "error"){ |
57 |
display_string = _("Error"); |
58 |
} |
59 |
else if (data == "not_found"){ |
60 |
display_string = _("Not found"); |
61 |
} |
62 |
else if (data == "updated"){ |
63 |
display_string = _("Updated"); |
64 |
} |
65 |
return display_string; |
66 |
} |
67 |
}, |
68 |
{ data: 'upload_timestamp', }, |
69 |
{ |
70 |
data: 'imported_record', render: function (data, type, full, meta){ |
71 |
var display_string = data; |
72 |
var record_type = (full.record_type) ? full.record_type : 'biblio'; |
73 |
if (data && record_type == 'biblio'){ |
74 |
var link_text = _("View biblio record"); |
75 |
var link = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='+data+'">'+link_text+'</a>'; |
76 |
display_string = link; |
77 |
} |
78 |
return display_string; |
79 |
}, searchable: false |
80 |
|
81 |
}, |
82 |
{ |
83 |
data: 'import_oai_id', render: function (data, type, full, meta){ |
84 |
var display_string = data; |
85 |
var link_text = _("View record"); |
86 |
var link = '<a href="/cgi-bin/koha/tools/oai-pmh-harvester/record.pl?import_oai_id='+data+'">'+link_text+'</a>'; |
87 |
display_string = link; |
88 |
return display_string; |
89 |
}, searchable: false |
90 |
}, |
91 |
], |
92 |
//In theory, it would be nice to sort in descending order, but |
93 |
//it causes severe paging issues the data is frequently updated. |
94 |
//Caching would make the paging more stable, but the results would be stale. |
95 |
order: [ |
96 |
[ 0, 'asc' ], |
97 |
] |
98 |
}); |
99 |
$('#refresh-button').click(function(){ |
100 |
history_table.ajax.reload( null, false ); |
101 |
}); |
102 |
}); |
103 |
//]]> |
104 |
</script> |
105 |
<style type="text/css"> |
8 |
<style type="text/css"> |
106 |
a.paginate_button { |
9 |
a.paginate_button { |
107 |
padding: 2px; |
10 |
padding: 2px; |
Lines 118-124
Link Here
|
118 |
<div class="yui-b"> |
21 |
<div class="yui-b"> |
119 |
<h1>OAI-PMH harvester</h1> |
22 |
<h1>OAI-PMH harvester</h1> |
120 |
<div id="toolbar" class="btn-toolbar"> |
23 |
<div id="toolbar" class="btn-toolbar"> |
121 |
<a id="new-request" class="btn btn-default btn-sm" href="[% request_page %]?op=new"><i class="fa fa-plus"></i> New request</a> |
24 |
<a id="new-request" class="btn btn-default btn-sm" href="[% request_page | url %]?op=new"><i class="fa fa-plus"></i> New request</a> |
122 |
</div> |
25 |
</div> |
123 |
[% IF ( harvester.offline ) %] |
26 |
[% IF ( harvester.offline ) %] |
124 |
<div class="alert"> |
27 |
<div class="alert"> |
Lines 128-137
Link Here
|
128 |
<div id="dashboard-items" class="toptabs"> |
31 |
<div id="dashboard-items" class="toptabs"> |
129 |
<ul> |
32 |
<ul> |
130 |
<li> |
33 |
<li> |
131 |
<a href="#saved_requests">Saved requests <span id="saved_count">([% saved_requests.size %])</span></a> |
34 |
<a href="#saved_requests">Saved requests <span id="saved_count">([% saved_requests.size | html %])</span></a> |
132 |
</li> |
35 |
</li> |
133 |
<li> |
36 |
<li> |
134 |
<a href="#submitted_requests">Submitted requests <span id="submitted_count">([% submitted_requests.size %])</span></a> |
37 |
<a href="#submitted_requests">Submitted requests <span id="submitted_count">([% submitted_requests.size | html %])</span></a> |
135 |
</li> |
38 |
</li> |
136 |
<li> |
39 |
<li> |
137 |
<a href="#imports">Import history <span id="import_count">(0)</span></a> |
40 |
<a href="#imports">Import history <span id="import_count">(0)</span></a> |
Lines 184-198
Link Here
|
184 |
[% IF ( submitted_requests ) %] |
87 |
[% IF ( submitted_requests ) %] |
185 |
[% FOREACH submitted_request IN submitted_requests %] |
88 |
[% FOREACH submitted_request IN submitted_requests %] |
186 |
<tr> |
89 |
<tr> |
187 |
<td>[% submitted_request.name %]</td> |
90 |
<td>[% submitted_request.name | html %]</td> |
188 |
<td>[% submitted_request.parameters.oai_pmh.baseURL %]</td> |
91 |
<td>[% submitted_request.parameters.oai_pmh.baseURL | html %]</td> |
189 |
<td>[% submitted_request.parameters.oai_pmh.set %]</td> |
92 |
<td>[% submitted_request.parameters.oai_pmh.set | html %]</td> |
190 |
<td>[% submitted_request.parameters.oai_pmh.from %]</td> |
93 |
<td>[% submitted_request.parameters.oai_pmh.from | html %]</td> |
191 |
<td>[% submitted_request.parameters.oai_pmh.until %]</td> |
94 |
<td>[% submitted_request.parameters.oai_pmh.until | html %]</td> |
192 |
<td>[% submitted_request.interval %]</td> |
95 |
<td>[% submitted_request.interval | html %]</td> |
193 |
<td>[% submitted_request.effective_from %]</td> |
96 |
<td>[% submitted_request.effective_from | html %]</td> |
194 |
<td>[% submitted_request.effective_until %]</td> |
97 |
<td>[% submitted_request.effective_until | html %]</td> |
195 |
<td>[% submitted_request.pending_imports %]</td> |
98 |
<td>[% submitted_request.pending_imports |html %]</td> |
196 |
<td> |
99 |
<td> |
197 |
[% IF ( submitted_status = submitted_request.status ) %] |
100 |
[% IF ( submitted_status = submitted_request.status ) %] |
198 |
[% IF ( submitted_status == "new" ) %] |
101 |
[% IF ( submitted_status == "new" ) %] |
Lines 214-226
Link Here
|
214 |
<a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a> |
117 |
<a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a> |
215 |
<ul class="dropdown-menu pull-right" role="menu"> |
118 |
<ul class="dropdown-menu pull-right" role="menu"> |
216 |
<li> |
119 |
<li> |
217 |
<a href="[% dashboard_page %]?op=start&uuid=[% submitted_request.uuid %]"><i class="fa fa-play"></i> Start</a> |
120 |
<a href="[% dashboard_page | url %]?op=start&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-play"></i> Start</a> |
218 |
</li> |
121 |
</li> |
219 |
<li> |
122 |
<li> |
220 |
<a href="[% dashboard_page %]?op=stop&uuid=[% submitted_request.uuid %]"><i class="fa fa-stop"></i> Stop</a> |
123 |
<a href="[% dashboard_page | url %]?op=stop&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-stop"></i> Stop</a> |
221 |
</li> |
124 |
</li> |
222 |
<li> |
125 |
<li> |
223 |
<a href="[% dashboard_page %]?op=delete&uuid=[% submitted_request.uuid %]"><i class="fa fa-trash"></i> Delete</a> |
126 |
<a href="[% dashboard_page | url %]?op=delete&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-trash"></i> Delete</a> |
224 |
</li> |
127 |
</li> |
225 |
</ul> |
128 |
</ul> |
226 |
</div> |
129 |
</div> |
Lines 264-283
Link Here
|
264 |
[% IF ( saved_requests ) %] |
167 |
[% IF ( saved_requests ) %] |
265 |
[% FOREACH saved_request IN saved_requests %] |
168 |
[% FOREACH saved_request IN saved_requests %] |
266 |
<tr> |
169 |
<tr> |
267 |
<td>[% saved_request.name %]</td> |
170 |
<td>[% saved_request.name | html %]</td> |
268 |
<td>[% saved_request.http_url %]</td> |
171 |
<td>[% saved_request.http_url | html %]</td> |
269 |
<!-- <td>[% saved_request.oai_verb %]</td> |
172 |
<!-- <td>[% saved_request.oai_verb | html %]</td> |
270 |
<td>[% saved_request.oai_metadataPrefix %]</td> |
173 |
<td>[% saved_request.oai_metadataPrefix | html %]</td> |
271 |
<td>[% saved_request.oai_identifier %]</td> --> |
174 |
<td>[% saved_request.oai_identifier | html %]</td> --> |
272 |
<td>[% saved_request.oai_set %]</td> |
175 |
<td>[% saved_request.oai_set | html %]</td> |
273 |
<td>[% saved_request.oai_from %]</td> |
176 |
<td>[% saved_request.oai_from | html %]</td> |
274 |
<td>[% saved_request.oai_until %]</td> |
177 |
<td>[% saved_request.oai_until | html %]</td> |
275 |
<td>[% saved_request.interval %]</td> |
178 |
<td>[% saved_request.interval | html %]</td> |
276 |
<!-- <td> |
179 |
<!-- <td> |
277 |
[% IF ( saved_request.import_filter == "default" ) %] |
180 |
[% IF ( saved_request.import_filter == "default" ) %] |
278 |
<span>Default</span> |
181 |
<span>Default</span> |
279 |
[% ELSE %] |
182 |
[% ELSE %] |
280 |
[% saved_request.import_filter %] |
183 |
[% saved_request.import_filter | html %] |
281 |
[% END %] |
184 |
[% END %] |
282 |
</td> |
185 |
</td> |
283 |
<td> |
186 |
<td> |
Lines 288-303
Link Here
|
288 |
[% END %] |
191 |
[% END %] |
289 |
[% END %] |
192 |
[% END %] |
290 |
[% IF ( display_framework ) %] |
193 |
[% IF ( display_framework ) %] |
291 |
[% display_framework.frameworktext %] |
194 |
[% display_framework.frameworktext | html %] |
292 |
[% ELSE %] |
195 |
[% ELSE %] |
293 |
[% saved_request.import_framework_code %] |
196 |
[% saved_request.import_framework_code | html %] |
294 |
[% END %] |
197 |
[% END %] |
295 |
</td> |
198 |
</td> |
296 |
<td> |
199 |
<td> |
297 |
[% IF ( saved_request.import_record_type == "biblio" ) %] |
200 |
[% IF ( saved_request.import_record_type == "biblio" ) %] |
298 |
<span>Bibliographic</span> |
201 |
<span>Bibliographic</span> |
299 |
[% ELSE %] |
202 |
[% ELSE %] |
300 |
[% saved_request.import_record_type %] |
203 |
[% saved_request.import_record_type | html %] |
301 |
[% END %] |
204 |
[% END %] |
302 |
</td> |
205 |
</td> |
303 |
<td> |
206 |
<td> |
Lines 308-316
Link Here
|
308 |
[% END %] |
211 |
[% END %] |
309 |
[% END %] |
212 |
[% END %] |
310 |
[% IF ( display_matcher ) %] |
213 |
[% IF ( display_matcher ) %] |
311 |
[% display_matcher.description %] |
214 |
[% display_matcher.description | html %] |
312 |
[% ELSE %] |
215 |
[% ELSE %] |
313 |
[% saved_request.import_matcher_code %] |
216 |
[% saved_request.import_matcher_code | html %] |
314 |
[% END %] |
217 |
[% END %] |
315 |
</td> --> |
218 |
</td> --> |
316 |
<td> |
219 |
<td> |
Lines 318-333
Link Here
|
318 |
<a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a> |
221 |
<a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a> |
319 |
<ul class="dropdown-menu pull-right" role="menu"> |
222 |
<ul class="dropdown-menu pull-right" role="menu"> |
320 |
<li> |
223 |
<li> |
321 |
<a href="[% request_page %]?op=edit&id=[% saved_request.id %]"><i class="fa fa-pencil"></i> Edit</a> |
224 |
<a href="[% request_page | url %]?op=edit&id=[% saved_request.id | url %]"><i class="fa fa-pencil"></i> Edit</a> |
322 |
</li> |
225 |
</li> |
323 |
<li> |
226 |
<li> |
324 |
<a href="[% request_page %]?op=new&id=[% saved_request.id %]"><i class="fa fa-copy"></i> Copy</a> |
227 |
<a href="[% request_page | url %]?op=new&id=[% saved_request.id | url %]"><i class="fa fa-copy"></i> Copy</a> |
325 |
</li> |
228 |
</li> |
326 |
<li> |
229 |
<li> |
327 |
<a href="[% dashboard_page %]?op=send&id=[% saved_request.id %]"><i class="fa fa-send"></i> Submit</a> |
230 |
<a href="[% dashboard_page | url %]?op=send&id=[% saved_request.id | url %]"><i class="fa fa-send"></i> Submit</a> |
328 |
</li> |
231 |
</li> |
329 |
<li> |
232 |
<li> |
330 |
<a href="[% request_page %]?op=delete&id=[% saved_request.id %]"><i class="fa fa-trash"></i> Delete</a> |
233 |
<a href="[% request_page | url %]?op=delete&id=[% saved_request.id | url %]"><i class="fa fa-trash"></i> Delete</a> |
331 |
</li> |
234 |
</li> |
332 |
</ul> |
235 |
</ul> |
333 |
</div> |
236 |
</div> |
Lines 366-369
Link Here
|
366 |
[% INCLUDE 'tools-menu.inc' %] |
269 |
[% INCLUDE 'tools-menu.inc' %] |
367 |
</div> |
270 |
</div> |
368 |
</div> |
271 |
</div> |
|
|
272 |
|
273 |
[% MACRO jsinclude BLOCK %] |
274 |
[% INCLUDE 'datatables.inc' %] |
275 |
[% INCLUDE 'columns_settings.inc' %] |
276 |
<script type="text/javascript"> |
277 |
$(document).ready(function() { |
278 |
$('#dashboard-items').tabs(); |
279 |
[% IF ( result.start.defined || result.stop.defined || result.delete.defined ) %] |
280 |
$('#dashboard-items').tabs("option","active",1); |
281 |
[% END %] |
282 |
|
283 |
var saved_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'saved-table', 'json' ) | $raw %]; |
284 |
var saved_table = KohaTable("saved-table",{},saved_table_columns_settings); |
285 |
|
286 |
var submitted_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'submitted-table', 'json' ) | $raw %]; |
287 |
var submitted_table = KohaTable("submitted-table",{},submitted_table_columns_settings); |
288 |
|
289 |
var history_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'history-table', 'json' ) | $raw %]; |
290 |
var history_table = KohaTable("history-table",{ |
291 |
serverSide: true, |
292 |
searching: true, |
293 |
processing: true, |
294 |
ajax: { |
295 |
"url": '/cgi-bin/koha/svc/oai-pmh-harvester/history', |
296 |
contentType: 'application/json', |
297 |
type: 'POST', |
298 |
data: function ( d ) { |
299 |
return JSON.stringify( d ); |
300 |
}, |
301 |
dataSrc: function (json){ |
302 |
var recordsTotal = json.recordsTotal; |
303 |
if(recordsTotal){ |
304 |
$('#import_count').text( "("+recordsTotal+")" ); |
305 |
} |
306 |
return json.data; |
307 |
} |
308 |
}, |
309 |
columns: [ |
310 |
{ data: 'import_oai_id', }, |
311 |
{ data: 'repository', }, |
312 |
{ data: 'header_identifier', }, |
313 |
{ data: 'header_datestamp', }, |
314 |
{ |
315 |
data: 'header_status', render: function (data, type, full, meta){ |
316 |
var display_string = _("Active"); |
317 |
if (data == "deleted"){ |
318 |
display_string = _("Deleted"); |
319 |
} |
320 |
return display_string; |
321 |
} |
322 |
}, |
323 |
{ |
324 |
data: 'status', render: function (data, type, full, meta){ |
325 |
var display_string = data; |
326 |
if (data == "added"){ |
327 |
display_string = _("Added"); |
328 |
} |
329 |
else if (data == "error"){ |
330 |
display_string = _("Error"); |
331 |
} |
332 |
else if (data == "not_found"){ |
333 |
display_string = _("Not found"); |
334 |
} |
335 |
else if (data == "updated"){ |
336 |
display_string = _("Updated"); |
337 |
} |
338 |
return display_string; |
339 |
} |
340 |
}, |
341 |
{ data: 'upload_timestamp', }, |
342 |
{ |
343 |
data: 'imported_record', render: function (data, type, full, meta){ |
344 |
var display_string = data; |
345 |
var record_type = (full.record_type) ? full.record_type : 'biblio'; |
346 |
if (data && record_type == 'biblio'){ |
347 |
var link_text = _("View biblio record"); |
348 |
var link = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='+data+'">'+link_text+'</a>'; |
349 |
display_string = link; |
350 |
} |
351 |
return display_string; |
352 |
}, searchable: false |
353 |
|
354 |
}, |
355 |
{ |
356 |
data: 'import_oai_id', render: function (data, type, full, meta){ |
357 |
var display_string = data; |
358 |
var link_text = _("View record"); |
359 |
var link = '<a href="/cgi-bin/koha/tools/oai-pmh-harvester/record.pl?import_oai_id='+data+'">'+link_text+'</a>'; |
360 |
display_string = link; |
361 |
return display_string; |
362 |
}, searchable: false |
363 |
}, |
364 |
], |
365 |
//In theory, it would be nice to sort in descending order, but |
366 |
//it causes severe paging issues the data is frequently updated. |
367 |
//Caching would make the paging more stable, but the results would be stale. |
368 |
order: [ |
369 |
[ 0, 'asc' ], |
370 |
] |
371 |
},history_table_columns_settings); |
372 |
$('#refresh-button').click(function(){ |
373 |
history_table.ajax.reload( null, false ); |
374 |
}); |
375 |
}); |
376 |
</script> |
377 |
[% END %] |
369 |
[% INCLUDE 'intranet-bottom.inc' %] |
378 |
[% INCLUDE 'intranet-bottom.inc' %] |