diff --git a/code/web/RecordDrivers/SummonRecordDriver.php b/code/web/RecordDrivers/SummonRecordDriver.php index 6b1749e99c..9987ae9d26 100644 --- a/code/web/RecordDrivers/SummonRecordDriver.php +++ b/code/web/RecordDrivers/SummonRecordDriver.php @@ -24,19 +24,25 @@ public function isValid() { } public function getBookcoverUrl($size='large', $absolutePath = false) { + // require_once ROOT_DIR . '/sys/LibraryLocation/Library.php'; + global $library; + global $configArray; if ($size == 'small' || $size == 'medium'){ $sizeInArray = 'thumbnail_m'; }else{ $sizeInArray = 'thumbnail_l'; } - if (!empty($this->record[$sizeInArray][0])) { - $imageDimensions = getimagesize($this->record[$sizeInArray][0]); - if ($sizeInArray == 'thumbnail_m' && $imageDimensions[0] > 10) { - return $this->record[$sizeInArray][0]; - } elseif ($sizeInArray == 'thumbnail_l' && $imageDimensions[0] > 10) { - return $this->record[$sizeInArray][0]; - } + + if ($library->showAvailableCoversInSummon) { + if(!empty($this->record[$sizeInArray][0])){ + $imagePath = $this->record[$sizeInArray][0]; + + $imageDimensions = getImageSize($imagePath); + if($imageDimensions[0] > 10){ + return $imagePath; + } + } } if ($absolutePath) { $bookCoverUrl = $configArray['Site']['url']; @@ -242,6 +248,9 @@ public function getStaffView() { public function getTitle() { if (isset($this->record['Title'])) { $title=$this->record['Title'][0]; + if (isset($this->record['Subtitle'])) { + $title .= ': ' . $this->record['Subtitle'][0]; + } } else { $title='Unknown Title'; } @@ -339,8 +348,8 @@ public function getPrimaryAuthor() { } public function getAuthor() { - if(isset($this->record['Author'][0])) { - $author=$this->record['Author'][0]; + if(isset($this->record['Author_xml'][0]['fullname'])) { + $author=$this->record['Author_xml'][0]['fullname']; } else { $author='Unknown Title'; } diff --git a/code/web/interface/themes/responsive/Search/explore-more-bar.tpl b/code/web/interface/themes/responsive/Search/explore-more-bar.tpl index 96ec4a1f11..991435230b 100644 --- a/code/web/interface/themes/responsive/Search/explore-more-bar.tpl +++ b/code/web/interface/themes/responsive/Search/explore-more-bar.tpl @@ -1,5 +1,6 @@ {strip} {* TODO: Consider renaming classes to assume they are under the exploreMoreBar class *} +{if !empty($showExploreMoreOptions)}
{*
*}
@@ -50,4 +51,9 @@
-{/strip} \ No newline at end of file +{else} +
+
+{/if} +{/strip} + diff --git a/code/web/interface/themes/responsive/Summon/result-tools-horizontal.tpl b/code/web/interface/themes/responsive/Summon/result-tools-horizontal.tpl index d42cae024d..2f44603abe 100644 --- a/code/web/interface/themes/responsive/Summon/result-tools-horizontal.tpl +++ b/code/web/interface/themes/responsive/Summon/result-tools-horizontal.tpl @@ -5,7 +5,7 @@ {if !empty($showMoreInfo)} {if $showMoreInfo !== false}
- {translate text="More Info" isPublicFacing=true} + {translate text="More Info" isPublicFacing=true}
{/if} {if $showFavorites == 1} diff --git a/code/web/interface/themes/responsive/images/summon.png b/code/web/interface/themes/responsive/images/summon.png new file mode 100644 index 0000000000..0c0ac431a5 Binary files /dev/null and b/code/web/interface/themes/responsive/images/summon.png differ diff --git a/code/web/interface/themes/responsive/images/summon.png:Zone.Identifier b/code/web/interface/themes/responsive/images/summon.png:Zone.Identifier new file mode 100644 index 0000000000..5bfebe3650 --- /dev/null +++ b/code/web/interface/themes/responsive/images/summon.png:Zone.Identifier @@ -0,0 +1,4 @@ +[ZoneTransfer] +ZoneId=3 +ReferrerUrl=https://www.google.com/ +HostUrl=https://files.mtstatic.com/site_11811/55152/0?Expires=1708452791&Signature=O-eIysOYl-1drJTT2f6LTnuDXMhKycAnvuWBQT53Y5WC-uFeYwIE744-kFoVgc-gDsc1ODNBFX1G09SEdxs6NAzaBLFM1c9V0Xq3GZiKsUMivxIQC8YNpa9VHLWM0KE-snOgnMcGuuzuqvpFNAZA5J7FNpYuE~F2eWzOKKYIdhw_&Key-Pair-Id=APKAJ5Y6AV4GI7A555NA diff --git a/code/web/release_notes/24.06.00.MD b/code/web/release_notes/24.06.00.MD index 26a52db63a..d290eea457 100644 --- a/code/web/release_notes/24.06.00.MD +++ b/code/web/release_notes/24.06.00.MD @@ -48,10 +48,12 @@ //other + //morgan - Added new Documentation links to several settings pages (*MKD*) - Updates to default user roles: removed testing roles and a couple uncommonly used roles; updated role titles (*MKD*) + ## This release includes code contributions from - ByWater Solutions - Mark Noble (MDN) @@ -59,3 +61,10 @@ - Kodi Lein (KL) - Liz Rea (LR) - Morgan Daigneault (MKD) + +- PTFS Europe + - Alexander Blanchard (AB) + - Jacob O'Mara (JO) + + + diff --git a/code/web/sys/DBMaintenance/summon_updates.php b/code/web/sys/DBMaintenance/summon_updates.php index 18dd4db7ba..8cc0a64e4c 100644 --- a/code/web/sys/DBMaintenance/summon_updates.php +++ b/code/web/sys/DBMaintenance/summon_updates.php @@ -84,5 +84,12 @@ function getSummonUpdates() { 'ALTER TABLE library ADD COLUMN summonApiPassword VARCHAR(50)', ], ], + 'add_book_cover_display_control_in_library_settings' => [ + 'title' => 'Display Available Book Covers in Summon', + 'description' => 'Whether to display available book covers in Summon Searcher', + 'sql' => [ + "ALTER TABLE library ADD COLUMN showAvailableCoversInSummon TINYINT(1) DEFAULT 0", + ], + ], ]; } \ No newline at end of file diff --git a/code/web/sys/DBMaintenance/version_updates/24.06.00.php b/code/web/sys/DBMaintenance/version_updates/24.06.00.php index 429e2dcd65..33ff6185b8 100644 --- a/code/web/sys/DBMaintenance/version_updates/24.06.00.php +++ b/code/web/sys/DBMaintenance/version_updates/24.06.00.php @@ -63,9 +63,26 @@ function getUpdates24_06_00(): array { "ALTER TABLE ebsco_eds_settings ADD COLUMN fullTextLimiter TINYINT NOT NULL DEFAULT 1;", ], ], //full_text_limiter + //alexander - PTFS Europe + 'summon_ip_addresses' => [ + 'title' => 'Summon IP address configuration', + 'description' => 'Allow configuration of which IP addresses should automatically authenticate with Summon', + 'continueOnError' => true, + 'sql' => [ + 'ALTER TABLE ip_lookup ADD COLUMN authenticatedForSummon TINYINT DEFAULT 0', + ] + ], //summon authentication + 'explore_more_section_control' => [ + 'title' => 'Explore More Section Control', + 'description' => 'Allow control over whether the Explore More Section is displayed', + 'sql' => [ + "ALTER TABLE layout_settings ADD COLUMN showExploreMoreOptions TINYINT DEFAULT '1'", + ] + ],//control_whether_the_explore_more_box_is_displayed //other + ]; } \ No newline at end of file diff --git a/code/web/sys/ExploreMore.php b/code/web/sys/ExploreMore.php index 10c99b1f38..a80bbe0454 100644 --- a/code/web/sys/ExploreMore.php +++ b/code/web/sys/ExploreMore.php @@ -733,7 +733,7 @@ public function loadSummonOptions($activeSection, $exploreMoreOptions, $searchTe global $enabledModules; if (!empty($searchTerm) && array_key_exists('Summon', $enabledModules) && $library->summonSettingsId != -1 && $activeSection != 'summon') { //Load Summon Options - /** @var Search_Object_SummonSearcher $summonSearcher */ + /** @var SearchObject_SummonSearcher $summonSearcher */ $summonSearcher = SearchObjectFactory::initSearchObject('Summon'); $summonSearcher->setSearchTerms([ 'lookfor' => $searchTerm, @@ -745,9 +745,9 @@ public function loadSummonOptions($activeSection, $exploreMoreOptions, $searchTe $numMatches = $summonResults['recordCount']; if ($numMatches > 1) { if ($appliedTheme != null && !empty($appliedTheme->articlesDBImage)) { - //TODO path to image files + $image = '/files/origional/' . $appliedTheme->articlesDBImage; } else { - //TODO inset path to default image + $image = '/interface/themes/responsive/images/summon.png'; } $exploreMoreOptions['searchLinks'][] = [ 'label' => translate([ @@ -760,8 +760,8 @@ public function loadSummonOptions($activeSection, $exploreMoreOptions, $searchTe 1 => $searchTerm, 'isPublicFacing' => true, ]), - //'image' => $image, - //'link' => TODO, + 'image' => $image, + 'link' => '/Summon/Results?lookfor=' . urlencode($searchTerm), 'openInNewWindow' => false, ]; } diff --git a/code/web/sys/Interface.php b/code/web/sys/Interface.php index 4af661079e..c01cf04176 100644 --- a/code/web/sys/Interface.php +++ b/code/web/sys/Interface.php @@ -747,6 +747,7 @@ function loadDisplayOptions($fromBookCoverProcessing = false) { $this->assign('showDisplayNameInHeader', $library->showDisplayNameInHeader); $this->assign('externalMaterialsRequestUrl', $library->externalMaterialsRequestUrl); $this->assign('languageAndDisplayInHeader', $library->languageAndDisplayInHeader); + $this->assign('showExploreMoreOptions', $library->getLayoutSettings()->showExploreMoreOptions); if ($location != null) { $this->assign('showDisplayNameInHeader', $location->showDisplayNameInHeader); diff --git a/code/web/sys/LibraryLocation/Library.php b/code/web/sys/LibraryLocation/Library.php index d55b451d3d..8588eb122c 100644 --- a/code/web/sys/LibraryLocation/Library.php +++ b/code/web/sys/LibraryLocation/Library.php @@ -357,6 +357,7 @@ class Library extends DataObject { //Summon Settings public $summonSettingsId; + public $showAvailableCoversInSummon; //SSO public /** @noinspection PhpUnused */ @@ -3703,7 +3704,6 @@ static function getObjectStructure($context = ''): array { 'label' => 'Summon', 'hideInLists' => true, 'renderAsHeading' => true, - // 'permissions' => ['A'], 'properties' => [ 'summonSettingsId' => [ 'property' => 'summonSettingsId', @@ -3714,6 +3714,14 @@ static function getObjectStructure($context = ''): array { 'hideInLists' => true, 'default' => -1, ], + 'showAvailableCoversInSummon' => [ + 'property' => 'showAvailableCoversInSummon', + 'type' => 'checkbox', + 'label' => 'Show Available Covers in Summon', + 'description' => 'Determine whether or not available book covers should be displayed in Summon', + 'hideInLists' => true, + 'default' => 0, + ], ], ], @@ -4951,6 +4959,7 @@ public function getApiInfo(): array { 'passwordLabel' => $this->loginFormPasswordLabel ?? 'Library Card Number', 'code' => $this->ilsCode, 'finePaymentType' => (int)$this->finePaymentType, + 'showAvailableCoversInSummon' => $this->showAvailableCoversInSummon, ]; if (empty($this->baseUrl)) { $apiInfo['baseUrl'] = $configArray['Site']['url']; diff --git a/code/web/sys/SearchObject/SummonSearcher.php b/code/web/sys/SearchObject/SummonSearcher.php index f6f48dc6c7..cc12ca2d04 100644 --- a/code/web/sys/SearchObject/SummonSearcher.php +++ b/code/web/sys/SearchObject/SummonSearcher.php @@ -41,14 +41,13 @@ class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{ protected $searchType = 'basic'; /** Values for the options array*/ - protected $holdings = false; + protected $holdings = true; protected $didYouMean = false; protected $language = 'en'; protected $idsToFetch = array(); /**@var int */ protected $maxTopics = 1; protected $groupFilters = array(); - protected $rangeFilters = array(); protected $openAccessFilter = false; protected $expand = false; protected $sortOptions = array(); @@ -58,6 +57,7 @@ class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{ protected $defaultSort = 'relevance'; protected $query; protected $filters = array(); + protected $rangeFilters = array(); /** * @var int @@ -92,6 +92,18 @@ class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{ 'SourceType,or,1,30', ]; + protected $limits = [ + 'IsPeerReviewed,or,1,30', + 'IsScholarly,or,1,30', + ]; + + protected $rangeFacets = [ + ]; + + protected $limitList = []; + protected $limitFields; + + protected $facetFields; public function __construct() { @@ -233,13 +245,15 @@ public function getOptions () { //Fetch specific records 's.fids' =>$this->idsToFetch, //Side facets to filter by - 's.ff' =>$this->facets, + 's.ff' =>array_merge($this->facets, $this->limits), //Filters that are active - from side facets 's.fvf' => $this->getSummonFilters(), //Default 1 's.rec.topic.max' => $this->maxTopics, //Filters 's.fvgf' => $this->groupFilters, + //Range Facets + 's.rff' => $this->rangeFacets, //Filters 's.rf' => $this->rangeFilters, //Order results @@ -275,9 +289,28 @@ public function processData($recordData) { $this->page = $recordData['query']['pageNumber']; $this->resultsTotal = $recordData['recordCount']; $this->filters = $recordData['query']['facetValueFilters']; - $this->facetFields= $recordData['facetFields']; + $splitFacets = $this->splitFacets($recordData['facetFields']); + $this->facetFields = $splitFacets['facetFields']; + $this->limitFields = $splitFacets['limitFields']; } - return $recordData; + return $recordData; + } + + public function splitFacets($combinedFacets) { + $splitFacets = []; + foreach($combinedFacets as $facet) { + foreach ($this->facets as $facetName) { + if (strpos($facetName, $facet['displayName']) !== false) { + $splitFacets['facetFields'][] = $facet; + } + } + foreach ($this->limits as $limitName) { + if (strpos($limitName, $facet['displayName']) !== false) { + $splitFacets['limitFields'][] = $facet; + } + } + } + return $splitFacets; } /** @@ -428,7 +461,6 @@ public function renderLinkWithSort($newSort) { */ public function getFacetSet() { $availableFacets = []; - $label = ''; $this->filters = []; if (isset($this->facetFields)) { foreach ($this->facetFields as $facetField) { @@ -445,6 +477,11 @@ public function getFacetSet() { if ($facetId == 'ContentType') { $availableFacets[$facetId]['collapseByDefault'] = false; } + + if ($facetId == 'IsScholarly' || $facetId == 'IsPeerReviewed') { + $availableFacets[$facetId]['multiSelect'] = false; + } + $list = []; foreach ($facetField['counts'] as $value) { $facetValue = $value['value']; @@ -469,6 +506,41 @@ public function getFacetSet() { return $availableFacets; } + public function getLimitList() { + + $availableLimits=[]; + if (isset($this->limitFields)){ + foreach($this->limitFields as $limitOption){ + $limitId = $limitOption['displayName']; + $parts = preg_split('/(?=[A-Z])/', $limitId, -1, PREG_SPLIT_NO_EMPTY); + $displayName = implode(' ', $parts); + + foreach($limitOption['counts'] as $value){ + if ($value['value'] == 'true') { + $availableLimits[$limitId] = [ + 'display' => $displayName, + 'value' => $limitId, + 'isApplied' => ($this->limiters[$limitId]) == 'y' ? 1 : 0, + 'url' => $this->renderLinkWithLimiter($limitId), + 'removalUrl' => $this->renderLinkWithoutLimiter($limitId), + ]; + } + } + + } + } + return $availableLimits; + } + + public function createSearchLimits() { + foreach ($this->limiters as $limiter => $limiterOptions) { + if ($this->limiters[$limiter] == 'y') { + $this->limitList[$limiter] = $limiterOptions; + } + } + return $this->limitList; + } + //Retreive a specific record - used to retreive bookcovers public function retrieveRecord ($id) { $baseUrl = $this->summonBaseApi . '/' .$this->version . '/' .$this->service; @@ -484,6 +556,10 @@ public function retrieveRecord ($id) { //Compile filter options chosen in side facets and add to filter array to be passed in via options array public function getSummonFilters() { $this->filters = array(); + $this->createSearchLimits(); + if (isset($this->limitList) && isset($this->filterList)) { + $this->filterList = array_merge($this->limitList, $this->filterList); + } foreach ($this->filterList as $key => $value) { if (is_array($value)) { foreach ($value as $val) { diff --git a/code/web/sys/Theming/LayoutSetting.php b/code/web/sys/Theming/LayoutSetting.php index 140113b331..9e68ad8750 100644 --- a/code/web/sys/Theming/LayoutSetting.php +++ b/code/web/sys/Theming/LayoutSetting.php @@ -16,6 +16,7 @@ class LayoutSetting extends DataObject { public $showTopOfPageButton; public $dismissPlacardButtonLocation; public $dismissPlacardButtonIcon; + public $showExploreMoreOptions; public $contrastRatio; static function getObjectStructure($context = ''): array { @@ -103,6 +104,13 @@ static function getObjectStructure($context = ''): array { 'description' => 'Whether or not to show icon instead of default dismiss placard text', 'default' => false, ], + 'showExploreMoreOptions' => [ + 'property' => 'showExploreMoreOptions', + 'type' => 'checkbox', + 'label' => 'Show Explore More Options', + 'description' => 'Whether or not to display the Explore More Options box.', + 'default' => true, + ], 'contrastRatio' => [ 'property' => 'contrastRatio', 'type' => 'enum',