Index: admin_templates/scheduled_tasks/scheduled_task_edit.tpl
===================================================================
--- admin_templates/scheduled_tasks/scheduled_task_edit.tpl (revision 15907)
+++ admin_templates/scheduled_tasks/scheduled_task_edit.tpl (working copy)
@@ -69,11 +69,13 @@
+
+
Index: install/install_schema.sql
===================================================================
--- install/install_schema.sql (revision 15907)
+++ install/install_schema.sql (working copy)
@@ -777,6 +777,7 @@
LastTimeoutOn int(10) unsigned DEFAULT NULL,
SiteDomainLimitation varchar(255) NOT NULL DEFAULT '',
Settings text,
+ Module varchar(30) NOT NULL DEFAULT 'In-Portal',
PRIMARY KEY (ScheduledTaskId),
KEY `Status` (`Status`),
KEY LastRunOn (LastRunOn),
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 15907)
+++ install/upgrades.sql (working copy)
@@ -2940,3 +2940,6 @@
INSERT INTO SystemSettings VALUES(DEFAULT, 'PlainTextCookies', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_PlainTextCookies', 'text', '', '', 60.10, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceCanonicalUrls', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceCanonicalUrls', 'checkbox', '', '', 10.0125, 0, 0, NULL);
+
+ALTER TABLE ScheduledTasks ADD Module varchar(30) NOT NULL DEFAULT 'In-Portal';
+
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 15907)
+++ kernel/application.php (working copy)
@@ -2146,9 +2146,9 @@
* @param int $status
* @access public
*/
- public function registerScheduledTask($short_name, $event_string, $run_schedule, $status = STATUS_ACTIVE)
+ public function registerScheduledTask($short_name, $event_string, $run_schedule, $module, $status = STATUS_ACTIVE)
{
- $this->EventManager->registerScheduledTask($short_name, $event_string, $run_schedule, $status);
+ $this->EventManager->registerScheduledTask($short_name, $event_string, $run_schedule, $module, $status);
}
/**
Index: kernel/event_manager.php
===================================================================
--- kernel/event_manager.php (revision 15907)
+++ kernel/event_manager.php (working copy)
@@ -122,9 +122,9 @@
* @param int $status
* @access public
*/
- public function registerScheduledTask($short_name, $event_string, $run_schedule, $status = STATUS_ACTIVE)
+ public function registerScheduledTask($short_name, $event_string, $run_schedule, $module, $status = STATUS_ACTIVE)
{
- $this->ScheduledTasks->add($short_name, $event_string, $run_schedule, $status);
+ $this->ScheduledTasks->add($short_name, $event_string, $run_schedule, $module, $status);
}
/**
Index: kernel/managers/scheduled_task_manager.php
===================================================================
--- kernel/managers/scheduled_task_manager.php (revision 15907)
+++ kernel/managers/scheduled_task_manager.php (working copy)
@@ -84,10 +84,10 @@
* @param int $status
* @access public
*/
- public function add($short_name, $event_string, $run_schedule, $status = STATUS_ACTIVE)
+ public function add($short_name, $event_string, $run_schedule, $module, $status = STATUS_ACTIVE)
{
$this->tasks[$short_name] = Array (
- 'Event' => $event_string, 'RunSchedule' => $run_schedule, 'Status' => $status
+ 'Event' => $event_string, 'RunSchedule' => $run_schedule, 'Status' => $status, 'Module' => $module
);
}
Index: kernel/utility/unit_config.php
===================================================================
--- kernel/utility/unit_config.php (revision 15907)
+++ kernel/utility/unit_config.php (working copy)
@@ -1141,10 +1141,31 @@
foreach ($scheduled_tasks as $short_name => $scheduled_task_info) {
$event_status = array_key_exists('Status', $scheduled_task_info) ? $scheduled_task_info['Status'] : STATUS_ACTIVE;
- $this->Application->delayUnitProcessing('registerScheduledTask', Array ($short_name, $this->_prefix . ':' . $scheduled_task_info['EventName'], $scheduled_task_info['RunSchedule'], $event_status));
+ $this->Application->delayUnitProcessing('registerScheduledTask', Array ($short_name, $this->_prefix . ':' . $scheduled_task_info['EventName'], $scheduled_task_info['RunSchedule'], $this->_getModule(), $event_status));
}
}
+ /**
+ * Determines module by unit path
+ *
+ * @return string
+ * @access protected
+ */
+ protected function _getModule()
+ {
+ $ret = '';
+ $module_path = $this->getModuleFolder() . '/';
+
+ foreach ($this->Application->ModuleInfo AS $module_name => $module_data) {
+ if ( $module_data['Path'] == $module_path ) {
+ $ret = $module_name;
+ break;
+ }
+ }
+
+ return $ret;
+ }
+
protected function _parseHooks()
{
$hooks = $this->getHooks();
Index: units/scheduled_tasks/scheduled_task_eh.php
===================================================================
--- units/scheduled_tasks/scheduled_task_eh.php (revision 15907)
+++ units/scheduled_tasks/scheduled_task_eh.php (working copy)
@@ -87,6 +87,7 @@
'Event' => $scheduled_task_params['Event'],
'Name' => $scheduled_task_name,
'Type' => ScheduledTask::TYPE_SYSTEM,
+ 'Module' => $scheduled_task_params['Module'],
'Status' => isset($scheduled_task_params['Status']) ? $scheduled_task_params['Status'] : STATUS_ACTIVE,
'RunSchedule' => $scheduled_task_params['RunSchedule'],
);
Index: units/scheduled_tasks/scheduled_tasks_config.php
===================================================================
--- units/scheduled_tasks/scheduled_tasks_config.php (revision 15907)
+++ units/scheduled_tasks/scheduled_tasks_config.php (working copy)
@@ -145,6 +145,11 @@
'not_null' => 1, 'default' => ''
),
'Settings' => Array ('type' => 'string', 'default' => NULL),
+ 'Module' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Modules WHERE (Loaded = 1) AND (Name <> "In-Portal") ORDER BY LoadOrder', 'option_key_field' => 'Name', 'option_title_field' => 'Name',
+ 'not_null' => 1, 'required' => 1, 'default' => 'Core'
+ ),
),
'Grids' => Array (
@@ -167,6 +172,7 @@
'Timeout' => Array ('filter_block' => 'grid_range_filter', 'width' => 85),
'LastTimeoutOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145),
'SiteDomainLimitation' => Array ('data_block' => 'grid_picker_td', 'filter_block' => 'grid_multioptions_filter', 'separator' => ', ', 'width' => 145),
+ 'Module' => Array ('filter_block' => 'grid_options_filter', 'width' => 65),
),
),
),