@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 87 +++++++++++++--------------- 1 file changed, 41 insertions(+), 46 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -554,9 +554,9 @@ $(document).ready(function() { let content = ""; if ( oObj.return_claim_id ) { - content = `${oObj.return_claim_created_on_formatted}`; + content = '' + oObj.return_claim_created_on_formatted + ''; } else { - content = ` ${RETURN_CLAIMED_MAKE}`; + content = '' + RETURN_CLAIMED_MAKE + ''; } return content; } @@ -845,7 +845,7 @@ $(document).ready(function() { $('#claims-returned-modal').modal('hide') - $(`.claim-returned-btn[data-itemnumber='${itemnumber}']`).replaceWith(``); + $('.claim-returned-btn[data-itemnumber="' + itemnumber + '"]').replaceWith('${created_on.toLocaleDateString()}`; + content = '' + created_on.toLocaleDateString() + ''; $(id).parent().parent().addClass('ok'); } else { content = RETURN_CLAIMED_FAILURE; @@ -900,14 +900,14 @@ $(document).ready(function() { }, { "mDataProp": function ( oObj ) { - let title = ` - ${oObj.title} - ${oObj.enumchron || ""} - `; + let title = '' + + oObj.title + + ( oObj.enumchron || "" ) + + ''; if ( oObj.author ) { - title += `by ${oObj.author}`; + title += 'by ' + oObj.author; } - title += `${oObj.barcode}`; + title += '' + oObj.barcode + ''; return title; } @@ -915,10 +915,8 @@ $(document).ready(function() { { "sClass": "return-claim-notes-td", "mDataProp": function ( oObj ) { - return ` - ${oObj.notes} - - `; + return '' + oObj.notes + '' + + ''; } }, { @@ -937,32 +935,30 @@ $(document).ready(function() { "mDataProp": function ( oObj ) { if ( ! oObj.resolution ) return ""; - let desc = `${oObj.resolution_data.lib} on ${oObj.resolved_on}`; - if (oObj.resolved_by_data) desc += ` by ${oObj.resolved_by_data.firstname || ""} ${oObj.resolved_by_data.surname || ""}`; + let desc = '' + oObj.resolution_data.lib + ' on ' + oObj.resolved_on + ''; + if (oObj.resolved_by_data) desc += ' by ' + ( oObj.resolved_by_data.firstname || "" ) + ( oObj.resolved_by_data.surname || "" ) + ''; return desc; } }, { "mDataProp": function ( oObj ) { let delete_html = oObj.resolved_on - ? `
  • Delete
  • ` + ? '
  • Delete
  • ' : ""; let resolve_html = ! oObj.resolution - ? `
  • Resolve
  • ` + ? '
  • Resolve
  • ' : ""; - return ` -
    - - -
    - `; + return '
    ' + + ' ' + + ' ' + + '
    '; } }, ], @@ -989,21 +985,20 @@ $(document).ready(function() { $('body').on('click', '.return-claim-tools-editnotes', function() { let id = $(this).data('return-claim-id'); - $(`#return-claim-notes-static-${id}`).parent().dblclick(); + $('#return-claim-notes-static-' + id).parent().dblclick(); }); $('body').on('dblclick', '.return-claim-notes-td', function() { let elt = $(this).children('.return-claim-notes'); let id = elt.data('return-claim-id'); - if ( $(`#return-claim-notes-editor-textarea-${id}`).length == 0 ) { + if ( $('#return-claim-notes-editor-textarea-' + id).length == 0 ) { let note = elt.text(); - let editor = ` - - -
    - Update - Cancel -
    - `; + let editor = + ' ' + + ' ' + + '
    ' + + ' Update' + + ' Cancel' + + '
    '; elt.hide(); $(editor).insertAfter( elt ); } @@ -1011,7 +1006,7 @@ $(document).ready(function() { $('body').on('click', '.claim-returned-notes-editor-submit', function(){ let id = $(this).data('return-claim-id'); - let notes = $(`#return-claim-notes-editor-textarea-${id}`).val(); + let notes = $('#return-claim-notes-editor-textarea-' + id).val(); let params = { notes: notes, @@ -1021,11 +1016,11 @@ $(document).ready(function() { $(this).parent().remove(); $.ajax({ - url: `/api/v1/return_claims/${id}/notes`, + url: '/api/v1/return_claims/' + id + '/notes', type: 'PUT', data: JSON.stringify(params), success: function( data ) { - let notes = $(`#return-claim-notes-static-${id}`); + let notes = $('#return-claim-notes-static-' + id); notes.text(data.notes); notes.show(); }, @@ -1036,7 +1031,7 @@ $(document).ready(function() { $('body').on('click', '.claim-returned-notes-editor-cancel', function(){ let id = $(this).data('return-claim-id'); $(this).parent().remove(); - $(`#return-claim-notes-static-${id}`).show(); + $('#return-claim-notes-static-' + id).show(); }); // Hanld return claim deletion @@ -1046,7 +1041,7 @@ $(document).ready(function() { let id = $(this).data('return-claim-id'); $.ajax({ - url: `/api/v1/return_claims/${id}`, + url: '/api/v1/return_claims/' + id, type: 'DELETE', success: function( data ) { refreshReturnClaimsTable(); @@ -1076,7 +1071,7 @@ $(document).ready(function() { }; $.ajax({ - url: `/api/v1/return_claims/${id}/resolve`, + url: '/api/v1/return_claims/' + id + '/resolve', type: 'PUT', data: JSON.stringify(params), success: function( data ) { --