Skip to content

Commit

Permalink
Merge pull request #48 from AlexanderBlanchardAC/summon_new_features
Browse files Browse the repository at this point in the history
Summon new features - moving to 24.06.00
  • Loading branch information
AlexanderBlanchardAC authored May 14, 2024
2 parents dbe77f7 + 8d71472 commit ae13f23
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 26 deletions.
Binary file added code/folio_export/folio_export.jar
Binary file not shown.
27 changes: 18 additions & 9 deletions code/web/RecordDrivers/SummonRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -236,6 +242,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';
}
Expand Down Expand Up @@ -333,8 +342,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';
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{strip}
{* TODO: Consider renaming classes to assume they are under the exploreMoreBar class *}
{if !empty($showExploreMoreOptions)}
<div class="exploreMoreBar row">
{*<div class="label-left">*}
<div class="label-top">
Expand Down Expand Up @@ -50,4 +51,9 @@
</div>

</div>
{/strip}
{else}
<div>
</div>
{/if}
{/strip}

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{if !empty($showMoreInfo)}
{if $showMoreInfo !== false}
<div class="btn-group btn-group-sm">
<a href="{if !empty($summUrl)}{$summUrl}{else}{$recordDriver->getLinkUrl()}{/if}" class="btn btn-sm btn-tools" onclick="AspenDiscovery.EBSCO.trackEdsUsage('{$recordDriver->getPermanentId()}')" target="_blank" aria-label="{translate text='More Info' isPublicFacing=true} ({translate text='opens in new window' isPublicFacing=true})"><i class="fas fa-external-link-alt" role="presentation"></i> {translate text="More Info" isPublicFacing=true}</a>
<a href="{if !empty($summUrl)}{$summUrl}{else}{$recordDriver->getLinkUrl()}{/if}" class="btn btn-sm btn-tools" onclick="AspenDiscovery.Summon.trackSummonUsage('{$recordDriver->getPermanentId()}')" target="_blank" aria-label="{translate text='More Info' isPublicFacing=true} ({translate text='opens in new window' isPublicFacing=true})"><i class="fas fa-external-link-alt" role="presentation"></i> {translate text="More Info" isPublicFacing=true}</a>
</div>
{/if}
{if $showFavorites == 1}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions code/web/release_notes/24.06.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Aspen Discovery Updates
//mark


- Added option for Explore More bar to be hidden (*AB*)
- Added control over whether images avaialble from the API are used in a Summon Search or whether Aspen created covers only should be used - impacts load speed. (*AB*)
- Limited Summon Search results to those within each libraries subscription. (*AB / JO*)
- Added limit filters for Summon Search - search by whether record is scholarly and whether it is peer reviewed. (*AB / JO*)
### Koha Updates
- When a user has opted out of auto-renewal, do not show auto-renewal message even if the title is otherwise eligible for auto-renewal. (Ticket 131789) (*MDN*)

Expand All @@ -21,3 +27,7 @@
- Mark Noble (MDN)
- Kirstin Kroeger
- Kodi Lein (KL)

- PTFS Europe
- Alexander Blanchard (AB)
- Jacob O'Mara (JO)
7 changes: 7 additions & 0 deletions code/web/sys/DBMaintenance/summon_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
],
];
}
2 changes: 1 addition & 1 deletion code/web/sys/DBMaintenance/version_updates/23.12.01.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ function getUpdates23_12_01(): array {
'UPDATE overdrive_settings SET runFullUpdate = 1',
]
], //force_overdrive_full_update
];
];
}
2 changes: 0 additions & 2 deletions code/web/sys/DBMaintenance/version_updates/24.05.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ function getUpdates24_05_00(): array {
'ALTER TABLE javascript_snippets ADD COLUMN containsAnalyticsCookies TINYINT(1)'
]
], //Snippet_Contains_Marketing_Cookies


];
}

Expand Down
17 changes: 17 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.06.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ function getUpdates24_06_00(): array {

//other

//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


];
}
10 changes: 5 additions & 5 deletions code/web/sys/ExploreMore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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([
Expand All @@ -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,
];
}
Expand Down
1 change: 1 addition & 0 deletions code/web/sys/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,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);
Expand Down
11 changes: 10 additions & 1 deletion code/web/sys/LibraryLocation/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ class Library extends DataObject {

//Summon Settings
public $summonSettingsId;
public $showAvailableCoversInSummon;

//SSO
public /** @noinspection PhpUnused */
Expand Down Expand Up @@ -3703,7 +3704,6 @@ static function getObjectStructure($context = ''): array {
'label' => 'Summon',
'hideInLists' => true,
'renderAsHeading' => true,
// 'permissions' => ['A'],
'properties' => [
'summonSettingsId' => [
'property' => 'summonSettingsId',
Expand All @@ -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,
],
],
],

Expand Down Expand Up @@ -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'];
Expand Down
Loading

0 comments on commit ae13f23

Please sign in to comment.