[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 14:02:28 +0000 (16:02 +0200)
When tasks are executed manually via the Scheduler BE module, their
status icons should be changed to "running".

Resolves: #25669
Releases: 4.5, 4.6

Change-Id: I1ed15666b64916f9e165c8784c569ec6319745a8
Reviewed-on: http://review.typo3.org/2738
Reviewed-by: Francois Suter
Tested-by: Francois Suter
typo3/sysext/scheduler/mod1/index.php
typo3/sysext/scheduler/res/tx_scheduler_be.js

index 8b9d678..12b348c 100755 (executable)
@@ -143,6 +143,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(
@@ -1156,7 +1157,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;
@@ -1193,7 +1194,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) {
index f8ca28a..34d1145 100644 (file)
@@ -32,7 +32,7 @@
 /**
  * Global variable to keep track of checked/unchecked status of all
  * checkboxes for execution selection
- * 
+ *
  * @var        boolean
  */
 var allCheckedStatus = false;
@@ -100,3 +100,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});
+                       }
+               }
+       });
+});