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 1179-1206 Link Here
1179
    <table class="holdingst table table-bordered table-striped">
1180
    <table class="holdingst table table-bordered table-striped">
1180
        <thead>
1181
        <thead>
1181
            <tr>
1182
            <tr>
1182
                [% IF ( item_level_itypes ) %]<th id="item_itemtype" class="itype">Item type</th>[% END %]
1183
        [% IF ( item_level_itypes ) %]
1183
                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1184
                <th id="item_itemtype" data-colname="item_itemtype" class="itype">Item type</th>[% END %]
1184
                    <th id="item_current_location" class="item_location">Current location</th>
1185
        [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1185
                [% END %]
1186
                <th id="item_current_location" data-colname="item_current_location" class="item_location">Current location</th>[% END %]
1186
                [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1187
        [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1187
                    <th id="item_home_location" class="item_location">Home library</th>
1188
                <th id="item_home_location" data-colname="item_home_location" class="item_location">Home library</th>[% END %]
1188
                [% END %]
1189
        [% IF ( itemdata_ccode ) %]
1189
                [% IF ( itemdata_ccode ) %]<th id="item_ccode" class="collection">Collection</th>[% END %]
1190
                <th id="item_ccode" data-colname="item_ccode" class="collection">Collection</th>[% END %]
1190
                <th id="item_callnumber" class="call_no">Call number</th>
1191
                <th id="item_callnumber" data-colname="item_callnumber" class="call_no">Call number</th>
1191
                [% IF ( itemdata_enumchron ) %]<th id="item_enumchron" class="vol_info">Vol info</th>[% END %]
1192
        [% IF ( itemdata_enumchron ) %]
1192
                [% IF ( itemdata_uri ) %]<th id="item_url" class="url">URL</th>[% END %]
1193
                <th id="item_enumchron" data-colname="item_enumchron" class="vol_info">Vol info</th>[% END %]
1193
                [% IF ( itemdata_copynumber ) %]<th id="item_copy" class="copynumber">Copy number</th>[% END %]
1194
        [% IF ( itemdata_uri ) %]
1194
                <th id="item_status" class="status">Status</th>
1195
                <th id="item_url" data-colname="item_url" class="url">URL</th>[% END %]
1195
                [% IF ( itemdata_itemnotes ) %]<th id="item_notes" class="notes">Notes</th>[% END %]
1196
        [% IF ( itemdata_copynumber ) %]
1196
                <th id="item_datedue" class="date_due">Date due</th>
1197
                <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>[% END %]
1197
                [% IF ( OPACShowBarcode ) %]<th id="item_barcode" class="barcode">Barcode</th>[% END %]
1198
                <th id="item_status" data-colname="item_status" class="status">Status</th>
1198
                [% IF holds_count.defined %]
1199
        [% IF ( itemdata_itemnotes ) %]
1199
                    <th id="item_holds">Item holds</th>
1200
                <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>[% END %]
1200
                [% ELSIF show_priority %]
1201
                <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
1201
                    <th id="item_priority">Item hold queue priority</th>
1202
        [% IF ( OPACShowBarcode ) %]
1202
                [% END %]
1203
                <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>[% END %]
1203
                [% IF ( ShowCourseReservesHeader ) %]<th id="item_coursereserves">Course reserves</th>[% END %]
1204
        [% IF holds_count.defined %]
1205
                <th id="item_holds" data-colname="item_holds">Item holds</th>
1206
        [% ELSIF show_priority %]
1207
                <th id="item_priority" data-colname="item_priority">Item hold queue priority</th>
1208
        [% END %]
1209
        [% IF ( ShowCourseReservesHeader ) %]
1210
                <th id="item_coursereserves" data-colname="item_coursereserves">Course reserves</th>[% END %]
1204
            </tr>
1211
            </tr>
1205
        </thead>
1212
        </thead>
1206
        <tbody>
1213
        <tbody>
Lines 1361-1366 Link Here
1361
1368
1362
[% BLOCK jsinclude %]
1369
[% BLOCK jsinclude %]
1363
[% INCLUDE 'datatables.inc' %]
1370
[% INCLUDE 'datatables.inc' %]
1371
[% INCLUDE 'columns_settings.inc' %]
1364
[% IF ( SocialNetworks ) %]
1372
[% IF ( SocialNetworks ) %]
1365
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
1373
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
1366
    //<![CDATA[
1374
    //<![CDATA[
Lines 1427-1432 Link Here
1427
                return element.html();
1435
                return element.html();
1428
            }
1436
            }
1429
        });
1437
        });
1438
1439
        var columns_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'holdingst', 'json' ) %];
1440
        KohaTable(".holdingst", {
1441
            dom: 'B<"clearfix">t',
1442
            "columnDefs": [
1443
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
1444
                { "sType": "title-string", "aTargets" : [ "title-string" ] }
1445
                ],
1446
            "bKohaColumnsUseNames": true
1447
        }, columns_settings);
1448
1430
[% IF ( TagsInputEnabled && loggedinusername ) %]
1449
[% IF ( TagsInputEnabled && loggedinusername ) %]
1431
        $(".tag_add").click(function(){
1450
        $(".tag_add").click(function(){
1432
            var thisid = $(this).attr("id");
1451
            var thisid = $(this).attr("id");
Lines 1469-1497 Link Here
1469
        [% ELSE %]
1488
        [% ELSE %]
1470
            var default_order_index = 0;
1489
            var default_order_index = 0;
1471
        [% END %]
1490
        [% END %]
1472
        $(".holdingst").dataTable($.extend(true, {}, dataTablesDefaults, {
1473
            "aoColumns": [
1474
                [% IF ( item_level_itypes ) %]null,[% END %]
1475
                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
1476
                [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
1477
                [% IF ( itemdata_ccode ) %]null,[% END %]
1478
                null,
1479
                [% IF ( itemdata_enumchron ) %]null,[% END %]
1480
                [% IF ( itemdata_uri ) %]null,[% END %]
1481
                [% IF ( itemdata_copynumber ) %]null,[% END %]
1482
                null,
1483
                [% IF ( itemdata_itemnotes ) %]null,[% END %]
1484
                { "sType": "title-string" },
1485
                [% IF ( OPACShowBarcode ) %]null,[% END %]
1486
                [% IF holds_count.defined %]
1487
                    null,
1488
                [% ELSIF show_priority %]
1489
                    null,
1490
                [% END %]
1491
                [% IF ( ShowCourseReservesHeader ) %]null,[% END %]
1492
            ],
1493
            "aaSorting": [[ default_order_index, 'asc' ]]
1494
        }));
1495
1491
1496
        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
1492
        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
1497
            q_array = query_desc.split(" ");
1493
            q_array = query_desc.split(" ");
1498
- 

Return to bug 16759