|
Lines 238-243
Link Here
|
| 238 |
[% END %] |
238 |
[% END %] |
| 239 |
]; |
239 |
]; |
| 240 |
|
240 |
|
|
|
241 |
const op = "[% op | html %]"; |
| 242 |
const job = { |
| 243 |
status: "[% job.status | html %]", |
| 244 |
type: "[% job.type | html %]", |
| 245 |
}; |
| 246 |
</script> |
| 247 |
|
| 248 |
<script> |
| 241 |
function get_job_type (job_type) { |
249 |
function get_job_type (job_type) { |
| 242 |
let job_type_lib = job_types.find( t => t._id == job_type ); |
250 |
let job_type_lib = job_types.find( t => t._id == job_type ); |
| 243 |
if ( job_type_lib ) { |
251 |
if ( job_type_lib ) { |
|
Lines 247-257
Link Here
|
| 247 |
} |
255 |
} |
| 248 |
|
256 |
|
| 249 |
$(document).ready(function() { |
257 |
$(document).ready(function() { |
| 250 |
[% IF op == 'view' %] |
258 |
if (op == 'view'){ |
| 251 |
$("#job_status_description").html( get_job_status("[% job.status | html %]") ); |
259 |
$("#job_status_description").html( get_job_status(job.status) ); |
| 252 |
$("#job_type_description").html( get_job_type("[% job.type | html %]") ); |
260 |
$("#job_type_description").html( get_job_type(job.type) ); |
| 253 |
$("#job_details").show(); |
261 |
$("#job_details").show(); |
| 254 |
[% END %] |
262 |
} |
| 255 |
|
263 |
|
| 256 |
let only_current_filter = function(){ |
264 |
let only_current_filter = function(){ |
| 257 |
if ( $("#only_current").is(":checked") ) { |
265 |
if ( $("#only_current").is(":checked") ) { |
|
Lines 324-330
Link Here
|
| 324 |
data: function( row, type, val, meta ) { |
332 |
data: function( row, type, val, meta ) { |
| 325 |
var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id='+ encodeURIComponent(row.job_id) +'"><i class="fa-solid fa-eye aria-hidden="true"></i> '+_("View")+'</a>'+"\n"; |
333 |
var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id='+ encodeURIComponent(row.job_id) +'"><i class="fa-solid fa-eye aria-hidden="true"></i> '+_("View")+'</a>'+"\n"; |
| 326 |
if ( row.status == 'new' || row.status == 'started' ) { |
334 |
if ( row.status == 'new' || row.status == 'started' ) { |
| 327 |
result += '<a class="btn btn-default btn-xs submit-form-link" role="button" href="#" data-action="/cgi-bin/koha/admin/background_jobs.pl" data-method="post" data-op="cud-cancel" data-confirmation-msg="[% t('Are you sure you want to cancel this job?') | html %]" data-id="'+ encodeURIComponent(row.job_id) +'"><i class="fa fa-trash-can" aria-hidden="true"></i> '+_("Cancel")+'</a>'; |
335 |
result += '<a class="btn btn-default btn-xs submit-form-link" role="button" href="#" data-action="/cgi-bin/koha/admin/background_jobs.pl" data-method="post" data-op="cud-cancel" data-confirmation-msg="' + _("Are you sure you want to cancel this job?") + '" data-id="'+ encodeURIComponent(row.job_id) +'"><i class="fa fa-trash-can" aria-hidden="true"></i> '+_("Cancel")+'</a>'; |
| 328 |
} |
336 |
} |
| 329 |
return result; |
337 |
return result; |
| 330 |
}, |
338 |
}, |
| 331 |
- |
|
|