Skip to content

Commit

Permalink
Merge pull request #48 from mzeis/task_records
Browse files Browse the repository at this point in the history
Added name, short description and description to jobs.
  • Loading branch information
fbrnc committed Nov 28, 2014
2 parents 3a58b85 + bfaef9d commit 547c571
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,32 @@ protected function _prepareForm()
));
}

$fieldset->addField('name', 'text', array(
'name' => 'name',
'label' => Mage::helper('aoe_scheduler')->__('Name'),
'title' => Mage::helper('aoe_scheduler')->__('Name'),
'class' => '',
'required' => false,
'after_element_html' => $xmlJob ? $this->getOriginalValueSnippet($xmlJob->getName()) : ''
));

$fieldset->addField('short_description', 'textarea', array(
'name' => 'short_description',
'label' => Mage::helper('aoe_scheduler')->__('Short description'),
'title' => Mage::helper('aoe_scheduler')->__('Short description'),
'class' => '',
'required' => false,
'after_element_html' => $xmlJob ? $this->getOriginalValueSnippet($xmlJob->getShortDescription()) : ''
));

$fieldset->addField('description', 'textarea', array(
'name' => 'description',
'label' => Mage::helper('aoe_scheduler')->__('Description'),
'title' => Mage::helper('aoe_scheduler')->__('Description'),
'class' => '',
'required' => false,
'after_element_html' => $xmlJob ? $this->getOriginalValueSnippet($xmlJob->getDescription()) : ''
));

$fieldset->addField('run_model', 'text', array(
'name' => 'run_model',
Expand Down
16 changes: 14 additions & 2 deletions app/code/community/Aoe/Scheduler/Block/Adminhtml/Job/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,24 @@ protected function _prepareMassaction()
*/
protected function _prepareColumns()
{

$this->addColumn('job_code', array(
'header' => Mage::helper('aoe_scheduler')->__('Job code'),
'index' => 'job_code',
'sortable' => false,
));

$this->addColumn('name', array(
'header' => Mage::helper('aoe_scheduler')->__('Name'),
'index' => 'name',
'sortable' => false,
));

$this->addColumn('short_description', array(
'header' => Mage::helper('aoe_scheduler')->__('Short Description'),
'index' => 'short_description',
'sortable' => false,
));

$this->addColumn('schedule_cron_expr', array(
'header' => Mage::helper('aoe_scheduler')->__('Cron expression'),
'index' => 'schedule_cron_expr',
Expand Down Expand Up @@ -191,4 +203,4 @@ public function getGridUrl()
return $this->getUrl('adminhtml/job/index', array('_current' => true));
}

}
}
11 changes: 10 additions & 1 deletion app/code/community/Aoe/Scheduler/Model/Job/Xml/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ public function loadByCode($jobCode)
if ($xmlConfiguration->groups) {
$this->setGroups((string)$xmlConfiguration->groups);
}
if ($xmlConfiguration->name) {
$this->setName((string)$xmlConfiguration->name);
}
if ($xmlConfiguration->short_description) {
$this->setShortDescription((string)$xmlConfiguration->short_description);
}
if ($xmlConfiguration->description) {
$this->setDescription((string)$xmlConfiguration->description);
}

$disabledCrons = Mage::helper('aoe_scheduler')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
$this->setIsActive(!in_array($this->getId(), $disabledCrons));
Expand All @@ -82,4 +91,4 @@ public function getCollection()
return $collection;
}

}
}
4 changes: 2 additions & 2 deletions app/code/community/Aoe/Scheduler/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Aoe_Scheduler>
<version>0.5.2</version>
<version>0.5.3</version>
</Aoe_Scheduler>
</modules>

Expand Down Expand Up @@ -175,4 +175,4 @@
</suite>
</phpunit>

</config>
</config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

$installer = $this; /* @var $installer Mage_Core_Model_Resource_Setup */

$installer->startSetup();

$installer->getConnection()->addColumn($installer->getTable('aoe_scheduler/job'), 'name', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 256,
'nullable' => true,
'default' => null,
'comment' => 'Name'
));

$installer->getConnection()->addColumn($installer->getTable('aoe_scheduler/job'), 'short_description', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => '64K',
'comment' => 'Short Description'
));

$installer->getConnection()->addColumn($installer->getTable('aoe_scheduler/job'), 'description', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => '64K',
'comment' => 'Description'
));

$installer->endSetup();

0 comments on commit 547c571

Please sign in to comment.