[BUGFIX] Scheduler: Show running icon during execution
authorAndy Grunwald <andreas.grunwald@wmdb.de>
Mon, 30 May 2011 16:30:47 +0000 (18:30 +0200)
committerFrancois Suter <francois@typo3.org>
Tue, 14 Jun 2011 13:44:20 +0000 (15:44 +0200)
When tasks are executed manually via the Scheduler BE module, their
status icons should be changed to "running".

Change-Id: Iae0140f5d9b8a9b622a189fbe12a55bc2d0032c5
Resolves: #25669
Releases: 4.5, 4.6
Reviewed-on: http://review.typo3.org/2449
Reviewed-by: Francois Suter
Tested-by: Francois Suter
typo3/sysext/scheduler/class.tx_scheduler_module.php
typo3/sysext/scheduler/res/tx_scheduler_be.js

index 017ffc1..1275171 100644 (file)
@@ -137,6 +137,7 @@ class tx_scheduler_Module extends t3lib_SCbase {
                                        }
                                </script>
                        ';
+                       $this->doc->getPageRenderer()->addInlineSetting('scheduler', 'runningIcon', t3lib_extMgm::extRelPath('scheduler') . 'res/gfx/status_running.png');
 
                                // Prepare main content
                        $this->content  = $this->doc->header(
@@ -1150,7 +1151,7 @@ class tx_scheduler_Module extends t3lib_SCbase {
 
                                                // Format the execution status,
                                                // including failure feedback, if any
-                                       $executionStatusOutput = '<img ' . t3lib_iconWorks::skinImg(t3lib_extMgm::extRelPath('scheduler'), 'res/gfx/status_' . $executionStatus . '.png') . ' alt="' . htmlspecialchars($GLOBALS['LANG']->getLL('status.' . $executionStatus)) . '" title="' . htmlspecialchars($GLOBALS['LANG']->getLL('status.legend.' . $executionStatus)) . '" />' . $failureOutput;
+                                       $executionStatusOutput = '<img ' . t3lib_iconWorks::skinImg(t3lib_extMgm::extRelPath('scheduler'), 'res/gfx/status_' . $executionStatus . '.png') . ' id="executionstatus_' . $schedulerRecord['uid'] . '" alt="' . htmlspecialchars($GLOBALS['LANG']->getLL('status.' . $executionStatus)) . '" title="' . htmlspecialchars($GLOBALS['LANG']->getLL('status.legend.' . $executionStatus)) . '" />' . $failureOutput;
 
                                        $table[$tr][] = $startExecutionElement;
                                        $table[$tr][] = $actions;
@@ -1187,7 +1188,7 @@ class tx_scheduler_Module extends t3lib_SCbase {
                                // Render table
                        $content .= $this->doc->table($table, $tableLayout);
 
-                       $content .= '<input type="submit" class="button" name="go" value="' . $GLOBALS['LANG']->getLL('label.executeSelected') . '" />';
+                       $content .= '<input type="submit" class="button" name="go" id="scheduler_executeselected" value="' . $GLOBALS['LANG']->getLL('label.executeSelected') . '" />';
                }
 
                if (count($registeredClasses) > 0) {
@@ -1603,4 +1604,4 @@ class tx_scheduler_Module extends t3lib_SCbase {
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/scheduler/class.tx_scheduler_module.php'])) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/scheduler/class.tx_scheduler_module.php']);
 }
-?>
\ No newline at end of file
+?>
index 0e84618..d348479 100644 (file)
@@ -30,7 +30,7 @@
 /**
  * Global variable to keep track of checked/unchecked status of all
  * checkboxes for execution selection
- * 
+ *
  * @var        boolean
  */
 var allCheckedStatus = false;
@@ -98,3 +98,26 @@ function toggleCheckboxes() {
                checkboxes.item(i).dom.checked = allCheckedStatus;
        }
 }
+
+/**
+ * Ext.onReader functions
+ *
+ * onClick event for scheduler task execution from backend module
+ */
+Ext.onReady(function(){
+       Ext.addBehaviors({
+                       // Add a listener for click on scheduler execute button
+               '#scheduler_executeselected@click' : function(e, t){
+                               // Get all active checkboxes with proper class
+                       var checkboxes = Ext.select('.checkboxes:checked');
+                       var count = checkboxes.getCount();
+                       var idParts;
+
+                               // Set the status icon all to same status: running
+                       for (var i = 0; i < count; i++) {
+                               idParts = checkboxes.item(i).id.split('_');
+                               Ext.select('#executionstatus_' + idParts[1]).item(0).set({src: TYPO3.settings.scheduler.runningIcon});
+                       }
+               }
+       });
+});