Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…iscovery into 25.02.00
  • Loading branch information
mdnoble73 committed Feb 4, 2025
2 parents 340133c + 00a8859 commit d661edf
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{/if}
</h1>

{if !$minimalInterface}
<div class="row">
<div class="col-xs-4 col-sm-5 col-md-4 col-lg-3 text-center">
{if $disableCoverArt != 1}
Expand Down Expand Up @@ -135,6 +136,7 @@

</div>
</div>
{/if}

<div class="row">
{include file=$moreDetailsTemplate}
Expand Down
23 changes: 23 additions & 0 deletions code/web/release_notes/25.02.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
- When copying .env files during the build process, check for local .env files (prefixed by the slug). (DIS-270) (*MDN*)
- Pass app slug to Aspen Discovery as a header. (DIS-270) (*MDN*)

// kirstien

- On the Library Card screen, fixed a bug where 'Manage Alternate Library Card' button was displaying when the library
did not have the feature enabled. (DIS-201) (*KK*)
- Add 'More Info' button at bottom of the Grouped Work screen to open up the grouped work in Aspen Discovery to provide
the user with additional details. (DIS-207) (*KK*)

## Aspen Discovery Updates
//mark
### Account Profile Updates
Expand Down Expand Up @@ -141,6 +148,22 @@

//kirstien

### Aspen LiDA Updates

- Added new setting to show/hide More Info button on the Grouped Work screen in Aspen LiDA. (DIS-207) (*KK*)

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

#### New Settings

- Aspen LiDA > General Settings > Show More Info button on Grouped Work Screen

</div>

### API Updates

- Add support for starting a Shared Session with LiDA to open a Grouped Work (DIS-207) (*KK*)

//james
### Carl.X Updates
- Add Lost items to Checked Out page (DIS-244) (*JStaub*)
Expand Down
27 changes: 18 additions & 9 deletions code/web/services/Authentication/LiDA.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ public function launch() {
$logger->log('Starting LiDA Authentication', Logger::LOG_ERROR);

$returnTo = $_REQUEST['goTo'] ?? 'Home';
$id = $_REQUEST['id'] ?? null;

if(isset($_REQUEST['session']) && isset($_REQUEST['user'])) {
if (isset($_REQUEST['session']) && isset($_REQUEST['user'])) {
$session = new SharedSession();
$session->setSessionId($_REQUEST['session']);
$session->setUserId($_REQUEST['user']);
if($session->find(true)) {
if($session->isSessionStillValid()) {
if ($session->find(true)) {
if ($session->isSessionStillValid()) {
if (UserAccount::findNewAspenUser('id', $_REQUEST['user'])) {
$tmpUser = new User();
$tmpUser->id = $_REQUEST['user'];
if ($tmpUser->find(true)) {
$session->redirectUser($tmpUser, $returnTo);
$session->redirectUser($tmpUser, $returnTo, $id);
}
}
} else {
Expand All @@ -44,17 +45,25 @@ public function launch() {
$tmpUser = new User();
$tmpUser->id = $_REQUEST['user'];
if ($tmpUser->find(true)) {
$session->redirectUser($tmpUser, $returnTo);
$session->redirectUser($tmpUser, $returnTo, $id);
}
}
}
} else {
// no matching shared session found, ask the user to log into Discovery
header('Location: /MyAccount/' . $returnTo . '?minimalInterface=true');
// no matching shared session found, we just redirect them to the requested page and will be asked to log in when necessary
if ($returnTo === 'GroupedWork' && $id) {
header('Location: /GroupedWork/' . $id . '/Home/?minimalInterface=true');
} else {
header('Location: /MyAccount/' . $returnTo . '?minimalInterface=true');
}
}
} else {
// not enough data provided, ask the user to log into Discovery
header('Location: /MyAccount/' . $returnTo . '?minimalInterface=true');
// not enough data provided, we just redirect them to the requested page and will be asked to log in when necessary
if ($returnTo === 'GroupedWork' && $id) {
header('Location: /GroupedWork/' . $id . '/Home/?minimalInterface=true');
} else {
header('Location: /MyAccount/' . $returnTo . '?minimalInterface=true');
}
}
} else {
// probably ended up here by mistake
Expand Down
9 changes: 9 additions & 0 deletions code/web/sys/AspenLiDA/GeneralSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class GeneralSetting extends DataObject {
public $name;
public $autoRotateCard;
public $enableSelfRegistration;
public $showMoreInfoBtn;

private $_libraries;

Expand Down Expand Up @@ -41,6 +42,14 @@ static function getObjectStructure($context = ''): array {
'description' => 'Whether or not users can self register for a new account in LiDA.',
'hideInLists' => true,
],
'showMoreInfoBtn' => [
'property' => 'showMoreInfoBtn',
'type' => 'checkbox',
'label' => 'Show More Info button on Grouped Work Screen',
'note' => 'This button opens up an in-app Aspen Discovery session to see additional record information.',
'description' => 'Whether or not to display a More Info button in Aspen LiDA on the Grouped Work screen.',
'hideInLists' => true,
],
'libraries' => [
'property' => 'libraries',
'type' => 'multiSelect',
Expand Down
8 changes: 8 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/25.02.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ function getUpdates25_02_00(): array {
//katherine

//kirstien - Grove
'lida_general_settings_add_more_info' => [
'title' => 'Add option in Aspen LiDA General Settings to display More Info button',
'description' => 'Add option in Aspen LiDA General Settings to display More Info button',
'sql' => [
"ALTER TABLE aspen_lida_general_settings add COLUMN showMoreInfoBtn TINYINT(1) DEFAULT 1"
]
],
//lida_general_settings_add_more_info

//kodi

Expand Down
1 change: 1 addition & 0 deletions code/web/sys/LibraryLocation/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -5475,6 +5475,7 @@ public function getApiInfo(): array {
$generalSettings = $this->getLiDAGeneralSettings();
$apiInfo['generalSettings']['autoRotateCard'] = $generalSettings->autoRotateCard ?? 0;
$apiInfo['enableSelfRegistrationInApp'] = $generalSettings->enableSelfRegistration ?? 0;
$apiInfo['showMoreInfoBtn'] = (int)$generalSettings->showMoreInfoBtn ?? 0;

$apiInfo['hasEventSettings'] = $this->hasEventSettings();

Expand Down
14 changes: 8 additions & 6 deletions code/web/sys/Session/SharedSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function isSessionStillValid() {
return $this->createdOn < strtotime('+1 hour', $this->createdOn);
}

public function getSessionId() : mixed {
public function getSessionId(): mixed {
return $this->sessionId;
}

Expand Down Expand Up @@ -45,15 +45,17 @@ public function setCreated($created): void {
$this->createdOn = $created;
}

public function redirectUser(User $user, $returnTo) {
// for now, we will assume users are being redirected to a MyAccount action
public function redirectUser(User $user, $returnTo, $id = null) {
$page = '/MyAccount/' . $returnTo;
if ($returnTo === 'GroupedWork' && $id) {
$page = '/GroupedWork/' . $id . '/Home/';
}

global $configArray;
$redirectTo = $configArray['Site']['url'] . $page . '?minimalInterface=true'; // set minimalInterface to hide some unnecessary elements that clutter the mobile UI
if(UserAccount::loginWithAspen($user)) {
if (UserAccount::loginWithAspen($user)) {
global $timer;
/** SessionInterface $session */
global $session;
/** SessionInterface $session */ global $session;
require_once ROOT_DIR . '/sys/Session/MySQLSession.php';
session_name('aspen_session');
$session = new MySQLSession();
Expand Down

0 comments on commit d661edf

Please sign in to comment.