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

(-)a/admin/columns_settings.yml (+31 lines)
Lines 765-770 modules: Link Here
765
        -
765
        -
766
          columnname: items_needed
766
          columnname: items_needed
767
767
768
    overdues:
769
      circ-overdues:
770
        -
771
          columname: due_date
772
        -
773
          columname: patron
774
        -
775
          columname: patron_category
776
          is_hidden: 1
777
        -
778
          columname: patron_library
779
        -
780
          columname: title
781
        -
782
          columname: home_library
783
          is_hidden: 1
784
        -
785
          columname: holding_library
786
          is_hidden: 1
787
        -
788
          columname: barcode
789
        -
790
          columname: call_number
791
        -
792
          columname: item_type
793
          is_hidden: 1
794
        -
795
          columname: price
796
        -
797
          columname: non-public_note
798
768
  opac:
799
  opac:
769
    biblio-detail:
800
    biblio-detail:
770
      holdingst:
801
      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 48-57 Link Here
48
        <tr>
51
        <tr>
49
          <th class="title-string">Due date</th>
52
          <th class="title-string">Due date</th>
50
          <th>Patron</th>
53
          <th>Patron</th>
51
          <th>Library</th>
54
          <th>Patron category</th>
52
          <th>Title</th>
55
          <th>Patron library</th>
56
          <th class="anti-the">Title</th>
57
          <th>Home library</th>
58
          <th>Holding library</th>
53
          <th>Barcode</th>
59
          <th>Barcode</th>
54
          <th>Call number</th>
60
          <th>Call number</th>
61
          <th>Item type</th>
55
          <th>Price</th>
62
          <th>Price</th>
56
          <th>Non-public note</th>
63
          <th>Non-public note</th>
57
        </tr>
64
        </tr>
Lines 67-76 Link Here
67
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
74
                [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
68
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
75
                [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
69
            [% END %]
76
            [% END %]
70
          <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
77
            <td>[% Categories.GetName( overdueloo.patron.categorycode ) | html %]</td>
78
            <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
71
          <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
          <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
81
            <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
82
            <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
72
          <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>
83
          <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>
73
          <td>[% overdueloo.itemcallnumber | html %]</td>
84
          <td>[% overdueloo.itemcallnumber | html %]</td>
85
            <td>[% ItemTypes.GetDescription( overdueloo.itemtype ) | html %]</td>
74
          <td>[% overdueloo.replacementprice | $Price %]</td>
86
          <td>[% overdueloo.replacementprice | $Price %]</td>
75
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
87
          <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
76
        </tr>
88
        </tr>
Lines 210-216 Link Here
210
[% MACRO jsinclude BLOCK %]
222
[% MACRO jsinclude BLOCK %]
211
    [% INCLUDE 'calendar.inc' %]
223
    [% INCLUDE 'calendar.inc' %]
212
    [% INCLUDE 'datatables.inc' %]
224
    [% INCLUDE 'datatables.inc' %]
213
    <script type="text/javascript">
225
    [% INCLUDE 'columns_settings.inc' %]
226
    <script>
214
        function clone_parent(node) {
227
        function clone_parent(node) {
215
            var parent = node.parentNode;
228
            var parent = node.parentNode;
216
            var clone = parent.cloneNode(true);
229
            var clone = parent.cloneNode(true);
Lines 263-275 Link Here
263
        }
276
        }
264
277
265
        $(document).ready(function(){
278
        $(document).ready(function(){
266
            $("#overduest").dataTable($.extend(true, {}, dataTablesDefaults, {
279
280
            var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
281
            var od_table = localStorage.getItem("DataTables_overduest_/cgi-bin/koha/circ/overdue.pl");
282
            var updated_settings = get_columns_saved_state( od_table, columns_settings );
283
284
            KohaTable("overduest", {
267
                "sPaginationType": "four_button",
285
                "sPaginationType": "four_button",
268
                "aaSorting": [[0, 'asc']],
286
                "aaSorting": [[0, 'asc']],
269
                "aoColumnDefs": [
287
                "aoColumnDefs": [
270
                    { "sType": "title-string", "aTargets": [ "title-string" ] }
288
                    { "sType": "title-string", "aTargets": [ "title-string" ] },
271
                ]
289
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
272
            }));
290
                ],
291
                "autoWidth": false,
292
                "stateSave": true
293
            }, updated_settings);
273
        });
294
        });
274
  </script>
295
  </script>
275
[% END %]
296
[% 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