Skip to content

Commit ae13f23

Browse files
Merge pull request #48 from AlexanderBlanchardAC/summon_new_features
Summon new features - moving to 24.06.00
2 parents dbe77f7 + 8d71472 commit ae13f23

File tree

16 files changed

+171
-26
lines changed

16 files changed

+171
-26
lines changed

code/folio_export/folio_export.jar

545 KB
Binary file not shown.

code/web/RecordDrivers/SummonRecordDriver.php

+18-9
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,25 @@ public function isValid() {
2424
}
2525

2626
public function getBookcoverUrl($size='large', $absolutePath = false) {
27+
// require_once ROOT_DIR . '/sys/LibraryLocation/Library.php';
28+
global $library;
29+
2730
global $configArray;
2831
if ($size == 'small' || $size == 'medium'){
2932
$sizeInArray = 'thumbnail_m';
3033
}else{
3134
$sizeInArray = 'thumbnail_l';
3235
}
33-
if (!empty($this->record[$sizeInArray][0])) {
34-
$imageDimensions = getimagesize($this->record[$sizeInArray][0]);
35-
if ($sizeInArray == 'thumbnail_m' && $imageDimensions[0] > 10) {
36-
return $this->record[$sizeInArray][0];
37-
} elseif ($sizeInArray == 'thumbnail_l' && $imageDimensions[0] > 10) {
38-
return $this->record[$sizeInArray][0];
39-
}
36+
37+
if ($library->showAvailableCoversInSummon) {
38+
if(!empty($this->record[$sizeInArray][0])){
39+
$imagePath = $this->record[$sizeInArray][0];
40+
41+
$imageDimensions = getImageSize($imagePath);
42+
if($imageDimensions[0] > 10){
43+
return $imagePath;
44+
}
45+
}
4046
}
4147
if ($absolutePath) {
4248
$bookCoverUrl = $configArray['Site']['url'];
@@ -236,6 +242,9 @@ public function getStaffView() {
236242
public function getTitle() {
237243
if (isset($this->record['Title'])) {
238244
$title=$this->record['Title'][0];
245+
if (isset($this->record['Subtitle'])) {
246+
$title .= ': ' . $this->record['Subtitle'][0];
247+
}
239248
} else {
240249
$title='Unknown Title';
241250
}
@@ -333,8 +342,8 @@ public function getPrimaryAuthor() {
333342
}
334343

335344
public function getAuthor() {
336-
if(isset($this->record['Author'][0])) {
337-
$author=$this->record['Author'][0];
345+
if(isset($this->record['Author_xml'][0]['fullname'])) {
346+
$author=$this->record['Author_xml'][0]['fullname'];
338347
} else {
339348
$author='Unknown Title';
340349
}

code/web/interface/themes/responsive/Search/explore-more-bar.tpl

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{strip}
22
{* TODO: Consider renaming classes to assume they are under the exploreMoreBar class *}
3+
{if !empty($showExploreMoreOptions)}
34
<div class="exploreMoreBar row">
45
{*<div class="label-left">*}
56
<div class="label-top">
@@ -50,4 +51,9 @@
5051
</div>
5152

5253
</div>
53-
{/strip}
54+
{else}
55+
<div>
56+
</div>
57+
{/if}
58+
{/strip}
59+

code/web/interface/themes/responsive/Summon/result-tools-horizontal.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{if !empty($showMoreInfo)}
66
{if $showMoreInfo !== false}
77
<div class="btn-group btn-group-sm">
8-
<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>
8+
<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>
99
</div>
1010
{/if}
1111
{if $showFavorites == 1}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[ZoneTransfer]
2+
ZoneId=3
3+
ReferrerUrl=https://www.google.com/
4+
HostUrl=https://files.mtstatic.com/site_11811/55152/0?Expires=1708452791&Signature=O-eIysOYl-1drJTT2f6LTnuDXMhKycAnvuWBQT53Y5WC-uFeYwIE744-kFoVgc-gDsc1ODNBFX1G09SEdxs6NAzaBLFM1c9V0Xq3GZiKsUMivxIQC8YNpa9VHLWM0KE-snOgnMcGuuzuqvpFNAZA5J7FNpYuE~F2eWzOKKYIdhw_&Key-Pair-Id=APKAJ5Y6AV4GI7A555NA

code/web/release_notes/24.06.00.MD

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Aspen Discovery Updates
44
//mark
5+
6+
7+
- Added option for Explore More bar to be hidden (*AB*)
8+
- 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*)
9+
- Limited Summon Search results to those within each libraries subscription. (*AB / JO*)
10+
- Added limit filters for Summon Search - search by whether record is scholarly and whether it is peer reviewed. (*AB / JO*)
511
### Koha Updates
612
- 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*)
713

@@ -21,3 +27,7 @@
2127
- Mark Noble (MDN)
2228
- Kirstin Kroeger
2329
- Kodi Lein (KL)
30+
31+
- PTFS Europe
32+
- Alexander Blanchard (AB)
33+
- Jacob O'Mara (JO)

code/web/sys/DBMaintenance/summon_updates.php

+7
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,12 @@ function getSummonUpdates() {
8484
'ALTER TABLE library ADD COLUMN summonApiPassword VARCHAR(50)',
8585
],
8686
],
87+
'add_book_cover_display_control_in_library_settings' => [
88+
'title' => 'Display Available Book Covers in Summon',
89+
'description' => 'Whether to display available book covers in Summon Searcher',
90+
'sql' => [
91+
"ALTER TABLE library ADD COLUMN showAvailableCoversInSummon TINYINT(1) DEFAULT 0",
92+
],
93+
],
8794
];
8895
}

code/web/sys/DBMaintenance/version_updates/23.12.01.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ function getUpdates23_12_01(): array {
1919
'UPDATE overdrive_settings SET runFullUpdate = 1',
2020
]
2121
], //force_overdrive_full_update
22-
];
22+
];
2323
}

code/web/sys/DBMaintenance/version_updates/24.05.00.php

-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ function getUpdates24_05_00(): array {
123123
'ALTER TABLE javascript_snippets ADD COLUMN containsAnalyticsCookies TINYINT(1)'
124124
]
125125
], //Snippet_Contains_Marketing_Cookies
126-
127-
128126
];
129127
}
130128

code/web/sys/DBMaintenance/version_updates/24.06.00.php

+17
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ function getUpdates24_06_00(): array {
2020

2121
//other
2222

23+
//alexander - PTFS Europe
24+
'summon_ip_addresses' => [
25+
'title' => 'Summon IP address configuration',
26+
'description' => 'Allow configuration of which IP addresses should automatically authenticate with Summon',
27+
'continueOnError' => true,
28+
'sql' => [
29+
'ALTER TABLE ip_lookup ADD COLUMN authenticatedForSummon TINYINT DEFAULT 0',
30+
]
31+
], //summon authentication
32+
'explore_more_section_control' => [
33+
'title' => 'Explore More Section Control',
34+
'description' => 'Allow control over whether the Explore More Section is displayed',
35+
'sql' => [
36+
"ALTER TABLE layout_settings ADD COLUMN showExploreMoreOptions TINYINT DEFAULT '1'",
37+
]
38+
],//control_whether_the_explore_more_box_is_displayed
39+
2340

2441
];
2542
}

code/web/sys/ExploreMore.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ public function loadSummonOptions($activeSection, $exploreMoreOptions, $searchTe
733733
global $enabledModules;
734734
if (!empty($searchTerm) && array_key_exists('Summon', $enabledModules) && $library->summonSettingsId != -1 && $activeSection != 'summon') {
735735
//Load Summon Options
736-
/** @var Search_Object_SummonSearcher $summonSearcher */
736+
/** @var SearchObject_SummonSearcher $summonSearcher */
737737
$summonSearcher = SearchObjectFactory::initSearchObject('Summon');
738738
$summonSearcher->setSearchTerms([
739739
'lookfor' => $searchTerm,
@@ -745,9 +745,9 @@ public function loadSummonOptions($activeSection, $exploreMoreOptions, $searchTe
745745
$numMatches = $summonResults['recordCount'];
746746
if ($numMatches > 1) {
747747
if ($appliedTheme != null && !empty($appliedTheme->articlesDBImage)) {
748-
//TODO path to image files
748+
$image = '/files/origional/' . $appliedTheme->articlesDBImage;
749749
} else {
750-
//TODO inset path to default image
750+
$image = '/interface/themes/responsive/images/summon.png';
751751
}
752752
$exploreMoreOptions['searchLinks'][] = [
753753
'label' => translate([
@@ -760,8 +760,8 @@ public function loadSummonOptions($activeSection, $exploreMoreOptions, $searchTe
760760
1 => $searchTerm,
761761
'isPublicFacing' => true,
762762
]),
763-
//'image' => $image,
764-
//'link' => TODO,
763+
'image' => $image,
764+
'link' => '/Summon/Results?lookfor=' . urlencode($searchTerm),
765765
'openInNewWindow' => false,
766766
];
767767
}

code/web/sys/Interface.php

+1
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ function loadDisplayOptions($fromBookCoverProcessing = false) {
740740
$this->assign('showDisplayNameInHeader', $library->showDisplayNameInHeader);
741741
$this->assign('externalMaterialsRequestUrl', $library->externalMaterialsRequestUrl);
742742
$this->assign('languageAndDisplayInHeader', $library->languageAndDisplayInHeader);
743+
$this->assign('showExploreMoreOptions', $library->getLayoutSettings()->showExploreMoreOptions);
743744

744745
if ($location != null) {
745746
$this->assign('showDisplayNameInHeader', $location->showDisplayNameInHeader);

code/web/sys/LibraryLocation/Library.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ class Library extends DataObject {
357357

358358
//Summon Settings
359359
public $summonSettingsId;
360+
public $showAvailableCoversInSummon;
360361

361362
//SSO
362363
public /** @noinspection PhpUnused */
@@ -3703,7 +3704,6 @@ static function getObjectStructure($context = ''): array {
37033704
'label' => 'Summon',
37043705
'hideInLists' => true,
37053706
'renderAsHeading' => true,
3706-
// 'permissions' => ['A'],
37073707
'properties' => [
37083708
'summonSettingsId' => [
37093709
'property' => 'summonSettingsId',
@@ -3714,6 +3714,14 @@ static function getObjectStructure($context = ''): array {
37143714
'hideInLists' => true,
37153715
'default' => -1,
37163716
],
3717+
'showAvailableCoversInSummon' => [
3718+
'property' => 'showAvailableCoversInSummon',
3719+
'type' => 'checkbox',
3720+
'label' => 'Show Available Covers in Summon',
3721+
'description' => 'Determine whether or not available book covers should be displayed in Summon',
3722+
'hideInLists' => true,
3723+
'default' => 0,
3724+
],
37173725
],
37183726
],
37193727

@@ -4951,6 +4959,7 @@ public function getApiInfo(): array {
49514959
'passwordLabel' => $this->loginFormPasswordLabel ?? 'Library Card Number',
49524960
'code' => $this->ilsCode,
49534961
'finePaymentType' => (int)$this->finePaymentType,
4962+
'showAvailableCoversInSummon' => $this->showAvailableCoversInSummon,
49544963
];
49554964
if (empty($this->baseUrl)) {
49564965
$apiInfo['baseUrl'] = $configArray['Site']['url'];

0 commit comments

Comments
 (0)