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

(-)a/admin/columns_settings.yml (+53 lines)
Lines 644-649 modules: Link Here
644
        -
644
        -
645
          columnname: action
645
          columnname: action
646
646
647
    holdsratios:
648
      holds-ratios:
649
        -
650
          columnname: holds
651
        -
652
          columnname: items
653
        -
654
          columnname: holds_ratio
655
        -
656
          columnname: title
657
        -
658
          columnname: home_libraries
659
        -
660
          columnname: holding_libraries
661
        -
662
          columnname: location
663
        -
664
          columnname: itemtype
665
        -
666
          columnname: call_numbers
667
        -
668
          columnname: items_needed
669
670
    overdues:
671
      circ-overdues:
672
        -
673
          columname: due_date
674
        -
675
          columname: patron
676
        -
677
          columname: patron_category
678
          is_hidden: 1
679
        -
680
          columname: patron_library
681
        -
682
          columname: title
683
        -
684
          columname: home_library
685
          is_hidden: 1
686
        -
687
          columname: holding_library
688
          is_hidden: 1
689
        -
690
          columname: barcode
691
        -
692
          columname: call_number
693
        -
694
          columname: item_type
695
          is_hidden: 1
696
        -
697
          columname: price
698
        -
699
          columname: non-public_note
647
  opac:
700
  opac:
648
    biblio-detail:
701
    biblio-detail:
649
      holdingst:
702
      holdingst:
(-)a/circ/overdue.pl (-3 / +5 lines)
Lines 239-245 if ($noreport) { Link Here
239
        items.itemcallnumber,
239
        items.itemcallnumber,
240
        items.replacementprice,
240
        items.replacementprice,
241
        items.enumchron,
241
        items.enumchron,
242
        items.itemnotes_nonpublic
242
        items.itemnotes_nonpublic,
243
        items.itype
243
      FROM issues
244
      FROM issues
244
    LEFT JOIN borrowers   ON (issues.borrowernumber=borrowers.borrowernumber )
245
    LEFT JOIN borrowers   ON (issues.borrowernumber=borrowers.borrowernumber )
245
    LEFT JOIN items       ON (issues.itemnumber=items.itemnumber)
246
    LEFT JOIN items       ON (issues.itemnumber=items.itemnumber)
Lines 322-333 if ($noreport) { Link Here
322
            biblionumber           => $data->{biblionumber},
323
            biblionumber           => $data->{biblionumber},
323
            title                  => $data->{title},
324
            title                  => $data->{title},
324
            author                 => $data->{author},
325
            author                 => $data->{author},
325
            homebranchcode         => $data->{homebranchcode},
326
            homebranchcode         => $data->{homebranch},
326
            holdingbranchcode      => $data->{holdingbranchcode},
327
            holdingbranchcode      => $data->{holdingbranch},
327
            itemcallnumber         => $data->{itemcallnumber},
328
            itemcallnumber         => $data->{itemcallnumber},
328
            replacementprice       => $data->{replacementprice},
329
            replacementprice       => $data->{replacementprice},
329
            itemnotes_nonpublic    => $data->{itemnotes_nonpublic},
330
            itemnotes_nonpublic    => $data->{itemnotes_nonpublic},
330
            enumchron              => $data->{enumchron},
331
            enumchron              => $data->{enumchron},
332
            itemtype               => $data->{itype},
331
            patron_attr_value_loop => \@patron_attr_value_loop,
333
            patron_attr_value_loop => \@patron_attr_value_loop,
332
        };
334
        };
333
    }
335
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (-8 / +29 lines)
Lines 3-8 Link Here
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[%- USE Branches -%]
4
[%- USE Branches -%]
5
[%- USE Price -%]
5
[%- USE Price -%]
6
[%- USE ItemTypes -%]
7
[%- USE Categories -%]
8
[%- USE ColumnsSettings -%]
6
[% SET footerjs = 1 %]
9
[% SET footerjs = 1 %]
7
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Koha &rsaquo; Circulation &rsaquo; Items overdue as of [% todaysdate | html %]</title>
11
<title>Koha &rsaquo; Circulation &rsaquo; Items overdue as of [% todaysdate | html %]</title>
Lines 49-58 Link Here
49
        <tr>
52
        <tr>
50
          <th class="title-string">Due date</th>
53
          <th class="title-string">Due date</th>
51
          <th>Patron</th>
54
          <th>Patron</th>
52
          <th>Library</th>
55
          <th>Patron category</th>
53
          <th>Title</th>
56
          <th>Patron library</th>
57
          <th class="anti-the">Title</th>
58
          <th>Home library</th>
59
          <th>Holding library</th>
54
          <th>Barcode</th>
60
          <th>Barcode</th>
55
          <th>Call number</th>
61
          <th>Call number</th>
62
          <th>Item type</th>
56
          <th>Price</th>
63
          <th>Price</th>
57
          <th>Non-public note</th>
64
          <th>Non-public note</th>
58
        </tr>
65
        </tr>
Lines 68-77 Link Here
68
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
75
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
69
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
76
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
70
            [% END %]
77
            [% END %]
71
          <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
78
            <td>[% Categories.GetName( overdueloo.patron.categorycode ) | html %]</td>
79
            <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
72
          <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% overdueloo.title | html %]  [% overdueloo.subtitle | html %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author | html %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron | html %][% END %]</td>
80
          <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% overdueloo.title | html %]  [% overdueloo.subtitle | html %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author | html %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron | html %][% END %]</td>
81
82
            <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
83
            <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
73
          <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber | uri %]&amp;itemnumber=[% overdueloo.itemnum | uri %]#item[% overdueloo.itemnum | uri %]">[% overdueloo.barcode | html %]</a></td>
84
          <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber | uri %]&amp;itemnumber=[% overdueloo.itemnum | uri %]#item[% overdueloo.itemnum | uri %]">[% overdueloo.barcode | html %]</a></td>
74
          <td>[% overdueloo.itemcallnumber | html %]</td>
85
          <td>[% overdueloo.itemcallnumber | html %]</td>
86
            <td>[% ItemTypes.GetDescription( overdueloo.itemtype ) | html %]</td>
75
          <td>[% overdueloo.replacementprice | $Price %]</td>
87
          <td>[% overdueloo.replacementprice | $Price %]</td>
76
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
88
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
77
        </tr>
89
        </tr>
Lines 206-212 Link Here
206
[% MACRO jsinclude BLOCK %]
218
[% MACRO jsinclude BLOCK %]
207
    [% INCLUDE 'calendar.inc' %]
219
    [% INCLUDE 'calendar.inc' %]
208
    [% INCLUDE 'datatables.inc' %]
220
    [% INCLUDE 'datatables.inc' %]
209
    <script type="text/javascript">
221
    [% INCLUDE 'columns_settings.inc' %]
222
    <script>
210
        function clone_parent(node) {
223
        function clone_parent(node) {
211
            var parent = node.parentNode;
224
            var parent = node.parentNode;
212
            var clone = parent.cloneNode(true);
225
            var clone = parent.cloneNode(true);
Lines 259-271 Link Here
259
        }
272
        }
260
273
261
        $(document).ready(function(){
274
        $(document).ready(function(){
262
            $("#overduest").dataTable($.extend(true, {}, dataTablesDefaults, {
275
276
            var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
277
            var od_table = localStorage.getItem("DataTables_overduest_/cgi-bin/koha/circ/overdue.pl");
278
            var updated_settings = get_columns_saved_state( od_table, columns_settings );
279
280
            KohaTable("overduest", {
263
                "sPaginationType": "four_button",
281
                "sPaginationType": "four_button",
264
                "aaSorting": [[0, 'asc']],
282
                "aaSorting": [[0, 'asc']],
265
                "aoColumnDefs": [
283
                "aoColumnDefs": [
266
                    { "sType": "title-string", "aTargets": [ "title-string" ] }
284
                    { "sType": "title-string", "aTargets": [ "title-string" ] },
267
                ]
285
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
268
            }));
286
                ],
287
                "autoWidth": false,
288
                "stateSave": true
289
            }, updated_settings);
269
        });
290
        });
270
  </script>
291
  </script>
271
[% END %]
292
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-1 / +28 lines)
Lines 567-569 function footer_column_sum( api, column_numbers ) { Link Here
567
        $( api.column( column_number ).footer() ).html(total.format_price());
567
        $( api.column( column_number ).footer() ).html(total.format_price());
568
    };
568
    };
569
}
569
}
570
- 
570
571
/* get_columns_saved_state checks for a DataTables configuration saved
572
 * in the browser's local storage. If it is present, the columns
573
 * configuration supplied by Koha is overwritten
574
 *
575
 * It takes two parameters:
576
 *  - localstorage_config, the DataTables saved state object from local storage
577
 *  - columns_settings, the columns settings object supplied by the template
578
 */
579
580
function get_columns_saved_state( localstorage_config, columns_settings ){
581
    var tables = JSON.parse( localstorage_config );
582
    // if a table configuration was found in local storage, parse it
583
    if( tables ){
584
        var stateSave_column_visibility = [];
585
        $(tables.columns).each(function(){
586
            stateSave_column_visibility.push( this.visible === true ? 0 : 1 );
587
        });
588
        $.each( columns_settings, function( index, key ){
589
            if( stateSave_column_visibility[ index ] !== columns_settings[key] ){
590
                columns_settings[ index ].is_hidden = stateSave_column_visibility[ index ];
591
            }
592
        });
593
        return columns_settings;
594
    } else {
595
        return columns_settings;
596
    }
597
}

Return to bug 21852