From a7fcfdac151fa290a59a6100fd1e45a7416be8a3 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Fri, 2 Aug 2024 15:03:40 -0600 Subject: [PATCH] Add the ability to show checkout grid per format type for Sierra Systems --- code/web/RecordDrivers/MarcRecordDriver.php | 25 ++++++++++++++++--- code/web/release_notes/24.09.00.MD | 9 +++++++ .../version_updates/24.09.00.php | 9 +++++++ code/web/sys/Indexing/FormatMapValue.php | 10 ++++++++ code/web/sys/Indexing/IndexingProfile.php | 6 ++++- 5 files changed, 54 insertions(+), 5 deletions(-) diff --git a/code/web/RecordDrivers/MarcRecordDriver.php b/code/web/RecordDrivers/MarcRecordDriver.php index 5edf48c556..606249ed5f 100644 --- a/code/web/RecordDrivers/MarcRecordDriver.php +++ b/code/web/RecordDrivers/MarcRecordDriver.php @@ -1612,12 +1612,29 @@ public function getMoreDetailsOptions() { //Get copies for the record $this->assignCopiesInformation(); + $ils = 'Unknown'; + if ($this->getIndexingProfile()->getAccountProfile() != null) { + $ils = $this->getIndexingProfile()->getAccountProfile()->ils; + + } + //If this is a periodical we may have additional information $isPeriodical = false; + require_once ROOT_DIR . '/sys/Indexing/FormatMapValue.php'; foreach ($this->getFormats() as $format) { - if ($format == 'Journal' || $format == 'Newspaper' || $format == 'Print Periodical' || $format == 'Magazine') { - $isPeriodical = true; - break; + if ($ils == 'sierra' || $ils == 'millennium') { + $formatValue = new FormatMapValue(); + $formatValue->format = $format; + $formatValue->displaySierraCheckoutGrid = 1; + if ($formatValue->find(true)) { + $isPeriodical = true; + break; + } + }else{ + if ($format == 'Journal' || $format == 'Newspaper' || $format == 'Print Periodical' || $format == 'Magazine') { + $isPeriodical = true; + break; + } } } if ($isPeriodical) { @@ -1641,7 +1658,7 @@ public function getMoreDetailsOptions() { $showLastCheckIn = false; if ($this->getIndexingProfile()->getAccountProfile() != null) { $ils = $this->getIndexingProfile()->getAccountProfile()->ils; - if ($ils == 'Sierra' || $ils == 'Millennium') { + if ($ils == 'sierra' || $ils == 'millennium') { $showLastCheckIn = $interface->getVariable('hasLastCheckinData'); } } diff --git a/code/web/release_notes/24.09.00.MD b/code/web/release_notes/24.09.00.MD index f926f44146..6c56975a88 100644 --- a/code/web/release_notes/24.09.00.MD +++ b/code/web/release_notes/24.09.00.MD @@ -2,6 +2,15 @@ ## Aspen Discovery Updates // mark +### Sierra Updates +- Add the ability to show checkout grid per format type for Sierra Systems. (Ticket 133281) (*MDN*) + +
+ +#### New Settings +- ILS Integration > Indexing Profiles > Format Information > Display Sierra Checkout Grid? + +
// katherine diff --git a/code/web/sys/DBMaintenance/version_updates/24.09.00.php b/code/web/sys/DBMaintenance/version_updates/24.09.00.php index d4c450762f..b4cd2dd357 100644 --- a/code/web/sys/DBMaintenance/version_updates/24.09.00.php +++ b/code/web/sys/DBMaintenance/version_updates/24.09.00.php @@ -13,6 +13,15 @@ function getUpdates24_09_00(): array { ], //name*/ //mark - ByWater + 'show_checkout_grid_by_format' => [ + 'title' => 'Show Sierra Checkout Grid by Format', + 'description' => 'Add the ability to enable or disable the Sierra checkout grid by Format', + 'continueOnError' => false, + 'sql' => [ + 'ALTER TABLE format_map_values ADD COLUMN displaySierraCheckoutGrid TINYINT(1) DEFAULT 0', + "UPDATE format_map_values SET displaySierraCheckoutGrid = 1 where format IN ('Journal', 'Newspaper', 'Print Periodical', 'Magazine')" + ] + ], //show_checkout_grid_by_format //katherine - ByWater diff --git a/code/web/sys/Indexing/FormatMapValue.php b/code/web/sys/Indexing/FormatMapValue.php index 0353e5249e..47a444d406 100644 --- a/code/web/sys/Indexing/FormatMapValue.php +++ b/code/web/sys/Indexing/FormatMapValue.php @@ -16,6 +16,7 @@ class FormatMapValue extends DataObject { public $appliesToItemType; public $appliesToItemFormat; public $appliesToFallbackFormat; + public $displaySierraCheckoutGrid; public $suppress; public /** @noinspection PhpUnused */ @@ -198,6 +199,15 @@ static function getObjectStructure($context = ''): array { 'required' => true, 'forcesReindex' => false, ], + 'displaySierraCheckoutGrid' => [ + 'property' => 'displaySierraCheckoutGrid', + 'type' => 'checkbox', + 'label' => 'Display Sierra Checkout Grid?', + 'description' => 'Whether or not checkout grids are shown for this type of item', + 'default' => 0, + 'required' => false, + 'forcesReindex' => false, + ], ]; } diff --git a/code/web/sys/Indexing/IndexingProfile.php b/code/web/sys/Indexing/IndexingProfile.php index 2d6ca4db9a..0b33c5594b 100644 --- a/code/web/sys/Indexing/IndexingProfile.php +++ b/code/web/sys/Indexing/IndexingProfile.php @@ -234,12 +234,14 @@ static function getObjectStructure($context = ''): array { $showLastUpdateOfAuthorities = false; $showItemFieldFormatInfo = false; $showMatTypeFormatInfo = false; + $showSierraCheckoutGrid = false; foreach (UserAccount::getAccountProfiles() as $accountProfileInfo) { /** @var AccountProfile $accountProfile */ $accountProfile = $accountProfileInfo['accountProfile']; if ($accountProfile->ils == 'sierra') { $showSierraFieldMappings = true; $showMatTypeFormatInfo = true; + $showSierraCheckoutGrid = true; }elseif ($accountProfile->ils == 'koha') { $showTimeToReshelve = false; $showLastUpdateOfAuthorities = true; @@ -258,7 +260,6 @@ static function getObjectStructure($context = ''): array { $formatMapStructure = FormatMapValue::getObjectStructure($context); unset($formatMapStructure['indexingProfileId']); - if (!$showItemFieldFormatInfo) { unset($formatMapStructure['appliesToItemShelvingLocation']); unset($formatMapStructure['appliesToItemSublocation']); @@ -268,6 +269,9 @@ static function getObjectStructure($context = ''): array { if (!$showMatTypeFormatInfo){ unset($formatMapStructure['appliesToMatType']); } + if (!$showSierraCheckoutGrid) { + unset($formatMapStructure['displaySierraCheckoutGrid']); + } $structure = [ 'id' => [