+
-
diff --git a/code/web/interface/themes/responsive/Report/barcodeGenerator.tpl b/code/web/interface/themes/responsive/Report/barcodeGenerator.tpl
new file mode 100644
index 0000000000..fca9bd59d9
--- /dev/null
+++ b/code/web/interface/themes/responsive/Report/barcodeGenerator.tpl
@@ -0,0 +1,135 @@
+{strip}
+
+
+
+
+
+
+
+{/strip}
\ No newline at end of file
diff --git a/code/web/interface/themes/responsive/Report/discBarcodeGenerator.tpl b/code/web/interface/themes/responsive/Report/discBarcodeGenerator.tpl
new file mode 100644
index 0000000000..b484408164
--- /dev/null
+++ b/code/web/interface/themes/responsive/Report/discBarcodeGenerator.tpl
@@ -0,0 +1,289 @@
+{strip}
+
+
+
+
+
+
+
+
+
+{/strip}
\ No newline at end of file
diff --git a/code/web/interface/themes/responsive/Report/studentBarcodes.tpl b/code/web/interface/themes/responsive/Report/studentBarcodes.tpl
index f8e061cf1b..39e9290d67 100644
--- a/code/web/interface/themes/responsive/Report/studentBarcodes.tpl
+++ b/code/web/interface/themes/responsive/Report/studentBarcodes.tpl
@@ -90,9 +90,15 @@ document.addEventListener("DOMContentLoaded", function(event) {
@media print {
.avery5160 {
+ break-inside: avoid-page !important;
outline: 0px;
}
- #footer-container, #header-wrapper,#horizontal-menu-bar-wrapper,#side-bar,#system-message-header,.breadcrumbs {
+ #footer-container
+ , #header-wrapper
+ , #horizontal-menu-bar-wrapper
+ , #side-bar
+ , #system-message-header
+ , .breadcrumbs {
display: none;
}
.container
@@ -100,14 +106,17 @@ document.addEventListener("DOMContentLoaded", function(event) {
, #main-content
, #printish {
clear: both !important;
- left: 0px !important;
+ left: 0 !important;
margin: 0 !important;;
padding: 0 !important;
- height: 10.625in !important;
- width: 8.25in !important;
}
.page {
- page-break-after: always !important;
+ break-after: page !important;
+ break-inside: avoid-page !important;
+ height: 10.6in !important;
+ width: 8.25in !important;
+ margin-left: .2in !important;
+ margin-top: .4in !important;
}
#reportFrontMatter {
display: none;
@@ -115,9 +124,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
}
@page {
- size: 8.5in 11in !important;
-/* margin: .375in .125in .375in !important; */
- margin: .375in .125in 0in !important;
+ size: letter !important;
}
{/literal}
@@ -142,7 +149,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
{else}
{html_options name=homeroom options=$homeroomLookupList class="form-control input-sm" onchange="this.form.submit()"}
{/if}
-
+
{if !empty($reportData)}
diff --git a/code/web/interface/themes/responsive/js/aspen.js b/code/web/interface/themes/responsive/js/aspen.js
index 8cfafab3d3..4ecfb1b711 100644
--- a/code/web/interface/themes/responsive/js/aspen.js
+++ b/code/web/interface/themes/responsive/js/aspen.js
@@ -9604,6 +9604,51 @@ AspenDiscovery.Admin = (function () {
$("#propertyRowshowSearchToolsAtTop").hide();
}
},
+ initializeFormatSort: function () {
+ this.updateGroupedWorkSortFields('book');
+ this.updateGroupedWorkSortFields('comic');
+ this.updateGroupedWorkSortFields('movie');
+ this.updateGroupedWorkSortFields('music');
+ this.updateGroupedWorkSortFields('other');
+ },
+ updateGroupedWorkSortFields: function(groupingCategory) {
+ if (groupingCategory == 'book') {
+ var selectedOption = $("#bookSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedBookFormats").hide();
+ }else{
+ $("#propertyRowsortedBookFormats").show();
+ }
+ }else if (groupingCategory == 'comic') {
+ var selectedOption = $("#comicSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedComicFormats").hide();
+ }else{
+ $("#propertyRowsortedComicFormats").show();
+ }
+ }else if (groupingCategory == 'movie') {
+ var selectedOption = $("#movieSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedMovieFormats").hide();
+ }else{
+ $("#propertyRowsortedMovieFormats").show();
+ }
+ }else if (groupingCategory == 'music') {
+ var selectedOption = $("#musicSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedMusicFormats").hide();
+ }else{
+ $("#propertyRowsortedMusicFormats").show();
+ }
+ }else if (groupingCategory == 'other') {
+ var selectedOption = $("#otherSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedOtherFormats").hide();
+ }else{
+ $("#propertyRowsortedOtherFormats").show();
+ }
+ }
+ },
updateIndexingProfileFields: function () {
var audienceType = $('#determineAudienceBySelect').val();
if (audienceType === '3') {
@@ -11544,7 +11589,7 @@ AspenDiscovery.CloudLibrary = (function () {
var patronId = $("#patronId option:selected").val();
var useAlternateCard = $("#useAlternateLibraryCard").val();
var validCard = $("#patronId option:selected").attr("data-valid-card");
- if (useAlternateCard === 0 || validCard === "1") {
+ if (useAlternateCard == 0 || validCard === "1") {
return AspenDiscovery.CloudLibrary.doCheckOut(patronId, id);
} else {
var url = Globals.path + "/CloudLibrary/" + id + "/AJAX?method=prepareAlternateLibraryCardPrompts&type=checkOutTitle&patronId=" + patronId;
@@ -11573,7 +11618,7 @@ AspenDiscovery.CloudLibrary = (function () {
var patronId = $("#patronId option:selected").val();
var useAlternateCard = $("#useAlternateLibraryCard").val();
var validCard = $("#patronId option:selected").attr("data-valid-card");
- if (useAlternateCard === 0 || validCard === "1") {
+ if (useAlternateCard == 0 || validCard === "1") {
return AspenDiscovery.CloudLibrary.doHold(patronId, id);
} else {
var url = Globals.path + "/CloudLibrary/" + id + "/AJAX?method=prepareAlternateLibraryCardPrompts&type=placeHold&patronId=" + patronId;
diff --git a/code/web/interface/themes/responsive/js/aspen/admin.js b/code/web/interface/themes/responsive/js/aspen/admin.js
index 78b36b61e9..c69324dd63 100644
--- a/code/web/interface/themes/responsive/js/aspen/admin.js
+++ b/code/web/interface/themes/responsive/js/aspen/admin.js
@@ -1388,6 +1388,51 @@ AspenDiscovery.Admin = (function () {
$("#propertyRowshowSearchToolsAtTop").hide();
}
},
+ initializeFormatSort: function () {
+ this.updateGroupedWorkSortFields('book');
+ this.updateGroupedWorkSortFields('comic');
+ this.updateGroupedWorkSortFields('movie');
+ this.updateGroupedWorkSortFields('music');
+ this.updateGroupedWorkSortFields('other');
+ },
+ updateGroupedWorkSortFields: function(groupingCategory) {
+ if (groupingCategory == 'book') {
+ var selectedOption = $("#bookSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedBookFormats").hide();
+ }else{
+ $("#propertyRowsortedBookFormats").show();
+ }
+ }else if (groupingCategory == 'comic') {
+ var selectedOption = $("#comicSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedComicFormats").hide();
+ }else{
+ $("#propertyRowsortedComicFormats").show();
+ }
+ }else if (groupingCategory == 'movie') {
+ var selectedOption = $("#movieSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedMovieFormats").hide();
+ }else{
+ $("#propertyRowsortedMovieFormats").show();
+ }
+ }else if (groupingCategory == 'music') {
+ var selectedOption = $("#musicSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedMusicFormats").hide();
+ }else{
+ $("#propertyRowsortedMusicFormats").show();
+ }
+ }else if (groupingCategory == 'other') {
+ var selectedOption = $("#otherSortMethodSelect").find(":selected").val();
+ if (selectedOption == 1) {
+ $("#propertyRowsortedOtherFormats").hide();
+ }else{
+ $("#propertyRowsortedOtherFormats").show();
+ }
+ }
+ },
updateIndexingProfileFields: function () {
var audienceType = $('#determineAudienceBySelect').val();
if (audienceType === '3') {
diff --git a/code/web/interface/themes/responsive/js/aspen/cloud-library.js b/code/web/interface/themes/responsive/js/aspen/cloud-library.js
index d3b07f4f1c..345f8fecc3 100644
--- a/code/web/interface/themes/responsive/js/aspen/cloud-library.js
+++ b/code/web/interface/themes/responsive/js/aspen/cloud-library.js
@@ -169,7 +169,7 @@ AspenDiscovery.CloudLibrary = (function () {
var patronId = $("#patronId option:selected").val();
var useAlternateCard = $("#useAlternateLibraryCard").val();
var validCard = $("#patronId option:selected").attr("data-valid-card");
- if (useAlternateCard === 0 || validCard === "1") {
+ if (useAlternateCard == 0 || validCard === "1") {
return AspenDiscovery.CloudLibrary.doCheckOut(patronId, id);
} else {
var url = Globals.path + "/CloudLibrary/" + id + "/AJAX?method=prepareAlternateLibraryCardPrompts&type=checkOutTitle&patronId=" + patronId;
@@ -198,7 +198,7 @@ AspenDiscovery.CloudLibrary = (function () {
var patronId = $("#patronId option:selected").val();
var useAlternateCard = $("#useAlternateLibraryCard").val();
var validCard = $("#patronId option:selected").attr("data-valid-card");
- if (useAlternateCard === 0 || validCard === "1") {
+ if (useAlternateCard == 0 || validCard === "1") {
return AspenDiscovery.CloudLibrary.doHold(patronId, id);
} else {
var url = Globals.path + "/CloudLibrary/" + id + "/AJAX?method=prepareAlternateLibraryCardPrompts&type=placeHold&patronId=" + patronId;
diff --git a/code/web/migrations/importBiblioCommonsData.php b/code/web/migrations/importBiblioCommonsData.php
index 12987890d4..0f7d268305 100644
--- a/code/web/migrations/importBiblioCommonsData.php
+++ b/code/web/migrations/importBiblioCommonsData.php
@@ -312,9 +312,24 @@ function getGroupedWorkForRecordId($bibNumber, &$validRecords, &$invalidRecords)
} elseif (array_key_exists($bibNumber, $invalidRecords)) {
return null;
} else {
+ $ils = '';
$groupedWorkPrimaryIdentifier = new GroupedWorkPrimaryIdentifier();
$groupedWorkPrimaryIdentifier->type = 'ils';
- $groupedWorkPrimaryIdentifier->identifier = $bibNumber;
+ $accountProfiles = new AccountProfile();
+ $accountProfiles->find();
+ while ($accountProfiles->fetch()) {
+ if ($accountProfiles->ils != 'na') {
+ $ils = $accountProfiles->ils;
+ }
+ }
+ if ($ils == 'sierra') {
+ $escapedFilter = $groupedWorkPrimaryIdentifier->escape('.b' . $bibNumber . '%');
+ $groupedWorkPrimaryIdentifier->whereAdd("identifier LIKE $escapedFilter");
+
+ } else {
+ $groupedWorkPrimaryIdentifier->identifier = $bibNumber;
+ }
+
if ($groupedWorkPrimaryIdentifier->find(true)) {
$groupedWork = new GroupedWork();
$groupedWork->id = $groupedWorkPrimaryIdentifier->grouped_work_id;
diff --git a/code/web/release_notes/24.08.01.MD b/code/web/release_notes/24.08.01.MD
index cdc7953044..96c91d5a02 100644
--- a/code/web/release_notes/24.08.01.MD
+++ b/code/web/release_notes/24.08.01.MD
@@ -1,7 +1,12 @@
## Aspen Discovery Updates
### Koha Updates
- Changed data fetch for message_queue table to only query rows created in the last 24 hours. (*KK*)
+- Updated placing volume holds to not pass in an item group id if none exists for the volume (Ticket 137232) (*KL*)
+
+### Other Updates
+- Fixed issue where importing BiblioCommons data for Sierra libraries wasn't working correctly. (Ticket 131179) (*KL*)
## This release includes code contributions from
- ByWater Solutions
- - Kirstien Kroeger (KK)
\ No newline at end of file
+ - Kirstien Kroeger (KK)
+ - Kodi Lein (KL)
\ No newline at end of file
diff --git a/code/web/release_notes/24.09.00.MD b/code/web/release_notes/24.09.00.MD
index 70664c0fb6..0d88509285 100644
--- a/code/web/release_notes/24.09.00.MD
+++ b/code/web/release_notes/24.09.00.MD
@@ -1,4 +1,8 @@
## Aspen LiDA Updates
+- Fixed a bug where when selecting radio button values in Facets (i.e. Search Within), it would display a different value as being selected. (Ticket 132013) (*KK*)
+- Added prompts for providing an alternate library card while placing a hold or checking out cloudLibrary items. (*KK*)
+- Added a screen to modify or remove alternative library card information, if enabled for the library. This screen is accessible in both the Account Drawer and on the Card screens. (*KK*)
+- When freezing a hold, fixed a bug where the date picker actions when selecting the thaw date were not using translated values. (*KK*)
## Aspen Discovery Updates
// mark - ByWater
@@ -20,32 +24,51 @@
// 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)
+
+
+
+#### New Permissions
+- Grouped Work Display > Administer All Format Sorting - Allows users to change how formats are sorted within a grouped work for all libraries.
+- Grouped Work Display > Administer Library Format Sorting - Allows users to change how formats are sorted within a grouped work for their library.
+
+#### New Settings
+- Catalog / Grouped Works > Format Sorting
+
+
### 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*)
#### New Settings
- Primary Configuration > Locations > ILS/Account Integration > Stat Group
+- Primary Configuration > Locations > ILS/Account Integration > Circulation Username
### Palace Project Updates
- Update formatting of Palace Project Collection report to apply default table styling and right align the number of deleted titles. (*MDN-G*)
+### Record Display Updates
+- 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*)
#### New Permissions
-- Circulation/Test Self Check - Allows users to access the self check testing page.
+- Circulation > Test Self Check - Allows users to access the self check testing page.
### Sierra Updates
@@ -63,6 +86,7 @@
// katherine
### Indexing Updates
- Add target audience to grouped works diagnostic panel (Ticket 134227) (*KP*)
+- Get volume information for holds from MARC record when not provided via volumes.txt for Symphony (Ticket 134021) (*KP*)
### Language Updates
- Sort languages by weight, then alphabetically by display name to make consistent with LiDA. (*KP*)
@@ -70,6 +94,13 @@
### System Updates
- Add pagination to Usage by User Agent Report. (*KP*)
+### cloudLibrary Updates
+- Bugfix for alternate card prompt appearing when it should not. (*KP*)
+- Linked accounts use the settings for the scope that matches the linked account's home library during checkout/hold placement. (*KP*)
+
+### Other Updates
+- Automatically block requests when the User Agent contains spammy content. (*KP*)
+
// kirstien
### API Updates
- Added useAlternateLibraryCardForCloudLibrary in Location and Library APIs to get the useAlternateLibraryCard setting for the assigned cloudLibrary scope. (*KK*)
@@ -91,6 +122,7 @@
### Other Updates
- Added function to gather all the various alternate library card settings for a library system. (*KK*)
- Changed how Aspen Discovery determines its current version by using the most recent release notes file instead of looking in the git file. (*KK*)
+- The New Materials Request email to staff will only try to send if it has not already been sent. (*KK*)
@@ -108,6 +140,18 @@
### General Updates
- Remove 'required' flag for Order Record Status to treat as Under Consideration in Indexing Profiles (*KL*)
- Remove false error message "Payment amount did not match..." for NCR payments (*KL*)
+- Account for patron types being '0' when doing boolean check to get the patron type object (*KL*)
+
+### Libby Updates
+- If Lexis Nexis is used, the linking url will use /title instead of /media (Ticket 136556) (*KL*)
+
+### Sierra Updates
+- Added patron code to variables used for Sierra self registration via Aspen (*KL*)
+-
+
+#### New Settings
+- ILS Integration > Self Registration Forms > Patron Code
+
// alexander
@@ -118,19 +162,38 @@
- Fixed an issue where location-related search facets would disappear by amending the 'Show This Branch In Available At and Owning Location Facets' filter so that it can be applied to any scope. (*CZ*)
- Fixed an issue where attempting to save user preferences would result in an error being displayed on the OPAC and cause the save to fail (*CZ*)
- 'Your Preferences' settings only show ILS-related options to users associated with ILS (*CZ*)
+- Fixed an issue where records from summon and ebsco were not properly added to and were not displayed properly in user lists. (*CZ*)
// pedro
// lucas
### Other updates
- Add supportingCompany support in Docker scripts. (*LM*)
+- Now cron process is executed in foreground at the end of the start up script. (*LM*)
// James Staub
+### GitHub Actions
+- Improve GitHub Action to check pull request for spaces vs tabs. (*JStaub*)
+
+### Other Updates
+- Small bug fix for Admin settings search (*JStaub*)
+
+### New Permissions
+- Adds new permission to allow access to the Barcode Generators. (*JStaub*)
+
### Reports
- Improves Nashville-specific Student Barcode report. (*JStaub*)
+- Adds Code 39 barcode generator for Avery 5160 labels to Circulation Reports. (*JStaub*)
+- Adds EAN-8 disc hub barcode generator to Circulation Reports. (*JStaub*)
+
+
+
+#### New Permissions
+- Circulation Reports > Barcode Generators - Allows the user to run the Barcode Generators
+
// Jeremy Eden
-### Other
+### Other Updates
- Explicitly disable on screen error display when debugging is disabled by IP.
- Set cover title text to same as alt text for both browse category and search results views (Ticket 131697)
diff --git a/code/web/services/API/UserAPI.php b/code/web/services/API/UserAPI.php
index 2de85af829..4094d3415c 100644
--- a/code/web/services/API/UserAPI.php
+++ b/code/web/services/API/UserAPI.php
@@ -6062,7 +6062,7 @@ function updateAlternateLibraryCard(): array {
$alternateLibraryCard = $_REQUEST['alternateLibraryCard'] ?? null;
$alternateLibraryCardPassword = $_REQUEST['alternateLibraryCardPassword'] ?? null;
$deleteAlternateLibraryCard = $_REQUEST['deleteAlternateLibraryCard'] ?? false;
- if(!$deleteAlternateLibraryCard) {
+ if(!$deleteAlternateLibraryCard || $deleteAlternateLibraryCard === "false") {
if ($alternateLibraryCard) {
$user->alternateLibraryCard = $alternateLibraryCard;
}
diff --git a/code/web/services/Admin/GroupedWorkFormatSorting.php b/code/web/services/Admin/GroupedWorkFormatSorting.php
new file mode 100644
index 0000000000..aa35ee53a1
--- /dev/null
+++ b/code/web/services/Admin/GroupedWorkFormatSorting.php
@@ -0,0 +1,112 @@
+orderBy($this->getSort());
+ $this->applyFilters($object);
+ $object->limit(($page - 1) * $recordsPerPage, $recordsPerPage);
+ if (!UserAccount::userHasPermission('Administer All Format Sorting')) {
+ $library = Library::getPatronHomeLibrary(UserAccount::getActiveUserObj());
+ $groupedWorkDisplaySettings = new GroupedWorkDisplaySetting();
+ $groupedWorkDisplaySettings->id = $library->groupedWorkDisplaySettingId;
+ $groupedWorkDisplaySettings->find(true);
+ $object->id = $groupedWorkDisplaySettings->formatSortingGroupId;
+ }
+ $object->find();
+ $list = [];
+ while ($object->fetch()) {
+ $list[$object->id] = clone $object;
+ }
+ return $list;
+ }
+
+ function getDefaultSort(): string {
+ return 'name asc';
+ }
+
+ function getObjectStructure($context = ''): array {
+ return GroupedWorkFormatSortingGroup::getObjectStructure($context);
+ }
+
+ function getPrimaryKeyColumn(): string {
+ return 'id';
+ }
+
+ function getIdKeyColumn(): string {
+ return 'id';
+ }
+
+ function getInstructions(): string {
+ return '';
+ }
+
+ function getBreadcrumbs(): array {
+ $breadcrumbs = [];
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home', 'Administration Home');
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home#cataloging', 'Catalog / Grouped Works');
+ $breadcrumbs[] = new Breadcrumb('/Admin/GroupedWorkFormatSorting', 'Grouped Work Format Sorting');
+ return $breadcrumbs;
+ }
+
+ function getActiveAdminSection(): string {
+ return 'cataloging';
+ }
+
+ function canView(): bool {
+ return UserAccount::userHasPermission([
+ 'Administer All Format Sorting',
+ 'Administer Library Format Sorting',
+ ]);
+ }
+
+ function canBatchEdit(): bool {
+ return UserAccount::userHasPermission([
+ 'Administer All Format Sorting',
+ ]);
+ }
+
+ function getInitializationJs(): string {
+ return 'AspenDiscovery.Admin.initializeFormatSort();';
+ }
+
+ function getAdditionalObjectActions($existingObject): array {
+ $objectActions = [];
+ if (isset($existingObject) && $existingObject != null) {
+ $objectActions[] = [
+ 'text' => 'Update Active Formats',
+ 'url' => '/Admin/GroupedWorkFormatSorting?objectAction=loadActiveFormats&id=' . $existingObject->id,
+ ];
+ }
+ return $objectActions;
+ }
+
+ function loadActiveFormats(){
+ $id = $_REQUEST['id'];
+ if (!empty($id) && is_numeric($id)) {
+ $formatSortingGroup = new GroupedWorkFormatSortingGroup();
+ $formatSortingGroup->id = $id;
+ if ($formatSortingGroup->find(true)) {
+ $formatSortingGroup->loadDefaultFormats();
+ }
+ }
+ $structure = $this->getObjectStructure();
+ $structure = $this->applyPermissionsToObjectStructure($structure);
+ $this->viewIndividualObject($structure);
+ }
+}
\ No newline at end of file
diff --git a/code/web/services/CloudLibrary/AJAX.php b/code/web/services/CloudLibrary/AJAX.php
index 974563271a..ef54a4dddd 100644
--- a/code/web/services/CloudLibrary/AJAX.php
+++ b/code/web/services/CloudLibrary/AJAX.php
@@ -97,11 +97,10 @@ function getHoldPrompts() {
$promptTitle = 'cloudLibrary Hold Options';
$interface->assign('useAlternateLibraryCard', $settings->useAlternateLibraryCard);
$validCards = [];
- if ($settings->useAlternateLibraryCard) {
- foreach ($usersWithCloudLibraryAccess as $userWithAccess) {
- if (!empty($userWithAccess->alternateLibraryCard) && $driver->checkAuthentication($userWithAccess)) {
- $validCards[] = $userWithAccess;
- }
+ foreach ($usersWithCloudLibraryAccess as $userWithAccess) {
+ $userAltCardOptions = $userWithAccess->getHomeLibrary()->getAlternateLibraryCardOptions();
+ if ($userAltCardOptions['useAlternateLibraryCardForCloudLibrary'] && !empty($userWithAccess->alternateLibraryCard) && $driver->checkAuthentication($userWithAccess)) {
+ $validCards[] = $userWithAccess;
}
}
$interface->assign('validCards', $validCards);
@@ -172,11 +171,10 @@ function getCheckOutPrompts() {
$promptTitle = 'cloudLibrary Checkout Options';
$interface->assign('useAlternateLibraryCard', $settings->useAlternateLibraryCard);
$validCards = [];
- if ($settings->useAlternateLibraryCard) {
- foreach ($usersWithCloudLibraryAccess as $userWithAccess) {
- if (!empty($userWithAccess->alternateLibraryCard) && $driver->checkAuthentication($userWithAccess)) {
- $validCards[] = $userWithAccess;
- }
+ foreach ($usersWithCloudLibraryAccess as $userWithAccess) {
+ $userAltCardOptions = $userWithAccess->getHomeLibrary()->getAlternateLibraryCardOptions();
+ if ($userAltCardOptions['useAlternateLibraryCardForCloudLibrary'] && !empty($userWithAccess->alternateLibraryCard) && $driver->checkAuthentication($userWithAccess)) {
+ $validCards[] = $userWithAccess;
}
}
$interface->assign('validCards', $validCards);
diff --git a/code/web/services/Report/BarcodeGenerator.php b/code/web/services/Report/BarcodeGenerator.php
new file mode 100644
index 0000000000..4dad27dfdf
--- /dev/null
+++ b/code/web/services/Report/BarcodeGenerator.php
@@ -0,0 +1,26 @@
+display('barcodeGenerator.tpl', 'Barcode Generator');
+ }
+
+ function getBreadcrumbs(): array {
+ $breadcrumbs = [];
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home', 'Administration Home');
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home#circulation_reports', 'Circulation Reports');
+ $breadcrumbs[] = new Breadcrumb('', 'Barcode Generator');
+ return $breadcrumbs;
+ }
+
+ function getActiveAdminSection(): string {
+ return 'circulation_reports';
+ }
+ function canView(): bool {
+ return UserAccount::userHasPermission([
+ 'Barcode Generators',
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/code/web/services/Report/DiscBarcodeGenerator.php b/code/web/services/Report/DiscBarcodeGenerator.php
new file mode 100644
index 0000000000..6ddb4e982e
--- /dev/null
+++ b/code/web/services/Report/DiscBarcodeGenerator.php
@@ -0,0 +1,26 @@
+display('discBarcodeGenerator.tpl', 'Disc Barcode Generator');
+ }
+
+ function getBreadcrumbs(): array {
+ $breadcrumbs = [];
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home', 'Administration Home');
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home#circulation_reports', 'Circulation Reports');
+ $breadcrumbs[] = new Breadcrumb('', 'Disc Barcode Generator');
+ return $breadcrumbs;
+ }
+
+ function getActiveAdminSection(): string {
+ return 'circulation_reports';
+ }
+ function canView(): bool {
+ return UserAccount::userHasPermission([
+ 'Barcode Generators',
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/code/web/sys/Account/User.php b/code/web/sys/Account/User.php
index efdaa7120f..f7fa8a3bba 100644
--- a/code/web/sys/Account/User.php
+++ b/code/web/sys/Account/User.php
@@ -3,14 +3,14 @@
require_once ROOT_DIR . '/sys/DB/DataObject.php';
class User extends DataObject {
- public $__table = 'user'; // table name
+ public $__table = 'user'; // table name
public $id;
public $source;
public $username;
public $unique_ils_id;
public $cat_username; //Old field for barcode/username from the ILS deprecated
- public $cat_password; //Old field barcode/username from the ILS deprecated
- public $ils_barcode; //The barcode for the user as stored within the ILS. Will be null for admin users and users not stored in the ils
+ public $cat_password; //Old field barcode/username from the ILS deprecated
+ public $ils_barcode; //The barcode for the user as stored within the ILS. Will be null for admin users and users not stored in the ils
public $ils_username; //A custom username for the user as stored within the ILS that can be used for login rather than using the barcode.
public $ils_password; //The password to use when logging in
public $displayName;
@@ -20,16 +20,16 @@ class User extends DataObject {
public $email;
public $phone;
public $patronType;
- public $created; // datetime(19) not_null binary
- public $homeLocationId; // int(11)
- public $myLocation1Id; // int(11)
- public $myLocation2Id; // int(11)
- public $trackReadingHistory; // tinyint
+ public $created; // datetime(19) not_null binary
+ public $homeLocationId; // int(11)
+ public $myLocation1Id; // int(11)
+ public $myLocation2Id; // int(11)
+ public $trackReadingHistory; // tinyint
public $initialReadingHistoryLoaded;
public $lastReadingHistoryUpdate;
- public $bypassAutoLogout; //tinyint
- public $disableRecommendations; //tinyint
- public $disableCoverArt; //tinyint
+ public $bypassAutoLogout; //tinyint
+ public $disableRecommendations; //tinyint
+ public $disableCoverArt; //tinyint
public $overdriveEmail;
public $promptForOverdriveEmail; //Semantics of this have changed to not prompting for hold settings
public $hooplaCheckOutConfirmation;
@@ -344,7 +344,7 @@ function getRoles() {
/**
* @return Role[]
*/
- public function getRolesAssignedByPType() : array {
+ public function getRolesAssignedByPType(): array {
$rolesAssignedByPType = [];
if ($this->id) {
//Get role based on patron type
@@ -468,8 +468,8 @@ function getLinkedUsers() {
/** @var User $userData */
//$userData = $memCache->get("user_{$serverName}_{$linkedUser->id}");
//if ($userData === false || isset($_REQUEST['reload'])) {
- //Load full information from the catalog
- $linkedUser = UserAccount::validateAccount($linkedUser->ils_barcode, $linkedUser->ils_password, $linkedUser->source, $this);
+ //Load full information from the catalog
+ $linkedUser = UserAccount::validateAccount($linkedUser->ils_barcode, $linkedUser->ils_password, $linkedUser->source, $this);
//} else {
// $logger->log("Found cached linked user {$userData->id}", Logger::LOG_DEBUG);
// $linkedUser = $userData;
@@ -531,8 +531,8 @@ public function setParentUser($user) {
/**
* Checks if there is any settings disallowing the account $accountIdToCheck to be linked to this user.
*
- * @param $accountIdToCheck string linked account Id to check for blocking
- * @return bool true for blocking, false for no blocking
+ * @param $accountIdToCheck string linked account Id to check for blocking
+ * @return bool true for blocking, false for no blocking
*/
public function isBlockedAccount($accountIdToCheck) {
if (is_null($this->blockAll)) {
@@ -729,11 +729,11 @@ function removeManagingAccount($managingAccount) {
$userLink = new UserLink();
$userLink->primaryAccountId = $managingAccount;
$userLink->linkedAccountId = $this->id;
- if($userLink->delete(true)) {
+ if ($userLink->delete(true)) {
$managingUser = new User();
$managingUser->id = $managingAccount;
- if($managingUser->find(true)) {
+ if ($managingUser->find(true)) {
/* Send all the things to the managing account that the user removed the link from */
$managingUser->removeManagingAccountMessage($this); // Display alert in Aspen Discovery
$managingUser->sendRemoveManagingLinkNotification($this); // Send Aspen LiDA notification
@@ -1006,10 +1006,10 @@ function loadContactInformation() {
}
}
- public function allowUpdatesOfPreferredName() : bool {
+ public function allowUpdatesOfPreferredName(): bool {
if ($this->getCatalogDriver()) {
return $this->getCatalogDriver()->allowUpdatesOfPreferredName($this);
- }else{
+ } else {
return false;
}
}
@@ -1211,8 +1211,8 @@ function clearCache() {
}
/**
- * @param $list UserList object of the user list to check permission for
- * @return bool true if this user can edit passed list
+ * @param $list UserList object of the user list to check permission for
+ * @return bool true if this user can edit passed list
*/
function canEditList($list) {
if (($this->id == $list->user_id) || $this->hasPermission('Edit All Lists')) {
@@ -1388,7 +1388,7 @@ public function getCheckouts($includeLinkedUsers = true, $source = 'all'): array
}
}
- $this->__set('checkoutInfoLastLoaded',time());
+ $this->__set('checkoutInfoLastLoaded', time());
$this->update();
} else {
if ($source == 'all' || $source == 'overdrive') {
@@ -1442,9 +1442,9 @@ public function isRecordCheckedOut($source, $recordId) {
public function isBlockedFromIllRequests() {
if ($this->_isBlockedFromIllRequests === null) {
- if ($this->hasIlsConnection()){
+ if ($this->hasIlsConnection()) {
$this->_isBlockedFromIllRequests = $this->getCatalogDriver()->isBlockedFromIllRequests($this);
- }else{
+ } else {
return true;
}
}
@@ -1703,7 +1703,7 @@ public function inUserEvents($id) {
$event = new UserEventsEntry();
$event->sourceId = $id;
$event->userId = $this->id;
- if ($event->find()){
+ if ($event->find()) {
return true;
}
return false;
@@ -1715,7 +1715,7 @@ public function isRegistered($eventId): bool {
$registration = new UserEventsRegistrations();
$registration->sourceId = $eventId;
$registration->userId = $this->id;
- if ($registration->find()){
+ if ($registration->find()) {
return true;
}
return false;
@@ -1731,13 +1731,13 @@ public function isAllowedToAddEventsToList($vendor): bool {
$eventsSetting = new LibraryEventsSetting();
$eventsSetting->libraryId = $activeLibrary->libraryId;
$eventsSetting->settingSource = $vendor;
- if($eventsSetting->find(true)) {
- if($vendor == 'communico') {
+ if ($eventsSetting->find(true)) {
+ if ($vendor == 'communico') {
require_once ROOT_DIR . '/sys/Events/CommunicoSetting.php';
$settings = new CommunicoSetting();
$settings->id = $eventsSetting->settingId;
- if ($settings->find(true)){
- if($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
+ if ($settings->find(true)) {
+ if ($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
return true;
}
}
@@ -1745,8 +1745,8 @@ public function isAllowedToAddEventsToList($vendor): bool {
require_once ROOT_DIR . '/sys/Events/SpringshareLibCalSetting.php';
$settings = new SpringshareLibCalSetting;
$settings->id = $eventsSetting->settingId;
- if ($settings->find(true)){
- if($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
+ if ($settings->find(true)) {
+ if ($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
return true;
}
}
@@ -1754,8 +1754,8 @@ public function isAllowedToAddEventsToList($vendor): bool {
require_once ROOT_DIR . '/sys/Events/LMLibraryCalendarSetting.php';
$settings = new LMLibraryCalendarSetting();
$settings->id = $eventsSetting->settingId;
- if ($settings->find(true)){
- if($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
+ if ($settings->find(true)) {
+ if ($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
return true;
}
}
@@ -1763,8 +1763,8 @@ public function isAllowedToAddEventsToList($vendor): bool {
require_once ROOT_DIR . '/sys/Events/AssabetSetting.php';
$settings = new AssabetSetting();
$settings->id = $eventsSetting->settingId;
- if ($settings->find(true)){
- if($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
+ if ($settings->find(true)) {
+ if ($settings->eventsInLists == 2 || ($settings->eventsInLists == 1 && $this->isStaff())) {
return true;
}
}
@@ -1788,8 +1788,8 @@ public function isRecordOnHold($source, $recordId) {
}
}
- public function areCirculationActionsDisabled(){
- if (!$this->hasIlsConnection()){
+ public function areCirculationActionsDisabled() {
+ if (!$this->hasIlsConnection()) {
return true;
} else {
if ($this->disableCirculationActions) {
@@ -1903,10 +1903,10 @@ public function getValidHomeLibraryBranches($recordSource) {
}
/**
- * Get a list of locations where a record can be picked up. Handles liked accounts
+ * Get a list of locations where a record can be picked up. Handles liked accounts
* and filtering to make sure that the user is able to
*
- * @param $recordSource string The source of the record that we are placing a hold on
+ * @param $recordSource string The source of the record that we are placing a hold on
*
* @return Location[]
*/
@@ -1924,7 +1924,7 @@ public function getValidPickupBranches($recordSource) {
$accountProfileForSource = UserAccount::getAccountProfileByRecordSource($recordSource);
if ($accountProfileForSource != null) {
$accountProfileSource = $accountProfileForSource->name;
- }else{
+ } else {
$accountProfileSource = '';
}
// $accountProfileForSource = new AccountProfile();
@@ -1983,10 +1983,10 @@ public function getValidPickupBranches($recordSource) {
* @param string $recordId The id of the bib record
* @param string $pickupBranch The branch where the user wants to pickup the item when available
* @param null|string $cancelDate When the hold should be automatically cancelled if desired
- * @return array An array with the following keys
- * result - true/false
- * message - the message to display
- * @access public
+ * @return array An array with the following keys
+ * result - true/false
+ * message - the message to display
+ * @access public
*/
function placeHold($recordId, $pickupBranch, $cancelDate = null) {
$result = $this->getCatalogDriver()->placeHold($this, $recordId, $pickupBranch, $cancelDate);
@@ -1995,7 +1995,7 @@ function placeHold($recordId, $pickupBranch, $cancelDate = null) {
'text' => 'You',
'isPublicFacing' => true,
]);
- if (!empty($this->parentUser)){
+ if (!empty($this->parentUser)) {
$thisUser = $this->displayName;
}
if ($result['success']) {
@@ -2007,7 +2007,7 @@ function placeHold($recordId, $pickupBranch, $cancelDate = null) {
]);
$result['viewHoldsAction'] = "
$viewHoldsText";
-
+
$this->clearCache();
$this->forceReloadOfHolds();
@@ -2022,7 +2022,7 @@ function placeVolumeHold($recordId, $volumeId, $pickupBranch) {
'text' => 'You',
'isPublicFacing' => true,
]);
- if (!empty($this->parentUser)){
+ if (!empty($this->parentUser)) {
$thisUser = $this->displayName;
}
if ($result['success']) {
@@ -2080,9 +2080,9 @@ function updateAltLocationForHold($pickupBranch) {
* @param string $itemId The id of the item to hold
* @param string $pickupBranch The branch where the user wants to pickup the item when available
* @param null|string $cancelDate The date to automatically cancel the hold if not filled
- * @return mixed True if successful, false if unsuccessful
- * If an error occurs, return a AspenError
- * @access public
+ * @return mixed True if successful, false if unsuccessful
+ * If an error occurs, return a AspenError
+ * @access public
*/
function placeItemHold($recordId, $itemId, $pickupBranch, $cancelDate = null) {
$result = $this->getCatalogDriver()->placeItemHold($this, $recordId, $itemId, $pickupBranch, $cancelDate);
@@ -2091,7 +2091,7 @@ function placeItemHold($recordId, $itemId, $pickupBranch, $cancelDate = null) {
'text' => 'You',
'isPublicFacing' => true,
]);
- if (!empty($this->parentUser)){
+ if (!empty($this->parentUser)) {
$thisUser = $this->displayName;
}
if ($result['success']) {
@@ -2110,10 +2110,10 @@ function placeItemHold($recordId, $itemId, $pickupBranch, $cancelDate = null) {
}
/**
- * Get the user referred to by id. Will return false if the specified patron id is not
+ * Get the user referred to by id. Will return false if the specified patron id is not
* the id of this user or one of the users that is linked to this user.
*
- * @param $patronId int The patron to check
+ * @param $patronId int The patron to check
* @return User|false
*/
function getUserReferredTo($patronId) {
@@ -2135,11 +2135,11 @@ function getUserReferredTo($patronId) {
/**
* Cancels a hold for the user in their ILS
*
- * @param $recordId string The Id of the record being cancelled
- * @param $cancelId string The Id of the hold to be cancelled. Structure varies by ILS
- * @param $isIll boolean If the hold is from the ILL system
+ * @param $recordId string The Id of the record being cancelled
+ * @param $cancelId string The Id of the hold to be cancelled. Structure varies by ILS
+ * @param $isIll boolean If the hold is from the ILL system
*
- * @return array Information about the result of the cancellation process
+ * @return array Information about the result of the cancellation process
*/
function cancelHold($recordId, $cancelId, $isIll): array {
$result = $this->getCatalogDriver()->cancelHold($this, $recordId, $cancelId, $isIll);
@@ -2209,7 +2209,7 @@ function freezeAllHolds($reactivationDate = false) {
$tmpResult = $user->freezeHold($recordId, $holdId, $reactivationDate);
if ($tmpResult['success']) {
$success++;
- }else{
+ } else {
$failed++;
}
} elseif ($holdType == 'axis360') {
@@ -2218,7 +2218,7 @@ function freezeAllHolds($reactivationDate = false) {
$tmpResult = $driver->freezeHold($user, $recordId);
if ($tmpResult['success']) {
$success++;
- }else{
+ } else {
$failed++;
}
} elseif ($holdType == 'overdrive') {
@@ -2227,7 +2227,7 @@ function freezeAllHolds($reactivationDate = false) {
$tmpResult = $driver->freezeHold($user, $recordId, $reactivationDate);
if ($tmpResult['success']) {
$success++;
- }else{
+ } else {
$failed++;
}
} else {
@@ -2281,7 +2281,7 @@ function freezeAllHolds($reactivationDate = false) {
'isPublicFacing' => true,
'inAttribute' => true,
]) . '
';
- }else{
+ } else {
$result['message'] = '
' . translate([
'text' => '%1% hold(s) could not be frozen',
1 => $failed,
@@ -2409,25 +2409,25 @@ function thawHold($recordId, $holdId): array {
return $result;
}
- function freezeOverDriveHold($overDriveId, $reactivationDate) : array {
+ function freezeOverDriveHold($overDriveId, $reactivationDate): array {
require_once ROOT_DIR . '/Drivers/OverDriveDriver.php';
$overDriveDriver = new OverDriveDriver();
return $overDriveDriver->freezeHold($this, $overDriveId, $reactivationDate);
}
- function thawOverDriveHold($overDriveId) : array {
+ function thawOverDriveHold($overDriveId): array {
require_once ROOT_DIR . '/Drivers/OverDriveDriver.php';
$overDriveDriver = new OverDriveDriver();
return $overDriveDriver->thawHold($this, $overDriveId);
}
- function freezeAxis360Hold($recordId) : array {
+ function freezeAxis360Hold($recordId): array {
require_once ROOT_DIR . '/Drivers/Axis360Driver.php';
$axis360Driver = new Axis360Driver();
return $axis360Driver->freezeHold($this, $recordId);
}
- function thawAxis360Hold($recordId) : array {
+ function thawAxis360Hold($recordId): array {
require_once ROOT_DIR . '/Drivers/Axis360Driver.php';
$axis360Driver = new Axis360Driver();
return $axis360Driver->thawHold($this, $recordId);
@@ -2481,7 +2481,7 @@ public function isReadingHistoryEnabled() {
$catalogDriver = $this->getCatalogDriver();
if ($catalogDriver != null) {
//Check to see if it's enabled by home library
- $homeLibrary = $this->getHomeLibrary();
+ $homeLibrary = $this->getHomeLibrary();
if (!empty($homeLibrary)) {
if ($homeLibrary->enableReadingHistory) {
//Check to see if it's enabled by PType
@@ -2504,7 +2504,7 @@ public function isReadingHistoryEnabled() {
public function isPaymentHistoryEnabled() {
//Check to see if it's enabled by home library
- $homeLibrary = $this->getHomeLibrary();
+ $homeLibrary = $this->getHomeLibrary();
if (!empty($homeLibrary)) {
return $homeLibrary->showPaymentHistory && $homeLibrary->finePaymentType > 1;
} else {
@@ -2531,14 +2531,14 @@ public function getPaymentHistory($page = 1, $recordsPerPage = 25) {
while ($userPayment->fetch()) {
if ($userPayment->completed) {
$completed = 'Yes';
- }else {
+ } else {
$completed = 'No';
}
$payments[] = [
'id' => $userPayment->id,
'date' => $userPayment->transactionDate,
- 'type' => translate(['text'=> ucfirst($userPayment->transactionType), 'isPublicFacing' => true, 'inAttribute' => true]),
- 'completed' => translate(['text'=> $completed, 'isPublicFacing' => true, 'inAttribute' => true]),
+ 'type' => translate(['text' => ucfirst($userPayment->transactionType), 'isPublicFacing' => true, 'inAttribute' => true]),
+ 'completed' => translate(['text' => $completed, 'isPublicFacing' => true, 'inAttribute' => true]),
'totalPaid' => StringUtils::formatCurrency($userPayment->totalPaid),
];
}
@@ -2600,7 +2600,7 @@ public function updateReadingHistoryBasedOnCurrentCheckouts($isNightlyUpdate) {
if ($this->isReadingHistoryEnabled()) {
$catalogDriver = $this->getCatalogDriver();
return $catalogDriver->updateReadingHistoryBasedOnCurrentCheckouts($this, $isNightlyUpdate);
- }else{
+ } else {
return [
'message' => 'Reading history is not enabled',
'skipped' => true
@@ -2624,16 +2624,15 @@ public function isStaff() {
return false;
}
- public function getPType() : ?string {
+ public function getPType(): ?string {
return $this->patronType;
}
private $_pTypeObj = false;
- public function getPTypeObj() : ?PType {
+
+ public function getPTypeObj(): ?PType {
if ($this->_pTypeObj === false) {
- if (empty($this->patronType)) {
- $this->_pTypeObj = null;
- }else {
+ if (!empty($this->patronType) || $this->patronType == 0) {
require_once ROOT_DIR . '/sys/Account/PType.php';
$patronType = new PType();
$patronType->pType = $this->patronType;
@@ -2642,6 +2641,8 @@ public function getPTypeObj() : ?PType {
} else {
$this->_pTypeObj = null;
}
+ }else {
+ $this->_pTypeObj = null;
}
}
return $this->_pTypeObj;
@@ -2737,7 +2738,7 @@ function importListsFromIls() {
public function canClientIpUseMasquerade(): bool {
global $library;
$masqueradeStatus = $library->getMasqueradeStatus();
- if ($masqueradeStatus == 1){
+ if ($masqueradeStatus == 1) {
return true;
} else if ($masqueradeStatus == 2) {
$clientIP = IPAddress::getClientIP();
@@ -2750,7 +2751,7 @@ public function canClientIpUseMasquerade(): bool {
}
public function canMasquerade() {
- if(self::canClientIpUseMasquerade()){
+ if (self::canClientIpUseMasquerade()) {
return $this->hasPermission([
'Masquerade as any user',
'Masquerade as unrestricted patron types',
@@ -2800,10 +2801,10 @@ function getNumSavedEvents($eventsFilter) {
$curTime = time();
$event = new UserEventsEntry();
- if ($eventsFilter == 'past'){
+ if ($eventsFilter == 'past') {
$event->whereAdd("eventDate < $curTime");
}
- if ($eventsFilter == 'upcoming'){
+ if ($eventsFilter == 'upcoming') {
$event->whereAdd("eventDate >= $curTime");
}
$event->whereAdd("userId = {$this->id}");
@@ -2931,7 +2932,7 @@ function newLinkMessage() {
$userMessage->userId = $this->id;
$userMessage->messageType = 'confirm_linked_accts';
$userMessage->message = translate([
- 'text' => "Other accounts have linked to your account. Do you want to continue allowing them to link to you?",
+ 'text' => "Other accounts have linked to your account. Do you want to continue allowing them to link to you?",
'isPublicFacing' => true,
]);
$userMessage->action1Title = translate([
@@ -3171,7 +3172,7 @@ function getHomeLocationCode() {
}
function getPickupLocationCode() {
- //Always check if a preferred pickup location has been selected. If not, use the home location
+ //Always check if a preferred pickup location has been selected. If not, use the home location
if ($this->pickupLocationId > 0 && $this->pickupLocationId != $this->homeLocationId) {
$pickupBranch = $this->pickupLocationId;
$locationLookup = new Location();
@@ -3190,7 +3191,7 @@ function getPickupLocationCode() {
}
function getPickupLocationName() {
- //Always check if a preferred pickup location has been selected. If not, use the home location
+ //Always check if a preferred pickup location has been selected. If not, use the home location
if ($this->pickupLocationId > 0 && $this->pickupLocationId != $this->homeLocationId) {
$pickupBranch = $this->pickupLocationId;
$locationLookup = new Location();
@@ -3338,7 +3339,7 @@ public function getAdminActions() {
]);
$sections['system_reports']->addAction(new AdminAction('Usage By IP Address', 'Reports which IP addresses have used Aspen Discovery.', '/Admin/UsageByIP'), 'View System Reports');
$sections['system_reports']->addAction(new AdminAction('Usage By User Agent', 'Reports which User Agents have used Aspen Discovery.', '/Admin/UsageByUserAgent'), 'View System Reports');
- $sections['system_reports']->addAction(new AdminAction('Nightly Index Log', 'Nightly indexing log for Aspen Discovery. The nightly index updates all records if needed.', '/Admin/ReindexLog'), [
+ $sections['system_reports']->addAction(new AdminAction('Nightly Index Log', 'Nightly indexing log for Aspen Discovery. The nightly index updates all records if needed.', '/Admin/ReindexLog'), [
'View System Reports',
'View Indexing Logs',
]);
@@ -3389,7 +3390,7 @@ public function getAdminActions() {
$sections['primary_configuration']->addAction(new AdminAction('User Agents', 'Configure User Agents and block access to Aspen Discovery by User Agent.', '/Admin/UserAgents'), 'Administer User Agents');
$sections['primary_configuration']->addAction(new AdminAction('Two-Factor Authentication', 'Administer two-factor authentication settings', '/Admin/TwoFactorAuth'), 'Administer Two-Factor Authentication');
- if(array_key_exists('Single sign-on', $enabledModules)) {
+ if (array_key_exists('Single sign-on', $enabledModules)) {
$sections['primary_configuration']->addAction(new AdminAction('Single Sign-on (SSO)', 'Administer single sign-on settings', '/Admin/SSOSettings'), 'Administer Single Sign-on');
}
@@ -3459,6 +3460,10 @@ public function getAdminActions() {
'Administer All Grouped Work Facets',
'Administer Library Grouped Work Facets',
]);
+ $groupedWorkAction->addSubAction(new AdminAction('Format Sorting', 'Define how formats are sorted within a Grouped Work.', '/Admin/GroupedWorkFormatSorting'), [
+ 'Administer All Format Sorting',
+ 'Administer Library Format Sorting',
+ ]);
$sections['cataloging']->addAction($groupedWorkAction, [
'Administer All Grouped Work Display Settings',
'Administer Library Grouped Work Display Settings',
@@ -3466,7 +3471,7 @@ public function getAdminActions() {
$sections['cataloging']->addAction(new AdminAction('Manual Grouping Authorities', 'View a list of all title author/authorities that have been added to Aspen to merge works.', '/Admin/AlternateTitles'), 'Manually Group and Ungroup Works');
$sections['cataloging']->addAction(new AdminAction('Author Authorities', 'Create and edit authorities for authors.', '/Admin/AuthorAuthorities'), 'Manually Group and Ungroup Works');
$sections['cataloging']->addAction(new AdminAction('Records To Not Group', 'Lists records that should not be grouped.', '/Admin/NonGroupedRecords'), 'Manually Group and Ungroup Works');
- $sections['cataloging']->addAction(new AdminAction('Hidden Series', 'Edit series to be excluded from the Series facet and Series Display Information', '/Admin/HideSeriess'), 'Hide Metadata');
+ $sections['cataloging']->addAction(new AdminAction('Hidden Series', 'Edit series to be excluded from the Series facet and Series Display Information', '/Admin/HideSeriess'), 'Hide Metadata');
$sections['cataloging']->addAction(new AdminAction('Hidden Subjects', 'Edit subjects to be excluded from the Subjects facet.', '/Admin/HideSubjectFacets'), 'Hide Metadata');
$sections['cataloging']->addAction(new AdminAction('Search Tests', 'Tests to be run to verify searching is generating optimal results.', '/Admin/GroupedWorkSearchTests'), 'Administer Grouped Work Tests');
@@ -3527,13 +3532,13 @@ public function getAdminActions() {
$sections['ecommerce'] = new AdminSection('eCommerce');
$sections['ecommerce']->addAction(new AdminAction('eCommerce Report', 'View payments initiated and completed within the system', '/Admin/eCommerceReport'), [
- 'View eCommerce Reports for All Libraries',
- 'View eCommerce Reports for Home Library'
- ]);
+ 'View eCommerce Reports for All Libraries',
+ 'View eCommerce Reports for Home Library'
+ ]);
$sections['ecommerce']->addAction(new AdminAction('Donations Report', 'View donations initiated and completed within the system', '/Admin/DonationsReport'), [
- 'View Donations Reports for All Libraries',
- 'View Donations Reports for Home Library'
- ]);
+ 'View Donations Reports for All Libraries',
+ 'View Donations Reports for Home Library'
+ ]);
$sections['ecommerce']->addAction(new AdminAction('Comprise Settings', 'Define Settings for Comprise SMARTPAY.', '/Admin/CompriseSettings'), 'Administer Comprise');
$sections['ecommerce']->addAction(new AdminAction('FIS WorldPay Settings', 'Define Settings for FIS WorldPay.', '/Admin/WorldPaySettings'), 'Administer WorldPay');
$sections['ecommerce']->addAction(new AdminAction('PayPal Settings', 'Define Settings for PayPal.', '/Admin/PayPalSettings'), 'Administer PayPal');
@@ -3577,9 +3582,9 @@ public function getAdminActions() {
if ($accountProfile->ils == 'symphony' || $accountProfile->ils == 'carlx' || $accountProfile->ils == 'sierra') {
$customSelfRegForms = true;
}
- if ($accountProfile->driver == 'Nashville') {
- $circulationReports = true;
- }
+ if ($accountProfile->driver == 'Nashville') {
+ $circulationReports = true;
+ }
}
if ($hasCurbside) {
$sections['ils_integration']->addAction(new AdminAction('Curbside Pickup Settings', 'Define Settings for Curbside Pickup, requires Koha Curbside plugin', '/ILS/CurbsidePickupSettings'), ['Administer Curbside Pickup']);
@@ -3603,29 +3608,35 @@ public function getAdminActions() {
'Administer Library VDX Forms',
]);
- if ($circulationReports) {
- $sections['circulation_reports'] = new AdminSection('Circulation Reports');
- $sections['circulation_reports']->addAction(new AdminAction('Holds Report', 'View a report of holds to be pulled from the shelf for patrons.', '/Report/HoldsReport'), [
- 'View Location Holds Reports',
- 'View All Holds Reports',
- ]);
- $sections['circulation_reports']->addAction(new AdminAction('Student Barcodes', 'View/print a report of all barcodes for a class.', '/Report/StudentBarcodes'), [
- 'View Location Student Reports',
- 'View All Student Reports',
- ]);
- $sections['circulation_reports']->addAction(new AdminAction('Student Checkout Report', 'View a report of all checkouts for a given class with filtering to only show overdue items and lost items.', '/Report/StudentReport'), [
- 'View Location Student Reports',
- 'View All Student Reports',
- ]);
- $sections['circulation_reports']->addAction(new AdminAction('Collection Report', 'View a report of all items for a branch.', '/Report/CollectionReport'), [
- 'View Location Collection Reports',
- 'View All Collection Reports',
- ]);
- $sections['circulation_reports']->addAction(new AdminAction('Weeding Report', 'View a collection weeding report for all items for a branch.', '/Report/WeedingReport'), [
- 'View Location Collection Reports',
- 'View All Collection Reports',
- ]);
- }
+ $sections['circulation_reports'] = new AdminSection('Circulation Reports');
+ $sections['circulation_reports']->addAction(new AdminAction('Barcode Generator', 'Create Code39 barcodes on Avery 5160 labels from a list of numbers.', '/Report/BarcodeGenerator'), [
+ 'Barcode Generators',
+ ]);
+ $sections['circulation_reports']->addAction(new AdminAction('Barcode Generator - Disc', 'Create hub EAN-8 barcodes for CDs and DVDs.', '/Report/DiscBarcodeGenerator'), [
+ 'Barcode Generators',
+ ]);
+ if ($circulationReports) {
+ $sections['circulation_reports']->addAction(new AdminAction('Collection Report', 'View a report of all items for a branch.', '/Report/CollectionReport'), [
+ 'View Location Collection Reports',
+ 'View All Collection Reports',
+ ]);
+ $sections['circulation_reports']->addAction(new AdminAction('Holds Report', 'View a report of holds to be pulled from the shelf for patrons.', '/Report/HoldsReport'), [
+ 'View Location Holds Reports',
+ 'View All Holds Reports',
+ ]);
+ $sections['circulation_reports']->addAction(new AdminAction('Student Barcodes', 'View/print a report of all barcodes for a class.', '/Report/StudentBarcodes'), [
+ 'View Location Student Reports',
+ 'View All Student Reports',
+ ]);
+ $sections['circulation_reports']->addAction(new AdminAction('Student Checkout Report', 'View a report of all checkouts for a given class with filtering to only show overdue items and lost items.', '/Report/StudentReport'), [
+ 'View Location Student Reports',
+ 'View All Student Reports',
+ ]);
+ $sections['circulation_reports']->addAction(new AdminAction('Weeding Report', 'View a collection weeding report for all items for a branch.', '/Report/WeedingReport'), [
+ 'View Location Collection Reports',
+ 'View All Collection Reports',
+ ]);
+ }
if (array_key_exists('Axis 360', $enabledModules)) {
$sections['boundless'] = new AdminSection('Boundless');
@@ -3685,7 +3696,7 @@ public function getAdminActions() {
if (array_key_exists('Summon', $enabledModules)) {
$sections['summon'] = new AdminSection('Summon');
- $sections['summon']->addAction(new AdminAction('Settings', 'Define connection information between Summon and Aspen Discovery.', '/Summon/SummonSettings'),['View Dashboards']);
+ $sections['summon']->addAction(new AdminAction('Settings', 'Define connection information between Summon and Aspen Discovery.', '/Summon/SummonSettings'), ['View Dashboards']);
$sections['summon']->addAction(new AdminAction('Dashboard', 'View the usage dashboard for Summon integration.', '/Summon/SummonDashboard'), [
'View Dashboards',
'View System Reports',
@@ -3790,11 +3801,11 @@ public function getAdminActions() {
if (array_key_exists('Open Archives', $enabledModules)) {
$sections['open_archives'] = new AdminSection('Open Archives');
$sections['open_archives']->addAction(new AdminAction('Collections', 'Define collections to be loaded into Aspen Discovery.', '/OpenArchives/Collections'), 'Administer Open Archives');
- $sections['open_archives']->addAction(new AdminAction('Open Archives Facet Settings', 'Define facets for open archives searches.', '/OpenArchives/OpenArchivesFacets'), [
- 'Administer All Open Archives Facet Settings',
- 'Administer Library Open Archives Facet Settings',
- ]);
- $sections['open_archives']->addAction(new AdminAction('Indexing Log', 'View the indexing log for Open Archives.', '/OpenArchives/IndexingLog'), [
+ $sections['open_archives']->addAction(new AdminAction('Open Archives Facet Settings', 'Define facets for open archives searches.', '/OpenArchives/OpenArchivesFacets'), [
+ 'Administer All Open Archives Facet Settings',
+ 'Administer Library Open Archives Facet Settings',
+ ]);
+ $sections['open_archives']->addAction(new AdminAction('Indexing Log', 'View the indexing log for Open Archives.', '/OpenArchives/IndexingLog'), [
'View System Reports',
'View Indexing Logs',
]);
@@ -3820,11 +3831,11 @@ public function getAdminActions() {
if (array_key_exists('Web Indexer', $enabledModules)) {
$sections['web_indexer'] = new AdminSection('Website Indexing');
$sections['web_indexer']->addAction(new AdminAction('Settings', 'Define settings for indexing websites within Aspen Discovery.', '/Websites/Settings'), 'Administer Website Indexing Settings');
- $sections['web_indexer']->addAction(new AdminAction('Website Facet Settings', 'Define facets for website searches.', '/Websites/WebsiteFacets'), [
- 'Administer All Website Facet Settings',
- 'Administer Library Website Facet Settings',
- ]);
- $sections['web_indexer']->addAction(new AdminAction('Website Pages', 'A list of pages that have been indexed.', '/Websites/WebsitePages'), 'Administer Website Indexing Settings');
+ $sections['web_indexer']->addAction(new AdminAction('Website Facet Settings', 'Define facets for website searches.', '/Websites/WebsiteFacets'), [
+ 'Administer All Website Facet Settings',
+ 'Administer Library Website Facet Settings',
+ ]);
+ $sections['web_indexer']->addAction(new AdminAction('Website Pages', 'A list of pages that have been indexed.', '/Websites/WebsitePages'), 'Administer Website Indexing Settings');
$sections['web_indexer']->addAction(new AdminAction('Indexing Log', 'View the indexing log for Websites.', '/Websites/IndexingLog'), [
'View System Reports',
'View Indexing Logs',
@@ -3858,7 +3869,7 @@ public function getAdminActions() {
]);
}
- if(array_key_exists('Aspen LiDA', $enabledModules)) {
+ if (array_key_exists('Aspen LiDA', $enabledModules)) {
$sections['aspen_lida'] = new AdminSection('Aspen LiDA');
$sections['aspen_lida']->addAction(new AdminAction('General Settings', 'Define general settings for Aspen LiDA.', '/AspenLiDA/GeneralSettings'), 'Administer Aspen LiDA Settings');
$sections['aspen_lida']->addAction(new AdminAction('Location Settings', 'Define location settings for Aspen LiDA.', '/AspenLiDA/LocationSettings'), 'Administer Aspen LiDA Settings');
@@ -3869,7 +3880,7 @@ public function getAdminActions() {
} else {
$sections['aspen_lida']->addAction($notificationReportAction, 'View Notifications Reports');
}
- if(false && $allowILSMessaging) {
+ if (false && $allowILSMessaging) {
$sections['aspen_lida']->addAction(new AdminAction('ILS Notification Settings', 'Define settings for ILS notifications in Aspen LiDA.', '/AspenLiDA/ILSNotificationSettings'), 'Administer Aspen LiDA Settings');
}
$sections['aspen_lida']->addAction(new AdminAction('LiDA Notifications', 'LiDA Notifications allow you to send custom alerts to your patrons via the app.', '/Admin/LiDANotifications'), [
@@ -4278,9 +4289,9 @@ public function canReceiveNotifications($alertType): bool {
$userHomeLocation = $this->homeLocationId;
$userLocation = new Location();
$userLocation->locationId = $this->homeLocationId;
- if($userLocation->find(true)) {
+ if ($userLocation->find(true)) {
$userLibrary = $userLocation->getParentLibrary();
- if($userLibrary) {
+ if ($userLibrary) {
require_once ROOT_DIR . '/sys/AspenLiDA/NotificationSetting.php';
$settings = new NotificationSetting();
$settings->id = $userLibrary->lidaNotificationSettingId;
@@ -4306,11 +4317,11 @@ public function canReceiveNotifications($alertType): bool {
}
public function canReceiveILSNotification($code): bool {
- if($this->isNotificationHistoryEnabled()) { // check if ils notifications are enabled for the ils
+ if ($this->isNotificationHistoryEnabled()) { // check if ils notifications are enabled for the ils
$userHomeLocation = $this->homeLocationId;
$userLocation = new Location();
$userLocation->locationId = $this->homeLocationId;
- if($userLocation->find(true)) {
+ if ($userLocation->find(true)) {
$userLibrary = $userLocation->getParentLibrary();
if ($userLibrary) {
require_once ROOT_DIR . '/sys/AspenLiDA/NotificationSetting.php';
@@ -4322,7 +4333,7 @@ public function canReceiveILSNotification($code): bool {
$ilsMessageTypes->ilsNotificationSettingId = $settings->ilsNotificationSettingId;
$ilsMessageTypes->code = $code;
$ilsMessageTypes->isEnabled = 1;
- if($ilsMessageTypes->find(true)) {
+ if ($ilsMessageTypes->find(true)) {
return true;
}
}
@@ -4391,7 +4402,7 @@ public function getNotificationPreferencesByUser() {
$preferences[] = $preference;
}
- if(empty($preferences)) {
+ if (empty($preferences)) {
$preference['device'] = 'Unknown';
$preference['token'] = 'Unknown';
$preference['notifySavedSearch'] = 0;
@@ -4425,7 +4436,7 @@ public function setNotificationPreference($option, $newValue, $token): bool {
$obj->pushToken = $token;
if ($obj->find(true)) {
$obj->$option = $newValue;
- if($obj->update()) {
+ if ($obj->update()) {
return true;
}
}
@@ -4438,7 +4449,7 @@ public function deleteNotificationPushToken($token): bool {
$pushToken->userId = $this->id;
$pushToken->pushToken = $token;
if ($pushToken->find(true)) {
- if($pushToken->delete()) {
+ if ($pushToken->delete()) {
return true;
}
}
@@ -4470,7 +4481,7 @@ public function loadObjectPropertiesFromJSON($jsonData, $mappings) {
foreach ($jsonData as $property => $value) {
if ($property != $this->getPrimaryKey() && $property != 'links') {
if (in_array($property, $encryptedFields)) {
- if (!empty($sourceEncryptionKey)){
+ if (!empty($sourceEncryptionKey)) {
$value = EncryptionUtils::decryptFieldWithProvidedKey($value, $sourceEncryptionKey);
} else {
//Source key was not provided, decrypt using our encryption key (assuming the source and destination match.
@@ -4608,7 +4619,7 @@ public function getILSName(): string {
public function canSuggestMaterials(): bool {
$patronType = $this->getPTypeObj();
if (!empty($patronType)) {
- if($patronType->canSuggestMaterials) {
+ if ($patronType->canSuggestMaterials) {
return true;
}
}
@@ -4618,7 +4629,7 @@ public function canSuggestMaterials(): bool {
function checkoutItem($barcode, Location $currentLocation): array {
if ($this->getCatalogDriver()->hasAPICheckout()) {
$result = $this->getCatalogDriver()->checkoutByAPI($this, $barcode, $currentLocation);
- }else{
+ } else {
$result = $this->getCatalogDriver()->checkoutBySip($this, $barcode, $currentLocation->code);
}
@@ -4629,14 +4640,14 @@ function checkoutItem($barcode, Location $currentLocation): array {
return $result;
}
- public function hasAPICheckIn() : bool {
+ public function hasAPICheckIn(): bool {
return $this->driver->hasAPICheckIin();
}
function checkInItem($barcode, Location $currentLocation): array {
if ($this->getCatalogDriver()->hasAPICheckin()) {
$result = $this->getCatalogDriver()->checkInByAPI($this, $barcode, $currentLocation);
- }else{
+ } else {
$result = $this->getCatalogDriver()->checkInBySip($this, $barcode, $currentLocation->code);
}
@@ -4651,11 +4662,11 @@ public function find($fetchFirst = false, $requireOneMatchToReturn = true): bool
return parent::find($fetchFirst, $requireOneMatchToReturn);
}
- public function isAspenAdminUser() : bool {
+ public function isAspenAdminUser(): bool {
return $this->source == 'admin' && $this->username == 'aspen_admin';
}
- public function showRenewalLink(AccountSummary $ilsAccountSummary) : bool {
+ public function showRenewalLink(AccountSummary $ilsAccountSummary): bool {
$showRenewalLink = false;
if ($ilsAccountSummary->isExpirationClose()) {
$pType = $this->getPTypeObj();
@@ -4682,7 +4693,7 @@ public function showRenewalLink(AccountSummary $ilsAccountSummary) : bool {
public function isNotificationHistoryEnabled() {
$catalogDriver = $this->getCatalogDriver();
- if($catalogDriver) {
+ if ($catalogDriver) {
return $catalogDriver->hasIlsInbox();
}
return false;
diff --git a/code/web/sys/DB/DataObject.php b/code/web/sys/DB/DataObject.php
index 298603b117..b2cbdf3a3a 100644
--- a/code/web/sys/DB/DataObject.php
+++ b/code/web/sys/DB/DataObject.php
@@ -965,7 +965,7 @@ public function setProperty(string $propertyName, $newValue, ?array $propertyStr
if ($propertyChanged) {
$this->_changedFields[] = $propertyName;
$oldValue = $this->$propertyName;
- if ($propertyStructure['type'] == 'checkbox') {
+ if ($propertyStructure != null && $propertyStructure['type'] == 'checkbox') {
if ($newValue == 'off' || $newValue == false) {
$newValue = 0;
} elseif ($newValue == 'on' || $newValue == true) {
@@ -980,7 +980,7 @@ public function setProperty(string $propertyName, $newValue, ?array $propertyStr
$logger->log("Forcing Nightly Index because $propertyName on " . get_class($this) . ' - ' . $this->getPrimaryKeyValue() . " was changed to $newValue by user " . UserAccount::getActiveUserId(), Logger::LOG_ALERT);
}
//Add the change to the history unless tracking the history is off (passwords)
- if ($propertyStructure['type'] != 'password' && $propertyStructure['type'] != 'storedPassword') {
+ if ($propertyStructure != null && $propertyStructure['type'] != 'password' && $propertyStructure['type'] != 'storedPassword') {
if ($this->objectHistoryEnabled()) {
require_once ROOT_DIR . '/sys/DB/DataObjectHistory.php';
$history = new DataObjectHistory();
@@ -1408,7 +1408,7 @@ public function getDeletionBlockInformation(array $structure) : array {
if (!empty($objectLinkingInfo['message'])) {
$objectLinkingInfo['message'] .= '
';
}
- $objectLinkingInfo['message'] .= translate(['text' => 'This object is linked to %1% %2% that should be unlinked or deleted before deleting this.', 'isAdminFacing'=>true, 1=>$numLinkedObjects, 2=>$objectInfo['objectName']]);
+ $objectLinkingInfo['message'] .= translate(['text' => 'This object is linked to %1% %2% that should be unlinked or deleted before deleting this.', 'isAdminFacing'=>true, 1=>$numLinkedObjects, 2=>($numLinkedObjects == 1 ? $objectInfo['objectName'] : $objectInfo['objectNamePlural'])]);
}
}
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 6dad2af123..b795e84e78 100644
--- a/code/web/sys/DBMaintenance/version_updates/24.09.00.php
+++ b/code/web/sys/DBMaintenance/version_updates/24.09.00.php
@@ -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',
@@ -66,6 +74,56 @@ function getUpdates24_09_00(): array {
"INSERT INTO role_permissions(roleId, permissionId) VALUES ((SELECT roleId from roles where name='opacAdmin'), (SELECT id from permissions where name='Test Self Check'))",
]
], //add_permission_for_testing_checkouts
+ 'add_permission_for_format_sorting' => [
+ 'title' => 'Add permissions for format sorting',
+ 'description' => 'Add permissions for format sorting',
+ 'continueOnError' => false,
+ 'sql' => [
+ "INSERT INTO permissions (sectionName, name, requiredModule, weight, description) VALUES ('Grouped Work Display', 'Administer All Format Sorting', '', 40, 'Allows users to change how formats are sorted within a grouped work for all libraries.')",
+ "INSERT INTO permissions (sectionName, name, requiredModule, weight, description) VALUES ('Grouped Work Display', 'Administer Library Format Sorting', '', 50, 'Allows users to change how formats are sorted within a grouped work for their library.')",
+ "INSERT INTO role_permissions(roleId, permissionId) VALUES ((SELECT roleId from roles where name='opacAdmin'), (SELECT id from permissions where name='Administer All Format Sorting'))",
+ ]
+ ], //add_permission_for_format_sorting
+ 'create_format_sorting_tables' => [
+ 'title' => 'Create format sorting tables',
+ 'description' => 'Create format sorting tables',
+ 'continueOnError' => true,
+ 'sql' => [
+ 'CREATE TABLE IF NOT EXISTS grouped_work_format_sort_group (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(255) NOT NULL UNIQUE,
+ bookSortMethod TINYINT(1) DEFAULT 1,
+ comicSortMethod TINYINT(1) DEFAULT 1,
+ movieSortMethod TINYINT(1) DEFAULT 1,
+ musicSortMethod TINYINT(1) DEFAULT 1,
+ otherSortMethod TINYINT(1) DEFAULT 1
+ )',
+ 'CREATE TABLE IF NOT EXISTS grouped_work_format_sort (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ formatSortingGroupId INT(11) NOT NULL,
+ groupingCategory VARCHAR(6) NOT NULL,
+ format VARCHAR(255) NOT NULL,
+ weight INT(11) NOT NULL,
+ UNIQUE(formatSortingGroupId, groupingCategory, format)
+ )',
+ ],
+ ], //create_format_sorting_tables
+ 'create_default_format_sorting' => [
+ 'title' => 'Create default format sorting',
+ 'description' => 'Create default format sorting',
+ 'continueOnError' => false,
+ 'sql' => [
+ "INSERT INTO grouped_work_format_sort_group (id, name, bookSortMethod, comicSortMethod, movieSortMethod, musicSortMethod, otherSortMethod) VALUES (1, 'Default', 1, 1, 1, 1, 1)"
+ ]
+ ],
+ 'link_format_sorting_to_display_settings' => [
+ 'title' => 'Link format sorting to display settings',
+ 'description' => 'Link format sorting to display settings',
+ 'continueOnError' => false,
+ 'sql' => [
+ 'ALTER TABLE grouped_work_display_settings ADD COLUMN formatSortingGroupId INT(11) DEFAULT 1'
+ ]
+ ], //link_format_sorting_to_display_settings
//katherine - ByWater
@@ -102,15 +160,39 @@ function getUpdates24_09_00(): array {
//migrate_web_resource_library_access_rules
//kodi - ByWater
+ 'sierra_self_reg_patron_type' => [
+ 'title' => 'Sierra Self Reg Patron Code',
+ 'description' => 'Add Patron Code to variables for Sierra self registration forms to define the patron type.',
+ 'sql' => [
+ 'ALTER TABLE self_registration_form_sierra ADD COLUMN selfRegPatronCode VARCHAR(75)',
+ ],
+ ],
//alexander - PTFS-Europe
//chloe - PTFS-Europe
+ 'sourceId_allow_255_char' => [
+ 'title'=> 'SourceId Allow 255 char',
+ 'description' => 'Allow for longer source ids so that summon and ebsco records can be included without clashing with the length constraint',
+ 'continueOnError' => false,
+ 'sql' => ["ALTER TABLE user_list_entry MODIFY COLUMN sourceId VARCHAR(255)"]
+
+ ], //
//pedro - PTFS-Europe
//James Staub - Nashville Public Library
-
+ 'barcode_generator_report_permissions' => [
+ 'title' => 'Barcode Generator report permissions',
+ 'description' => 'Create permissions for Barcode Generator reports',
+ 'continueOnError' => true,
+ 'sql' => [
+ "INSERT INTO permissions (sectionName, name, requiredModule, weight, description) VALUES
+ ('Circulation Reports', 'Barcode Generators', '', 60, 'Allows the user to run the Barcode Generators')
+ ",
+// "INSERT INTO role_permissions(roleId, permissionId) VALUES ((SELECT roleId from roles where name='locationReports'), (SELECT id from permissions where name='Barcode Generators'))",
+ ],
+ ],
//other
diff --git a/code/web/sys/Grouping/GroupedWorkDisplaySetting.php b/code/web/sys/Grouping/GroupedWorkDisplaySetting.php
index ae97820454..5593f80e02 100644
--- a/code/web/sys/Grouping/GroupedWorkDisplaySetting.php
+++ b/code/web/sys/Grouping/GroupedWorkDisplaySetting.php
@@ -1,11 +1,13 @@
'Show Fountas & Pinnell Information (This data must be present in MARC records)',
];
- // Use this to set which details will be shown in the the Main Details section of the record view.
+ // Use this to set which details will be shown in the Main Details section of the record view.
// You should be able to add options here without needing to change the database.
// set the key to the desired SMARTY template variable name, set the value to the label to show in the library configuration page
static $showInMainDetailsOptions = [
@@ -129,6 +132,14 @@ static function getObjectStructure($context = ''): array {
$facetGroups[$facetGroup->id] = $facetGroup->name;
}
+ $formatSortGroups = [];
+ $formatSort = new GroupedWorkFormatSortingGroup();
+ $formatSort->orderBy('name');
+ $formatSort->find();
+ while ($formatSort->fetch()) {
+ $formatSortGroups[$formatSort->id] = $formatSort->name;
+ }
+
$moreDetailsStructure = GroupedWorkMoreDetails::getObjectStructure($context);
unset($moreDetailsStructure['weight']);
unset($moreDetailsStructure['groupedWorkSettingsId']);
@@ -358,6 +369,12 @@ static function getObjectStructure($context = ''): array {
],
],
],
+ 'formatSortingGroupId' => [
+ 'property' => 'formatSortingGroupId',
+ 'type' => 'enum',
+ 'values' => $formatSortGroups,
+ 'label' => 'Format Sorting',
+ ],
'searchAlgorithm' => [
'property' => 'searchAlgorithm',
'type' => 'section',
@@ -494,7 +511,7 @@ static function getObjectStructure($context = ''): array {
'default' => 1,
'hideInLists' => true,
],
- //'showGoDeeper' => array('property'=>'showGoDeeper', 'type'=>'checkbox', 'label'=>'Show Content Enrichment (TOC, Excerpts, etc)', 'description'=>'Whether or not additional content enrichment like Table of Contents, Excerpts, etc are shown to the user', 'default' => 1, 'hideInLists' => true,),
+ //'showGoDeeper' => array('property'=>'showGoDeeper', 'type'=>'checkbox', 'label'=>'Show Content Enrichment (TOC, Excerpts, etc)', 'description'=>'Whether additional content enrichment like Table of Contents, Excerpts, etc. are shown to the user', 'default' => 1, 'hideInLists' => true,),
'showRatings' => [
'property' => 'showRatings',
'type' => 'checkbox',
@@ -542,7 +559,7 @@ static function getObjectStructure($context = ''): array {
// 'property' => 'show856LinksAsAccessOnlineButtons',
// 'type' => 'checkbox',
// 'label' => 'Show 856 Links as Access Online Buttons',
-// 'description' => 'Whether or not 856 links with indicator 1 of 4 and indicator 2 of 0 will be shown as access online buttons.',
+// 'description' => 'Whether 856 links with indicator 1 of 4 and indicator 2 of 0 will be shown as access online buttons.',
// 'hideInLists' => true,
// 'default' => 0,
// ],
@@ -692,10 +709,10 @@ static function getObjectStructure($context = ''): array {
*
* @see DB/DB_DataObject::fetch()
*/
- public function fetch() {
+ public function fetch(): bool|DataObject|null {
$return = parent::fetch();
if ($return) {
- if (isset($this->showInSearchResultsMainDetails) && is_string($this->showInSearchResultsMainDetails) && !empty($this->showInSearchResultsMainDetails)) {
+ if (!empty($this->showInSearchResultsMainDetails) && is_string($this->showInSearchResultsMainDetails) ) {
// convert to array retrieving from database
$unSerialized = @unserialize($this->showInSearchResultsMainDetails);
if (!empty($unSerialized)) {
@@ -708,7 +725,7 @@ public function fetch() {
}
}
- if (isset($this->showInMainDetails) && is_string($this->showInMainDetails) && !empty($this->showInMainDetails)) {
+ if (!empty($this->showInMainDetails) && is_string($this->showInMainDetails)) {
// convert to array retrieving from database
try {
$unSerialized = unserialize($this->showInMainDetails);
@@ -725,7 +742,7 @@ public function fetch() {
$logger->log("Error loading GroupedWorkDisplaySetting $this->id $e", Logger::LOG_DEBUG);
}
} elseif (empty($this->showInMainDetails)) {
- // when a value is not set, assume set to show all options, eg null = all
+ // when a value is not set, assume set to show all options, e.g. null = all
$default = self::$showInMainDetailsOptions;
// remove options below that aren't to be part of the default
unset($default['showISBNs']);
@@ -787,13 +804,14 @@ public function insert($context = '') {
return $ret;
}
- private $_facetGroup = false;
+ private GroupedWorkFacetGroup|false|null $_facetGroup = false;
/** @return GroupedWorkFacet[] */
- public function getFacets() {
+ public function getFacets() : array {
try {
return $this->getFacetGroup()->getFacets();
- } catch (Exception $e) {
+ } /** @noinspection PhpUnusedLocalVariableInspection */
+ catch (Exception $e) {
return [];
}
}
@@ -808,7 +826,8 @@ public function getFacetGroup(): ?GroupedWorkFacetGroup {
}
}
return $this->_facetGroup;
- } catch (Exception $e) {
+ } /** @noinspection PhpUnusedLocalVariableInspection */
+ catch (Exception $e) {
return null;
}
}
@@ -855,7 +874,10 @@ public function __set($name, $value) {
}
}
- public function getMoreDetailsOptions() {
+ /**
+ * @return GroupedWorkMoreDetails[]|null
+ */
+ public function getMoreDetailsOptions() : ?array {
if (!isset($this->_moreDetailsOptions) && $this->id) {
$this->_moreDetailsOptions = [];
$moreDetailsOptions = new GroupedWorkMoreDetails();
@@ -869,23 +891,23 @@ public function getMoreDetailsOptions() {
return $this->_moreDetailsOptions;
}
- public function setMoreDetailsOptions($value) {
+ public function setMoreDetailsOptions($value) : void {
$this->_moreDetailsOptions = $value;
}
- public function saveMoreDetailsOptions() {
- if (isset ($this->_moreDetailsOptions) && is_array($this->_moreDetailsOptions)) {
+ public function saveMoreDetailsOptions() : void {
+ if (isset ($this->_moreDetailsOptions)) {
$this->saveOneToManyOptions($this->_moreDetailsOptions, 'groupedWorkSettingsId');
unset($this->_moreDetailsOptions);
}
}
- public function clearMoreDetailsOptions() {
+ public function clearMoreDetailsOptions() : void {
$this->clearOneToManyOptions('GroupedWorkMoreDetails', 'groupedWorkSettingsId');
$this->_moreDetailsOptions = [];
}
- public static function getDefaultDisplaySettings() {
+ public static function getDefaultDisplaySettings() : GroupedWorkDisplaySetting {
$defaultDisplaySettings = new GroupedWorkDisplaySetting();
$defaultDisplaySettings->name = 'default';
$defaultDisplaySettings->sortOwnedEditionsFirst = true;
@@ -912,8 +934,8 @@ public static function getDefaultDisplaySettings() {
return $defaultDisplaySettings;
}
- public function saveLibraries() {
- if (isset ($this->_libraries) && is_array($this->_libraries)) {
+ public function saveLibraries() : void {
+ if (isset ($this->_libraries)) {
$libraryList = Library::getLibraryList(!UserAccount::userHasPermission('Administer All Grouped Work Display Settings'));
foreach ($libraryList as $libraryId => $displayName) {
$library = new Library();
@@ -937,8 +959,8 @@ public function saveLibraries() {
}
}
- public function saveLocations() {
- if (isset ($this->_locations) && is_array($this->_locations)) {
+ public function saveLocations() : void {
+ if (isset ($this->_locations)) {
$locationList = Location::getLocationList(!UserAccount::userHasPermission('Administer All Grouped Work Display Settings'));
/**
* @var int $locationId
@@ -972,35 +994,35 @@ public function saveLocations() {
/** @return Library[]
* @noinspection PhpUnused
*/
- public function getLibraries() {
+ public function getLibraries() : array {
return $this->_libraries;
}
/** @return Location[]
* @noinspection PhpUnused
*/
- public function getLocations() {
+ public function getLocations() : array {
return $this->_locations;
}
/** @noinspection PhpUnused */
- public function setLibraries($val) {
+ public function setLibraries($val) : void {
$this->_libraries = $val;
}
/** @noinspection PhpUnused */
- public function setLocations($val) {
+ public function setLocations($val) : void {
$this->_libraries = $val;
}
/** @noinspection PhpUnused */
- public function clearLibraries() {
+ public function clearLibraries() : void {
$this->clearOneToManyOptions('Library', 'groupedWorkDisplaySettingId');
unset($this->_libraries);
}
/** @noinspection PhpUnused */
- public function clearLocations() {
+ public function clearLocations() : void {
$this->clearOneToManyOptions('Location', 'groupedWorkDisplaySettingId');
unset($this->_locations);
}
@@ -1022,13 +1044,27 @@ public function getLinkedObjectStructure() : array {
'class' => ROOT_DIR . '/sys/LibraryLocation/Location.php',
'linkingProperty' => 'groupedWorkDisplaySettingId',
'objectName' => 'Location',
+ 'objectNamePlural' => 'Locations',
],
[
'object' => 'Library',
'class' => ROOT_DIR . '/sys/LibraryLocation/Library.php',
'linkingProperty' => 'groupedWorkDisplaySettingId',
'objectName' => 'Library',
+ 'objectNamePlural' => 'Libraries',
],
];
}
+
+ private GroupedWorkFormatSortingGroup|false|null $_formatSortingGroup = false;
+ public function getFormatSortingGroup() {
+ if ($this->_formatSortingGroup === false) {
+ $this->_formatSortingGroup = new GroupedWorkFormatSortingGroup();
+ $this->_formatSortingGroup->id = $this->formatSortingGroupId;
+ if (!$this->_formatSortingGroup->find(true)) {
+ $this->_formatSortingGroup = null;
+ }
+ }
+ return $this->_formatSortingGroup;
+ }
}
\ No newline at end of file
diff --git a/code/web/sys/Grouping/GroupedWorkFacetGroup.php b/code/web/sys/Grouping/GroupedWorkFacetGroup.php
index 88e4d575ba..ff78fe8948 100644
--- a/code/web/sys/Grouping/GroupedWorkFacetGroup.php
+++ b/code/web/sys/Grouping/GroupedWorkFacetGroup.php
@@ -335,4 +335,16 @@ function getAdditionalListJavascriptActions(): array {
return $objectActions;
}
+
+ public function getLinkedObjectStructure() : array {
+ return [
+ [
+ 'object' => 'GroupedWorkDisplaySetting',
+ 'class' => ROOT_DIR . '/sys/Grouping/GroupedWorkDisplaySetting.php',
+ 'linkingProperty' => 'facetGroupId',
+ 'objectName' => 'Grouped Work Display Setting',
+ 'objectNamePlural' => 'Grouped Work Display Settings',
+ ],
+ ];
+ }
}
\ No newline at end of file
diff --git a/code/web/sys/Grouping/GroupedWorkFormatSort.php b/code/web/sys/Grouping/GroupedWorkFormatSort.php
new file mode 100644
index 0000000000..259c48f104
--- /dev/null
+++ b/code/web/sys/Grouping/GroupedWorkFormatSort.php
@@ -0,0 +1,57 @@
+ [
+ 'property' => 'id',
+ 'type' => 'label',
+ 'label' => 'Id',
+ 'description' => 'The unique id within the database',
+ ],
+ 'weight' => [
+ 'property' => 'weight',
+ 'type' => 'numeric',
+ 'label' => 'Weight',
+ 'weight' => 'Defines how items are sorted. Lower weights are displayed higher.',
+ 'required' => true,
+ ],
+ 'formatSortingGroupId' => [
+ 'property' => 'formatSortingGroupId',
+ 'type' => 'integer',
+ 'label' => 'Format Sorting Group ID',
+ 'description' => 'The sorting group this belongs to',
+ ],
+ 'groupingCategory' => [
+ 'property' => 'groupingCategory',
+ 'type' => 'enum',
+ 'values' => [
+ 'book' => 'book',
+ 'comic' => 'comic',
+ 'movie' => 'movie',
+ 'music' => 'music',
+ 'other' => 'other'
+ ],
+ 'label' => 'Grouping Category',
+ 'description' => 'The category this format belongs in',
+ ],
+ 'format' => [
+ 'property' => 'format',
+ 'type' => 'text',
+ 'label' => 'Format',
+ 'description' => 'The format being sorted',
+ 'size' => '40',
+ 'maxLength' => 255,
+ 'readOnly' => true,
+ ],
+ ];
+ }
+}
\ No newline at end of file
diff --git a/code/web/sys/Grouping/GroupedWorkFormatSortingGroup.php b/code/web/sys/Grouping/GroupedWorkFormatSortingGroup.php
new file mode 100644
index 0000000000..8eddaed915
--- /dev/null
+++ b/code/web/sys/Grouping/GroupedWorkFormatSortingGroup.php
@@ -0,0 +1,399 @@
+ [
+ 'property' => 'id',
+ 'type' => 'label',
+ 'label' => 'Id',
+ 'description' => 'The unique id within the database',
+ ],
+ 'name' => [
+ 'property' => 'name',
+ 'type' => 'text',
+ 'label' => 'Display Name',
+ 'description' => 'The name of the settings',
+ 'size' => '40',
+ 'maxLength' => 255,
+ ],
+ 'booksSection' => [
+ 'property' => 'booksSection',
+ 'type' => 'section',
+ 'label' => 'Books',
+ 'properties' => [
+ 'bookSortMethod' => [
+ 'property' => 'bookSortMethod',
+ 'type' => 'enum',
+ 'values' => [
+ '1' => 'Sort Alphabetically with Books first',
+ '2' => 'Custom Sort'
+ ],
+ 'label' => 'Sorting Method for Books',
+ 'description' => 'Determines how formats are sorted for grouped works with a grouping category of book',
+ 'onchange' => "return AspenDiscovery.Admin.updateGroupedWorkSortFields('book');",
+ ],
+ 'sortedBookFormats' => [
+ 'property' => 'sortedBookFormats',
+ 'type' => 'oneToMany',
+ 'label' => 'Sorted Book Formats',
+ 'description' => 'A list of formats in the order they should be displayed',
+ 'keyThis' => 'id',
+ 'keyOther' => 'formatSortingGroupId',
+ 'subObjectType' => 'GroupedWorkFormatSort',
+ 'structure' => $formatSortStructure,
+ 'sortable' => true,
+ 'storeDb' => true,
+ 'allowEdit' => false,
+ 'canEdit' => false,
+ 'canAddNew' => false,
+ 'canDelete' => false,
+ ],
+ ]
+ ],
+
+ 'comicsSection' => [
+ 'property' => 'comicsSection',
+ 'type' => 'section',
+ 'label' => 'Comics',
+ 'properties' => [
+ 'comicSortMethod' => [
+ 'property' => 'comicSortMethod',
+ 'type' => 'enum',
+ 'values' => [
+ '1' => 'Sort Alphabetically',
+ '2' => 'Custom Sort'
+ ],
+ 'label' => 'Sorting Method for Comics',
+ 'description' => 'Determines how formats are sorted for grouped works with a grouping category of comic',
+ 'onchange' => "return AspenDiscovery.Admin.updateGroupedWorkSortFields('comic');",
+ ],
+ 'sortedComicFormats' => [
+ 'property' => 'sortedComicFormats',
+ 'type' => 'oneToMany',
+ 'label' => 'Sorted Comic Formats',
+ 'description' => 'A list of formats in the order they should be displayed',
+ 'keyThis' => 'id',
+ 'keyOther' => 'formatSortingGroupId',
+ 'subObjectType' => 'GroupedWorkFormatSort',
+ 'structure' => $formatSortStructure,
+ 'sortable' => true,
+ 'storeDb' => true,
+ 'allowEdit' => false,
+ 'canEdit' => false,
+ 'canAddNew' => false,
+ 'canDelete' => false,
+ ],
+ ],
+ ],
+ 'moviesSection' => [
+ 'property' => 'moviesSection',
+ 'type' => 'section',
+ 'label' => 'Movies',
+ 'properties' => [
+ 'movieSortMethod' => [
+ 'property' => 'movieSortMethod',
+ 'type' => 'enum',
+ 'values' => [
+ '1' => 'Sort Alphabetically',
+ '2' => 'Custom Sort'
+ ],
+ 'label' => 'Sorting Method for Movies',
+ 'description' => 'Determines how formats are sorted for grouped works with a grouping category of movie',
+ 'onchange' => "return AspenDiscovery.Admin.updateGroupedWorkSortFields('movie');",
+ ],
+ 'sortedMovieFormats' => [
+ 'property' => 'sortedMovieFormats',
+ 'type' => 'oneToMany',
+ 'label' => 'Sorted Movie Formats',
+ 'description' => 'A list of formats in the order they should be displayed',
+ 'keyThis' => 'id',
+ 'keyOther' => 'formatSortingGroupId',
+ 'subObjectType' => 'GroupedWorkFormatSort',
+ 'structure' => $formatSortStructure,
+ 'sortable' => true,
+ 'storeDb' => true,
+ 'allowEdit' => false,
+ 'canEdit' => false,
+ 'canAddNew' => false,
+ 'canDelete' => false,
+ ],
+ ],
+ ],
+ 'musicSection' => [
+ 'property' => 'musicSection',
+ 'type' => 'section',
+ 'label' => 'Music',
+ 'properties' => [
+ 'musicSortMethod' => [
+ 'property' => 'musicSortMethod',
+ 'type' => 'enum',
+ 'values' => [
+ '1' => 'Sort Alphabetically',
+ '2' => 'Custom Sort'
+ ],
+ 'label' => 'Sorting Method for Music',
+ 'description' => 'Determines how formats are sorted for grouped works with a grouping category of music',
+ 'onchange' => "return AspenDiscovery.Admin.updateGroupedWorkSortFields('music');",
+ ],
+ 'sortedMusicFormats' => [
+ 'property' => 'sortedMusicFormats',
+ 'type' => 'oneToMany',
+ 'label' => 'Sorted Music Formats',
+ 'description' => 'A list of formats in the order they should be displayed',
+ 'keyThis' => 'id',
+ 'keyOther' => 'formatSortingGroupId',
+ 'subObjectType' => 'GroupedWorkFormatSort',
+ 'structure' => $formatSortStructure,
+ 'sortable' => true,
+ 'storeDb' => true,
+ 'allowEdit' => false,
+ 'canEdit' => false,
+ 'canAddNew' => false,
+ 'canDelete' => false,
+ ],
+ ],
+ ],
+ 'otherSection' => [
+ 'property' => 'otherSection',
+ 'type' => 'section',
+ 'label' => 'Other',
+ 'properties' => [
+ 'otherSortMethod' => [
+ 'property' => 'otherSortMethod',
+ 'type' => 'enum',
+ 'values' => [
+ '1' => 'Sort Alphabetically',
+ '2' => 'Custom Sort'
+ ],
+ 'label' => 'Sorting Method for Other',
+ 'description' => 'Determines how formats are sorted for grouped works with a grouping category of other',
+ 'onchange' => "return AspenDiscovery.Admin.updateGroupedWorkSortFields('other');",
+ ],
+ 'sortedOtherFormats' => [
+ 'property' => 'sortedOtherFormats',
+ 'type' => 'oneToMany',
+ 'label' => 'Sorted Other Formats',
+ 'description' => 'A list of formats in the order they should be displayed',
+ 'keyThis' => 'id',
+ 'keyOther' => 'formatSortingGroupId',
+ 'subObjectType' => 'GroupedWorkFormatSort',
+ 'structure' => $formatSortStructure,
+ 'sortable' => true,
+ 'storeDb' => true,
+ 'allowEdit' => false,
+ 'canEdit' => false,
+ 'canAddNew' => false,
+ 'canDelete' => false,
+ ],
+ ],
+ ],
+ ];
+ if ($context == 'addNew') {
+ unset($objectStructure['booksSection']);
+ unset($objectStructure['comicsSection']);
+ unset($objectStructure['moviesSection']);
+ unset($objectStructure['musicSection']);
+ unset($objectStructure['otherSection']);
+ }
+ return $objectStructure;
+ }
+
+ public function update($context = '') {
+ $ret = parent::update();
+ if ($ret !== FALSE) {
+ $this->saveSortedFormats('book');
+ $this->saveSortedFormats('comic');
+ $this->saveSortedFormats('movie');
+ $this->saveSortedFormats('music');
+ $this->saveSortedFormats('other');
+ }
+ return $ret;
+ }
+
+ public function insert($context = '') {
+ $ret = parent::insert();
+ if ($ret !== FALSE) {
+ $this->loadDefaultFormats();
+ }
+ return $ret;
+ }
+
+ public function delete($useWhere = false): int {
+ $ret = parent::delete($useWhere);
+ if ($ret !== false) {
+ $sortedFormat = new GroupedWorkFormatSort();
+ $sortedFormat->formatSortingGroupId = $this->id;
+ $sortedFormat->delete(true);
+ }
+ return $ret;
+ }
+
+ private function getArrayNameForGroupingCategory($groupingCategory) {
+ $internalArrayName = null;
+ switch ($groupingCategory) {
+ case 'book':
+ $internalArrayName = '_sortedBookFormats';
+ break;
+ case 'comic':
+ $internalArrayName = '_sortedComicFormats';
+ break;
+ case 'movie':
+ $internalArrayName = '_sortedMovieFormats';
+ break;
+ case 'music':
+ $internalArrayName = '_sortedMusicFormats';
+ break;
+ case 'other':
+ $internalArrayName = '_sortedOtherFormats';
+ break;
+ }
+ return $internalArrayName;
+ }
+
+ public function saveSortedFormats($groupingCategory) {
+ $internalArrayName = $this->getArrayNameForGroupingCategory($groupingCategory);
+ if (!empty($internalArrayName) && isset ($this->$internalArrayName) && is_array($this->$internalArrayName)) {
+ foreach ($this->$internalArrayName as $id => $formatSort) {
+ $formatSort->groupingCategory = $groupingCategory;
+ }
+ $this->saveOneToManyOptions($this->$internalArrayName, 'formatSortingGroupId');
+ unset($this->$internalArrayName);
+ }
+ }
+
+ public function __get($name) {
+ if ($name == 'sortedBookFormats') {
+ return $this->getSortedFormats('book');
+ } elseif ($name == 'sortedComicFormats') {
+ return $this->getSortedFormats('comic');
+ } elseif ($name == 'sortedMovieFormats') {
+ return $this->getSortedFormats('movie');
+ } elseif ($name == 'sortedMusicFormats') {
+ return $this->getSortedFormats('music');
+ } elseif ($name == 'sortedOtherFormats') {
+ return $this->getSortedFormats('other');
+ } else {
+ return parent::__get($name);
+ }
+ }
+
+ public function __set($name, $value) {
+ if ($name == 'sortedBookFormats') {
+ $this->setSortedFormats('book', $value);
+ } elseif ($name == 'sortedComicFormats') {
+ $this->setSortedFormats('comic', $value);
+ } elseif ($name == 'sortedMovieFormats') {
+ $this->setSortedFormats('movie', $value);
+ } elseif ($name == 'sortedMusicFormats') {
+ $this->setSortedFormats('music', $value);
+ } elseif ($name == 'sortedOtherFormats') {
+ $this->setSortedFormats('other', $value);
+ } else {
+ parent::__set($name, $value);
+ }
+ }
+
+ /** @return GroupedWorkFormatSort[] */
+ public function getSortedFormats($groupingCategory): ?array {
+ $internalArrayName = $this->getArrayNameForGroupingCategory($groupingCategory);
+ if (!empty($internalArrayName) && !isset($this->$internalArrayName) && $this->id) {
+ $this->$internalArrayName = [];
+ $sortedFormat = new GroupedWorkFormatSort();
+ $sortedFormat->facetGroupId = $this->id;
+ $sortedFormat->groupingCategory = $groupingCategory;
+ $sortedFormat->orderBy('weight');
+ $sortedFormat->find();
+ while ($sortedFormat->fetch()) {
+ $this->$internalArrayName[$sortedFormat->id] = clone($sortedFormat);
+ }
+ }
+ return $this->$internalArrayName;
+ }
+
+ public function loadDefaultFormats() {
+ //Automatically generate based on the data in the database.
+ global $aspen_db;
+ $loadDefaultFormatsStmt = "SELECT grouping_category, format FROM grouped_work_variation inner join indexed_format on indexed_format.id = formatId inner join grouped_work on grouped_work.id = grouped_work_variation.groupedWorkId group by format, grouping_category order by grouping_category, lower(format);";
+ $results = $aspen_db->query($loadDefaultFormatsStmt, PDO::FETCH_ASSOC);
+
+ $bookSort = $this->getSortedFormats('book');
+ $comicSort = $this->getSortedFormats('comic');
+ $movieSort = $this->getSortedFormats('movie');
+ $musicSort = $this->getSortedFormats('music');
+ $otherSort = $this->getSortedFormats('other');
+
+ foreach ($results as $result) {
+ //Check to see if we already have this category
+ if ($result['grouping_category'] == 'book') {
+ $activeFormats = $bookSort;
+ }elseif ($result['grouping_category'] == 'comic') {
+ $activeFormats = $comicSort;
+ }elseif ($result['grouping_category'] == 'movie') {
+ $activeFormats = $movieSort;
+ }elseif ($result['grouping_category'] == 'music') {
+ $activeFormats = $musicSort;
+ }elseif ($result['grouping_category'] == 'other') {
+ $activeFormats = $otherSort;
+ }
+ $formatExists = false;
+ foreach ($activeFormats as $activeFormat) {
+ if ($activeFormat->format == $result['format']) {
+ $formatExists = true;
+ break;
+ }
+ }
+ if (!$formatExists) {
+ $groupedWorkFormatSort = new GroupedWorkFormatSort();
+ $groupedWorkFormatSort->formatSortingGroupId = $this->id;
+ $groupedWorkFormatSort->groupingCategory = $result['grouping_category'];
+ $groupedWorkFormatSort->format = $result['format'];
+ $groupedWorkFormatSort->weight = count($activeFormats) + 1;
+ $groupedWorkFormatSort->insert();
+ $activeFormats[$groupedWorkFormatSort->id] = $groupedWorkFormatSort;
+ }
+ }
+ }
+
+ private function setSortedFormats(string $groupingCategory, ?array $value) : void {
+ $internalArrayName = $this->getArrayNameForGroupingCategory($groupingCategory);
+ if (!empty($internalArrayName)) {
+ $this->$internalArrayName = $value;
+ }
+ }
+
+ public function getLinkedObjectStructure() : array {
+ return [
+ [
+ 'object' => 'GroupedWorkDisplaySetting',
+ 'class' => ROOT_DIR . '/sys/Grouping/GroupedWorkDisplaySetting.php',
+ 'linkingProperty' => 'formatSortingGroupId',
+ 'objectName' => 'Grouped Work Display Setting',
+ 'objectNamePlural' => 'Grouped Work Display Settings',
+ ],
+ ];
+ }
+
+
+}
\ No newline at end of file
diff --git a/code/web/sys/LibraryLocation/Location.php b/code/web/sys/LibraryLocation/Location.php
index 7243349ddb..830059e3d8 100644
--- a/code/web/sys/LibraryLocation/Location.php
+++ b/code/web/sys/LibraryLocation/Location.php
@@ -76,6 +76,7 @@ class Location extends DataObject {
public $scope;
public $useScope;
public $statGroup;
+ public $circulationUsername;
public $facetLabel;
public $groupedWorkDisplaySettingId;
public $browseCategoryGroupId;
@@ -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',
diff --git a/code/web/sys/MaterialsRequest.php b/code/web/sys/MaterialsRequest.php
index 5d8e281499..7ab3a94d71 100644
--- a/code/web/sys/MaterialsRequest.php
+++ b/code/web/sys/MaterialsRequest.php
@@ -275,7 +275,7 @@ function sendStatusChangeEmail() {
function sendStaffNewMaterialsRequestEmail() {
global $configArray;
global $interface;
- if ($this->getCreatedByUser() != false) {
+ if ($this->getCreatedByUser() != false && $this->createdEmailSent == 0) {
$patronLibrary = $this->getCreatedByUser()->getHomeLibrary();
if ($patronLibrary->materialsRequestSendStaffEmailOnNew && !empty($patronLibrary->materialsRequestNewEmail)) {
$url = $configArray['Site']['url'] . '/MaterialsRequest/ManageRequests';
diff --git a/code/web/sys/SearchObject/SummonSearcher.php b/code/web/sys/SearchObject/SummonSearcher.php
index 18c34d6fd6..0845665fed 100644
--- a/code/web/sys/SearchObject/SummonSearcher.php
+++ b/code/web/sys/SearchObject/SummonSearcher.php
@@ -6,39 +6,38 @@
class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{
- static $instance;
+ static $instance;
/** @var SummonSettings */
- private $summonBaseApi ='http://api.summon.serialssolutions.com';
+ private $summonBaseApi ='http://api.summon.serialssolutions.com';
/**Build URL */
- private $sessionId;
- private $version = '2.0.0';
- private $service = 'search';
- private $responseType = "json";
+ private $sessionId;
+ private $version = '2.0.0';
+ private $service = 'search';
+ private $responseType = "json";
- private static $searchOptions;
-
- private $curl_connection;
+ private static $searchOptions;
+ private $curl_connection;
/**Track query time info */
- protected $queryStartTime = null;
+ protected $queryStartTime = null;
protected $queryEndTime = null;
protected $queryTime = null;
- // STATS
+ // STATS
protected $resultsTotal = 0;
protected $searchTerms;
protected $lastSearchResults;
- // Module and Action for building search results
+ // Module and Action for building search results
protected $resultsModule = 'Search';
protected $resultsAction = 'Results';
- /** @var string */
+ /** @var string */
protected $searchSource = 'local';
- protected $searchType = 'basic';
+ protected $searchType = 'basic';
/** Values for the options array*/
protected $holdings = true;
@@ -106,15 +105,15 @@ class SearchObject_SummonSearcher extends SearchObject_BaseSearcher{
protected $facetFields;
- public function __construct() {
- //Initialize properties with default values
- $this->searchSource = 'summon';
- $this->searchType = 'summon';
- $this->resultsModule = 'Summon';
- $this->resultsAction = 'Results';
+ public function __construct() {
+ //Initialize properties with default values
+ $this->searchSource = 'summon';
+ $this->searchType = 'summon';
+ $this->resultsModule = 'Summon';
+ $this->resultsAction = 'Results';
}
-
- /**
+
+ /**
* Initialise the object from the global
* search parameters in $_REQUEST.
* @access public
@@ -183,9 +182,9 @@ private function getSettings() {
AspenError::raiseError(new AspenError('There are no Summon Settings set for this library system.'));
}
- public function getCurlConnection() {
+ public function getCurlConnection() {
if ($this->curl_connection == null) {
- $this->curl_connection = curl_init();
+ $this->curl_connection = curl_init();
curl_setopt($this->curl_connection, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($this->curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($this->curl_connection, CURLOPT_RETURNTRANSFER, true);
@@ -209,16 +208,16 @@ public function getHeaders() {
/**
* Use Institution's Summon API credentials to authenticate and allow connection with the Summon API
*/
- public function authenticate($settings, $queryString) {
+ public function authenticate($settings, $queryString) {
$headers = $this->getHeaders();
$data = implode("\n", $headers). "\n/$this->version/search\n" . urldecode($queryString) . "\n";
$hmacHash = $this->hmacsha1($settings->summonApiPassword, $data);
$headers['Authorization'] = "Summon $settings->summonApiId;$hmacHash";
- if (!is_null($this->sessionId)){
- $headers['x-summon-session-id'] = $this->sessionId;
- }
+ if (!is_null($this->sessionId)){
+ $headers['x-summon-session-id'] = $this->sessionId;
+ }
return $headers;
- }
+ }
public function getSort() {
$this->sortOptions = array(
@@ -281,8 +280,8 @@ public function getOptions () {
/**
* Use the data that is returned when from the API and process it to assign it to variables
*/
- public function processData($recordData) {
- $recordData = $this->process($recordData);
+ public function processData($recordData, $textQuery = null) {
+ $recordData = $this->process($recordData, $textQuery);
if (is_array($recordData)){
$this->sessionId = $recordData['sessionId'];
$this->lastSearchResults = $recordData['documents'];
@@ -313,7 +312,7 @@ public function splitFacets($combinedFacets) {
return $splitFacets;
}
- /**
+ /**
* Return an array of data summarising the results of a search.
*
* @access public
@@ -358,7 +357,7 @@ public function renderLinkPageTemplate() {
return $url;
}
- /**
+ /**
* Use the record driver to build an array of HTML displays from the search
* results. Called by results.php.
*
@@ -389,7 +388,7 @@ public function getResultRecordHTML() {
return $html;
}
- /**
+ /**
* Use the record driver to build an array of HTML displays from the search
* results.
*
@@ -430,7 +429,7 @@ public function getSortList() {
'desc' => $label,
'selected' => ($sort == $this->sort),
];
- }
+ }
}
return $list;
}
@@ -551,7 +550,7 @@ public function retrieveRecord ($id) {
$headers = $this->authenticate($settings, $queryString);
$recordData = $this->httpRequest($baseUrl, $queryString, $headers);
if (!empty($recordData)){
- $recordData = $this->processData($recordData);
+ $recordData = $this->processData($recordData, $queryString);
}return $recordData['documents'][0];
}
@@ -566,11 +565,11 @@ public function getSummonFilters() {
if (is_array($value)) {
foreach ($value as $val) {
$encodedValue = urlencode($val);
- $this->filters[] = urlencode($key) . ',' . $encodedValue . ',';
+ $this->filters[] = urlencode($key) . ',' . $encodedValue . ',';
}
} else {
$encodedValue = urlencode($value);
- $this->filters[] = urlencode($key) . ',' . $encodedValue . ',';
+ $this->filters[] = urlencode($key) . ',' . $encodedValue . ',';
}
}
return $this->filters;
@@ -583,7 +582,7 @@ public function getSummonFilters() {
* @param string $key Hash key
* @param string $data Data to hash
*
- * @return string Generated hash
+ * @return string Generated hash
*/
protected function hmacsha1($key, $data) {
$blocksize=64;
@@ -634,70 +633,73 @@ public function sendRequest() {
$headers = $this->authenticate($settings, $queryString);
$recordData = $this->httpRequest($baseUrl, $queryString, $headers);
if (!empty($recordData)){
- $recordData = $this->processData($recordData);
+ $recordData = $this->processData($recordData);
$this->stopQueryTimer();
}
return $recordData;
}
- public function process($input) {
- if (SearchObject_SummonSearcher::$searchOptions == null) {
- if ($this->responseType != 'json') {
- return $input;
- }
- SearchObject_SummonSearcher::$searchOptions = json_decode($input, true);
- if (!SearchObject_SummonSearcher::$searchOptions) {
- SearchObject_SummonSearcher::$searchOptions = array(
- 'recordCount' => 0,
- 'documents' => array(),
- 'errors' => array(
- array(
- 'code' => 'PHP-Internal',
- 'message' => 'Cannot decode JSON response: ' . $input
- )
- )
- );
- }
- // Detect errors
- if (isset(SearchObject_SummonSearcher::$searchOptions['errors']) && is_array(SearchObject_SummonSearcher::$searchOptions['errors'])) {
- foreach (SearchObject_SummonSearcher::$searchOptions['errors'] as $current) {
- $errors[] = "{$current['code']}: {$current['message']}";
- }
- $msg = 'Unable to process query
Summon returned: ' .
- implode('
', $errors);
- throw new Exception($msg);
- }
- if (SearchObject_SummonSearcher::$searchOptions) {
- return SearchObject_SummonSearcher::$searchOptions;
- } else {
- return null;
- }
- } else {
- return SearchObject_SummonSearcher::$searchOptions;
- }
- }
-
- /**
+ public function process($input, $textQuery = null) {
+ // if no search options are found, assing them
+ // alternatively, if the search options do not match the current search, update them
+ if (SearchObject_SummonSearcher::$searchOptions == null ||
+ SearchObject_SummonSearcher::$searchOptions['textQuery'] != $textQuery ) {
+ if ($this->responseType != 'json') {
+ return $input;
+ }
+ SearchObject_SummonSearcher::$searchOptions = json_decode($input, true);
+ if (!SearchObject_SummonSearcher::$searchOptions) {
+ SearchObject_SummonSearcher::$searchOptions = array(
+ 'recordCount' => 0,
+ 'documents' => array(),
+ 'errors' => array(
+ array(
+ 'code' => 'PHP-Internal',
+ 'message' => 'Cannot decode JSON response: ' . $input
+ )
+ )
+ );
+ }
+ // Detect errors
+ if (isset(SearchObject_SummonSearcher::$searchOptions['errors']) && is_array(SearchObject_SummonSearcher::$searchOptions['errors'])) {
+ foreach (SearchObject_SummonSearcher::$searchOptions['errors'] as $current) {
+ $errors[] = "{$current['code']}: {$current['message']}";
+ }
+ $msg = 'Unable to process query
Summon returned: ' .
+ implode('
', $errors);
+ throw new Exception($msg);
+ }
+ if (SearchObject_SummonSearcher::$searchOptions) {
+ return SearchObject_SummonSearcher::$searchOptions;
+ } else {
+ return null;
+ }
+ } else {
+ return SearchObject_SummonSearcher::$searchOptions;
+ }
+ }
+
+ /**
* Send HTTP request with headers modified to meet Summon API requirements
*/
- protected function httpRequest($baseUrl, $queryString, $headers) {
+ protected function httpRequest($baseUrl, $queryString, $headers) {
foreach ($headers as $key =>$value) {
$modified_headers[] = $key.": ".$value;
}
- $curlConnection = $this->getCurlConnection();
- $curlOptions = array(
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_URL => "{$baseUrl}?{$queryString}",
- CURLOPT_HTTPHEADER => $modified_headers
- );
- curl_setopt_array($curlConnection, $curlOptions);
- $result = curl_exec($curlConnection);
- if ($result === false) {
- throw new Exception("Error in HTTP Request.");
- }
- // curl_close($curlConnection);
- return $result;
- }
+ $curlConnection = $this->getCurlConnection();
+ $curlOptions = array(
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => "{$baseUrl}?{$queryString}",
+ CURLOPT_HTTPHEADER => $modified_headers
+ );
+ curl_setopt_array($curlConnection, $curlOptions);
+ $result = curl_exec($curlConnection);
+ if ($result === false) {
+ throw new Exception("Error in HTTP Request.");
+ }
+ // curl_close($curlConnection);
+ return $result;
+ }
/**
* Start the timer to work out how long a query takes. Complements
@@ -733,32 +735,32 @@ public function getQuerySpeed() {
/**
* Search indexes
*/
- public function getSearchIndexes() {
+ public function getSearchIndexes() {
return [
"Title" => translate([
'text' => "Title",
'isPublicFacing' => true,
'inAttribute' => true,
]),
- 'All Text' => translate([
- 'text' => "All Text",
+ 'All Text' => translate([
+ 'text' => "All Text",
'isPublicFacing' => true,
'inAttribute' => true,
- ]),
- 'Keyword' => translate([
- 'text' => "Keyword",
- 'isPublicFacing' => true,
- 'inAttribute' => true,
- ])
+ ]),
+ 'Keyword' => translate([
+ 'text' => "Keyword",
+ 'isPublicFacing' => true,
+ 'inAttribute' => true,
+ ])
];
- }
+ }
- //Default search index
- public function getDefaultIndex() {
+ //Default search index
+ public function getDefaultIndex() {
return $this->searchIndex;
}
- public function setSearchTerm() {
+ public function setSearchTerm() {
if (strpos($this->searchTerms, ':') !== false) {
[
$searchIndex,
@@ -776,7 +778,7 @@ public function setSearchTerm() {
}
}
- public function getIndexError() {
+ public function getIndexError() {
// TODO: Implement getIndexError() method.
}
@@ -804,7 +806,7 @@ function loadDynamicFields() {
// TODO: Implement loadDynamicFields() method.
}
- public function getEngineName() {
+ public function getEngineName() {
return 'summon';
}
@@ -820,8 +822,8 @@ public function getresultsTotal(){
return $this->resultsTotal;
}
- public function processSearch($returnIndexErrors = false, $recommendations = false, $preventQueryModification = false) {
- }
+ public function processSearch($returnIndexErrors = false, $recommendations = false, $preventQueryModification = false) {
+ }
public function __destruct() {
if ($this->curl_connection) {
@@ -829,4 +831,14 @@ public function __destruct() {
}
}
+ public function getRecords($ids) {
+ $records = [];
+ require_once ROOT_DIR . '/RecordDrivers/SummonRecordDriver.php';
+ foreach ($ids as $index => $id) {
+ $records[$index] = new SummonRecordDriver($id);
+ }
+ return $records;
+ }
+
+
}
\ No newline at end of file
diff --git a/code/web/sys/SelfRegistrationForms/SierraSelfRegistrationForm.php b/code/web/sys/SelfRegistrationForms/SierraSelfRegistrationForm.php
index aaf3267e90..7d7df60f17 100644
--- a/code/web/sys/SelfRegistrationForms/SierraSelfRegistrationForm.php
+++ b/code/web/sys/SelfRegistrationForms/SierraSelfRegistrationForm.php
@@ -9,6 +9,7 @@ class SierraSelfRegistrationForm extends DataObject {
public $selfRegistrationTemplate;
public $termsOfServiceSetting;
public $selfRegEmailBarcode;
+ public $selfRegPatronCode;
private $_fields;
private $_libraries;
@@ -74,6 +75,13 @@ static function getObjectStructure($context = ''): array {
'hideInLists' => true,
'default' => 'default',
],
+ 'selfRegPatronCode' => [
+ 'property' => 'selfRegPatronCode',
+ 'type' => 'text',
+ 'label' => 'Patron Code',
+ 'description' => 'Patron code to use for self registered patrons',
+ 'maxLength' => 75,
+ ],
'selfRegEmailBarcode' => [
'property' => 'selfRegEmailBarcode',
'type' => 'checkbox',
diff --git a/code/web/sys/SolrConnector/GroupedWorksSolrConnector2.php b/code/web/sys/SolrConnector/GroupedWorksSolrConnector2.php
index 6f211b558f..025752a798 100644
--- a/code/web/sys/SolrConnector/GroupedWorksSolrConnector2.php
+++ b/code/web/sys/SolrConnector/GroupedWorksSolrConnector2.php
@@ -12,6 +12,7 @@ function __construct($host, $index = '') {
* @return string
*/
function getSearchSpecsFile() {
+ /** @var Library $library */
global $library;
$searchSpecsVersion = $library->getGroupedWorkDisplaySettings()->searchSpecVersion;
if ($searchSpecsVersion == 2) {
diff --git a/code/web/sys/UserLists/UserListEntry.php b/code/web/sys/UserLists/UserListEntry.php
index 966ae9bc2c..c968dd95de 100644
--- a/code/web/sys/UserLists/UserListEntry.php
+++ b/code/web/sys/UserLists/UserListEntry.php
@@ -107,6 +107,7 @@ public function getRecordDriver() {
}
public function getNotes() {
+ /** @var Library $library */
global $library;
require_once ROOT_DIR . '/sys/LocalEnrichment/BadWord.php';
$badWords = new BadWord();
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index aab14a4e7e..6ddcb18056 100755
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -38,7 +38,6 @@ services:
- ${ASPEN_DATA_DIR}/logs:/var/log/aspen-discovery
depends_on:
- backend
- entrypoint: cron -f -L 2
db:
image: ${MARIADB_IMAGE:-mariadb:10.5}
diff --git a/docker/files/scripts/start.sh b/docker/files/scripts/start.sh
index c04b02d588..4dc025199d 100755
--- a/docker/files/scripts/start.sh
+++ b/docker/files/scripts/start.sh
@@ -9,30 +9,30 @@ cd "/usr/local/aspen-discovery/docker/files/scripts" || exit
# Check if site configuration exists
confSiteFile="$CONFIG_DIRECTORY/conf/config.ini"
if [ ! -f "$confSiteFile" ] ; then
- mkdir -p "$CONFIG_DIRECTORY"
- if ! php createConfig.php "$CONFIG_DIRECTORY" ; then
- echo "ERROR : FAILED TO CREATE ASPEN SETTINGS"
- exit 1
- fi
+ mkdir -p "$CONFIG_DIRECTORY"
+ if ! php createConfig.php "$CONFIG_DIRECTORY" ; then
+ echo "ERROR : FAILED TO CREATE ASPEN SETTINGS"
+ exit 1
+ fi
fi
# Initialize Aspen database
if ! php initDatabase.php ; then
- echo "ERROR : FAILED TO INITIALIZE DATABASE"
- exit 1
+ echo "ERROR : FAILED TO INITIALIZE DATABASE"
+ exit 1
fi
# Initialize Koha Connection
if ! php initKohaLink.php ; then
- echo "ERROR : FAILED TO ESTABLISH A CONNECTION WITH KOHA"
- exit 1
+ echo "ERROR : FAILED TO ESTABLISH A CONNECTION WITH KOHA"
+ exit 1
fi
# Create missing dirs and fix ownership and permissions if needed
if ! php createDirs.php ; then
- echo "ERROR : FAILED TO CREATE DIRECTORIES OR TRY TO FIX OWNERSHIP AND PERMISSIONS"
- exit 1
+ echo "ERROR : FAILED TO CREATE DIRECTORIES OR TRY TO FIX OWNERSHIP AND PERMISSIONS"
+ exit 1
fi
# Move and create temporarily sym-links to etc/cron directory
@@ -62,9 +62,9 @@ curl -k http://"$SITE_NAME"/API/SystemAPI?method=runPendingDatabaseUpdates
# Start Cron
if [ "$ASPEN_CRON" == "yes" ]; then
- service cron start
php /usr/local/aspen-discovery/code/web/cron/checkBackgroundProcesses.php "$SITE_NAME" &
+ cron -f -L 2
+else
+/bin/bash -c "trap : TERM INT; sleep infinity & wait"
fi
-# Infinite loop
-/bin/bash -c "trap : TERM INT; sleep infinity & wait"