From e095834544e4460d6c9556dab584135fe69fc118 Mon Sep 17 00:00:00 2001 From: catsoup11789 Date: Sun, 2 Feb 2025 11:39:26 -0600 Subject: [PATCH 1/4] Add support for opening GroupedWork Discovery session (DIS-207) - Add check for id parameter - Add support for starting a shared session with LiDA to opening a Grouped Work page --- code/web/services/Authentication/LiDA.php | 27 +++++++++++++++-------- code/web/sys/Session/SharedSession.php | 14 +++++++----- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/code/web/services/Authentication/LiDA.php b/code/web/services/Authentication/LiDA.php index 81d6ea7b4b..deb0920ef2 100644 --- a/code/web/services/Authentication/LiDA.php +++ b/code/web/services/Authentication/LiDA.php @@ -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 { @@ -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 diff --git a/code/web/sys/Session/SharedSession.php b/code/web/sys/Session/SharedSession.php index 28953f2e33..554a9976e1 100644 --- a/code/web/sys/Session/SharedSession.php +++ b/code/web/sys/Session/SharedSession.php @@ -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; } @@ -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(); From 9b5d12338af82becf6e837f2ec87db97c3093639 Mon Sep 17 00:00:00 2001 From: catsoup11789 Date: Sun, 2 Feb 2025 11:48:13 -0600 Subject: [PATCH 2/4] Update 25.02.00.MD --- code/web/release_notes/25.02.00.MD | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/web/release_notes/25.02.00.MD b/code/web/release_notes/25.02.00.MD index df178196db..0488736426 100644 --- a/code/web/release_notes/25.02.00.MD +++ b/code/web/release_notes/25.02.00.MD @@ -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 @@ -140,6 +147,10 @@ //kirstien +### 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*) From 612efc4dd94ca50f3bf079528138bcf34ab7b2fc Mon Sep 17 00:00:00 2001 From: catsoup11789 Date: Mon, 3 Feb 2025 17:10:27 -0600 Subject: [PATCH 3/4] hide some details for minimal interface (DIS-207) hides cover, title information, edition information, hold buttons, etc. to display the More Information tabs right away --- .../web/interface/themes/responsive/GroupedWork/full-record.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/web/interface/themes/responsive/GroupedWork/full-record.tpl b/code/web/interface/themes/responsive/GroupedWork/full-record.tpl index 74c179c4cd..8c90a7fde4 100644 --- a/code/web/interface/themes/responsive/GroupedWork/full-record.tpl +++ b/code/web/interface/themes/responsive/GroupedWork/full-record.tpl @@ -15,6 +15,7 @@ {/if} + {if !$minimalInterface}
{if $disableCoverArt != 1} @@ -135,6 +136,7 @@
+ {/if}
{include file=$moreDetailsTemplate} From 6e60b624398dd7928997f9672832e3027e475845 Mon Sep 17 00:00:00 2001 From: catsoup11789 Date: Mon, 3 Feb 2025 17:14:07 -0600 Subject: [PATCH 4/4] Add setting to show/hide More Info button in LiDA --- code/web/release_notes/25.02.00.MD | 12 ++++++++++++ code/web/sys/AspenLiDA/GeneralSetting.php | 9 +++++++++ .../sys/DBMaintenance/version_updates/25.02.00.php | 8 ++++++++ code/web/sys/LibraryLocation/Library.php | 1 + 4 files changed, 30 insertions(+) diff --git a/code/web/release_notes/25.02.00.MD b/code/web/release_notes/25.02.00.MD index 77c354d50b..e0584e1e20 100644 --- a/code/web/release_notes/25.02.00.MD +++ b/code/web/release_notes/25.02.00.MD @@ -147,6 +147,18 @@ //kirstien +### Aspen LiDA Updates + +- Added new setting to show/hide More Info button on the Grouped Work screen in Aspen LiDA. (DIS-207) (*KK*) + +
+ +#### New Settings + +- Aspen LiDA > General Settings > Show More Info button on Grouped Work Screen + +
+ ### API Updates - Add support for starting a Shared Session with LiDA to open a Grouped Work (DIS-207) (*KK*) diff --git a/code/web/sys/AspenLiDA/GeneralSetting.php b/code/web/sys/AspenLiDA/GeneralSetting.php index f12da186a2..42150e1c66 100644 --- a/code/web/sys/AspenLiDA/GeneralSetting.php +++ b/code/web/sys/AspenLiDA/GeneralSetting.php @@ -6,6 +6,7 @@ class GeneralSetting extends DataObject { public $name; public $autoRotateCard; public $enableSelfRegistration; + public $showMoreInfoBtn; private $_libraries; @@ -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', diff --git a/code/web/sys/DBMaintenance/version_updates/25.02.00.php b/code/web/sys/DBMaintenance/version_updates/25.02.00.php index 197da38ea3..edcb766038 100644 --- a/code/web/sys/DBMaintenance/version_updates/25.02.00.php +++ b/code/web/sys/DBMaintenance/version_updates/25.02.00.php @@ -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 diff --git a/code/web/sys/LibraryLocation/Library.php b/code/web/sys/LibraryLocation/Library.php index 6c5b8bd59d..8638698456 100644 --- a/code/web/sys/LibraryLocation/Library.php +++ b/code/web/sys/LibraryLocation/Library.php @@ -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();