From 18fa92394872e1fe46cd06ae44212a2937abcdaa Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Fri, 15 Nov 2024 08:59:10 -0700 Subject: [PATCH] Correct 24.11 issues found during testing - When showing multi-select options within a One To Many Block, show all selected options - Correct sorting of formats within a grouped work if the grouped work display settings do not have valid format sorting options. - Do not allow adding OverDrive Scopes from the OverDrive Scopes list. They should be added within the settings instead. - Update the list of libraries and locations that apply to an OverDrive scope to be checkboxes rather than individual dropdowns. - Add additional notes to Library Settings and Scopes within OverDrive settings to better explain what they do. - Do not allow sorting requests needing holds based on Format. - Make cloudSourceBaseUrl within Library Settings a TINYTEXT field instead of VARCHAR to avoid row size limits. --- code/web/RecordDrivers/GroupedWorkDriver.php | 26 +- .../responsive/DataObjectUtil/oneToMany.tpl | 16 +- code/web/release_notes/24.11.00.MD | 218 ++++++++++++++ code/web/services/OverDrive/Scopes.php | 6 +- .../version_updates/24.11.00.php | 283 ++++++++++++++++++ .../MaterialsRequests/MaterialsRequest.php | 3 +- code/web/sys/OverDrive/OverDriveScope.php | 119 +++++--- code/web/sys/OverDrive/OverDriveSetting.php | 66 +++- 8 files changed, 663 insertions(+), 74 deletions(-) create mode 100644 code/web/release_notes/24.11.00.MD create mode 100644 code/web/sys/DBMaintenance/version_updates/24.11.00.php diff --git a/code/web/RecordDrivers/GroupedWorkDriver.php b/code/web/RecordDrivers/GroupedWorkDriver.php index 3a0b11263d..790a0de487 100644 --- a/code/web/RecordDrivers/GroupedWorkDriver.php +++ b/code/web/RecordDrivers/GroupedWorkDriver.php @@ -417,17 +417,23 @@ function compareRelatedManifestations($a, $b) { $groupedWorkDisplaySettings = $library->getGroupedWorkDisplaySettings(); $this->_formatSorting = $groupedWorkDisplaySettings->getFormatSortingGroup(); } - $groupedWork = $this->getGroupedWorkObject(); - if ($groupedWork->grouping_category == 'book') { - $sortMethod = $this->_formatSorting->bookSortMethod; - }elseif ($groupedWork->grouping_category == 'comic') { - $sortMethod = $this->_formatSorting->comicSortMethod; - }elseif ($groupedWork->grouping_category == 'movie') { - $sortMethod = $this->_formatSorting->movieSortMethod; - }elseif ($groupedWork->grouping_category == 'music') { - $sortMethod = $this->_formatSorting->musicSortMethod; + + //Format sorting can still be null before the format sorting is fully setup + if ($this->_formatSorting == null) { + $sortMethod = 1; }else{ - $sortMethod = $this->_formatSorting->otherSortMethod; + $groupedWork = $this->getGroupedWorkObject(); + if ($groupedWork->grouping_category == 'book') { + $sortMethod = $this->_formatSorting->bookSortMethod; + }elseif ($groupedWork->grouping_category == 'comic') { + $sortMethod = $this->_formatSorting->comicSortMethod; + }elseif ($groupedWork->grouping_category == 'movie') { + $sortMethod = $this->_formatSorting->movieSortMethod; + }elseif ($groupedWork->grouping_category == 'music') { + $sortMethod = $this->_formatSorting->musicSortMethod; + }else{ + $sortMethod = $this->_formatSorting->otherSortMethod; + } } if ($sortMethod == 1) { diff --git a/code/web/interface/themes/responsive/DataObjectUtil/oneToMany.tpl b/code/web/interface/themes/responsive/DataObjectUtil/oneToMany.tpl index 4a53f1b45d..caa1e303ca 100644 --- a/code/web/interface/themes/responsive/DataObjectUtil/oneToMany.tpl +++ b/code/web/interface/themes/responsive/DataObjectUtil/oneToMany.tpl @@ -8,7 +8,7 @@ {translate text="Sort" isAdminFacing=true} {/if} {foreach from=$property.structure item=subProperty} - {if (in_array($subProperty.type, array('text', 'regularExpression', 'multilineRegularExpression', 'enum', 'date', 'checkbox', 'integer', 'textarea', 'html', 'dynamic_label')) || ($subProperty.type == 'multiSelect' && $subProperty.listStyle == 'checkboxList')) && empty($subProperty.hideInLists) } + {if (in_array($subProperty.type, array('text', 'regularExpression', 'multilineRegularExpression', 'enum', 'date', 'checkbox', 'integer', 'textarea', 'html', 'dynamic_label', 'multiSelect')) || ($subProperty.type == 'multiSelect' && $subProperty.listStyle == 'checkboxList')) && empty($subProperty.hideInLists) } {translate text=$subProperty.label isAdminFacing=true} {/if} {/foreach} @@ -29,7 +29,7 @@ {/if} {foreach from=$property.structure item=subProperty} - {if in_array($subProperty.type, array('text', 'regularExpression', 'enum', 'date', 'checkbox', 'integer', 'textarea', 'html', 'dynamic_label')) && empty($subProperty.hideInLists)} + {if in_array($subProperty.type, array('text', 'regularExpression', 'enum', 'date', 'checkbox', 'integer', 'textarea', 'html', 'dynamic_label', 'multiSelect')) && empty($subProperty.hideInLists)} {assign var=subPropName value=$subProperty.property} {assign var=subPropValue value=$subObject->$subPropName} @@ -46,6 +46,16 @@ {if $subPropValue == 1}{translate text='Yes' isAdminFacing=true}{else}{translate text='No' isAdminFacing=true}{/if} {/if} + {elseif $subProperty.type=='multiSelect'} + + {if is_array($subPropValue) && count($subPropValue) > 0} + {foreach from=$subProperty.values item=propertyName key=propertyValue} + {if array_key_exists($propertyValue, $subPropValue)}{$propertyName|escape}
{/if} + {/foreach} + {else} + {translate text="No values selected" isAdminFacing='true'} + {/if} + {else} {if $subObject->canActiveUserChangeSelection()}