Bug 15091: DEBT is IMPOSSIBLE, not NEEDSCONFIRMATION
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / columns_settings.inc
1 [% USE ColumnsSettings %]
2
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.colvis.css" />
4 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.colvis.js"></script>
5
6 <script type="text/javascript">
7 function KohaTable(selector, dt_parameters, columns_settings) {
8     var id = 0;
9     var hidden_ids = [];
10     var excluded_ids = [];
11     $(columns_settings).each( function() {
12         var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
13         var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id;
14         if ( used_id == -1 ) return;
15
16         if ( this['is_hidden'] == "1" ) {
17             hidden_ids.push( used_id );
18         }
19         if ( this['cannot_be_toggled'] == "1" ) {
20             excluded_ids.push( used_id );
21         }
22         id++;
23     });
24     dt_parameters[ "oColVis" ] = { "aiExclude": excluded_ids };
25     var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters));
26
27     $(hidden_ids).each(function(index, value) {
28         table.fnSetColumnVis( value, false );
29     });
30
31     return table;
32 }
33
34 </script>