@@ -, +, @@ - Apply the patch and go to Acquisitions -> EDIFACT messages. - In the table of messages, the date should be displayed according to your system preference. - Sorting by date should work correctly regardless of date format setting. - The 'Actions' column should contain 'View message' and 'Delete' Bootstrap-style buttons with Font Awesome icons. The column should be unsorted. - Clicking the 'Delete' button should prompt you to confirm. - Clicking the 'View message' button should trigger a modal which loads the message data. - Test the page with no messages or when all messages have been deleted. The page should display a standard message dialog instead of an empty table. --- .../prog/en/modules/acqui/edifactmsgs.tt | 78 +++++++++++++++++----- .../intranet-tmpl/prog/en/modules/acqui/edimsg.tt | 40 +++++------ 2 files changed, 83 insertions(+), 35 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -1,5 +1,6 @@ +[% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Acquisitions +Koha › Acquisitions › EDIFACT messages [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] @@ -7,11 +8,37 @@ $(document).ready(function() { $('#edi_msgs').dataTable($.extend(true, {}, dataTablesDefaults, { 'aaSorting': [[1, "desc" ]], - 'sPaginationType': "four_button" - })); + 'sPaginationType': "four_button", + "aoColumnDefs": [ + { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, + { "sType": "title-string", "aTargets" : [ "title-string" ] } + ] + })); + + var EDIModal = $("#EDI_modal"); + var EDIModalBody = $("#EDI_modal .modal-body"); + + $(".view_message").on("click", function(e){ + e.preventDefault(); + var page = $(this).attr("href"); + EDIModalBody.load(page + " #edimsg"); + EDIModal.modal("show"); + }); + EDIModal.on("click",".closebtn",function(e){ + e.preventDefault(); + EDIModal.modal("hide"); + }); + EDIModal.on("hidden", function(){ + EDIModalBody.html("
\"\" "+_("Loading")+"
"); + }); + $(".delete_msg").on("click",function(){ + return confirm(_("Are you sure you want to delete this message?")); + }); }); - + [% INCLUDE 'header.inc' %] @@ -32,27 +59,29 @@ $(document).ready(function() {

EDIFACT messages

- +[% IF ( messages ) %] + - + - - + + [% FOREACH msg IN messages %] - + - - - [% END %] @@ -80,6 +109,25 @@ $(document).ready(function() {
TypeTransferredTransferred Status Vendor Details Filename ActionActions
[% msg.message_type %][% msg.transfer_date %][% msg.transfer_date | $KohaDates %] [% msg.status %] - -[% msg.vendor.name %] + + [% msg.vendor.name %] + [% IF msg.message_type == 'QUOTE' || msg.message_type == 'ORDERS' %] @@ -68,11 +97,11 @@ $(document).ready(function() { [% END %] [% msg.filename %]View message -Delete + + + View message + Delete
+ + + + +[% ELSE %] +
There are no EDIFACT messages.
+[% END %] +
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edimsg.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edimsg.tt @@ -12,24 +12,24 @@
- -[% IF no_message %] -
The requested message cannot be displayed
-[% ELSE %] -
-
-
-
    - [% FOREACH seg IN segments %] -
  • [% seg | html %]
  • - [% END %] -
-[% END %] - -
-
-
-[% INCLUDE 'acquisitions-menu.inc' %] -
-
+
+
+
+
+ [% IF no_message %] +
The requested message cannot be displayed
+ [% ELSE %] +
    + [% FOREACH seg IN segments %] +
  • [% seg | html %]
  • + [% END %] +
+ [% END %] +
+
+
+
+ [% INCLUDE 'acquisitions-menu.inc' %] +
+
[% INCLUDE 'intranet-bottom.inc' %] --