diff --git a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php index 6c69c47fe0af93b10e9bb0905612f93e5b3d8d1e..0d3779800ac4d9ee40bef628e604fdae159420b1 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php @@ -545,7 +545,7 @@ class Voyager extends AbstractBase if ($this->useHoldingsSortGroups) { uksort( $status, - function($a, $b) { + function ($a, $b) { return $status[$a]['sort_seq'] == $status[$b]['sort_seq'] ? $status[$a]['item_sort_seq'] - $status[$b]['item_sort_seq'] : $status[$a]['sort_seq'] - $status[$b]['sort_seq']; @@ -1114,7 +1114,7 @@ class Voyager extends AbstractBase if ($this->useHoldingsSortGroups) { usort( $holding, - function($a, $b) { + function ($a, $b) { return $a['sort_seq'] == $b['sort_seq'] ? $a['item_sort_seq'] - $b['item_sort_seq'] : $a['sort_seq'] - $b['sort_seq']; diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index 33c5e5553799d90afd7038d73edc89a341507813..3115500133e0a8ae0e31f5e371737ad72630bc57 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -1068,8 +1068,8 @@ class Params implements ServiceLocatorAwareInterface /** * Initialize all range filters. * - * @param \Zend\StdLib\Parameters $request Parameter object representing - * user request. + * @param \Zend\StdLib\Parameters $request Parameter object representing user + * request. * * @return void */ @@ -1167,33 +1167,33 @@ class Params implements ServiceLocatorAwareInterface * * @return void */ - protected function initGenericRangeFilters($request, - $requestParam = 'genericrange', $valueFilter = null, $filterGenerator = null - ) { - $rangeFacets = $request->get($requestParam); - if (!empty($rangeFacets)) { - $ranges = is_array($rangeFacets) ? $rangeFacets : array($rangeFacets); - foreach ($ranges as $range) { - // Load start and end of range: - $from = $request->get($range . 'from'); - $to = $request->get($range . 'to'); - - // Apply filtering/validation if necessary: - if (is_callable($valueFilter)) { - $from = call_user_func($valueFilter, $from); - $to = call_user_func($valueFilter, $to); - } - - // Build filter only if necessary: - if (!empty($range) && ($from != '*' || $to != '*')) { - $rangeFacet = is_callable($filterGenerator) + protected function initGenericRangeFilters($request, + $requestParam = 'genericrange', $valueFilter = null, $filterGenerator = null + ) { + $rangeFacets = $request->get($requestParam); + if (!empty($rangeFacets)) { + $ranges = is_array($rangeFacets) ? $rangeFacets : array($rangeFacets); + foreach ($ranges as $range) { + // Load start and end of range: + $from = $request->get($range . 'from'); + $to = $request->get($range . 'to'); + + // Apply filtering/validation if necessary: + if (is_callable($valueFilter)) { + $from = call_user_func($valueFilter, $from); + $to = call_user_func($valueFilter, $to); + } + + // Build filter only if necessary: + if (!empty($range) && ($from != '*' || $to != '*')) { + $rangeFacet = is_callable($filterGenerator) ? call_user_func($filterGenerator, $range, $from, $to) : $this->buildGenericRangeFilter($range, $from, $to, false); - $this->addFilter($rangeFacet); - } - } - } - } + $this->addFilter($rangeFacet); + } + } + } + } /** * Support method for initNumericRangeFilters() -- build a filter query based on diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/LibGuides/Connector.php b/module/VuFindSearch/src/VuFindSearch/Backend/LibGuides/Connector.php index b2aeef6ca3e1adb09a4ef6226a0b823a8563b8eb..79b3560d81881433c4a172c16765609eb604d18d 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/LibGuides/Connector.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/LibGuides/Connector.php @@ -76,7 +76,7 @@ class Connector * * Sets up the LibGuides Client * - * @param string $iid Institution ID + * @param string $iid Institution ID * @param HttpClient $client HTTP client */ public function __construct($iid, $client) diff --git a/themes/bootstrap/js/cart.js b/themes/bootstrap/js/cart.js index 3bf9fa3aa0f77ea65a1664998af30b840a57ed9e..e93f3c22f04f7c493a8abbabc0e7823e96d1a2b1 100644 --- a/themes/bootstrap/js/cart.js +++ b/themes/bootstrap/js/cart.js @@ -1,4 +1,4 @@ -/*global Cookies, path, vufindString, Lightbox */ +/*global Cookies, path, vufindString, Lightbox, updatePageForLogin */ var _CART_COOKIE = 'vufind_cart'; var _CART_COOKIE_SOURCES = 'vufind_cart_src'; diff --git a/themes/bootstrap/js/common.js b/themes/bootstrap/js/common.js index 6ede06761b46de2ccb512c72a9962237b9be4715..9a1b9d378d0ba40b908d29b5b4ac70c2f68d23fb 100644 --- a/themes/bootstrap/js/common.js +++ b/themes/bootstrap/js/common.js @@ -111,6 +111,51 @@ function registerLightboxEvents() { }); $('#modal .collapse').on('hidden', function(e){ e.stopPropagation(); }); } +function updatePageForLogin() +{ + // Hide "log in" options and show "log out" options: + $('#loginOptions').hide(); + $('.logoutOptions').show(); + + var recordId = $('#record_id').val(); + + // Update user save statuses if the current context calls for it: + if (typeof(checkSaveStatuses) == 'function') { + checkSaveStatuses(); + } + + // refresh the comment list so the "Delete" links will show + $('.commentList').each(function(){ + var recordSource = extractSource($('#record')); + refreshCommentList(recordId, recordSource); + }); + + var summon = false; + $('.hiddenSource').each(function(i, e) { + if(e.value == 'Summon') { + summon = true; + // If summon, queue reload for when we close + Lightbox.addCloseAction(function(){document.location.reload(true);}); + } + }); + + // Refresh tab content + var recordTabs = $('.recordTabs'); + if(!summon && recordTabs.length > 0) { // If summon, skip: about to reload anyway + var tab = recordTabs.find('.active a').attr('id'); + $.ajax({ // Shouldn't be cancelled, not assigned to XHR + type:'POST', + url:path+'/AJAX/JSON?method=get&submodule=Record&subaction=AjaxTab&id='+recordId, + data:{tab:tab}, + success:function(html) { + recordTabs.next('.tab-container').html(html); + }, + error:function(d,e) { + console.log(d,e); // Error reporting + } + }); + } +} /** * This is a full handler for the login form */ @@ -172,52 +217,6 @@ function ajaxLogin(form) { }); } -function updatePageForLogin() -{ - // Hide "log in" options and show "log out" options: - $('#loginOptions').hide(); - $('.logoutOptions').show(); - - var recordId = $('#record_id').val(); - - // Update user save statuses if the current context calls for it: - if (typeof(checkSaveStatuses) == 'function') { - checkSaveStatuses(); - } - - // refresh the comment list so the "Delete" links will show - $('.commentList').each(function(){ - var recordSource = extractSource($('#record')); - refreshCommentList(recordId, recordSource); - }); - - var summon = false; - $('.hiddenSource').each(function(i, e) { - if(e.value == 'Summon') { - summon = true; - // If summon, queue reload for when we close - Lightbox.addCloseAction(function(){document.location.reload(true);}); - } - }); - - // Refresh tab content - var recordTabs = $('.recordTabs'); - if(!summon && recordTabs.length > 0) { // If summon, skip: about to reload anyway - var tab = recordTabs.find('.active a').attr('id'); - $.ajax({ // Shouldn't be cancelled, not assigned to XHR - type:'POST', - url:path+'/AJAX/JSON?method=get&submodule=Record&subaction=AjaxTab&id='+recordId, - data:{tab:tab}, - success:function(html) { - recordTabs.next('.tab-container').html(html); - }, - error:function(d,e) { - console.log(d,e); // Error reporting - } - }); - } -} - /* --- BOOTSTRAP LIBRARY TWEAKS --- */ // Prevent typeahead highlighting $.fn.typeahead.Constructor.prototype.render = function(items) {