Version Notes
Bugfix release.
Check http://www.fabrizio-branca.de/magento-cron-scheduler.html for a summary of new features and bugfixes
Download this release
Release Info
Developer | Magento Core Team |
Extension | Aoe_Scheduler |
Version | 0.2.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.3 to 0.2.1
- app/code/local/Aoe/Scheduler/Block/Adminhtml/Cron.php +5 -0
- app/code/local/Aoe/Scheduler/Block/Adminhtml/Scheduler.php +1 -1
- app/code/local/Aoe/Scheduler/Block/Adminhtml/Timeline.php +11 -1
- app/code/local/Aoe/Scheduler/Block/Adminhtml/TimelineDetail.php +1 -1
- app/code/local/Aoe/Scheduler/Model/Api.php +49 -0
- app/code/local/Aoe/Scheduler/Model/Observer.php +41 -13
- app/code/local/Aoe/Scheduler/Model/Schedule.php +18 -2
- app/code/local/Aoe/Scheduler/controllers/Adminhtml/CronController.php +1 -1
- app/code/local/Aoe/Scheduler/etc/api.xml +42 -0
- app/code/local/Aoe/Scheduler/etc/config.xml +9 -1
- app/code/local/Aoe/Scheduler/etc/system.xml +27 -18
- app/design/adminhtml/default/default/template/aoe_scheduler/timeline.phtml +42 -35
- package.xml +7 -5
app/code/local/Aoe/Scheduler/Block/Adminhtml/Cron.php
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
class Aoe_Scheduler_Block_Adminhtml_Cron extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
4 |
|
5 |
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Cron block
|
5 |
+
*
|
6 |
+
* @author Fabrizio Branca
|
7 |
+
*/
|
8 |
class Aoe_Scheduler_Block_Adminhtml_Cron extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
9 |
|
10 |
|
app/code/local/Aoe/Scheduler/Block/Adminhtml/Scheduler.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Scheduler Block
|
5 |
*
|
6 |
-
* @author Fabrizio Branca
|
7 |
*/
|
8 |
class Aoe_Scheduler_Block_Adminhtml_Scheduler extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
9 |
|
3 |
/**
|
4 |
* Scheduler Block
|
5 |
*
|
6 |
+
* @author Fabrizio Branca
|
7 |
*/
|
8 |
class Aoe_Scheduler_Block_Adminhtml_Scheduler extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
9 |
|
app/code/local/Aoe/Scheduler/Block/Adminhtml/Timeline.php
CHANGED
@@ -1,4 +1,10 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Aoe_Scheduler_Block_Adminhtml_Timeline extends Mage_Adminhtml_Block_Widget_Container {
|
3 |
|
4 |
/**
|
@@ -178,7 +184,11 @@ class Aoe_Scheduler_Block_Adminhtml_Timeline extends Mage_Adminhtml_Block_Widget
|
|
178 |
*/
|
179 |
public function getGanttDivAttributes(Aoe_Scheduler_Model_Schedule $schedule) {
|
180 |
|
181 |
-
|
|
|
|
|
|
|
|
|
182 |
$duration = $duration / $this->zoom;
|
183 |
$duration = ceil($duration / 4) * 4 - 1; // round to numbers dividable by 4, then remove 1 px border
|
184 |
$duration = max($duration, 3);
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Timeline block
|
5 |
+
*
|
6 |
+
* @author Fabrizio Branca
|
7 |
+
*/
|
8 |
class Aoe_Scheduler_Block_Adminhtml_Timeline extends Mage_Adminhtml_Block_Widget_Container {
|
9 |
|
10 |
/**
|
184 |
*/
|
185 |
public function getGanttDivAttributes(Aoe_Scheduler_Model_Schedule $schedule) {
|
186 |
|
187 |
+
if ($schedule->getStatus() == Mage_Cron_Model_Schedule::STATUS_RUNNING) {
|
188 |
+
$duration = time() - strtotime($schedule->getExecutedAt());
|
189 |
+
} else {
|
190 |
+
$duration = $schedule->getDuration() ? $schedule->getDuration() : 0;
|
191 |
+
}
|
192 |
$duration = $duration / $this->zoom;
|
193 |
$duration = ceil($duration / 4) * 4 - 1; // round to numbers dividable by 4, then remove 1 px border
|
194 |
$duration = max($duration, 3);
|
app/code/local/Aoe/Scheduler/Block/Adminhtml/TimelineDetail.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* TimelineDetail block
|
5 |
*
|
6 |
-
* @author
|
7 |
*/
|
8 |
class Aoe_Scheduler_Block_Adminhtml_TimelineDetail extends Mage_Adminhtml_Block_Template {
|
9 |
|
3 |
/**
|
4 |
* TimelineDetail block
|
5 |
*
|
6 |
+
* @author Fabrizio Branca
|
7 |
*/
|
8 |
class Aoe_Scheduler_Block_Adminhtml_TimelineDetail extends Mage_Adminhtml_Block_Template {
|
9 |
|
app/code/local/Aoe/Scheduler/Model/Api.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Scheduler API
|
4 |
+
*
|
5 |
+
* @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
|
6 |
+
*/
|
7 |
+
class Aoe_Scheduler_Model_Api extends Mage_Api_Model_Resource_Abstract {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Run task
|
11 |
+
*
|
12 |
+
* @param $code
|
13 |
+
* @return array
|
14 |
+
*/
|
15 |
+
public function runNow($code) {
|
16 |
+
$schedule = Mage::getModel('cron/schedule') /* @var $schedule Aoe_Scheduler_Model_Schedule */
|
17 |
+
->setJobCode($code)
|
18 |
+
->runNow(false) // without trying to lock the job
|
19 |
+
->save();
|
20 |
+
return $schedule->getData();
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Schedule task
|
25 |
+
*
|
26 |
+
* @param $code
|
27 |
+
* @param null $time
|
28 |
+
* @return array
|
29 |
+
*/
|
30 |
+
public function schedule($code, $time=NULL) {
|
31 |
+
$schedule = Mage::getModel('cron/schedule') /* @var $schedule Aoe_Scheduler_Model_Schedule */
|
32 |
+
->setJobCode($code)
|
33 |
+
->schedule($time)
|
34 |
+
->save();
|
35 |
+
return $schedule->getData();
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get info
|
40 |
+
*
|
41 |
+
* @param $id
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function info($id) {
|
45 |
+
$schedule = Mage::getModel('cron/schedule')->load($id); /* @var $schedule Aoe_Scheduler_Model_Schedule */
|
46 |
+
return $schedule->getData();
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
app/code/local/Aoe/Scheduler/Model/Observer.php
CHANGED
@@ -8,10 +8,11 @@
|
|
8 |
class Aoe_Scheduler_Model_Observer extends Mage_Cron_Model_Observer {
|
9 |
|
10 |
|
|
|
11 |
|
12 |
/**
|
13 |
* Process cron queue
|
14 |
-
*
|
15 |
* Cleanup tasks schedule
|
16 |
*
|
17 |
* @param Varien_Event_Observer $observer
|
@@ -23,21 +24,22 @@ class Aoe_Scheduler_Model_Observer extends Mage_Cron_Model_Observer {
|
|
23 |
$now = time();
|
24 |
$jobsRoot = Mage::getConfig()->getNode('crontab/jobs');
|
25 |
|
26 |
-
foreach ($schedules->getIterator() as $schedule) {
|
27 |
-
$jobConfig = $jobsRoot->{$schedule->getJobCode()};
|
28 |
-
if (!$jobConfig || !$jobConfig->run) {
|
29 |
-
continue;
|
30 |
-
}
|
31 |
-
|
32 |
-
$runConfig = $jobConfig->run;
|
33 |
-
$time = strtotime($schedule->getScheduledAt());
|
34 |
-
if ($time > $now) {
|
35 |
-
continue;
|
36 |
-
}
|
37 |
try {
|
38 |
$errorStatus = Mage_Cron_Model_Schedule::STATUS_ERROR;
|
39 |
$errorMessage = Mage::helper('cron')->__('Unknown error.');
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
if ($time < $now - $scheduleLifetime) {
|
42 |
$errorStatus = Mage_Cron_Model_Schedule::STATUS_MISSED;
|
43 |
Mage::throwException(Mage::helper('cron')->__('Too late for the schedule.'));
|
@@ -97,11 +99,36 @@ class Aoe_Scheduler_Model_Observer extends Mage_Cron_Model_Observer {
|
|
97 |
}
|
98 |
|
99 |
$this->generate();
|
|
|
100 |
$this->cleanup();
|
101 |
}
|
102 |
|
103 |
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
/**
|
106 |
* Generate jobs for config information
|
107 |
* Rewrites the original method to filter deactivated jobs
|
@@ -135,13 +162,14 @@ class Aoe_Scheduler_Model_Observer extends Mage_Cron_Model_Observer {
|
|
135 |
public function generate() {
|
136 |
$result = parent::generate();
|
137 |
|
|
|
138 |
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
139 |
$results = $conn->fetchAll("
|
140 |
SELECT
|
141 |
GROUP_CONCAT(schedule_id) AS ids,
|
142 |
CONCAT(job_code, scheduled_at) AS jobkey,
|
143 |
count(*) AS qty
|
144 |
-
FROM cron_schedule
|
145 |
WHERE status = 'pending'
|
146 |
GROUP BY jobkey
|
147 |
HAVING qty > 1;
|
8 |
class Aoe_Scheduler_Model_Observer extends Mage_Cron_Model_Observer {
|
9 |
|
10 |
|
11 |
+
const XML_PATH_MAX_RUNNING_TIME = 'system/cron/max_running_time';
|
12 |
|
13 |
/**
|
14 |
* Process cron queue
|
15 |
+
* Generate tasks schedule
|
16 |
* Cleanup tasks schedule
|
17 |
*
|
18 |
* @param Varien_Event_Observer $observer
|
24 |
$now = time();
|
25 |
$jobsRoot = Mage::getConfig()->getNode('crontab/jobs');
|
26 |
|
27 |
+
foreach ($schedules->getIterator() as $schedule) { /* @var $schedule Aoe_Scheduler_Model_Schedule */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
try {
|
29 |
$errorStatus = Mage_Cron_Model_Schedule::STATUS_ERROR;
|
30 |
$errorMessage = Mage::helper('cron')->__('Unknown error.');
|
31 |
|
32 |
+
$jobConfig = $jobsRoot->{$schedule->getJobCode()};
|
33 |
+
if (!$jobConfig || !$jobConfig->run) {
|
34 |
+
Mage::throwException(Mage::helper('cron')->__('No valid configuration found.'));
|
35 |
+
}
|
36 |
+
|
37 |
+
$runConfig = $jobConfig->run;
|
38 |
+
$time = strtotime($schedule->getScheduledAt());
|
39 |
+
if ($time > $now) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
if ($time < $now - $scheduleLifetime) {
|
44 |
$errorStatus = Mage_Cron_Model_Schedule::STATUS_MISSED;
|
45 |
Mage::throwException(Mage::helper('cron')->__('Too late for the schedule.'));
|
99 |
}
|
100 |
|
101 |
$this->generate();
|
102 |
+
$this->checkRunningJobs();
|
103 |
$this->cleanup();
|
104 |
}
|
105 |
|
106 |
|
107 |
|
108 |
+
/**
|
109 |
+
* Check running jobs
|
110 |
+
*
|
111 |
+
* @return void
|
112 |
+
*/
|
113 |
+
public function checkRunningJobs() {
|
114 |
+
|
115 |
+
$maxAge = time() - Mage::getStoreConfig(self::XML_PATH_MAX_RUNNING_TIME) * 60;
|
116 |
+
|
117 |
+
$schedules = Mage::getModel('cron/schedule')->getCollection()
|
118 |
+
->addFieldToFilter('status', Mage_Cron_Model_Schedule::STATUS_RUNNING)
|
119 |
+
->addFieldToFilter('executed_at', array('lt' => strftime('%Y-%m-%d %H:%M:00', $maxAge)))
|
120 |
+
->load();
|
121 |
+
|
122 |
+
foreach ($schedules->getIterator() as $schedule) { /* @var $schedule Aoe_Scheduler_Model_Schedule */
|
123 |
+
$schedule
|
124 |
+
->setStatus(Mage_Cron_Model_Schedule::STATUS_ERROR)
|
125 |
+
->setMessages('Job was running longer than the configured max_running_time')
|
126 |
+
->save();
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
|
131 |
+
|
132 |
/**
|
133 |
* Generate jobs for config information
|
134 |
* Rewrites the original method to filter deactivated jobs
|
162 |
public function generate() {
|
163 |
$result = parent::generate();
|
164 |
|
165 |
+
$cron_schedule = Mage::getSingleton('core/resource')->getTableName('cron_schedule');
|
166 |
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
|
167 |
$results = $conn->fetchAll("
|
168 |
SELECT
|
169 |
GROUP_CONCAT(schedule_id) AS ids,
|
170 |
CONCAT(job_code, scheduled_at) AS jobkey,
|
171 |
count(*) AS qty
|
172 |
+
FROM {$cron_schedule}
|
173 |
WHERE status = 'pending'
|
174 |
GROUP BY jobkey
|
175 |
HAVING qty > 1;
|
app/code/local/Aoe/Scheduler/Model/Schedule.php
CHANGED
@@ -27,7 +27,7 @@ class Aoe_Scheduler_Model_Schedule extends Mage_Cron_Model_Schedule {
|
|
27 |
$modelCallback = $this->getJobConfiguration()->getModel();
|
28 |
|
29 |
if (!$this->getCreatedAt()) {
|
30 |
-
$this->
|
31 |
}
|
32 |
|
33 |
if (!preg_match(Mage_Cron_Model_Observer::REGEX_RUN_MODEL, $modelCallback, $run)) {
|
@@ -78,12 +78,28 @@ class Aoe_Scheduler_Model_Schedule extends Mage_Cron_Model_Schedule {
|
|
78 |
/**
|
79 |
* Schedule this task to be executed as soon as possible
|
80 |
*
|
|
|
81 |
* @return Aoe_Scheduler_Model_Schedule
|
82 |
*/
|
83 |
public function scheduleNow() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
$this->setStatus(Mage_Cron_Model_Schedule::STATUS_PENDING)
|
85 |
->setCreatedAt(strftime('%Y-%m-%d %H:%M:%S', time()))
|
86 |
-
->setScheduledAt(strftime('%Y-%m-%d %H:%M', time
|
87 |
return $this;
|
88 |
}
|
89 |
|
27 |
$modelCallback = $this->getJobConfiguration()->getModel();
|
28 |
|
29 |
if (!$this->getCreatedAt()) {
|
30 |
+
$this->schedule();
|
31 |
}
|
32 |
|
33 |
if (!preg_match(Mage_Cron_Model_Observer::REGEX_RUN_MODEL, $modelCallback, $run)) {
|
78 |
/**
|
79 |
* Schedule this task to be executed as soon as possible
|
80 |
*
|
81 |
+
* @deprecated use Aoe_Scheduler_Model_Schedule::schedule() instead
|
82 |
* @return Aoe_Scheduler_Model_Schedule
|
83 |
*/
|
84 |
public function scheduleNow() {
|
85 |
+
return $this->schedule();
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Schedule this task to be executed at a given time
|
92 |
+
*
|
93 |
+
* @param int $time
|
94 |
+
* @return Aoe_Scheduler_Model_Schedule
|
95 |
+
*/
|
96 |
+
public function schedule($time=NULL) {
|
97 |
+
if (is_null($time)) {
|
98 |
+
$time = time();
|
99 |
+
}
|
100 |
$this->setStatus(Mage_Cron_Model_Schedule::STATUS_PENDING)
|
101 |
->setCreatedAt(strftime('%Y-%m-%d %H:%M:%S', time()))
|
102 |
+
->setScheduledAt(strftime('%Y-%m-%d %H:%M:%S', $time));
|
103 |
return $this;
|
104 |
}
|
105 |
|
app/code/local/Aoe/Scheduler/controllers/Adminhtml/CronController.php
CHANGED
@@ -65,7 +65,7 @@ class Aoe_Scheduler_Adminhtml_CronController extends Aoe_Scheduler_Adminhtml_Abs
|
|
65 |
foreach ($codes as $key) {
|
66 |
Mage::getModel('cron/schedule') /* @var Aoe_Scheduler_Model_Schedule */
|
67 |
->setJobCode($key)
|
68 |
-
->
|
69 |
->save();
|
70 |
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Scheduled "%s"', $key));
|
71 |
}
|
65 |
foreach ($codes as $key) {
|
66 |
Mage::getModel('cron/schedule') /* @var Aoe_Scheduler_Model_Schedule */
|
67 |
->setJobCode($key)
|
68 |
+
->schedule()
|
69 |
->save();
|
70 |
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Scheduled "%s"', $key));
|
71 |
}
|
app/code/local/Aoe/Scheduler/etc/api.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<api>
|
4 |
+
<resources>
|
5 |
+
<aoe_scheduler translate="title" module="aoe_scheduler">
|
6 |
+
<model>aoe_scheduler/api</model>
|
7 |
+
<title>Scheduler API</title>
|
8 |
+
<acl>aoe_scheduler/aoe_scheduler</acl>
|
9 |
+
<methods>
|
10 |
+
<runNow translate="title" module="aoe_scheduler">
|
11 |
+
<title>Run scheduler task</title>
|
12 |
+
<acl>aoe_scheduler/aoe_scheduler/runNow</acl>
|
13 |
+
</runNow>
|
14 |
+
<schedule translate="title" module="aoe_scheduler">
|
15 |
+
<title>Schedule task</title>
|
16 |
+
<acl>aoe_scheduler/aoe_scheduler/schedule</acl>
|
17 |
+
</schedule>
|
18 |
+
<info translate="title" module="aoe_scheduler">
|
19 |
+
<title>Get task information</title>
|
20 |
+
<acl>aoe_scheduler/aoe_scheduler/info</acl>
|
21 |
+
</info>
|
22 |
+
</methods>
|
23 |
+
</aoe_scheduler>
|
24 |
+
</resources>
|
25 |
+
<acl>
|
26 |
+
<resources>
|
27 |
+
<aoe_scheduler translate="title" module="aoe_scheduler">
|
28 |
+
<title>AOE Scheduler</title>
|
29 |
+
<runNow translate="title" module="aoe_scheduler">
|
30 |
+
<title>Run scheduler task</title>
|
31 |
+
</runNow>
|
32 |
+
<schedule translate="title" module="aoe_scheduler">
|
33 |
+
<title>Schedule task</title>
|
34 |
+
</schedule>
|
35 |
+
<info translate="title" module="aoe_scheduler">
|
36 |
+
<title>Get task information</title>
|
37 |
+
</info>
|
38 |
+
</aoe_scheduler>
|
39 |
+
</resources>
|
40 |
+
</acl>
|
41 |
+
</api>
|
42 |
+
</config>
|
app/code/local/Aoe/Scheduler/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Aoe_Scheduler>
|
5 |
-
<version>0.1
|
6 |
</Aoe_Scheduler>
|
7 |
</modules>
|
8 |
|
@@ -73,4 +73,12 @@
|
|
73 |
</jobs>
|
74 |
</crontab> -->
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Aoe_Scheduler>
|
5 |
+
<version>0.2.1</version>
|
6 |
</Aoe_Scheduler>
|
7 |
</modules>
|
8 |
|
73 |
</jobs>
|
74 |
</crontab> -->
|
75 |
|
76 |
+
<default>
|
77 |
+
<system>
|
78 |
+
<cron>
|
79 |
+
<max_running_time>120</max_running_time>
|
80 |
+
</cron>
|
81 |
+
</system>
|
82 |
+
</default>
|
83 |
+
|
84 |
</config>
|
app/code/local/Aoe/Scheduler/etc/system.xml
CHANGED
@@ -1,21 +1,30 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
+
<sections>
|
4 |
+
<system>
|
5 |
+
<groups>
|
6 |
+
<cron translate="label comment" module="cron">
|
7 |
+
<fields>
|
8 |
+
<disabled_crons translate="label">
|
9 |
+
<label>Disabled cron tasks</label>
|
10 |
+
<frontend_type>text</frontend_type>
|
11 |
+
<sort_order>100</sort_order>
|
12 |
+
<show_in_default>1</show_in_default>
|
13 |
+
<show_in_website>0</show_in_website>
|
14 |
+
<show_in_store>0</show_in_store>
|
15 |
+
</disabled_crons>
|
16 |
+
<max_running_time translate="label">
|
17 |
+
<label>Mark jobs as failed after</label>
|
18 |
+
<comment><![CDATA[Maximum time in minutes. The will only marked as failed. It won't be killed (if it should actually be still running).]]></comment>
|
19 |
+
<frontend_type>text</frontend_type>
|
20 |
+
<sort_order>100</sort_order>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<show_in_website>0</show_in_website>
|
23 |
+
<show_in_store>0</show_in_store>
|
24 |
+
</max_running_time>
|
25 |
+
</fields>
|
26 |
+
</cron>
|
27 |
+
</groups>
|
28 |
+
</system>
|
29 |
+
</sections>
|
30 |
</config>
|
app/design/adminhtml/default/default/template/aoe_scheduler/timeline.phtml
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
/* @var $this Aoe_Scheduler_Block_Adminhtml_Timeline */
|
3 |
$_helper = $this->helper('aoe_scheduler/data'); /* @var $_helper Aoe_Scheduler_Helper_Data */
|
|
|
4 |
?>
|
5 |
|
6 |
<div class="content-header">
|
@@ -14,52 +15,58 @@ $_helper = $this->helper('aoe_scheduler/data'); /* @var $_helper Aoe_Scheduler_H
|
|
14 |
|
15 |
<div id="maincontainer">
|
16 |
|
17 |
-
|
18 |
-
<div id="contentcolumn">
|
19 |
-
<div class="timeline-box">
|
20 |
-
<div class="timeline-panel" style="width: <?php echo $this->getTimelinePanelWidth(); ?>px;">
|
21 |
|
22 |
-
|
|
|
|
|
|
|
23 |
|
24 |
-
|
25 |
-
<div class="timeline">
|
26 |
-
<?php for($i = $this->getStarttime(); $i < $this->getEndtime(); $i+=60*60): ?>
|
27 |
-
<div class="hour"><?php echo $_helper->decorateTime($i, false, 'Y-m-d H:i'); ?></div>
|
28 |
-
<?php endfor; ?>
|
29 |
-
</div>
|
30 |
-
</div>
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
<?php
|
37 |
-
<div <?php echo $this->getGanttDivAttributes($_schedule); ?>></div>
|
38 |
-
<?php echo $this->getLayout()->createBlock('aoe_scheduler/adminhtml_timelineDetail')->setSchedule($_schedule)->toHtml(); ?>
|
39 |
-
<?php endforeach; ?>
|
40 |
</div>
|
41 |
</div>
|
42 |
-
<?php endforeach; ?>
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
</div>
|
45 |
-
</div
|
46 |
-
</div><!-- id="
|
47 |
-
</div><!-- id="contentwrapper" -->
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
59 |
</div>
|
60 |
-
|
61 |
-
|
|
|
62 |
|
63 |
-
|
|
|
|
|
64 |
|
65 |
</div><!-- id="maincontainer" -->
|
1 |
<?php
|
2 |
/* @var $this Aoe_Scheduler_Block_Adminhtml_Timeline */
|
3 |
$_helper = $this->helper('aoe_scheduler/data'); /* @var $_helper Aoe_Scheduler_Helper_Data */
|
4 |
+
$_jobCodes = $this->getAvailableJobCodes(); /* @var $_jobCodes array */
|
5 |
?>
|
6 |
|
7 |
<div class="content-header">
|
15 |
|
16 |
<div id="maincontainer">
|
17 |
|
18 |
+
<?php if (count($_jobCodes) > 0): ?>
|
|
|
|
|
|
|
19 |
|
20 |
+
<div id="contentwrapper">
|
21 |
+
<div id="contentcolumn">
|
22 |
+
<div class="timeline-box">
|
23 |
+
<div class="timeline-panel" style="width: <?php echo $this->getTimelinePanelWidth(); ?>px;">
|
24 |
|
25 |
+
<div id="now" style="left: <?php echo $this->getNowline(); ?>px"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
<div class="row hours">
|
28 |
+
<div class="timeline">
|
29 |
+
<?php for($i = $this->getStarttime(); $i < $this->getEndtime(); $i+=60*60): ?>
|
30 |
+
<div class="hour"><?php echo $_helper->decorateTime($i, false, 'Y-m-d H:i'); ?></div>
|
31 |
+
<?php endfor; ?>
|
|
|
|
|
|
|
32 |
</div>
|
33 |
</div>
|
|
|
34 |
|
35 |
+
<?php foreach ($_jobCodes as $jobCode): /* @var $jobCode string */ ?>
|
36 |
+
<?php $_schedules = $this->getSchedulesForCode($jobCode); ?>
|
37 |
+
<div class="row">
|
38 |
+
<div class="timeline timeline_<?php echo $jobCode; ?>">
|
39 |
+
<?php foreach ($_schedules as $_schedule): /* @var $_schedule Aoe_Scheduler_Model_Schedule */ ?>
|
40 |
+
<div <?php echo $this->getGanttDivAttributes($_schedule); ?>></div>
|
41 |
+
<?php echo $this->getLayout()->createBlock('aoe_scheduler/adminhtml_timelineDetail')->setSchedule($_schedule)->toHtml(); ?>
|
42 |
+
<?php endforeach; ?>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
<?php endforeach; ?>
|
46 |
+
|
47 |
+
</div>
|
48 |
</div>
|
49 |
+
</div><!-- id="contentcolumn" -->
|
50 |
+
</div><!-- id="contentwrapper" -->
|
|
|
51 |
|
52 |
+
<div id="leftcolumn">
|
53 |
|
54 |
+
<div class="row hours">
|
55 |
+
<div class="caption"><?php echo $_helper->decorateTime($this->getStarttime(), true, 'Y-m-d H:i'); ?> - <?php echo $_helper->decorateTime($this->getEndtime(), true, 'Y-m-d H:i'); ?></div>
|
56 |
+
</div>
|
57 |
|
58 |
+
<?php foreach ($this->getAvailableJobCodes() as $jobCode): /* @var $jobCode string */ ?>
|
59 |
+
<div class="row">
|
60 |
+
<div class="configuration">
|
61 |
+
<?php echo $jobCode; ?>
|
62 |
+
</div>
|
63 |
</div>
|
64 |
+
<?php endforeach; ?>
|
65 |
+
|
66 |
+
</div><!-- id="leftcolumn" -->
|
67 |
|
68 |
+
<?php else: ?>
|
69 |
+
<?php echo $this->__('No tasks found.'); ?>
|
70 |
+
<?php endif; ?>
|
71 |
|
72 |
</div><!-- id="maincontainer" -->
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Aoe_Scheduler</name>
|
4 |
-
<version>0.1
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Scheduler / Cron Management</summary>
|
10 |
<description>This extension allows you to manage your scheduler task. Schedules can be disabled. From version 0.1.0 this extension also comes with a graphical timeline view.</description>
|
11 |
-
<notes>Bugfix release
|
|
|
|
|
12 |
<authors><author><name>Fabrizio Branca</name><user>auto-converted</user><email>magento@fabrizio-branca.de</email></author></authors>
|
13 |
-
<date>2011-
|
14 |
-
<time>21:
|
15 |
-
<contents><target name="magelocal"><dir name="Aoe"><dir name="Scheduler"><dir name="Block"><dir name="Adminhtml"><dir name="Cron"><file name="Grid.php" hash="794200ea4a6885a19b86c972d06b3693"/></dir><dir name="Scheduler"><file name="Grid.php" hash="73eb69714d3ec1a6b3e5ceb566067ad1"/></dir><file name="Cron.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Aoe_Scheduler</name>
|
4 |
+
<version>0.2.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Scheduler / Cron Management</summary>
|
10 |
<description>This extension allows you to manage your scheduler task. Schedules can be disabled. From version 0.1.0 this extension also comes with a graphical timeline view.</description>
|
11 |
+
<notes>Bugfix release.
|
12 |
+

|
13 |
+
Check http://www.fabrizio-branca.de/magento-cron-scheduler.html for a summary of new features and bugfixes</notes>
|
14 |
<authors><author><name>Fabrizio Branca</name><user>auto-converted</user><email>magento@fabrizio-branca.de</email></author></authors>
|
15 |
+
<date>2011-12-15</date>
|
16 |
+
<time>21:39:04</time>
|
17 |
+
<contents><target name="magelocal"><dir name="Aoe"><dir name="Scheduler"><dir name="Block"><dir name="Adminhtml"><dir name="Cron"><file name="Grid.php" hash="794200ea4a6885a19b86c972d06b3693"/></dir><dir name="Scheduler"><file name="Grid.php" hash="73eb69714d3ec1a6b3e5ceb566067ad1"/></dir><file name="Cron.php" hash="f3fe20d102c7ddff6c1a4f72c14ab95f"/><file name="Scheduler.php" hash="a9d0f50f2a66532f76746cc311ad1b09"/><file name="Timeline.php" hash="4febff14b58b081b3df00871a3ce0d8e"/><file name="TimelineDetail.php" hash="0cdc46705c070dee76c6938175586c6a"/></dir></dir><dir name="Helper"><file name="Data.php" hash="9ba5f7c21da1a226e531162b9e9622d2"/></dir><dir name="Model"><dir name="Collection"><file name="Crons.php" hash="733ae06d490b4b371d70ee275bd3a3a9"/></dir><file name="Api.php" hash="2f674c989ec27b19f2f5530fcf698c0c"/><file name="Configuration.php" hash="1c21f0c4fa50cd4980fe1bdb7e4956f3"/><file name="Observer.php" hash="e16ed30761103862660a771915d6577f"/><file name="Schedule.php" hash="299b3bca57e6aa16e3be6f834d103413"/><file name="TestTask.php" hash="96ac1c00c24cf959cbef452dd57900e4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbstractController.php" hash="4435f29815e4253eb47f15221b5c0d43"/><file name="CronController.php" hash="fdb5947cb2a45ba4e616cb78127a217a"/><file name="SchedulerController.php" hash="95ffe62214e872e566332de6a2141cab"/><file name="TimelineController.php" hash="c0ccb4163c8495c9b8b07a869e27563b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="42f04275451a6837516cdcef0a14c40b"/><file name="api.xml" hash="cc6cc05874a1277ba53e07c3450541c5"/><file name="config.xml" hash="bdf9556a60d441c99a4bb5d54b29320d"/><file name="system.xml" hash="eb17e005b5f9ea5617be7b728e5c7c8c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aoe_Scheduler.xml" hash="3fa179507d5b3b3f1cde3be281ee1a26"/></dir></target><target name="mage"><dir name="shell"><file name="scheduler.php" hash="1d9ab318d9cc13448cd93a99038f9b3b"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Aoe_Scheduler.csv" hash="f06c379c1170bc67f978b05943197601"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="aoe_scheduler"><file name="timeline.phtml" hash="9b8bf5864319542e8aa6ecc19efa5108"/><file name="timeline_detail.phtml" hash="d353689ad539f2adc0df97716ff7eb88"/></dir></dir><dir name="layout"><dir name="aoe_scheduler"><file name="aoe_scheduler.xml" hash="95be2d020b3281f3400a2edb809fce79"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="aoe_scheduler"><dir name="Images"><file name="bg_notifications.gif" hash="df73b8aa7e48bb56e0a644245aa3683f"/><file name="gradient.png" hash="17f6c6ef64b1682a06060950933561c9"/><file name="hour.gif" hash="91a63b82b2b41a046ca938aea3238a41"/></dir><dir name="JavaScript"><file name="common.js" hash="af6dadb7e3a18a2d4a882d9249f3f7a0"/><file name="jquery-1.6.2.min.js" hash="a1a8cb16a060f6280a767187fd22e037"/><file name="tooltip.dynamic.js" hash="c6737dd54890ca0cac816f3fecaf33d9"/><file name="tooltip.js" hash="d731eecbe152f86d3c702b55b4767fb1"/></dir><dir name="StyleSheet"><file name="bars.css" hash="c98df4a3611f628dba01b8cd0142f3d2"/><file name="timeline.css" hash="41510bd533aaeab5df46fa49210cfc9f"/></dir></dir></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies/>
|
20 |
</package>
|