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

(-)a/admin/columns_settings.yml (+31 lines)
Lines 920-925 modules: Link Here
920
        -
920
        -
921
          columnname: items_needed
921
          columnname: items_needed
922
922
923
    overdues:
924
      circ-overdues:
925
        -
926
          columname: due_date
927
        -
928
          columname: patron
929
        -
930
          columname: patron_category
931
          is_hidden: 1
932
        -
933
          columname: patron_library
934
        -
935
          columname: title
936
        -
937
          columname: home_library
938
          is_hidden: 1
939
        -
940
          columname: holding_library
941
          is_hidden: 1
942
        -
943
          columname: barcode
944
        -
945
          columname: call_number
946
        -
947
          columname: item_type
948
          is_hidden: 1
949
        -
950
          columname: price
951
        -
952
          columname: non-public_note
953
923
  opac:
954
  opac:
924
    biblio-detail:
955
    biblio-detail:
925
      holdingst:
956
      holdingst:
(-)a/circ/overdue.pl (-3 / +5 lines)
Lines 249-255 if ($noreport) { Link Here
249
        items.itemcallnumber,
249
        items.itemcallnumber,
250
        items.replacementprice,
250
        items.replacementprice,
251
        items.enumchron,
251
        items.enumchron,
252
        items.itemnotes_nonpublic
252
        items.itemnotes_nonpublic,
253
        items.itype
253
      FROM issues
254
      FROM issues
254
    LEFT JOIN borrowers   ON (issues.borrowernumber=borrowers.borrowernumber )
255
    LEFT JOIN borrowers   ON (issues.borrowernumber=borrowers.borrowernumber )
255
    LEFT JOIN items       ON (issues.itemnumber=items.itemnumber)
256
    LEFT JOIN items       ON (issues.itemnumber=items.itemnumber)
Lines 332-343 if ($noreport) { Link Here
332
            biblionumber           => $data->{biblionumber},
333
            biblionumber           => $data->{biblionumber},
333
            title                  => $data->{title},
334
            title                  => $data->{title},
334
            author                 => $data->{author},
335
            author                 => $data->{author},
335
            homebranchcode         => $data->{homebranchcode},
336
            homebranchcode         => $data->{homebranch},
336
            holdingbranchcode      => $data->{holdingbranchcode},
337
            holdingbranchcode      => $data->{holdingbranch},
337
            itemcallnumber         => $data->{itemcallnumber},
338
            itemcallnumber         => $data->{itemcallnumber},
338
            replacementprice       => $data->{replacementprice},
339
            replacementprice       => $data->{replacementprice},
339
            itemnotes_nonpublic    => $data->{itemnotes_nonpublic},
340
            itemnotes_nonpublic    => $data->{itemnotes_nonpublic},
340
            enumchron              => $data->{enumchron},
341
            enumchron              => $data->{enumchron},
342
            itemtype               => $data->{itype},
341
            patron_attr_value_loop => \@patron_attr_value_loop,
343
            patron_attr_value_loop => \@patron_attr_value_loop,
342
        };
344
        };
343
    }
345
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (-8 / +28 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 51-60 Link Here
51
        <tr>
54
        <tr>
52
          <th class="title-string">Due date</th>
55
          <th class="title-string">Due date</th>
53
          <th>Patron</th>
56
          <th>Patron</th>
54
          <th>Library</th>
57
          <th>Patron category</th>
55
          <th>Title</th>
58
          <th>Patron library</th>
59
          <th class="anti-the">Title</th>
60
          <th>Home library</th>
61
          <th>Holding library</th>
56
          <th>Barcode</th>
62
          <th>Barcode</th>
57
          <th>Call number</th>
63
          <th>Call number</th>
64
          <th>Item type</th>
58
          <th>Price</th>
65
          <th>Price</th>
59
          <th>Non-public note</th>
66
          <th>Non-public note</th>
60
        </tr>
67
        </tr>
Lines 70-79 Link Here
70
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
77
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
71
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
78
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
72
            [% END %]
79
            [% END %]
73
          <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
80
            <td>[% Categories.GetName( overdueloo.patron.categorycode ) | html %]</td>
81
            <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
74
          <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=overdueloo %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author | html %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron | html %][% END %]</td>
82
          <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=overdueloo %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author | html %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron | html %][% END %]</td>
83
            <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
84
            <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
75
          <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>
85
          <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>
76
          <td>[% overdueloo.itemcallnumber | html %]</td>
86
          <td>[% overdueloo.itemcallnumber | html %]</td>
87
            <td>[% ItemTypes.GetDescription( overdueloo.itemtype ) | html %]</td>
77
          <td>[% overdueloo.replacementprice | $Price %]</td>
88
          <td>[% overdueloo.replacementprice | $Price %]</td>
78
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
89
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
79
        </tr>
90
        </tr>
Lines 213-219 Link Here
213
[% MACRO jsinclude BLOCK %]
224
[% MACRO jsinclude BLOCK %]
214
    [% INCLUDE 'calendar.inc' %]
225
    [% INCLUDE 'calendar.inc' %]
215
    [% INCLUDE 'datatables.inc' %]
226
    [% INCLUDE 'datatables.inc' %]
216
    <script type="text/javascript">
227
    [% INCLUDE 'columns_settings.inc' %]
228
    <script>
217
        function clone_parent(node) {
229
        function clone_parent(node) {
218
            var parent = node.parentNode;
230
            var parent = node.parentNode;
219
            var clone = parent.cloneNode(true);
231
            var clone = parent.cloneNode(true);
Lines 266-278 Link Here
266
        }
278
        }
267
279
268
        $(document).ready(function(){
280
        $(document).ready(function(){
269
            $("#overduest").dataTable($.extend(true, {}, dataTablesDefaults, {
281
282
            var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
283
            var od_table = localStorage.getItem("DataTables_overduest_/cgi-bin/koha/circ/overdue.pl");
284
            var updated_settings = get_columns_saved_state( od_table, columns_settings );
285
286
            KohaTable("overduest", {
270
                "sPaginationType": "four_button",
287
                "sPaginationType": "four_button",
271
                "aaSorting": [[0, 'asc']],
288
                "aaSorting": [[0, 'asc']],
272
                "aoColumnDefs": [
289
                "aoColumnDefs": [
273
                    { "sType": "title-string", "aTargets": [ "title-string" ] }
290
                    { "sType": "title-string", "aTargets": [ "title-string" ] },
274
                ]
291
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
275
            }));
292
                ],
293
                "autoWidth": false,
294
                "stateSave": true
295
            }, updated_settings);
276
        });
296
        });
277
  </script>
297
  </script>
278
[% END %]
298
[% 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