Index: typo3/sysext/reports/ext_autoload.php =================================================================== --- typo3/sysext/reports/ext_autoload.php (revision 9356) +++ typo3/sysext/reports/ext_autoload.php (working copy) @@ -15,5 +15,6 @@ 'tx_reports_reports_status_securitystatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_securitystatus.php', 'tx_reports_reports_status_configurationstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_configurationstatus.php', 'tx_reports_reports_status_status' => $extensionPath . 'reports/status/class.tx_reports_reports_status_status.php', + 'tx_reports_tasks_systemstatusupdatetask' => $extensionPath . 'tasks/class.tx_reports_tasks_systemstatusupdatetask.php', ); ?> \ No newline at end of file Index: typo3/sysext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php =================================================================== --- typo3/sysext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php (revision 0) +++ typo3/sysext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php (revision 0) @@ -0,0 +1,60 @@ + +* All rights reserved +* +* This script is part of the TYPO3 project. The TYPO3 project is +* free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* +* This script is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + + +/** + * A task that should be run regularly to determine the system's status. + * + * @author Ingo Renner + * @package TYPO3 + * @subpackage reports + */ +class tx_reports_tasks_SystemStatusUpdateTask extends tx_scheduler_Task { + + /** + * Executes the System Status Update task, determing the highest severity of + * status reports and saving that to the registry to be displayed at login + * if necessary. + * + * @see typo3/sysext/scheduler/tx_scheduler_Task::execute() + */ + public function execute() { + $registry = t3lib_div::makeInstance('t3lib_Registry'); + $statusReport = t3lib_div::makeInstance('tx_reports_reports_Status'); + + $systemStatus = $statusReport->getSystemStatus(); + $highestSeverity = $statusReport->getHighestSeverity($systemStatus); + + $registry->set('tx_reports', 'status.highestSeverity', $highestSeverity); + + return true; + } +} + + +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php']) { + include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/tasks/class.tx_reports_tasks_systemstatusupdatetask.php']); +} + +?> \ No newline at end of file Index: typo3/sysext/reports/reports/locallang.xml =================================================================== --- typo3/sysext/reports/reports/locallang.xml (revision 9356) +++ typo3/sysext/reports/reports/locallang.xml (working copy) @@ -19,6 +19,8 @@ + + Index: typo3/sysext/reports/ext_localconf.php =================================================================== --- typo3/sysext/reports/ext_localconf.php (revision 9356) +++ typo3/sysext/reports/ext_localconf.php (working copy) @@ -5,6 +5,12 @@ die ('Access denied.'); } +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_reports_tasks_SystemStatusUpdateTask'] = array( + 'extension' => $_EXTKEY, + 'title' => 'LLL:EXT:' . $_EXTKEY . '/reports/locallang.xml:status_updateTaskTitle', + 'description' => 'LLL:EXT:' . $_EXTKEY . '/reports/locallang.xml:status_updateTaskDescription' +); + $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages']['tx_reports_WarningMessagePostProcessor'] = 'EXT:reports/reports/status/class.tx_reports_reports_status_warningmessagepostprocessor.php:tx_reports_reports_status_WarningMessagePostProcessor'; ?> \ No newline at end of file