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

(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js (-3 / +21 lines)
Lines 1-5 Link Here
1
$(document).ready(function() {
1
$(document).ready(function() {
2
2
3
    var getLinks = function(row) {
4
        if (row.links.length === 0) {
5
            return false;
6
        }
7
        return row.links.map(function(link) {
8
            return '<a href="' + link.url + '" target="_blank">' +
9
                link.text +
10
                '</a>';
11
        });
12
    };
13
3
    window.doSearch = function() {
14
    window.doSearch = function() {
4
        // In case the source doesn't supply data required for DT to calculate
15
        // In case the source doesn't supply data required for DT to calculate
5
        // pagination, we need to do it ourselves
16
        // pagination, we need to do it ourselves
Lines 51-59 $(document).ready(function() { Link Here
51
        // Here we store them
62
        // Here we store them
52
        var renders = {
63
        var renders = {
53
            title: function(data, type, row) {
64
            title: function(data, type, row) {
54
                return row.url ?
65
                var links = getLinks(row);
55
                    '<a href="'+row.url+'" target="_blank">'+row.title+'</a>' :
66
                if (links) {
56
                    row.title;
67
                    return row.title + ' - ' + links.join(', ');
68
                } else if (row.url) {
69
                    return '<a href="' + row.url  + '" target="_blank">' +
70
                        row.title +
71
                        '</a>';
72
                } else {
73
                    return row.title;
74
                }
57
            },
75
            },
58
            source: function(data, type, row) {
76
            source: function(data, type, row) {
59
                return row.opac_url ?
77
                return row.opac_url ?
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js (-4 / +21 lines)
Lines 1-5 Link Here
1
$(document).ready(function() {
1
$(document).ready(function() {
2
2
3
    var getLinks = function(row) {
4
        if (row.links.length === 0) {
5
            return false;
6
        }
7
        return row.links.map(function(link) {
8
            return '<a href="' + link.url + '" target="_blank">' +
9
                link.text +
10
                '</a>';
11
        });
12
    };
13
3
    window.doSearch = function() {
14
    window.doSearch = function() {
4
        // In case the source doesn't supply data required for DT to calculate
15
        // In case the source doesn't supply data required for DT to calculate
5
        // pagination, we need to do it ourselves
16
        // pagination, we need to do it ourselves
Lines 51-59 $(document).ready(function() { Link Here
51
        // Here we store them
62
        // Here we store them
52
        var renders = {
63
        var renders = {
53
            title: function(data, type, row) {
64
            title: function(data, type, row) {
54
                return row.url ?
65
                var links = getLinks(row);
55
                    '<a href="'+row.url+'" target="_blank">'+row.title+'</a>' :
66
                if (links) {
56
                    row.title;
67
                    return row.title + ' - ' + links.join(', ');
68
                } else if (row.url) {
69
                    return '<a href="' + row.url  + '" target="_blank">' +
70
                        row.title +
71
                        '</a>';
72
                } else {
73
                    return row.title;
74
                }
57
            },
75
            },
58
            source: function(data, type, row) {
76
            source: function(data, type, row) {
59
                return row.opac_url ?
77
                return row.opac_url ?
60
- 

Return to bug 27170