From 42895e1cc01f4cb2458e496c664b78fd692a17bd Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Tue, 3 Jun 2014 13:08:44 -0300 Subject: [PATCH] limited PEI Collection search results to pei and changed title --- targets/evergreen/roblib_search_evergreen.module | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/targets/evergreen/roblib_search_evergreen.module b/targets/evergreen/roblib_search_evergreen.module index fd41fa4..34fca3a 100644 --- a/targets/evergreen/roblib_search_evergreen.module +++ b/targets/evergreen/roblib_search_evergreen.module @@ -157,7 +157,7 @@ function roblib_search_evergreen_block_view($delta = '') { // The subject is displayed at the top of the block. Note that it // should be passed through t() for translation. The title configured // for the block using Drupal UI supercedes this one. - $block['subject'] = t('Evergreen Results'); + $block['subject'] = t('PEI Collection'); // The content of the block is typically generated by calling a custom // function. $block['content'] = theme('roblib_search_evergreen', array('results' => NULL)); @@ -184,7 +184,8 @@ function roblib_search_evergreen_get_results($query) { $url = variable_get('roblib_search_evergreen_url', 'http://137.149.200.52'); $url_suffix = variable_get('roblib_search_evergreen_search_suffix', '/opac/extras/sru?version=1.1&operation=searchRetrieve&query='); $number_of_records = variable_get('roblib_search_evergreen_num_results', '5'); - $query = str_replace(' ', '%20AND%20',$query);//hack until the library decides if we want phrase or individual words + $query = str_replace(' ', '%20AND%20',$query); //hack until the library decides if we want phrase or individual words + $query .= urlencode(' AND "prince edward island"'); $search_url = $url . $url_suffix . $query . '&maximumRecords=' . $number_of_records; $catalog_base_search_url = variable_get('roblib_search_evergreen_catalog_base_search_url', 'http://islandpines.roblib.upei.ca/opac/en-CA/skin/roblib/xml/rresult.xml?rt=keyword&tp=keyword&t='); drupal_add_js(array('roblib_search_evergreen' => array('catalog_url' => $catalog_base_search_url)), array('type' => 'setting')); @@ -193,7 +194,8 @@ function roblib_search_evergreen_get_results($query) { $output = roblib_search_evergreen_parse_results($results, $query); } else { - $output = 'Error retrieving Evergreen results ' . $results->status_message; + watchdog('roblib_search_evergreen', 'Error retrieving results: %error', array('%error' => $results->status_message), WATCHDOG_ERROR); + $output = ''; } return json_encode($output);