Skip to content

Commit

Permalink
Add the ability to show checkout grid per format type for Sierra Systems
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Aug 2, 2024
1 parent 603f4d8 commit a7fcfda
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
25 changes: 21 additions & 4 deletions code/web/RecordDrivers/MarcRecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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');
}
}
Expand Down
9 changes: 9 additions & 0 deletions code/web/release_notes/24.09.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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*)

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

#### New Settings
- ILS Integration > Indexing Profiles > Format Information > Display Sierra Checkout Grid?

</div>

// katherine

Expand Down
9 changes: 9 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.09.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions code/web/sys/Indexing/FormatMapValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class FormatMapValue extends DataObject {
public $appliesToItemType;
public $appliesToItemFormat;
public $appliesToFallbackFormat;
public $displaySierraCheckoutGrid;

public $suppress;
public /** @noinspection PhpUnused */
Expand Down Expand Up @@ -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,
],
];
}

Expand Down
6 changes: 5 additions & 1 deletion code/web/sys/Indexing/IndexingProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -258,7 +260,6 @@ static function getObjectStructure($context = ''): array {

$formatMapStructure = FormatMapValue::getObjectStructure($context);
unset($formatMapStructure['indexingProfileId']);

if (!$showItemFieldFormatInfo) {
unset($formatMapStructure['appliesToItemShelvingLocation']);
unset($formatMapStructure['appliesToItemSublocation']);
Expand All @@ -268,6 +269,9 @@ static function getObjectStructure($context = ''): array {
if (!$showMatTypeFormatInfo){
unset($formatMapStructure['appliesToMatType']);
}
if (!$showSierraCheckoutGrid) {
unset($formatMapStructure['displaySierraCheckoutGrid']);
}

$structure = [
'id' => [
Expand Down

0 comments on commit a7fcfda

Please sign in to comment.