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

(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-18 / +24 lines)
Lines 260-266 $(document).ready(function() { Link Here
260
                    "bVisible": false,
260
                    "bVisible": false,
261
                },
261
                },
262
                {
262
                {
263
                    "iDataSort": 2, // Sort on hidden unformatted date due column
263
                    "aDataSort": [1,2], // Sort on hidden unformatted date due column
264
                    "mDataProp": function( oObj ) {
264
                    "mDataProp": function( oObj ) {
265
                        var due = oObj.date_due_formatted;
265
                        var due = oObj.date_due_formatted;
266
266
Lines 344-411 $(document).ready(function() { Link Here
344
344
345
                        return title;
345
                        return title;
346
                    },
346
                    },
347
                    "sType": "anti-the"
347
                    "sType": "anti-the",
348
                    "aDataSort": [1, 3]
348
                },
349
                },
349
                {
350
                {
350
                    "mDataProp": function ( oObj ) {
351
                    "mDataProp": function ( oObj ) {
351
                        return oObj.recordtype_description.escapeHtml();
352
                        return oObj.recordtype_description.escapeHtml();
352
                    }
353
                    },
354
                    "aDataSort": [1, 4]
353
                },
355
                },
354
                {
356
                {
355
                    "mDataProp": function ( oObj ) {
357
                    "mDataProp": function ( oObj ) {
356
                        return oObj.itemtype_description.escapeHtml();
358
                        return oObj.itemtype_description.escapeHtml();
357
                    }
359
                    },
360
                    "aDataSort": [1, 5]
358
                },
361
                },
359
                {
362
                {
360
                    "mDataProp": function ( oObj ) {
363
                    "mDataProp": function ( oObj ) {
361
                        return ( oObj.collection ? oObj.collection.escapeHtml() : '' );
364
                        return ( oObj.collection ? oObj.collection.escapeHtml() : '' );
362
                    }
365
                    },
366
                    "aDataSort": [1,6]
363
                },
367
                },
364
                {
368
                {
365
                    "mDataProp": function ( oObj ) {
369
                    "mDataProp": function ( oObj ) {
366
                        return ( oObj.location ? oObj.location.escapeHtml() : '' );
370
                        return ( oObj.location ? oObj.location.escapeHtml() : '' );
367
                    }
371
                    },
372
                    "aDataSort": [1,7]
368
                },
373
                },
369
                {
374
                {
370
                    "mDataProp": function ( oObj ) {
375
                    "mDataProp": function ( oObj ) {
371
                        return oObj.homebranch.escapeHtml();
376
                        return oObj.homebranch.escapeHtml();
372
                    }
377
                    },
378
                    "aDataSort": [1,8]
373
                },
379
                },
374
                {
380
                {
375
                    "mDataProp": "issuedate",
381
                    "mDataProp": "issuedate",
376
                    "bVisible": false,
382
                    "bVisible": false,
377
                },
383
                },
378
                {
384
                {
379
                    "iDataSort": 9, // Sort on hidden unformatted issuedate column
385
                    "aDataSort": [1,9], // Sort on hidden unformatted issuedate column
380
                    "mDataProp": "issuedate_formatted",
386
                    "mDataProp": "issuedate_formatted",
381
                },
387
                },
382
                {
388
                {
383
                    "mDataProp": function ( oObj ) {
389
                    "mDataProp": function ( oObj ) {
384
                        return oObj.branchname.escapeHtml();
390
                        return oObj.branchname.escapeHtml();
385
                    }
391
                    },
392
                    "aDataSort": [1,11]
386
                },
393
                },
387
                {
394
                {
388
                    "mDataProp": function ( oObj ) {
395
                    "mDataProp": function ( oObj ) {
389
                        return ( oObj.itemcallnumber ? oObj.itemcallnumber.escapeHtml() : '' );
396
                        return ( oObj.itemcallnumber ? oObj.itemcallnumber.escapeHtml() : '' );
390
                    }
397
                    },
398
                    "aDataSort": [1,12]
391
                },
399
                },
392
                {
400
                {
393
                    "mDataProp": function ( oObj ) {
401
                    "mDataProp": function ( oObj ) {
394
                        if ( ! oObj.charge ) oObj.charge = 0;
402
                        if ( ! oObj.charge ) oObj.charge = 0;
395
                        return '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).toFixed(2) + '<span>';
403
                        return '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).toFixed(2) + '<span>';
396
                    }
404
                    },
405
                    "aDataSort": [1,13]
397
                },
406
                },
398
                {
407
                {
399
                    "mDataProp": function ( oObj ) {
408
                    "mDataProp": function ( oObj ) {
400
                        if ( ! oObj.fine ) oObj.fine = 0;
409
                        if ( ! oObj.fine ) oObj.fine = 0;
401
                        return '<span style="text-align: right; display: block;">' + parseFloat(oObj.fine).toFixed(2)  + '<span>';
410
                        return '<span style="text-align: right; display: block;">' + parseFloat(oObj.fine).toFixed(2)  + '<span>';
402
                    }
411
                    },
412
                    "aDataSort": [1,14]
403
                },
413
                },
404
                {
414
                {
405
                    "mDataProp": function ( oObj ) {
415
                    "mDataProp": function ( oObj ) {
406
                        if ( ! oObj.price ) oObj.price = 0;
416
                        if ( ! oObj.price ) oObj.price = 0;
407
                        return '<span style="text-align: right; display: block;">' + parseFloat(oObj.price).toFixed(2) + '<span>';
417
                        return '<span style="text-align: right; display: block;">' + parseFloat(oObj.price).toFixed(2) + '<span>';
408
                    }
418
                    },
419
                    "aDataSort": [1,15]
409
                },
420
                },
410
                {
421
                {
411
                    "bSortable": false,
422
                    "bSortable": false,
Lines 607-616 $(document).ready(function() { Link Here
607
                }
618
                }
608
            },
619
            },
609
            "fnInitComplete": function(oSettings, json) {
620
            "fnInitComplete": function(oSettings, json) {
610
                // Disable rowGrouping plugin after first use
611
                // so any sorting on the table doesn't use it
612
                //var oSettings = issuesTable.fnSettings();
613
614
                // Build a summary of checkouts grouped by itemtype
621
                // Build a summary of checkouts grouped by itemtype
615
                var checkoutsByItype = json.aaData.reduce(function (obj, row) {
622
                var checkoutsByItype = json.aaData.reduce(function (obj, row) {
616
                    obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1;
623
                    obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1;
617
- 

Return to bug 23493