diff --git a/application/Espo/Resources/defaults/config.php b/application/Espo/Resources/defaults/config.php index e358e51415..d7beeb08ae 100644 --- a/application/Espo/Resources/defaults/config.php +++ b/application/Espo/Resources/defaults/config.php @@ -40,6 +40,7 @@ return [ 'useCache' => true, 'recordsPerPage' => 20, 'recordsPerPageSmall' => 5, + 'recordsPerPageSelect' => 10, 'applicationName' => 'EspoCRM', 'version' => '@@version', 'timeZone' => 'UTC', diff --git a/application/Espo/Resources/i18n/en_US/Settings.json b/application/Espo/Resources/i18n/en_US/Settings.json index 542f5587d4..8df2c9983a 100644 --- a/application/Espo/Resources/i18n/en_US/Settings.json +++ b/application/Espo/Resources/i18n/en_US/Settings.json @@ -28,6 +28,7 @@ "emailAddressLookupEntityTypeList": "Email address look-up scopes", "recordsPerPage": "Records Per Page", "recordsPerPageSmall": "Records Per Page (Small)", + "recordsPerPageSelect": "Records Per Page (Select)", "tabList": "Tab List", "quickCreateList": "Quick Create List", "exportDelimiter": "Export Delimiter", @@ -185,6 +186,7 @@ "massEmailVerp": "Variable envelope return path. For better handling of bounced messages. Make sure that your SMTP provider supports it.", "recordsPerPage": "Number of records initially displayed in list views.", "recordsPerPageSmall": "Number of records initially displayed in relationship panels.", + "recordsPerPageSelect": "Number of records initially displayed when selecting records.", "outboundEmailIsShared": "Allow users to send emails from this address.", "followCreatedEntities": "Users will automatically follow records they created.", "emailMessageMaxSize": "All inbound emails exceeding a specified size will be fetched w/o body and attachments.", diff --git a/application/Espo/Resources/layouts/Settings/userInterface.json b/application/Espo/Resources/layouts/Settings/userInterface.json index 4e491bbbb1..6d35de1448 100644 --- a/application/Espo/Resources/layouts/Settings/userInterface.json +++ b/application/Espo/Resources/layouts/Settings/userInterface.json @@ -6,6 +6,7 @@ [{"name": "applicationName"}, {"name": "userThemesDisabled"}], [{"name": "recordsPerPage"},{"name": "displayListViewRecordCount"}], [{"name": "recordsPerPageSmall"}, {"name": "avatarsDisabled"}], + [{"name": "recordsPerPageSelect"}, false], [{"name": "tabList"},{"name": "quickCreateList"}], [{"name": "scopeColorsDisabled"}, {"name": "tabColorsDisabled"}], [{"name": "tabIconsDisabled"}, false], diff --git a/application/Espo/Resources/metadata/entityDefs/Settings.json b/application/Espo/Resources/metadata/entityDefs/Settings.json index 0d4470b7dc..5518377e91 100644 --- a/application/Espo/Resources/metadata/entityDefs/Settings.json +++ b/application/Espo/Resources/metadata/entityDefs/Settings.json @@ -14,6 +14,14 @@ "tooltip": true }, "recordsPerPageSmall": { + "type": "int", + "min": 1, + "max": 100, + "default": 5, + "required": true, + "tooltip": true + }, + "recordsPerPageSelect": { "type": "int", "min": 1, "max": 100, diff --git a/client/src/views/modals/select-category-tree-records.js b/client/src/views/modals/select-category-tree-records.js index 1d43a9be73..6162b4d25c 100644 --- a/client/src/views/modals/select-category-tree-records.js +++ b/client/src/views/modals/select-category-tree-records.js @@ -90,7 +90,7 @@ define('views/modals/select-category-tree-records', 'views/modals/select-records Espo.require('search-manager', (SearchManager) => { this.getCollectionFactory().create(this.scope, (collection) => { - collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; + collection.maxSize = this.getConfig().get('recordsPerPageSelect') || 5; this.collection = collection; diff --git a/client/src/views/modals/select-records.js b/client/src/views/modals/select-records.js index df0a9181f8..45cc5e31dc 100644 --- a/client/src/views/modals/select-records.js +++ b/client/src/views/modals/select-records.js @@ -154,7 +154,7 @@ define('views/modals/select-records', ['views/modal', 'search-manager'], functio } this.getCollectionFactory().create(this.scope, (collection) => { - collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 5; + collection.maxSize = this.getConfig().get('recordsPerPageSelect') || 5; this.collection = collection; diff --git a/upgrades/7.1/scripts/AfterUpgrade.php b/upgrades/7.1/scripts/AfterUpgrade.php new file mode 100644 index 0000000000..5e80a9155a --- /dev/null +++ b/upgrades/7.1/scripts/AfterUpgrade.php @@ -0,0 +1,52 @@ +updateConfig( + $container->get('config'), + $container->get('injectableFactory')->create(ConfigWriter::class) + ); + } + catch (\Throwable $e) {} + } + + private function updateConfig(Config $config, ConfigWriter $configWriter): void + { + $configWriter->set('recordsPerPageSelect', 10); + $configWriter->save(); + } +}