diff --git a/config.TEMPLATE.inc.php b/config.TEMPLATE.inc.php index 1f03c48e1b8..a4c735f9aee 100644 --- a/config.TEMPLATE.inc.php +++ b/config.TEMPLATE.inc.php @@ -93,6 +93,9 @@ ; and 10. The more your connection bandwidth allows the better. citation_checking_max_processes = 3 +; Display a message on the site admin and journal manager user home pages if there is an upgrade available +show_upgrade_warning = On + ;;;;;;;;;;;;;;;;;;;;; ; Database Settings ; ;;;;;;;;;;;;;;;;;;;;; diff --git a/locale/en_US/locale.xml b/locale/en_US/locale.xml index b9968cd59c5..5e9cdbf6e0e 100644 --- a/locale/en_US/locale.xml +++ b/locale/en_US/locale.xml @@ -997,6 +997,9 @@ Your server currently supports mbstring: {$supportsMBString}]]>

Don't forget to set the "installed" setting in your config.inc.php configuration file back to On.

If you haven't already registered and wish to receive news and updates, please register at http://pkp.sfu.ca/ojs/register. If you have questions or comments, please visit the support forum.

]]> + + this page to download the most recent version and find upgrade instructions.]]> + {$siteAdminEmail}) to notify them of this new release. More information can be found here.]]> {$authorName} has entered a new submission, ID {$submissionId}. diff --git a/pages/admin/AdminHandler.inc.php b/pages/admin/AdminHandler.inc.php index 3ab8d49cefe..e9659815de0 100644 --- a/pages/admin/AdminHandler.inc.php +++ b/pages/admin/AdminHandler.inc.php @@ -33,6 +33,20 @@ function index() { $this->setupTemplate(); $templateMgr =& TemplateManager::getManager(); + + // Display a warning message if there is a new version of OJS available + $newVersionAvailable = false; + if (Config::getVar('general', 'show_upgrade_warning')) { + import('lib.pkp.classes.site.VersionCheck'); + if($latestVersion = VersionCheck::checkIfNewVersionExists()) { + $newVersionAvailable = true; + $templateMgr->assign('latestVersion', $latestVersion); + $currentVersion =& VersionCheck::getCurrentDBVersion(); + $templateMgr->assign('currentVersion', $currentVersion->getVersionString()); + } + } + + $templateMgr->assign('newVersionAvailable', $newVersionAvailable); $templateMgr->assign('helpTopicId', 'site.index'); $templateMgr->display('admin/index.tpl'); } diff --git a/pages/manager/ManagerHandler.inc.php b/pages/manager/ManagerHandler.inc.php index 481a951a43f..dafff4b4867 100644 --- a/pages/manager/ManagerHandler.inc.php +++ b/pages/manager/ManagerHandler.inc.php @@ -33,6 +33,26 @@ function index() { $this->setupTemplate(); $journal =& Request::getJournal(); $templateMgr =& TemplateManager::getManager(); + + // Display a warning message if there is a new version of OJS available + $newVersionAvailable = false; + if (Config::getVar('general', 'show_upgrade_warning')) { + import('lib.pkp.classes.site.VersionCheck'); + if($latestVersion = VersionCheck::checkIfNewVersionExists()) { + $newVersionAvailable = true; + $templateMgr->assign('latestVersion', $latestVersion); + $currentVersion =& VersionCheck::getCurrentDBVersion(); + $templateMgr->assign('currentVersion', $currentVersion->getVersionString()); + + // Get contact information for site administrator + $roleDao =& DAORegistry::getDAO('RoleDAO'); + $siteAdmins =& $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN); + $templateMgr->assign_by_ref('siteAdmin', $siteAdmins->next()); + } + } + + + $templateMgr->assign('newVersionAvailable', $newVersionAvailable); $templateMgr->assign_by_ref('roleSettings', $this->retrieveRoleAssignmentPreferences($journal->getId())); $templateMgr->assign('publishingMode', $journal->getSetting('publishingMode')); $templateMgr->assign('announcementsEnabled', $journal->getSetting('enableAnnouncements')); diff --git a/templates/admin/index.tpl b/templates/admin/index.tpl index ca4b2f4a148..0c7916851c9 100644 --- a/templates/admin/index.tpl +++ b/templates/admin/index.tpl @@ -12,6 +12,11 @@ {assign var="pageTitle" value="admin.siteAdmin"} {include file="common/header.tpl"} {/strip} + +{if $newVersionAvailable} +
{translate key="site.upgradeAvailable.admin" currentVersion=$currentVersion latestVersion=$latestVersion}
+{/if} +

{translate key="admin.siteManagement"}

diff --git a/templates/manager/index.tpl b/templates/manager/index.tpl index 2b33c56ea9b..28997ae0f46 100644 --- a/templates/manager/index.tpl +++ b/templates/manager/index.tpl @@ -12,6 +12,11 @@ {assign var="pageTitle" value="manager.journalManagement"} {include file="common/header.tpl"} {/strip} + +{if $newVersionAvailable} +
{translate key="site.upgradeAvailable.manager" currentVersion=$currentVersion latestVersion=$latestVersion siteAdminName=$siteAdmin->getFullName() siteAdminEmail=$siteAdmin->getEmail()}
+{/if} +

{translate key="manager.managementPages"}