diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js b/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js index 289b934ffa..8515200063 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js @@ -1,5 +1,16 @@ $(document).ready(function() { + var getLinks = function(row) { + if (row.links.length === 0) { + return false; + } + return row.links.map(function(link) { + return '' + + link.text + + ''; + }); + }; + window.doSearch = function() { // In case the source doesn't supply data required for DT to calculate // pagination, we need to do it ourselves @@ -51,9 +62,16 @@ $(document).ready(function() { // Here we store them var renders = { title: function(data, type, row) { - return row.url ? - ''+row.title+'' : - row.title; + var links = getLinks(row); + if (links) { + return row.title + ' - ' + links.join(', '); + } else if (row.url) { + return '' + + row.title + + ''; + } else { + return row.title; + } }, source: function(data, type, row) { return row.opac_url ? diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js b/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js index 9c0be4c105..239a3bfecd 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js @@ -1,5 +1,16 @@ $(document).ready(function() { + var getLinks = function(row) { + if (row.links.length === 0) { + return false; + } + return row.links.map(function(link) { + return '' + + link.text + + ''; + }); + }; + window.doSearch = function() { // In case the source doesn't supply data required for DT to calculate // pagination, we need to do it ourselves @@ -51,9 +62,16 @@ $(document).ready(function() { // Here we store them var renders = { title: function(data, type, row) { - return row.url ? - ''+row.title+'' : - row.title; + var links = getLinks(row); + if (links) { + return row.title + ' - ' + links.join(', '); + } else if (row.url) { + return '' + + row.title + + ''; + } else { + return row.title; + } }, source: function(data, type, row) { return row.opac_url ?