Skip to content

Commit

Permalink
#6457 Disentangle beacon enable/disable from upgrade warning (stable-…
Browse files Browse the repository at this point in the history
…3_2_1)
  • Loading branch information
asmecher committed Dec 9, 2020
1 parent 6aaae66 commit f9826bf
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions pages/management/ManagementHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,23 @@ function context($args, $request) {

$templateMgr->assign('settingsData', $settingsData);

// Interact with the beacon (if enabled) and determine if a new version exists
import('lib.pkp.classes.site.VersionCheck');
$latestVersion = VersionCheck::checkIfNewVersionExists();

// Display a warning message if there is a new version of OJS available
if (Config::getVar('general', 'show_upgrade_warning')) {
import('lib.pkp.classes.site.VersionCheck');
if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
$templateMgr->assign('newVersionAvailable', true);
$templateMgr->assign('latestVersion', $latestVersion);
$currentVersion = VersionCheck::getCurrentDBVersion();
$templateMgr->assign('currentVersion', $currentVersion->getVersionString());

// Get contact information for site administrator
$roleDao = DAORegistry::getDAO('RoleDAO'); /* @var $roleDao RoleDAO */
$siteAdmins = $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
$templateMgr->assign('siteAdmin', $siteAdmins->next());
}
if (Config::getVar('general', 'show_upgrade_warning') && $latestVersion) {
$currentVersion = VersionCheck::getCurrentDBVersion();
$templateMgr->assign([
'newVersionAvailable' => true,
'currentVersion' => $currentVersion->getVersionString()
'latestVersion' => $latestVersion,
]);

// Get contact information for site administrator
$roleDao = DAORegistry::getDAO('RoleDAO'); /* @var $roleDao RoleDAO */
$siteAdmins = $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
$templateMgr->assign('siteAdmin', $siteAdmins->next());
}

AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION);
Expand Down

0 comments on commit f9826bf

Please sign in to comment.