Skip to content

Commit

Permalink
DIS-6 Add circulation username to Location
Browse files Browse the repository at this point in the history
Ciculation username is needed to properly set the checkout location for checkout.
  • Loading branch information
mdnoble73 committed Sep 2, 2024
1 parent 880ef5e commit 3d37c9f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
11 changes: 11 additions & 0 deletions code/web/Drivers/Sierra.php
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,9 @@ public function checkoutByAPI(User $patron, $barcode, Location $currentLocation)
if (!empty($patron->ils_password)) {
$params['patronPin'] = $patron->ils_password;
}
if (!empty($currentLocation->circulationUsername)) {
$params['username'] = $currentLocation->circulationUsername;
}
if (!empty($currentLocation->statGroup) && $currentLocation->statGroup != -1) {
$params['statgroup'] = $currentLocation->statGroup;
}
Expand Down Expand Up @@ -2630,6 +2633,14 @@ public function checkInByAPI(User $patron, $barcode, Location $currentLocation):
if (!empty($currentLocation->statGroup) && $currentLocation->statGroup != -1) {
$sierraUrl .= '?statgroup=' . $currentLocation->statGroup;
}
if (!empty($currentLocation->circulationUsername)) {
if (strpos($sierraUrl, '?') === false) {
$sierraUrl .= '?';
}else{
$sierraUrl .= '&';
}
$sierraUrl .= 'username=' . $currentLocation->circulationUsername;
}

$checkoutResult = $this->_sendPage( 'sierra.checkin', 'DELETE', $sierraUrl);
if ($this->lastResponseCode >= 200 && $this->lastResponseCode < 300) {
Expand Down
10 changes: 6 additions & 4 deletions code/web/release_notes/24.09.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

// mark - Grove
## API Updates
- Update getUserForApiCall and checkoutILSItem APIs so they can be called internally. (AD-9) (*MDN-G*)
- Add checkInILSItem API to checkin titles. This method cannot be called externally. (AD-9) (*MDN-G*)
- Update getUserForApiCall and checkoutILSItem APIs so they can be called internally. (DIS-6) (*MDN-G*)
- Add checkInILSItem API to checkin titles. This method cannot be called externally. (DIS-6) (*MDN-G*)

### Grouped Work Display Updates
- Allow records within a Grouped Work to have a custom sort order rather than forcing them to be alphabetic with Book first. (DIS-11) (MDN-G)
Expand All @@ -40,13 +40,15 @@
</div>

### Library & Location Updates
- Allow Stat Group to be defined for each location (Sierra only). Stat Group is used when checking items in or out to determine where to credit the checkout. The stat group can be left -1 to use the default behavior. (A-9) (*MDN-G*)
- Allow Stat Group to be defined for each location (Sierra only). Stat Group is used when checking items in or out to determine where to credit the checkout. The stat group can be left -1 to use the default behavior. (DIS-6) (*MDN-G*)
- Allow Circulation Useranme to be defined for each location (Sierra only). Circulation Useranme is used when checking items in or out to determine the location where the item was checked out. The Circulation Useranme can be left blank to use the default behavior. (DIS-6) (*MDN-G*)
- Add an internal method to easily lookup the main location for a library. (*MDN-G*)

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

#### New Settings
- Primary Configuration > Locations > ILS/Account Integration > Stat Group
- Primary Configuration > Locations > ILS/Account Integration > Circulation Username

</div>

Expand All @@ -57,7 +59,7 @@
- Do natural sorting of magazine holdings. (*MDN-G*)

### Self Check Updates
- Add a test page to test self check within Aspen Discovery. The test page can be used for both testing check outs as well as check ins. Check ins currently only work with the Sierra ILS. (AD-9) (*MDN-G*)
- Add a test page to test self check within Aspen Discovery. The test page can be used for both testing check outs as well as check ins. Check ins currently only work with the Sierra ILS. (DIS-6) (*MDN-G*)
- Add additional error handling if SIP Host or Port are not configured when attempting a checkout by SIP. (*MDN-G*)
- Refactor determination of whether to use SIP or API for checkouts within drivers. (*MDN-G*)

Expand Down
8 changes: 8 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 @@ -57,6 +57,14 @@ function getUpdates24_09_00(): array {
'ALTER TABLE location add statGroup INT(11) DEFAULT -1',
]
], //add_location_stat_group
'add_location_circulation_username' => [
'title' => 'Add Location Circulation Username',
'description' => 'Add Location Circulation Username',
'continueOnError' => false,
'sql' => [
'ALTER TABLE location add circulationUsername VARCHAR(20)',
]
], //add_location_circulation_username
'add_permission_for_testing_checkouts' => [
'title' => 'Add permission for testing checkouts',
'description' => 'Add permission for testing checkouts',
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 @@ -76,6 +76,7 @@ class Location extends DataObject {
public $scope;
public $useScope;
public $statGroup;
public $circulationUsername;
public $facetLabel;
public $groupedWorkDisplaySettingId;
public $browseCategoryGroupId;
Expand Down Expand Up @@ -712,6 +713,15 @@ static function getObjectStructure($context = ''): array {
'permissions' => ['Location ILS Connection'],
'note' => 'Sierra only, set to -1 to ignore',
],
'circulationUsername' => [
'property' => 'circulationUsername',
'type' => 'text',
'label' => 'Circulation Username',
'description' => 'The username to use when checking titles in and out for Sierra',
'default' => '',
'permissions' => ['Location ILS Connection'],
'note' => 'Sierra only',
],
[
'property' => 'validHoldPickupBranch',
'type' => 'enum',
Expand Down

0 comments on commit 3d37c9f

Please sign in to comment.