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

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js (+25 lines)
Lines 414-416 $.fn.dataTableExt.oSort['num-html-desc'] = function(a,b) { Link Here
414
    y = parseFloat( y );
414
    y = parseFloat( y );
415
    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
415
    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
416
};
416
};
417
418
/* Plugin to allow sorting on data stored in a span's title attribute
419
 *
420
 * Ex: <td><span title="[% ISO_date %]">[% formatted_date %]</span></td>
421
 *
422
 * In DataTables config:
423
 *     "aoColumns": [
424
 *        { "sType": "title-string" },
425
 *      ]
426
 * http://datatables.net/plug-ins/sorting#hidden_title_string
427
 */
428
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
429
    "title-string-pre": function ( a ) {
430
        return a.match(/title="(.*?)"/)[1].toLowerCase();
431
    },
432
433
    "title-string-asc": function ( a, b ) {
434
        return ((a < b) ? -1 : ((a > b) ? 1 : 0));
435
    },
436
437
    "title-string-desc": function ( a, b ) {
438
        return ((a < b) ? 1 : ((a > b) ? -1 : 0));
439
    }
440
} );
441
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-8 / +19 lines)
Lines 10-16 Link Here
10
 $(document).ready(function() {
10
 $(document).ready(function() {
11
    $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
11
    $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
12
        "sPaginationType": "four_button",
12
        "sPaginationType": "four_button",
13
        "aaSorting": []
13
        "aaSorting": [],
14
        "aoColumns": [
15
            null,
16
            null,
17
            null,
18
            null,
19
            null,
20
            null,
21
            null,
22
            null,
23
            null,
24
            { "sType": "title-string" }
25
        ]
14
    }));
26
    }));
15
 });
27
 });
16
}); </script>
28
}); </script>
Lines 74-85 Link Here
74
                    [% issue.date_due | $KohaDates %]
86
                    [% issue.date_due | $KohaDates %]
75
                [% ELSE %]&nbsp;[% END %]</td>
87
                [% ELSE %]&nbsp;[% END %]</td>
76
            <td>
88
            <td>
77
        [% IF  issue.returndate %]
89
                [% IF  issue.returndate %]
78
            [% issue.returndate | $KohaDates %]
90
                    <span title="[% issue.returndate %]">[% issue.returndate | $KohaDates %]</span>
79
        [% ELSE %]
91
                [% ELSE %]
80
            Checked Out
92
                    <span title="Checked Out"><small>Checked Out</small></span>
81
        [% END %]
93
                [% END %]
82
	</td>
94
            </td>
83
</tr>
95
</tr>
84
[% END %]
96
[% END %]
85
</table>
97
</table>
86
- 

Return to bug 7019