Bug 22975: Remove type attribute from script tags: Acquisitions
authorOwen Leonard <oleonard@myacpl.org>
Thu, 23 May 2019 13:50:07 +0000 (13:50 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 30 May 2019 10:25:53 +0000 (10:25 +0000)
This patch removes the "type" attribute from <script> tags in several
acquisitions templates. Also removed: Obsolete "//<![CDATA[ //]]>"
markers.

This patch also makes minor indentation changes, so diff using the "-w"
flag.

To test, apply the patch and confirm that examples of affected pages
work properly without any JavaScript errors in the browser console:

 - Acquisitions -> Vendors -> Vendor -> Basket groups
 - Acquisitions -> Vendors -> Vendor -> Receive shipments
 - Acquisitions -> Vendors -> Vendor -> Basket:
   In the table of orders, click "Transfer." Transfer an order

Validating the HTML source of any of these pages should return no errors
related to the "type" attribute.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt

index 4ce2bd8..c3df514 100644 (file)
@@ -86,42 +86,38 @@ fieldset.various li {
 
 </style>
  [% END %]
-<script type="text/javascript">
-//<![CDATA[
-       YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
+<script>
+    YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true);
 
-var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
-var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
-var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
-var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
-var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
+    var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?");
+    var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?");
+    var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing");
+    var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup");
+    var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file");
 
-function submitForm(form) {
-    if (form.close.checked == true) {
-       var input = document.createElement("input");
-       input.setAttribute("type", "hidden");
-       input.setAttribute("name", "closed");
-       input.setAttribute("value", "1");
-       form.appendChild(input);
+    function submitForm(form) {
+        if (form.close.checked == true) {
+            var input = document.createElement("input");
+            input.setAttribute("type", "hidden");
+            input.setAttribute("name", "closed");
+            input.setAttribute("value", "1");
+            form.appendChild(input);
+        }
     }
-}
-
- $(document).ready(function() {
-    $("#basket_groups").tabs();
-
-    $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
-        "aoColumnDefs": [
-            { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
-        ],
-        "bAutoWidth": false,
-        "sPaginationType": "four_button"
-    } ));
 
- });
+    $(document).ready(function() {
+        $("#basket_groups").tabs();
 
-
-//]]>
+        $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "aoColumnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+            ],
+            "bAutoWidth": false,
+            "sPaginationType": "four_button"
+        } ));
+    });
 </script>
+
 </head>
 <body id="acq_basketgroup" class="acq">
 [% INCLUDE 'header.inc' %]
index aaf9ad4..3ee304e 100644 (file)
     [% Asset.js("js/acquisitions-menu.js") | $raw %]
     [% INCLUDE 'calendar.inc' %]
     [% INCLUDE 'datatables.inc' %]
-    <script type="text/javascript">
+    <script>
         $(document).ready(function() {
             var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
                 "aoColumnDefs": [
index 3870d2f..d4142ca 100644 (file)
 
 [% MACRO jsinclude BLOCK %]
     [% IF transferred %]
-        <script type="text/javascript">
+        <script>
             opener.location.reload();
             window.close();
         </script>
     [% END %]
 
     [% IF ( bookselleridfrom ) %]
-        <script type="text/javascript">
+        <script>
             $(document).ready(function(){
                 $(".confirm_transfer").on("click",function(){
                     return confirm( _("Transfer order to this basket?") );