Bug 29648: Authorised values view
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 16 Dec 2021 11:15:10 +0000 (12:15 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 27 Apr 2022 21:20:43 +0000 (11:20 -1000)
No change is expected on this view as the table is not part of the table
settings.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt

index 8eca9c2..424fcf0 100644 (file)
@@ -9,21 +9,23 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
     var included_ids = [];
     var selector = '#' + id_selector;
 
-    var columns_settings = table_settings['columns'];
+    if ( table_settings ) {
+        var columns_settings = table_settings['columns'];
 
-    $(columns_settings).each( function() {
-        var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
-        var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
-        if ( used_id == -1 ) return;
+        $(columns_settings).each( function() {
+            var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
+            var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
+            if ( used_id == -1 ) return;
 
-        if ( this['is_hidden'] == "1" ) {
-            hidden_ids.push( used_id );
-        }
-        if ( this['cannot_be_toggled'] == "0" ) {
-            included_ids.push( used_id );
-        }
-        counter++;
-    });
+            if ( this['is_hidden'] == "1" ) {
+                hidden_ids.push( used_id );
+            }
+            if ( this['cannot_be_toggled'] == "0" ) {
+                included_ids.push( used_id );
+            }
+            counter++;
+        });
+    }
 
     var exportColumns = ":visible:not(.noExport)";
     var exportRows = ":visible:not(.noExport)";
@@ -184,11 +186,13 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
         });
     }
 
-    if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) {
-        new_parameters["pageLength"] = table_settings['default_display_length'];
-    }
-    if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) {
-        new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]];
+    if ( table_settings ) {
+        if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) {
+            new_parameters["pageLength"] = table_settings['default_display_length'];
+        }
+        if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) {
+            new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]];
+        }
     }
 
     table.dataTable(new_parameters);
index e2ccd1a..04c7c87 100644 (file)
     [% INCLUDE 'columns_settings.inc' %]
     <script>
         $(document).ready(function() {
-            var columns_settings = []; // Empty because there are no columns we want to be configurable
 
             KohaTable("categoriest", {
                 "aaSorting": [[ 0, "asc" ]],
                 "sPaginationType": "full"
-            }, columns_settings);
+            });
 
             if ( $("#branches option:selected").length < 1 ) {
                 $("#branches option:first").attr("selected", "selected");