Bug 17698: (QA follow-up) few more things
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 13 Jun 2018 13:18:17 +0000 (10:18 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 23 Jul 2018 15:23:43 +0000 (15:23 +0000)
1. body tag was missing
2. make "Date" column sortable correctly
3. remove CDATA and type="text/javascript"
4. Handle server-side errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt

index ae954ca..4b99a49 100644 (file)
@@ -8,6 +8,9 @@
 [% INCLUDE 'doc-head-close.inc' %]
 [% Asset.css("css/datatables.css") %]
 </head>
+
+<body id="circ_checkout-notes" class="circ">
+
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'circ-search.inc' %]
 <div id="breadcrumbs">
@@ -58,7 +61,7 @@
                                 <th>&nbsp;</th>
                                 <th>Title</th>
                                 <th>Note</th>
-                                <th>Date</th>
+                                <th class="title-string">Date</th>
                                 <th>Set by</th>
                                 <th>Status</th>
                                 <th>Actions</th>
@@ -70,7 +73,7 @@
                                     <td><input type="checkbox" name="issue_ids" value="[% note.issue_id %]"></td>
                                     <td>[% note.item.biblio.title %] - [% note.item.biblio.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber %]">[% note.item.barcode %]</a>)</td>
                                     <td>[% note.note | html %]</td>
-                                    <td>[% note.notedate | $KohaDates %]</td>
+                                    <td><span title="[% note.notedate %]">[% note.notedate | $KohaDates %]</span></td>
                                     <td>[% INCLUDE 'patron-title.inc' patron => note.patron hide_patron_infos_if_needed=1 %]</td>
                                     <td class="seen[% note.noteseen %]">
                                         [% IF ( note.noteseen == 0 ) %]
     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
     [% INCLUDE 'calendar.inc' %]
     [% INCLUDE 'datatables.inc' %]
-    <script type="text/javascript">
-    //<![CDATA[
+    <script>
         $(document).ready(function(){
             $("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, {
                 "aoColumnDefs": [
                     { "aTargets": [ 0, -1 ], "bSearchable": false, "bSortable": false },
+                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
                 ],
                 "sPaginationType": "four_button"
             }));
                         $("#error").text(_("Unable to change status of note."));
                         $("#error").show();
                     }
+                })
+                .error(function(data){
+                    $("#error").text(_("Unable to change status of note."));
+                    $("#error").show();
                 });
             });
         });
-    //]]>
     </script>
 [% END %]