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

(-)a/admin/columns_settings.yml (+31 lines)
Lines 874-879 modules: Link Here
874
        -
874
        -
875
          columnname: items_needed
875
          columnname: items_needed
876
876
877
    overdues:
878
      circ-overdues:
879
        -
880
          columname: due_date
881
        -
882
          columname: patron
883
        -
884
          columname: patron_category
885
          is_hidden: 1
886
        -
887
          columname: patron_library
888
        -
889
          columname: title
890
        -
891
          columname: home_library
892
          is_hidden: 1
893
        -
894
          columname: holding_library
895
          is_hidden: 1
896
        -
897
          columname: barcode
898
        -
899
          columname: call_number
900
        -
901
          columname: item_type
902
          is_hidden: 1
903
        -
904
          columname: price
905
        -
906
          columname: non-public_note
907
877
  opac:
908
  opac:
878
    biblio-detail:
909
    biblio-detail:
879
      holdingst:
910
      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 47-56 Link Here
47
        <tr>
50
        <tr>
48
          <th class="title-string">Due date</th>
51
          <th class="title-string">Due date</th>
49
          <th>Patron</th>
52
          <th>Patron</th>
50
          <th>Library</th>
53
          <th>Patron category</th>
51
          <th>Title</th>
54
          <th>Patron library</th>
55
          <th class="anti-the">Title</th>
56
          <th>Home library</th>
57
          <th>Holding library</th>
52
          <th>Barcode</th>
58
          <th>Barcode</th>
53
          <th>Call number</th>
59
          <th>Call number</th>
60
          <th>Item type</th>
54
          <th>Price</th>
61
          <th>Price</th>
55
          <th>Non-public note</th>
62
          <th>Non-public note</th>
56
        </tr>
63
        </tr>
Lines 66-75 Link Here
66
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
73
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
67
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
74
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
68
            [% END %]
75
            [% END %]
69
          <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
76
            <td>[% Categories.GetName( overdueloo.patron.categorycode ) | html %]</td>
77
            <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
70
          <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>
78
          <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>
79
80
            <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
81
            <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
71
          <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>
82
          <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>
72
          <td>[% overdueloo.itemcallnumber | html %]</td>
83
          <td>[% overdueloo.itemcallnumber | html %]</td>
84
            <td>[% ItemTypes.GetDescription( overdueloo.itemtype ) | html %]</td>
73
          <td>[% overdueloo.replacementprice | $Price %]</td>
85
          <td>[% overdueloo.replacementprice | $Price %]</td>
74
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
86
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
75
        </tr>
87
        </tr>
Lines 209-215 Link Here
209
[% MACRO jsinclude BLOCK %]
221
[% MACRO jsinclude BLOCK %]
210
    [% INCLUDE 'calendar.inc' %]
222
    [% INCLUDE 'calendar.inc' %]
211
    [% INCLUDE 'datatables.inc' %]
223
    [% INCLUDE 'datatables.inc' %]
212
    <script type="text/javascript">
224
    [% INCLUDE 'columns_settings.inc' %]
225
    <script>
213
        function clone_parent(node) {
226
        function clone_parent(node) {
214
            var parent = node.parentNode;
227
            var parent = node.parentNode;
215
            var clone = parent.cloneNode(true);
228
            var clone = parent.cloneNode(true);
Lines 262-274 Link Here
262
        }
275
        }
263
276
264
        $(document).ready(function(){
277
        $(document).ready(function(){
265
            $("#overduest").dataTable($.extend(true, {}, dataTablesDefaults, {
278
279
            var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
280
            var od_table = localStorage.getItem("DataTables_overduest_/cgi-bin/koha/circ/overdue.pl");
281
            var updated_settings = get_columns_saved_state( od_table, columns_settings );
282
283
            KohaTable("overduest", {
266
                "sPaginationType": "four_button",
284
                "sPaginationType": "four_button",
267
                "aaSorting": [[0, 'asc']],
285
                "aaSorting": [[0, 'asc']],
268
                "aoColumnDefs": [
286
                "aoColumnDefs": [
269
                    { "sType": "title-string", "aTargets": [ "title-string" ] }
287
                    { "sType": "title-string", "aTargets": [ "title-string" ] },
270
                ]
288
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
271
            }));
289
                ],
290
                "autoWidth": false,
291
                "stateSave": true
292
            }, updated_settings);
272
        });
293
        });
273
  </script>
294
  </script>
274
[% END %]
295
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-1 / +28 lines)
Lines 604-606 function filterDataTable( table, column, term ){ Link Here
604
        table.search( term ).draw("page");
604
        table.search( term ).draw("page");
605
    }
605
    }
606
}
606
}
607
- 
607
608
/* get_columns_saved_state checks for a DataTables configuration saved
609
 * in the browser's local storage. If it is present, the columns
610
 * configuration supplied by Koha is overwritten
611
 *
612
 * It takes two parameters:
613
 *  - localstorage_config, the DataTables saved state object from local storage
614
 *  - columns_settings, the columns settings object supplied by the template
615
 */
616
617
function get_columns_saved_state( localstorage_config, columns_settings ){
618
    var tables = JSON.parse( localstorage_config );
619
    // if a table configuration was found in local storage, parse it
620
    if( tables ){
621
        var stateSave_column_visibility = [];
622
        $(tables.columns).each(function(){
623
            stateSave_column_visibility.push( this.visible === true ? 0 : 1 );
624
        });
625
        $.each( columns_settings, function( index, key ){
626
            if( stateSave_column_visibility[ index ] !== columns_settings[key] ){
627
                columns_settings[ index ].is_hidden = stateSave_column_visibility[ index ];
628
            }
629
        });
630
        return columns_settings;
631
    } else {
632
        return columns_settings;
633
    }
634
}

Return to bug 21852