Skip to content

Commit

Permalink
Merge branch '24.10.10' into 24.11.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Oct 17, 2024
2 parents 93125ac + c72b50e commit 6c3b133
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 6 deletions.
22 changes: 16 additions & 6 deletions code/web/Drivers/marmot_inc/SearchSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private static function getSearchSourcesDefault() {
$repeatInWorldCat = $location->repeatInWorldCat == 1;
$repeatInInnReach = $location->repeatInInnReach == 1;
$repeatInShareIt = $location->repeatInShareIt == 1;
$repeatInCloudSource = $location->repeatInCloudSource == 1;
if (strlen($location->systemsToRepeatIn) > 0) {
$systemsToRepeatIn = explode('|', $location->systemsToRepeatIn);
} else {
Expand All @@ -81,6 +82,7 @@ private static function getSearchSourcesDefault() {
$repeatInWorldCat = $library->repeatInWorldCat == 1;
$repeatInInnReach = $library->repeatInInnReach == 1;
$repeatInShareIt = $library->repeatInShareIt == 1;
$repeatInCloudSource = $library->repeatInCloudSource == 1;
$systemsToRepeatIn = explode('|', $library->systemsToRepeatIn);
}

Expand Down Expand Up @@ -304,6 +306,16 @@ private static function getSearchSourcesDefault() {
];
}

if ($repeatInCloudSource) {
$searchOptions['cloudSource'] = [
'name' => 'CloudSource',
'description' => "Open Articles, eBooks, eTextBooks, and more from CloudSource.",
'external' => true,
'catalogType' => 'cloudSource',
'hasAdvancedSearch' => false,
];
}

if ($repeatInInnReach) {
$searchOptions['innReach'] = [
'name' => $library->interLibraryLoanName,
Expand Down Expand Up @@ -392,23 +404,19 @@ static function getCombinedSearchSetupParameters($location, $library) {
}

public function getWorldCatSearchType($type) {
/** @noinspection PhpSwitchCanBeReplacedWithMatchExpressionInspection */
switch ($type) {
case 'Subject':
return 'su';
break;
case 'Author':
return 'au';
break;
case 'Title':
return 'ti';
break;
case 'ISN':
return 'bn';
break;
case 'Keyword':
default:
return 'kw';
break;
}
}

Expand All @@ -418,7 +426,7 @@ public function getExternalLink($searchSource, $type, $lookFor) : string {
global $configArray;
if ($searchSource == 'worldcat') {
$worldCatSearchType = $this->getWorldCatSearchType($type);
$worldCatLink = "http://www.worldcat.org/search?q={$worldCatSearchType}%3A" . urlencode($lookFor);
$worldCatLink = "https://www.worldcat.org/search?q={$worldCatSearchType}%3A" . urlencode($lookFor);
if (strlen($library->worldCatUrl) > 0) {
$worldCatLink = $library->worldCatUrl;
if (strpos($worldCatLink, '?') == false) {
Expand Down Expand Up @@ -469,6 +477,8 @@ public function getExternalLink($searchSource, $type, $lookFor) : string {
];
$link = $shareIt->getSearchLink($searchTerms);
return $link;
} elseif ($searchSource == 'cloudSource') {
return $library->cloudSourceBaseUrl . '/search/results?qu=' . urlencode($lookFor) . '&te=1803299674&dt=list';
} elseif ($searchSource == 'amazon') {
return "http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=" . urlencode($lookFor);
} elseif ($searchSource == 'course-reserves-course-name') {
Expand Down
18 changes: 18 additions & 0 deletions code/web/release_notes/24.10.10.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Aspen Discovery Updates
### CloudSource Updates
- Allow repeating searches within [CloudSource](https://cloudsource.net) so open articles, eBooks, eTextbooks, and more can be searched. (DIS-36)

<div markdown="1" class="settings">

#### New Settings
- Primary Configuration > Library Systems > CloudSource > Repeat In CloudSource
- Primary Configuration > Library Systems > CloudSource > CloudSource URL
- Primary Configuration > Library Systems > Locations > Searching > Search Box > Repeat In CloudSource
</div>

## This release includes code contributions from
- Grove For Libraries
- Mark Noble (MDN)

## This release includes sponsored developments from
- CLEVNET
27 changes: 27 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.10.10.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

function getUpdates24_10_10(): array {
$curTime = time();
return [
/*'name' => [
'title' => '',
'description' => '',
'continueOnError' => false,
'sql' => [
''
]
], //name*/

//mark - Grove
'repeat_in_cloudsource' => [
'title' => 'Repeat in CloudSource',
'description' => 'Add information to allow repeat in CloudSource to work properly.',
'continueOnError' => true,
'sql' => [
'ALTER TABLE library ADD COLUMN repeatInCloudSource TINYINT DEFAULT 0',
"ALTER TABLE library ADD COLUMN cloudSourceBaseUrl VARCHAR(255) DEFAULT ''",
'ALTER TABLE location ADD COLUMN repeatInCloudSource TINYINT DEFAULT 0',
],
],
];
}
28 changes: 28 additions & 0 deletions code/web/sys/LibraryLocation/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class Library extends DataObject {
$repeatInInnReach;
public /** @noinspection PhpUnused */
$repeatInWorldCat;
public $repeatInCloudSource;
public $cloudSourceBaseUrl;
public $overDriveScopeId;

public $hooplaLibraryID;
Expand Down Expand Up @@ -3805,6 +3807,32 @@ static function getObjectStructure($context = ''): array {
],
],
],
'cloudSourceSection' => [
'property' => 'cloudSourceSection',
'type' => 'section',
'label' => 'CloudSource',
'hideInLists' => true,
'renderAsHeading' => true,
'helpLink' => '',
'properties' => [
'repeatInCloudSource' => [
'property' => 'repeatInCloudSource',
'type' => 'checkbox',
'label' => 'Repeat In CloudSource',
'description' => 'Turn on to allow repeat search in CloudSource functionality.',
'hideInLists' => true,
],
'cloudSourceBaseUrl' => [
'property' => 'cloudSourceBaseUrl',
'type' => 'text',
'label' => 'CloudSource URL',
'description' => 'The base CloudSource URL to use while searching.',
'note' => 'Will be similar to https://csclient2.ent.sirsi.net/client/en_US/{customer_name}.',
'hideInLists' => true,
'size' => '255',
],
],
],
'hooplaSection' => [
'property' => 'hooplaSection',
'type' => 'section',
Expand Down
10 changes: 10 additions & 0 deletions code/web/sys/LibraryLocation/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Location extends DataObject {
public $repeatInInnReach;
public $repeatInWorldCat;
public $repeatInShareIt;
public $repeatInCloudSource;
public $vdxFormId;
public $vdxLocation;
public $systemsToRepeatIn;
Expand Down Expand Up @@ -164,6 +165,7 @@ function getNumericColumnNames(): array {
'repeatInInnReach',
'repeatInWorldCat',
'repeatInShareIt',
'repeatInCloudSource',
'showEmailThis',
'showShareOnExternalSites',
'showFavorites',
Expand Down Expand Up @@ -905,6 +907,14 @@ static function getObjectStructure($context = ''): array {
'hideInLists' => true,
'default' => false,
],
[
'property' => 'repeatInCloudSource',
'type' => 'checkbox',
'label' => 'Repeat In CloudSource',
'description' => 'Turn on to allow repeat search in CloudSource functionality.',
'hideInLists' => true,
'default' => false,
],
],
],
[
Expand Down

0 comments on commit 6c3b133

Please sign in to comment.