diff --git a/roblib_search.module b/roblib_search.module index eb4016c..4530da4 100644 --- a/roblib_search.module +++ b/roblib_search.module @@ -214,8 +214,6 @@ function roblib_search_preprocess_panels_pane(&$variables, $hook){ * Implements hook_init(). */ function roblib_search_init() { - // Make qtip available for all targets js. - drupal_add_js(drupal_get_path('module', 'roblib_search') . '/js/jquery.qtip.min.js'); drupal_add_js(drupal_get_path('module', 'roblib_search') . '/js/imagesloaded.pkg.min.js'); drupal_add_js(drupal_get_path('module', 'roblib_search') . '/js/roblib_search.js'); drupal_add_css(drupal_get_path('module', 'roblib_search') . '/css/jquery.qtip.min.css'); diff --git a/targets/eds/js/eds_results.js b/targets/eds/js/eds_results.js index c85d775..c2b8816 100644 --- a/targets/eds/js/eds_results.js +++ b/targets/eds/js/eds_results.js @@ -23,29 +23,33 @@ Drupal.behaviors.roblib_search_eds = { if (typeof val.Items !== 'undefined') { items.push('
'); if (typeof val.Items.Ti !== 'undefined') { - jQuery.each(val.Items.Ti, function (key2, val2) { + jQuery.each(val.RecordInfo.BibEntity.Titles, function (key2, val2) { items.push('
'); - items.push('' + val2.Data + '
'); + items.push('' + val2.TitleFull + '
'); }) } + val.pubType == 'Book' ? pubType = 'Print Book' : pubType = val.pubType; + pubYear = val.RecordInfo.BibRelationships.IsPartOfRelationships["date"]; !pubYear ? pubYear = " " : pubYear = pubYear[0]["Y"]; if (typeof val.Items.TypPub !== 'undefined') { jQuery.each(val.Items.TypPub, function (key6, typpub) { - strs = typpub.Data.split('; '); - types = roblib_intersects(strs, ['Book', 'eBook']); - items.push('
' + pubYear + ' - ' + types.join(', ') + '
'); + //strs = typpub.Data.split('; '); + //types = roblib_intersects(strs, ['Book', 'eBook']); + items.push('
' + pubYear + ' - ' + pubType + '
'); }) } - items.push('
'); - roblib_authors = ""; + var roblib_authors =[]; jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function (key3, author) { - roblib_authors += author.NameFull; + roblib_authors.push(author.NameFull); }) - roblib_authors = roblib_shorten(roblib_authors, 50, " "); + + items.push('
'); + roblib_authors = roblib_shorten(roblib_authors.join('; '), 50, " "); items.push(roblib_authors); items.push('
'); + if (typeof val.Items.Src !== 'undefined') { jQuery.each(val.Items.Src, function (key4, source) { items.push('
' + source.Data + '
'); @@ -56,9 +60,22 @@ Drupal.behaviors.roblib_search_eds = { items.push('
' + pubinfo.Data + '
'); }) } + var url; + !val.Items.URL ? url = " " : url = val.Items.URL[0].Data; + if(url) { + items.push('
' + url + '
'); + } - items.push('
' + val.DbLabel + '
'); - + if(pubType == "Print Book") { + anNumber = val.An.split("."); + if (anNumber[0] && anNumber[0] == 'upei') { + catalogUrl = 'View in UPEI Catalogue'; + } + if (catalogUrl) { + items.push(''); + } + } items.push('
'); } }); diff --git a/targets/eds/roblib_search_eds.module b/targets/eds/roblib_search_eds.module index d26d480..153eeb7 100644 --- a/targets/eds/roblib_search_eds.module +++ b/targets/eds/roblib_search_eds.module @@ -259,6 +259,7 @@ function roblib_search_eds_get_results($query = NULL, $type = NULL) { //$params = "query=AND,$query&view=detailed&includefacets=n&$limiters&resultsperpage=$number_per_page"; $params = "query=AND,$query&view=detailed&includefacets=n&resultsperpage=$number_per_page"; $output = $eds_api->apiSearch($params); + //roblib_search_eds_get_detailed_result($output, $query, $eds_api); return json_encode($output); }