|
Lines 37-80
Link Here
|
| 37 |
</div> |
37 |
</div> |
| 38 |
<!-- /#acqui_edifactmsgs --> |
38 |
<!-- /#acqui_edifactmsgs --> |
| 39 |
|
39 |
|
| 40 |
<!-- Modal to display EDIFACT messages --> |
40 |
[% INCLUDE 'modals/edifact-modal.inc' %] |
| 41 |
<div class="modal" id="EDI_modal" tabindex="-1" role="dialog" aria-labelledby="EDI_modal_label" aria-hidden="true"> |
|
|
| 42 |
<div class="modal-dialog modal-lg"> |
| 43 |
<div class="modal-content"> |
| 44 |
<div class="modal-header"> |
| 45 |
<h1 class="modal-title" id="EDI_modal_label">EDIFACT message</h1> |
| 46 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 47 |
</div> |
| 48 |
<div class="modal-body"> </div> |
| 49 |
<div class="modal-footer"> |
| 50 |
<button class="btn btn-default" data-bs-dismiss="modal">Close</button> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
</div> |
| 54 |
</div> |
| 55 |
|
| 56 |
<!-- Modal to display EDIFACT errors --> |
| 57 |
<div class="modal" id="EDI_errors_modal" tabindex="-1" role="dialog" aria-labelledby="EDI_errors_modal_label" aria-hidden="true"> |
| 58 |
<div class="modal-dialog modal-lg"> |
| 59 |
<div class="modal-content"> |
| 60 |
<div class="modal-header"> |
| 61 |
<h1 class="modal-title" id="EDI_errors_modal_label">EDIFACT processing errors for <span id="EDI_errors_filename"></span></h1> |
| 62 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 63 |
</div> |
| 64 |
<div class="modal-body"> |
| 65 |
<div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div> |
| 66 |
</div> |
| 67 |
<div class="modal-footer"> |
| 68 |
<button class="btn btn-default" data-bs-dismiss="modal">Close</button> |
| 69 |
</div> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
[% END %] |
41 |
[% END %] |
| 74 |
|
42 |
|
| 75 |
[% MACRO jsinclude BLOCK %] |
43 |
[% MACRO jsinclude BLOCK %] |
| 76 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
44 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
| 77 |
[% INCLUDE 'datatables.inc' %] |
45 |
[% INCLUDE 'datatables.inc' %] |
|
|
46 |
[% Asset.js("js/modals/edifact-modal.js") | $raw %] |
| 78 |
<script> |
47 |
<script> |
| 79 |
$(document).ready(function() { |
48 |
$(document).ready(function() { |
| 80 |
let edi_msgs_table_url = '/api/v1/acquisitions/edifiles?'; |
49 |
let edi_msgs_table_url = '/api/v1/acquisitions/edifiles?'; |
|
Lines 189-231
Link Here
|
| 189 |
] |
158 |
] |
| 190 |
}, 0, 0); |
159 |
}, 0, 0); |
| 191 |
|
160 |
|
| 192 |
var EDIModal = $("#EDI_modal"); |
|
|
| 193 |
var EDIModalBody = $("#EDI_modal .modal-body"); |
| 194 |
|
| 195 |
$("body").on("click", ".view_message", function(e){ |
| 196 |
e.preventDefault(); |
| 197 |
var page = $(this).attr("href"); |
| 198 |
EDIModalBody.load(page + " #edimsg"); |
| 199 |
EDIModal.modal("show"); |
| 200 |
}); |
| 201 |
EDIModal.on("click",".btn-close",function(e){ |
| 202 |
e.preventDefault(); |
| 203 |
EDIModal.modal("hide"); |
| 204 |
}); |
| 205 |
EDIModal.on("hidden.bs.modal", function(){ |
| 206 |
EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
| 207 |
}); |
| 208 |
|
| 209 |
const errorsModal = document.getElementById('EDI_errors_modal') |
| 210 |
if (errorsModal) { |
| 211 |
errorsModal.addEventListener('show.bs.modal', event => { |
| 212 |
// Link that triggered the modal |
| 213 |
const link = event.relatedTarget |
| 214 |
|
| 215 |
// Extract info from data-bs-* attributes |
| 216 |
const filename = link.getAttribute('data-bs-filename') |
| 217 |
const errors = link.getAttribute('data-bs-errors') |
| 218 |
|
| 219 |
// Update the modal's title. |
| 220 |
const modalTitleSpan = errorsModal.querySelector('.modal-title #EDI_errors_filename') |
| 221 |
modalTitleSpan.textContent = filename; |
| 222 |
|
| 223 |
// Update the modal's content. |
| 224 |
const modalBody = errorsModal.querySelector('.modal-body') |
| 225 |
modalBody.innerHTML = errors; |
| 226 |
}) |
| 227 |
} |
| 228 |
|
| 229 |
$("body").on("click", ".delete_msg" ,function(){ |
161 |
$("body").on("click", ".delete_msg" ,function(){ |
| 230 |
return confirm(_("Are you sure you want to delete this message?")); |
162 |
return confirm(_("Are you sure you want to delete this message?")); |
| 231 |
}); |
163 |
}); |
|
Lines 233-236
Link Here
|
| 233 |
</script> |
165 |
</script> |
| 234 |
[% END %] |
166 |
[% END %] |
| 235 |
|
167 |
|
| 236 |
[% INCLUDE 'intranet-bottom.inc' %] |
168 |
[% INCLUDE 'intranet-bottom.inc' %] |