Index: core/kernel/application.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/application.php (revision 15917)
+++ core/kernel/application.php (revision )
@@ -2143,12 +2143,13 @@
* @param string $short_name name to be used to store last maintenance run info
* @param string $event_string
* @param int $run_schedule run schedule like for Cron
+ * @param string $module
* @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: core/install/upgrades.sql
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install/upgrades.sql (revision 15908)
+++ core/install/upgrades.sql (revision )
@@ -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 'Core';
+
Index: core/kernel/managers/scheduled_task_manager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/managers/scheduled_task_manager.php (revision 15908)
+++ core/kernel/managers/scheduled_task_manager.php (revision )
@@ -81,13 +81,14 @@
* @param string $short_name name to be used to store last maintenance run info
* @param string $event_string
* @param int $run_schedule run schedule like for Cron
+ * @param string $module
* @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
);
}
\ No newline at end of file
Index: core/units/scheduled_tasks/scheduled_task_eh.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/units/scheduled_tasks/scheduled_task_eh.php (revision 15908)
+++ core/units/scheduled_tasks/scheduled_task_eh.php (revision )
@@ -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'],
);
@@ -287,6 +288,14 @@
protected function OnAfterConfigRead(kEvent $event)
{
parent::OnAfterConfigRead($event);
+
+ if ( $this->Application->findModule('Name', 'Custom') ) {
+ $config = $event->getUnitConfig();
+
+ $fields = $config->getFields();
+ $fields['Module']['default'] = 'Custom';
+ $config->setFields($fields);
+ }
$cron_helper = $this->Application->recallObject('kCronHelper');
/* @var $cron_helper kCronHelper */
\ No newline at end of file
Index: core/kernel/event_manager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/event_manager.php (revision 15908)
+++ core/kernel/event_manager.php (revision )
@@ -119,12 +119,13 @@
* @param string $short_name name to be used to store last maintenance run info
* @param string $event_string
* @param int $run_schedule run schedule like for Cron
+ * @param string $module
* @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);
}
/**
\ No newline at end of file
Index: core/admin_templates/scheduled_tasks/scheduled_task_edit.tpl
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/admin_templates/scheduled_tasks/scheduled_task_edit.tpl (revision 15908)
+++ core/admin_templates/scheduled_tasks/scheduled_task_edit.tpl (revision )
@@ -69,11 +69,13 @@
+
+
\ No newline at end of file
Index: core/kernel/utility/unit_config.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/utility/unit_config.php (revision 15908)
+++ core/kernel/utility/unit_config.php (revision )
@@ -1141,8 +1141,29 @@
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()
Index: core/units/scheduled_tasks/scheduled_tasks_config.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/units/scheduled_tasks/scheduled_tasks_config.php (revision 15908)
+++ core/units/scheduled_tasks/scheduled_tasks_config.php (revision )
@@ -145,7 +145,12 @@
'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 (
'Default' => 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),
),
),
),
\ No newline at end of file
Index: core/install/install_schema.sql
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install/install_schema.sql (revision 15908)
+++ core/install/install_schema.sql (revision )
@@ -777,6 +777,7 @@
LastTimeoutOn int(10) unsigned DEFAULT NULL,
SiteDomainLimitation varchar(255) NOT NULL DEFAULT '',
Settings text,
+ Module varchar(30) NOT NULL DEFAULT 'Core',
PRIMARY KEY (ScheduledTaskId),
KEY `Status` (`Status`),
KEY LastRunOn (LastRunOn),
\ No newline at end of file