View | Details | Raw Unified | Return to bug 16759
Collapse All | Expand All

(-)a/admin/columns_settings.yml (+34 lines)
Lines 255-260 modules: Link Here
255
          cannot_be_toggled: 1
255
          cannot_be_toggled: 1
256
          cannot_be_modified: 1
256
          cannot_be_modified: 1
257
257
258
  opac:
259
    biblio-detail:
260
      holdingst:
261
        -
262
          columnname: item_itemtype
263
        -
264
          columnname: item_current_location
265
        -
266
          columnname: item_home_location
267
        -
268
          columnname: item_ccode
269
        -
270
          columnname: item_callnumber
271
        -
272
          columnname: item_enumchron
273
        -
274
          columnname: item_url
275
        -
276
          columnname: item_copy
277
        -
278
          columnname: item_status
279
        -
280
          columnname: item_notes
281
        -
282
          columnname: item_datedue
283
        -
284
          columnname: item_barcode
285
        -
286
          columnname: item_holds
287
        -
288
          columnname: item_priority
289
        -
290
          columnname: item_coursereserves
291
258
  reports:
292
  reports:
259
    lostitems:
293
    lostitems:
260
      lostitems-table:
294
      lostitems-table:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt (+6 lines)
Lines 156-161 Link Here
156
            [% PROCESS pagelist module=modules.members modulename="members" %]
156
            [% PROCESS pagelist module=modules.members modulename="members" %]
157
          </div>
157
          </div>
158
158
159
          <h3><a href="#opac">OPAC</a></h3>
160
          <div id="opac">
161
            <h4>OPAC tables</h4>
162
            [% PROCESS pagelist module=modules.opac modulename="opac" %]
163
          </div>
164
159
          <h3><a href="#reports">Reports</a></h3>
165
          <h3><a href="#reports">Reports</a></h3>
160
          <div id="reports">
166
          <div id="reports">
161
            <h4>Reports tables</h4>
167
            <h4>Reports tables</h4>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc (+37 lines)
Line 0 Link Here
1
[% USE ColumnsSettings %]
2
3
<script type="text/javascript">
4
function KohaTable(selector, dt_parameters, columns_settings) {
5
    var id = 0;
6
    var hidden_ids = [];
7
    var included_ids = [];
8
    $(columns_settings).each( function() {
9
        var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
10
        var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id;
11
        if ( used_id == -1 ) return;
12
13
        if ( this['is_hidden'] == "1" ) {
14
            hidden_ids.push( used_id );
15
        }
16
        if ( this['cannot_be_toggled'] == "0" ) {
17
            included_ids.push( used_id );
18
        }
19
        id++;
20
    });
21
    dt_parameters[ "buttons" ] = [
22
        {
23
            extend: 'colvis',
24
            columns: included_ids,
25
            text: _("Column visibility"),
26
        }
27
    ];
28
    var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters));
29
30
    $(hidden_ids).each(function(index, value) {
31
        table.fnSetColumnVis( value, false );
32
    });
33
34
    return table;
35
}
36
37
</script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-46 / +41 lines)
Lines 2-7 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE ColumnsSettings %]
5
[% USE AuthorisedValues %]
6
[% USE AuthorisedValues %]
6
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
7
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
7
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
8
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
Lines 1181-1208 Link Here
1181
    <table class="holdingst table table-bordered table-striped">
1182
    <table class="holdingst table table-bordered table-striped">
1182
        <thead>
1183
        <thead>
1183
            <tr>
1184
            <tr>
1184
                [% IF ( item_level_itypes ) %]<th id="item_itemtype" class="itype">Item type</th>[% END %]
1185
        [% IF ( item_level_itypes ) %]
1185
                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1186
                <th id="item_itemtype" data-colname="item_itemtype" class="itype">Item type</th>[% END %]
1186
                    <th id="item_current_location" class="item_location">Current location</th>
1187
        [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1187
                [% END %]
1188
                <th id="item_current_location" data-colname="item_current_location" class="item_location">Current location</th>[% END %]
1188
                [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1189
        [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1189
                    <th id="item_home_location" class="item_location">Home library</th>
1190
                <th id="item_home_location" data-colname="item_home_location" class="item_location">Home library</th>[% END %]
1190
                [% END %]
1191
        [% IF ( itemdata_ccode ) %]
1191
                [% IF ( itemdata_ccode ) %]<th id="item_ccode" class="collection">Collection</th>[% END %]
1192
                <th id="item_ccode" data-colname="item_ccode" class="collection">Collection</th>[% END %]
1192
                <th id="item_callnumber" class="call_no">Call number</th>
1193
                <th id="item_callnumber" data-colname="item_callnumber" class="call_no">Call number</th>
1193
                [% IF ( itemdata_enumchron ) %]<th id="item_enumchron" class="vol_info">Vol info</th>[% END %]
1194
        [% IF ( itemdata_enumchron ) %]
1194
                [% IF ( itemdata_uri ) %]<th id="item_url" class="url">URL</th>[% END %]
1195
                <th id="item_enumchron" data-colname="item_enumchron" class="vol_info">Vol info</th>[% END %]
1195
                [% IF ( itemdata_copynumber ) %]<th id="item_copy" class="copynumber">Copy number</th>[% END %]
1196
        [% IF ( itemdata_uri ) %]
1196
                <th id="item_status" class="status">Status</th>
1197
                <th id="item_url" data-colname="item_url" class="url">URL</th>[% END %]
1197
                [% IF ( itemdata_itemnotes ) %]<th id="item_notes" class="notes">Notes</th>[% END %]
1198
        [% IF ( itemdata_copynumber ) %]
1198
                <th id="item_datedue" class="date_due">Date due</th>
1199
                <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>[% END %]
1199
                [% IF ( OPACShowBarcode ) %]<th id="item_barcode" class="barcode">Barcode</th>[% END %]
1200
                <th id="item_status" data-colname="item_status" class="status">Status</th>
1200
                [% IF holds_count.defined %]
1201
        [% IF ( itemdata_itemnotes ) %]
1201
                    <th id="item_holds">Item holds</th>
1202
                <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>[% END %]
1202
                [% ELSIF show_priority %]
1203
                <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
1203
                    <th id="item_priority">Item hold queue priority</th>
1204
        [% IF ( OPACShowBarcode ) %]
1204
                [% END %]
1205
                <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>[% END %]
1205
                [% IF ( ShowCourseReservesHeader ) %]<th id="item_coursereserves">Course reserves</th>[% END %]
1206
        [% IF holds_count.defined %]
1207
                <th id="item_holds" data-colname="item_holds">Item holds</th>
1208
        [% ELSIF show_priority %]
1209
                <th id="item_priority" data-colname="item_priority">Item hold queue priority</th>
1210
        [% END %]
1211
        [% IF ( ShowCourseReservesHeader ) %]
1212
                <th id="item_coursereserves" data-colname="item_coursereserves">Course reserves</th>[% END %]
1206
            </tr>
1213
            </tr>
1207
        </thead>
1214
        </thead>
1208
        <tbody>
1215
        <tbody>
Lines 1363-1368 Link Here
1363
1370
1364
[% BLOCK jsinclude %]
1371
[% BLOCK jsinclude %]
1365
[% INCLUDE 'datatables.inc' %]
1372
[% INCLUDE 'datatables.inc' %]
1373
[% INCLUDE 'columns_settings.inc' %]
1366
[% IF ( SocialNetworks ) %]
1374
[% IF ( SocialNetworks ) %]
1367
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
1375
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
1368
    //<![CDATA[
1376
    //<![CDATA[
Lines 1429-1434 Link Here
1429
                return element.html();
1437
                return element.html();
1430
            }
1438
            }
1431
        });
1439
        });
1440
1441
        var columns_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'holdingst', 'json' ) %];
1442
        KohaTable(".holdingst", {
1443
            dom: 'B<"clearfix">t',
1444
            "columnDefs": [
1445
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
1446
                { "sType": "title-string", "aTargets" : [ "title-string" ] }
1447
                ],
1448
            "bKohaColumnsUseNames": true
1449
        }, columns_settings);
1450
1432
[% IF ( TagsInputEnabled && loggedinusername ) %]
1451
[% IF ( TagsInputEnabled && loggedinusername ) %]
1433
        $(".tag_add").click(function(){
1452
        $(".tag_add").click(function(){
1434
            var thisid = $(this).attr("id");
1453
            var thisid = $(this).attr("id");
Lines 1471-1499 Link Here
1471
        [% ELSE %]
1490
        [% ELSE %]
1472
            var default_order_index = 0;
1491
            var default_order_index = 0;
1473
        [% END %]
1492
        [% END %]
1474
        $(".holdingst").dataTable($.extend(true, {}, dataTablesDefaults, {
1475
            "aoColumns": [
1476
                [% IF ( item_level_itypes ) %]null,[% END %]
1477
                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
1478
                [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
1479
                [% IF ( itemdata_ccode ) %]null,[% END %]
1480
                null,
1481
                [% IF ( itemdata_enumchron ) %]null,[% END %]
1482
                [% IF ( itemdata_uri ) %]null,[% END %]
1483
                [% IF ( itemdata_copynumber ) %]null,[% END %]
1484
                null,
1485
                [% IF ( itemdata_itemnotes ) %]null,[% END %]
1486
                { "sType": "title-string" },
1487
                [% IF ( OPACShowBarcode ) %]null,[% END %]
1488
                [% IF holds_count.defined %]
1489
                    null,
1490
                [% ELSIF show_priority %]
1491
                    null,
1492
                [% END %]
1493
                [% IF ( ShowCourseReservesHeader ) %]null,[% END %]
1494
            ],
1495
            "aaSorting": [[ default_order_index, 'asc' ]]
1496
        }));
1497
1493
1498
        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
1494
        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
1499
            q_array = query_desc.split(" ");
1495
            q_array = query_desc.split(" ");
1500
- 

Return to bug 16759