From 247d9b5b5c620a11c8d625be8e053b5cf876ad49 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 8 Jan 2026 11:05:37 +0800 Subject: [PATCH 1/2] * [refac] Fix undefined variables when upgrading open version. --- module/upgrade/model.php | 12 ++++++------ module/upgrade/ui/execute.html.php | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 7aae5b5803..cf981f0110 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -123,17 +123,17 @@ class upgradeModel extends model /* Means open source/pro upgrade to biz or max. */ if($this->config->edition != 'open' && ($fromEdition == 'open' || $fromEdition == 'pro')) { - $methods['importBuildinModules'] = []; - $methods['importLiteModules'] = []; - $methods['addSubStatus'] = []; + $methods['importBuildinModules'] = []; + $methods['importLiteModules'] = []; + $methods['addSubStatus'] = []; + $methods['processDataset'] = []; + $methods['upgradeScreenAndMetricData'] = []; + $methods['upgradeBIData'] = []; } $methods['convertCharset'] = []; $methods['program-refreshStats'] = [true]; $methods['product-refreshStats'] = [true]; $methods['deletePatch'] = []; - $methods['processDataset'] = []; - $methods['upgradeScreenAndMetricData'] = []; - $methods['upgradeBIData'] = []; return $methods; } diff --git a/module/upgrade/ui/execute.html.php b/module/upgrade/ui/execute.html.php index 8bba2a031f..fbcd9b27fd 100644 --- a/module/upgrade/ui/execute.html.php +++ b/module/upgrade/ui/execute.html.php @@ -18,7 +18,8 @@ jsVar('upgradeVersions', array_keys($upgradeVersions)); $editionNames = []; foreach(['open', 'biz', 'max', 'ipd'] as $edition) { - $editionNames[$edition] = $edition == 'open' ? $lang->pmsName : $lang->{$edition . 'Name'}; + $editionName = $lang->{$edition . 'Name'} ?? $edition; + $editionNames[$edition] = $edition == 'open' ? $lang->pmsName : $editionName; } $toVersionEdition = is_numeric($toVersion[0]) ? 'open' : substr($toVersion, 0, 3); From 36621c99183d45b6f4c3ae28cfd8a94ec20ad4d4 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 8 Jan 2026 11:37:33 +0800 Subject: [PATCH 2/2] * [refac] Optimize width of progress bar. --- module/upgrade/ui/execute.html.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/upgrade/ui/execute.html.php b/module/upgrade/ui/execute.html.php index fbcd9b27fd..ec012ab16f 100644 --- a/module/upgrade/ui/execute.html.php +++ b/module/upgrade/ui/execute.html.php @@ -24,6 +24,7 @@ foreach(['open', 'biz', 'max', 'ipd'] as $edition) $toVersionEdition = is_numeric($toVersion[0]) ? 'open' : substr($toVersion, 0, 3); $toVersionName = $editionNames[$toVersionEdition] . str_ireplace($toVersionEdition, '', $toVersion); +$versionCount = count($upgradeVersions); $buildVersions = function() use ($upgradeVersions, $editionNames) { @@ -131,23 +132,25 @@ div ), row ( - setClass('items-center gap-2'), + setClass('justify-between items-center gap-2'), progressbar ( setID('versionsProgressBar'), setClass('rounded-full'), - setStyle(['height' => '.75rem', 'width' => 'calc(100% - 3rem)']), + setStyle(['height' => '.75rem', 'width' => '100%']), set::color('rgba(var(--color-success-500-rgb), var(--tw-bg-opacity));'), set::percent(0) ), span ( + setClass('text-right'), + setStyle(['min-width' => (strlen((string)$versionCount) + 1) . 'rem']), span ( setID('versionsProgressText'), - '0' + 0 ), - ' / ' . count($upgradeVersions) + ' / ' . $versionCount ) ) )