Hide TimeZone setting check from install page
This commit is contained in:
sahartak2025 2020-09-16 18:00:01 +04:00
parent f472d98073
commit db547b2d99
4 changed files with 18 additions and 16 deletions

View File

@ -8,4 +8,4 @@ HumHub Changelog
- Fix #4328: Top navigation overlaps post input richtext menu on dashboard page
- Fix #4257: Notification dropdown text breaks after notification image on mobile
- Chg: Move CHANGELOG to humhub root
- Fix #4186:Add Timezone validation rules to admin prerequisite view
- Fix #4186: Add Timezone validation rules to admin prerequisite view

View File

@ -411,17 +411,19 @@ class SelfTest
}
// Timezone Setting
$title = 'Timezone Setting';
if (TimezoneHelper::compareTimeZones()) {
$checks[] = [
'title' => Yii::t('base', $title),
'state' => 'OK'
];
} else {
$checks[] = [
'title' => Yii::t('base', $title),
'state' => 'WARNING',
];
if (Yii::$app->controller->id != 'setup') {
$title = 'Timezone Setting';
if (TimezoneHelper::compareTimeZones()) {
$checks[] = [
'title' => Yii::t('base', $title),
'state' => 'OK'
];
} else {
$checks[] = [
'title' => Yii::t('base', $title),
'state' => 'WARNING',
];
}
}
// Check Runtime Directory

View File

@ -94,7 +94,7 @@ class TimezoneHelper
}
/**
* compare db and MySql Timezones
* Compares configured time zone with reported database connection time zone
*
* @return boolean
*/
@ -107,8 +107,8 @@ class TimezoneHelper
}
$dbTimeZone = new DateTimeZone($timeZone);
$dbTimeZoneOffset = $dbTimeZone->getOffset(new DateTime);
$offset_prefix = $dbTimeZoneOffset < 0 ? '-' : '+';
return self::getMysqlTimeZone() == $offset_prefix.gmdate('H:i', abs($dbTimeZoneOffset));
$offsetPrefix = $dbTimeZoneOffset < 0 ? '-' : '+';
return self::getMysqlTimeZone() == $offsetPrefix.gmdate('H:i', abs($dbTimeZoneOffset));
} catch (Exception $e) {
return false;
}

View File

@ -86,7 +86,7 @@ class BasicSettingsForm extends \yii\base\Model
public function attributeHints()
{
return [
'timeZone' => Yii::t('AdminModule.settings', 'Database Timezone: UTC{timeZone}', ['timeZone' => TimezoneHelper::getMysqlTimeZone()]),
'timeZone' => Yii::t('AdminModule.settings', 'Reported database time zone: UTC{timeZone}', ['timeZone' => TimezoneHelper::getMysqlTimeZone()]),
];
}