Attached Files |
rename_agents_294.patch [^] (92,516 bytes) 2011-10-07 09:19
[Show Content]
Index: admin/system_presets/simple/event_schedules_event-schedule.php
===================================================================
--- admin/system_presets/simple/event_schedules_event-schedule.php (revision 0)
+++ admin/system_presets/simple/event_schedules_event-schedule.php (revision 0)
@@ -0,0 +1,51 @@
+<?php
+
+ defined('FULL_PATH') or die('restricted access!');
+
+ // section removal
+ $remove_sections = Array (
+ 'in-portal:event_schedules',
+ );
+
+ // sections shown with debug on
+ $debug_only_sections = Array (
+// 'in-portal:event_schedules',
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+// list of event_schedules
+// 'event_schedule_list' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'process', 'cancel', 'view', 'dbl-click'),
+
+// edit event_schedule
+// 'event_schedule_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'EventScheduleId', 'EventScheduleName', 'EventScheduleType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
+ 'LastRunStatus', 'NextRunOn', 'RunTime', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'EventScheduleId', 'EventScheduleName', 'EventScheduleType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
+ 'LastRunStatus', 'NextRunOn', 'RunTime', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array ( );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ( 'EventScheduleId', 'EventScheduleName', 'EventScheduleType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn', 'LastRunStatus', 'NextRunOn', ),
+ );
\ No newline at end of file
Index: core/admin_templates/agents/agent_edit.tpl
===================================================================
--- core/admin_templates/agents/agent_edit.tpl (revision 14646)
+++ core/admin_templates/agents/agent_edit.tpl (working copy)
@@ -1,92 +0,0 @@
-<inp2:adm_SetPopupSize width="550" height="400"/>
-<inp2:m_include t="incs/header"/>
-
-<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_edit"/>
-
-<!-- ToolBar -->
-<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
-<tbody>
- <tr>
- <td>
- <script type="text/javascript">
- a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
- submit_event('agent', '<inp2:agent_SaveEvent/>');
- }
- ) );
- a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- cancel_edit('agent', 'OnCancelEdit','<inp2:agent_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
- }
- ) );
-
- a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
- reset_form('agent', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
- }
- ) );
-
- a_toolbar.AddButton( new ToolBarSeparator('sep1') );
-
- a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
- go_to_id('agent', '<inp2:agent_PrevId/>');
- }
- ) );
- a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
- go_to_id('agent', '<inp2:agent_NextId/>');
- }
- ) );
-
-
-
- a_toolbar.Render();
-
- <inp2:m_if check="agent_IsSingle" >
- a_toolbar.HideButton('prev');
- a_toolbar.HideButton('next');
- a_toolbar.HideButton('sep1');
- <inp2:m_else/>
- <inp2:m_if check="agent_IsLast" >
- a_toolbar.DisableButton('next');
- </inp2:m_if>
- <inp2:m_if check="agent_IsFirst" >
- a_toolbar.DisableButton('prev');
- </inp2:m_if>
- </inp2:m_if>
- </script>
- </td>
- </tr>
-</tbody>
-</table>
-
-<inp2:agent_SaveWarning name="grid_save_warning"/>
-<inp2:agent_ErrorWarning name="form_error_warning"/>
-
-<div id="scroll_container">
- <table class="edit-form">
- <inp2:m_RenderElement name="inp_id_label" prefix="agent" field="AgentId" title="la_fld_Id"/>
-
- <inp2:m_if check="agent_Field" name="AgentType" equals_to="1" db="db">
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="AgentName" title="la_fld_Name"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentType" title="la_fld_Type" has_empty="1"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="agent" field="Status" has_empty="1"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="Event"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentName" title="la_fld_Name"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentType" title="la_fld_Type" has_empty="1"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="agent" field="Status" has_empty="1"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="Event"/>
- </inp2:m_if>
-
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="RunInterval"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="agent" field="RunMode" has_empty="1"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="LastRunOn"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="LastRunStatus"/>
- <inp2:m_RenderElement name="inp_edit_date_time" prefix="agent" field="NextRunOn"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="RunTime"/>
-
- <inp2:m_RenderElement name="inp_edit_checkboxes" prefix="agent" field="SiteDomainLimitation"/>
-
- <inp2:m_RenderElement name="inp_edit_filler"/>
- </table>
-</div>
-
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/admin_templates/agents/agent_list.tpl
===================================================================
--- core/admin_templates/agents/agent_list.tpl (revision 14646)
+++ core/admin_templates/agents/agent_list.tpl (working copy)
@@ -1,91 +0,0 @@
-<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_list" pagination="1"/>
-
-<!-- ToolBar -->
-<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
-<tbody>
- <tr>
- <td>
- <script type="text/javascript">
- //do not rename - this function is used in default grid for double click!
- function edit()
- {
- std_edit_item('agent', 'agents/agent_edit');
- }
-
- var a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewAgent" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
- function() {
- std_precreate_item('agent', 'agents/agent_edit');
- } ) );
-
- a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
- a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
- function() {
- std_delete_items('agent')
- } ) );
-
- a_toolbar.AddButton( new ToolBarSeparator('sep1') );
-
- a_toolbar.AddButton(
- new ToolBarButton(
- 'approve',
- '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
- function() {
- submit_event('agent', 'OnMassApprove');
- }
- )
- );
-
- a_toolbar.AddButton(
- new ToolBarButton(
- 'decline',
- '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
- function() {
- submit_event('agent', 'OnMassDecline');
- }
- )
- );
-
- a_toolbar.AddButton( new ToolBarSeparator('sep2') );
-
- a_toolbar.AddButton(
- new ToolBarButton(
- 'process',
- '<inp2:m_phrase label="la_ToolTip_Run" escape="1"/>',
- function() {
- submit_event('agent', 'OnRunAgents');
- }
- )
- );
-
- a_toolbar.AddButton(
- new ToolBarButton(
- 'cancel',
- '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
- function() {
- submit_event('agent', 'OnMassCancel');
- }
- )
- );
-
- a_toolbar.AddButton( new ToolBarSeparator('sep3') );
-
- a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
- show_viewmenu(a_toolbar,'view');
- }
- ) );
-
- a_toolbar.Render();
- </script>
- </td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="agent" grid="Default"/>
- </tr>
-</tbody>
-</table>
-
-<inp2:m_RenderElement name="grid" PrefixSpecial="agent" IdField="AgentId" grid="Default"/>
-<script type="text/javascript">
- Grids['agent'].SetDependantToolbarButtons( new Array('edit','delete', 'approve', 'decline', 'process', 'cancel') );
-</script>
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/admin_templates/event_schedules/event_schedule_edit.tpl
===================================================================
--- core/admin_templates/event_schedules/event_schedule_edit.tpl (revision 0)
+++ core/admin_templates/event_schedules/event_schedule_edit.tpl (revision 0)
@@ -0,0 +1,92 @@
+<inp2:adm_SetPopupSize width="550" height="400"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_RenderElement name="combined_header" section="in-portal:event_schedules" prefix="event-schedule" title_preset="event_schedule_edit"/>
+
+<!-- ToolBar -->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('event-schedule', '<inp2:event-schedule_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ cancel_edit('event-schedule', 'OnCancelEdit','<inp2:event-schedule_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+ reset_form('event-schedule', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('event-schedule', '<inp2:event-schedule_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('event-schedule', '<inp2:event-schedule_NextId/>');
+ }
+ ) );
+
+
+
+ a_toolbar.Render();
+
+ <inp2:m_if check="event-schedule_IsSingle" >
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if check="event-schedule_IsLast" >
+ a_toolbar.DisableButton('next');
+ </inp2:m_if>
+ <inp2:m_if check="event-schedule_IsFirst" >
+ a_toolbar.DisableButton('prev');
+ </inp2:m_if>
+ </inp2:m_if>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:event-schedule_SaveWarning name="grid_save_warning"/>
+<inp2:event-schedule_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="inp_id_label" prefix="event-schedule" field="EventScheduleId" title="la_fld_Id"/>
+
+ <inp2:m_if check="event-schedule_Field" name="EventScheduleType" equals_to="1" db="db">
+ <inp2:m_RenderElement name="inp_edit_box" prefix="event-schedule" field="EventScheduleName" title="la_fld_Name"/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="EventScheduleType" title="la_fld_Type" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="event-schedule" field="Status" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="event-schedule" field="Event"/>
+ <inp2:m_else/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="EventScheduleName" title="la_fld_Name"/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="EventScheduleType" title="la_fld_Type" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="event-schedule" field="Status" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="Event"/>
+ </inp2:m_if>
+
+ <inp2:m_RenderElement name="inp_edit_box" prefix="event-schedule" field="RunInterval"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="event-schedule" field="RunMode" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="LastRunOn"/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="LastRunStatus"/>
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="event-schedule" field="NextRunOn"/>
+ <inp2:m_RenderElement name="inp_label" prefix="event-schedule" field="RunTime"/>
+
+ <inp2:m_RenderElement name="inp_edit_checkboxes" prefix="event-schedule" field="SiteDomainLimitation"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/admin_templates/event_schedules/event_schedule_list.tpl
===================================================================
--- core/admin_templates/event_schedules/event_schedule_list.tpl (revision 0)
+++ core/admin_templates/event_schedules/event_schedule_list.tpl (revision 0)
@@ -0,0 +1,91 @@
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:event_schedules" prefix="event-schedule" title_preset="event_schedule_list" pagination="1"/>
+
+<!-- ToolBar -->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ std_edit_item('event-schedule', 'event_schedules/event_schedule_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewEventSchedule" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ function() {
+ std_precreate_item('event-schedule', 'event_schedules/event_schedule_edit');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('event-schedule')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'approve',
+ '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
+ function() {
+ submit_event('event-schedule', 'OnMassApprove');
+ }
+ )
+ );
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'decline',
+ '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
+ function() {
+ submit_event('event-schedule', 'OnMassDecline');
+ }
+ )
+ );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'process',
+ '<inp2:m_phrase label="la_ToolTip_Run" escape="1"/>',
+ function() {
+ submit_event('event-schedule', 'OnRunEventSchedules');
+ }
+ )
+ );
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'cancel',
+ '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
+ function() {
+ submit_event('event-schedule', 'OnMassCancel');
+ }
+ )
+ );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="event-schedule" grid="Default"/>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_RenderElement name="grid" PrefixSpecial="event-schedule" IdField="EventScheduleId" grid="Default"/>
+<script type="text/javascript">
+ Grids['event-schedule'].SetDependantToolbarButtons( new Array('edit','delete', 'approve', 'decline', 'process', 'cancel') );
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/admin_templates/img/icons/icon24_conf_agents.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: core/admin_templates/img/icons/icon24_conf_event_schedules.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: core\admin_templates\img\icons\icon24_conf_event_schedules.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14646)
+++ core/install/english.lang (working copy)
@@ -641,9 +641,9 @@
<PHRASE Label="la_hint_SystemToolsRefreshThemeFiles" Module="Core" Type="1">PHVsPg0KICA8bGk+U2NhbnMgZm9yIG5ld2x5IGFkZGVkIEZyb250LWVuZCBUaGVtZSB0ZW1wbGF0ZXMgYWNyb3NzIGFsbCA8c3Ryb25nPjxpPmVuYWJsZWQ8L2k+PC9zdHJvbmc+IHRoZW1lcy4gVGhpcyBhY3Rpb24gaXMgcGVyZm9ybWVkIGF1dG9tYXRpY2FsbHkgd2hlbiBhIG5ldyB0aGVtZSBpcyBhZGRlZCBvciBleGlzdGluZyB0aGVtZSBpcyBlbmFibGVkLjwvbGk+DQogIDxsaT5BZGRpdGlvbmFsbHksIGRlbGV0ZXMgYWxsIGNvbXByZXNzZWQgYW5kIGNhY2hlZCBKYXZhc2NyaXB0L0NTUyBmaWxlcyAoLmpzIC5jc3MpIGxvYWRlZCB1c2luZyA8c3Ryb25nPjxpPiZsdDtpbnAyOm1fQ29tcHJlc3MgLi4uLyZndDs8L2k+PC9zdHJvbmc+IHRhZy48L2xpPg0KICA8bGk+VGhpcyBmdW5jdGlvbiBpcyBhbHNvIGF2YWlsYWJsZSBhcyBhICJSZWZyZXNoIiBidXR0b24gaW4gdGhlIFRoZW1lcyBzZWN0aW9uIHRvb2xiYXIgaW4gQWRtaW4gQ29uc29sZS48L2xpPg0KICA8bGk+VGhpcyBvcHRpb24gc2hvdWxkIGJlIHVzZWQgaW4gY2FzZSB3aGVuICI0MDQgTm90IEZvdW5kIiBwYWdlIGlzIHNob3duIGluc3RlYWQgb2YgZXhwZWN0ZWQgbmV3bHkgYWRkZWQgcGFnZSBvciB0ZW1wbGF0ZS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetAdminConsoleSections" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHRoZSBjYWNoZSBvZiBBZG1pbiBDb25zb2xlIHNlY3Rpb25zIChsZWZ0IG1lbnUpLiBUaGUgZGVmaW5pdGlvbnMgb2Ygc2VjdGlvbnMgYXJlIHJlYWQgYW5kIGNvbGxlY3RlZCBmcm9tIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIHRoYXQgYWxyZWFkeSBiZWVuIHNjYW5uZWQgYW5kIGNhY2hlZCBieSB0aGUgc3lzdGVtLjwvbGk+DQogIDxsaT5Vc2UgdGhpcyByZXNldCBvcHRpb24gaWYgYSBuZXdseSBhZGRlZCBzZWN0aW9uIGRvZXNuJ3QgYXBwZWFyIGluIHRoZSBsZWZ0IEFkbWluIENvbnNvbGUgbWVudS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetAllKeys" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIDxzdHJvbmc+PGk+QWxsIERhdGE8L2k+PC9zdHJvbmc+IHN0b3JlZCBpbiB0aGUgTWVtb3J5IENhY2hlLCBpbmNsdWRpbmcgYnV0IG5vdCBsaW1pdGVkIHRvIFN5c3RlbSBEYXRhIGFuZCBEYXRhYmFzZSBJdGVtcy48L2xpPg0KICA8bGk+VXNlIHdpdGggY2F1dGlvbiBkdWUgdG8gcG9zc2liaWxpdHkgb2YgbG9uZyBleGVjdXRpb24gdGltZS48L2xpPg0KPC91bD4=</PHRASE>
- <PHRASE Label="la_hint_SystemToolsResetConfigsAndParsedData" Module="Core" Type="1">PHVsPg0KICA8bGk+U2NhbnMgPHN0cm9uZz48aT4iY29yZSI8L2k+PC9zdHJvbmc+IGFuZCA8c3Ryb25nPjxpPiJtb2R1bGVzIjwvaT48L3N0cm9uZz4gZm9sZGVycyB0byBjYWNoZSB0aGUgbG9jYXRpb24gb2YgYWxsIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzLiBUaGUgZXhlY3V0aW9uIHRpbWUgZGVwZW5kcyBvbiB0aGUgbnVtYmVyIG9mIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIGZvdW5kLjwvbGk+DQogIDxsaT5SZXNldHMgdmFyaW91cyBjYWNoZWQgc3lzdGVtIGRhdGEgc3VjaCBhcyBkZWZpbmVkIFBIUCBDbGFzc2VzIChtYXBwaW5nIGJldHdlZW4gdGhlIGNsYXNzIG5hbWUgYW5kIHBoeXNpY2FsIGZpbGVuYW1lIGFuZCBsb2NhdGlvbiBvZiB0aGUgY2xhc3MpLCBIb29rcywgQWdlbnRzLCBDYWNoZWQgQ29uZmlndXJhdGlvbiBWYXJpYWJsZXMsIFJlcGxhY2VtZW50IFRlbXBsYXRlcywgUmV3cml0ZSBMaXN0ZW5lcnMgYW5kIExvYWRlZCBNb2R1bGVzLiBEYXRhIGlzIHJlYWQgYW5kIGNvbGxlY3RlZCBmcm9tIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIHRoYXQgYWxyZWFkeSBiZWVuIHNjYW5uZWQgYW5kIGNhY2hlZCBieSB0aGUgc3lzdGVtLjwvbGk+DQogIDxsaT5EZWxldGVzIGNvbXBpbGVkIHNraW5zIGZvciBBZG1pbiBDb25zb2xlIChjc3MgZmlsZXMpLjwvbGk+DQo8L3VsPg==</PHRASE>
+ <PHRASE Label="la_hint_SystemToolsResetConfigsAndParsedData" Module="Core" Type="1">PHVsPg0KICA8bGk+U2NhbnMgPHN0cm9uZz48aT4iY29yZSI8L2k+PC9zdHJvbmc+IGFuZCA8c3Ryb25nPjxpPiJtb2R1bGVzIjwvaT48L3N0cm9uZz4gZm9sZGVycyB0byBjYWNoZSB0aGUgbG9jYXRpb24gb2YgYWxsIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzLiBUaGUgZXhlY3V0aW9uIHRpbWUgZGVwZW5kcyBvbiB0aGUgbnVtYmVyIG9mIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIGZvdW5kLjwvbGk+DQogIDxsaT5SZXNldHMgdmFyaW91cyBjYWNoZWQgc3lzdGVtIGRhdGEgc3VjaCBhcyBkZWZpbmVkIFBIUCBDbGFzc2VzIChtYXBwaW5nIGJldHdlZW4gdGhlIGNsYXNzIG5hbWUgYW5kIHBoeXNpY2FsIGZpbGVuYW1lIGFuZCBsb2NhdGlvbiBvZiB0aGUgY2xhc3MpLCBIb29rcywgRXZlbnQgU2NoZWR1bGVzLCBDYWNoZWQgQ29uZmlndXJhdGlvbiBWYXJpYWJsZXMsIFJlcGxhY2VtZW50IFRlbXBsYXRlcywgUmV3cml0ZSBMaXN0ZW5lcnMgYW5kIExvYWRlZCBNb2R1bGVzLiBEYXRhIGlzIHJlYWQgYW5kIGNvbGxlY3RlZCBmcm9tIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIHRoYXQgYWxyZWFkeSBiZWVuIHNjYW5uZWQgYW5kIGNhY2hlZCBieSB0aGUgc3lzdGVtLjwvbGk+DQogIDxsaT5EZWxldGVzIGNvbXBpbGVkIHNraW5zIGZvciBBZG1pbiBDb25zb2xlIChjc3MgZmlsZXMpLjwvbGk+DQo8L3VsPg==</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetModRewriteCache" Module="Core" Type="1">PHVsPg0KICA8bGk+RGVsZXRlcyB0aGUgbWFwcGluZyBiZXR3ZWVuIHRoZSBGcm9udC1lbmQgVVJMcyBhbmQgYWN0dWFsIFRoZW1lIFRlbXBsYXRlcy4gVGhpcyBtYXBwaW5nIGlzIHVwZGF0ZWQgYXV0b21hdGljYWxseSwgd2hlbiB0aGUgd2Vic2l0ZSBTdHJ1Y3R1cmUgb3IgU2VjdGlvbnMgYXJlIGNoYW5nZWQuPC9saT4NCiAgPGxpPlVzZSB0aGlzIG9wdGlvbiBvbmx5IGluIGNhc2UgaWYgTW9kUmV3cml0ZSBtb2RlIGlzIGVuYWJsZWQgYW5kIGRpc3BsYXllZCBwYWdlIGRpZmZlcnMgZnJvbSB0aGUgcGFnZSB0aGF0IGl0IHNob3VsZCBiZSwgd2hlbiBnaXZlbiBVUkwgaXMgdmlzaXRlZC48L2xpPg0KPC91bD4=</PHRASE>
- <PHRASE Label="la_hint_SystemToolsResetParsedCachedData" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHZhcmlvdXMgY2FjaGVkIHN5c3RlbSBkYXRhIHN1Y2ggYXMgZGVmaW5lZCBQSFAgQ2xhc3NlcyAobWFwcGluZyBiZXR3ZWVuIHRoZSBjbGFzcyBuYW1lIGFuZCBwaHlzaWNhbCBmaWxlbmFtZSBhbmQgbG9jYXRpb24gb2YgdGhlIGNsYXNzKSwgSG9va3MsIEFnZW50cywgQ2FjaGVkIENvbmZpZ3VyYXRpb24gVmFyaWFibGVzLCBSZXBsYWNlbWVudCBUZW1wbGF0ZXMsIFJld3JpdGUgTGlzdGVuZXJzIGFuZCBMb2FkZWQgTW9kdWxlcy4gRGF0YSBpcyByZWFkIGFuZCBjb2xsZWN0ZWQgZnJvbSA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnPC9pPjwvc3Ryb25nPiBmaWxlcyB0aGF0IGFscmVhZHkgYmVlbiBzY2FubmVkIGFuZCBjYWNoZWQgYnkgdGhlIHN5c3RlbS48L2xpPg0KPC91bD4=</PHRASE>
+ <PHRASE Label="la_hint_SystemToolsResetParsedCachedData" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHZhcmlvdXMgY2FjaGVkIHN5c3RlbSBkYXRhIHN1Y2ggYXMgZGVmaW5lZCBQSFAgQ2xhc3NlcyAobWFwcGluZyBiZXR3ZWVuIHRoZSBjbGFzcyBuYW1lIGFuZCBwaHlzaWNhbCBmaWxlbmFtZSBhbmQgbG9jYXRpb24gb2YgdGhlIGNsYXNzKSwgSG9va3MsIEV2ZW50IFNjaGVkdWxlcywgQ2FjaGVkIENvbmZpZ3VyYXRpb24gVmFyaWFibGVzLCBSZXBsYWNlbWVudCBUZW1wbGF0ZXMsIFJld3JpdGUgTGlzdGVuZXJzIGFuZCBMb2FkZWQgTW9kdWxlcy4gRGF0YSBpcyByZWFkIGFuZCBjb2xsZWN0ZWQgZnJvbSA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnPC9pPjwvc3Ryb25nPiBmaWxlcyB0aGF0IGFscmVhZHkgYmVlbiBzY2FubmVkIGFuZCBjYWNoZWQgYnkgdGhlIHN5c3RlbS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetSMSMenuCache" Module="Core" Type="1">PHVsPg0KICA8bGk+RGVsZXRlcyB0aGUgY2FjaGVkIHZlcnNpb24gb2YgRnJvbnQtZW5kIG1lbnUgKGRpc3BsYXllZCB2aWEgPHN0cm9uZz48aT4mbHQ7aW5wMjpzdF9DYWNoZWRNZW51IC4uLi8mZ3Q7PC9pPjwvc3Ryb25nPiB0YWcpLiBUaGlzIGNhY2hlIGlzIHVwZGF0ZWQgYXV0b21hdGljYWxseSwgd2hlbiB0aGUgd2Vic2l0ZSBzdHJ1Y3R1cmUgb3Igc2VjdGlvbnMgYXJlIGNoYW5nZWQuPC9saT4NCiAgPGxpPlVzZSB0aGlzIG9wdGlvbiBvbmx5IGluIGNhc2UgaWYgZGlzcGxheWVkIG1lbnUgb24gdGhlIEZyb250LWVuZCBkb2Vzbid0IG1hdGNoIHRoZSBtZW51IGRlZmluZWQgaW4gQWRtaW4gQ29uc29sZS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsShowDatabaseTableStructure" Module="Core" Type="1">PHVsPg0KICA8bGk+U2hvd3MgdGhlIHN0cnVjdHVyZSBvZiB0aGUgZGF0YWJhc2UgdGFibGUgbG9hZGluZyBpdCBieSB0aGUgVGFibGUgTmFtZSAodGFibGUgcHJlZml4IGlzIG9wdGlvbmFsKSBvciA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnIFByZWZpeDwvaT48L3N0cm9uZz4gYXNzb2NpYXRlZCB3aXRoIHRoaXMgdGFibGUuPC9saT4NCjwvdWw+</PHRASE>
<PHRASE Label="la_hint_SystemToolsSynchronizeDBRevisions" Module="Core" Type="1">PHVsPg0KPGxpPkFzIGEgcmVzdWx0LCBzY3JpcHQgd2lsbCBWYWxpZGF0ZSBjdXJyZW50IDxiPjx1PnByb2plY3RfdXBncmFkZXMuc3FsPC91PjwvYj4gZmlsZSBhbmQgb3V0bGluZSBhbnkgZXJyb3JzIG9yIGluY29uc2lzdGVuY2llcywgYW5kIGF1dG8tcG9wdWxhdGUgYWxsIG1pc3NpbmcgREIgUmV2aXNpb25zIGZyb20gdGhlIGZpbGUgaW50byBBcHBsaWVkREJSZXZpc2lvbnMuPC9saT4NCjxsaT48YiBzdHlsZT0iY29sb3I6cmVkIj5OT1RFOjwvYj4gRGV2ZWxvcGVycyBzaG91bGQgT05MWSBydW4gdGhpcyBiZWZvcmUgdGhleSBwZXJmb3JtIFJlcG9zaXRvcnkgVXBkYXRlcyBvbiB0aGVpIHdvcmtpbmcgY29weSE8L2xpPg0KPC91bD4=</PHRASE>
@@ -1181,7 +1181,7 @@
<PHRASE Label="la_Text_Valid" Module="Core" Type="1">VmFsaWQ=</PHRASE>
<PHRASE Label="la_Text_Version" Module="Core" Type="1">VmVyc2lvbg==</PHRASE>
<PHRASE Label="la_Text_View" Module="Core" Type="1">Vmlldw==</PHRASE>
- <PHRASE Label="la_title_AddingAgent" Module="Core" Type="1">QWRkaW5nIEFnZW50</PHRASE>
+ <PHRASE Label="la_title_AddingEventSchedule" Module="Core" Type="1">QWRkaW5nIEV2ZW50IFNjaGVkdWxl</PHRASE>
<PHRASE Label="la_title_AddingBanRule" Module="Core" Type="1">QWRkaW5nIEJhbiBSdWxl</PHRASE>
<PHRASE Label="la_title_AddingCountryState" Module="Core" Type="1">QWRkaW5nIENvdW50cnkvU3RhdGU=</PHRASE>
<PHRASE Label="la_title_addingCustom" Module="Core" Type="1">QWRkaW5nIEN1c3RvbSBGaWVsZA==</PHRASE>
@@ -1214,7 +1214,7 @@
<PHRASE Label="la_title_Administrators" Module="Core" Type="1">QWRtaW5pc3RyYXRvcnM=</PHRASE>
<PHRASE Label="la_title_Advanced" Module="Core" Type="1">QWR2YW5jZWQ=</PHRASE>
<PHRASE Label="la_title_AdvancedView" Module="Core" Type="1">U2hvd2luZyBhbGwgcmVnYXJkbGVzcyBvZiBTdHJ1Y3R1cmU=</PHRASE>
- <PHRASE Label="la_title_Agents" Module="Core" Type="1">QWdlbnRz</PHRASE>
+ <PHRASE Label="la_title_EventSchedules" Module="Core" Type="1">RXZlbnQgU2NoZWR1bGVz</PHRASE>
<PHRASE Label="la_title_BaseStyles" Module="Core" Type="1">QmFzZSBTdHlsZXM=</PHRASE>
<PHRASE Label="la_title_BlockStyles" Module="Core" Type="1">QmxvY2sgU3R5bGVz</PHRASE>
<PHRASE Label="la_title_BounceSettings" Module="Core" Type="1">Qm91bmNlIFBPUDMgU2VydmVyIFNldHRpbmdz</PHRASE>
@@ -1228,7 +1228,7 @@
<PHRASE Label="la_title_CSVImport" Module="Core" Type="1">Q1NWIEltcG9ydA==</PHRASE>
<PHRASE Label="la_title_Custom" Module="Core" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_title_CustomFields" Module="Core" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
- <PHRASE Label="la_title_EditingAgent" Module="Core" Type="1">RWRpdGluZyBBZ2VudA==</PHRASE>
+ <PHRASE Label="la_title_EditingEventSchedule" Module="Core" Type="1">RWRpdGluZyBFdmVudCBTY2hlZHVsZQ==</PHRASE>
<PHRASE Label="la_title_EditingBanRule" Module="Core" Type="1">RWRpdGluZyBCYW4gUnVsZQ==</PHRASE>
<PHRASE Label="la_title_EditingChangeLog" Module="Core" Type="1">RWRpdGluZyBDaGFuZ2VzIExvZw==</PHRASE>
<PHRASE Label="la_title_EditingCountryState" Module="Core" Type="1">RWRpdGluZyBDb3VudHJ5L1N0YXRl</PHRASE>
@@ -1284,7 +1284,7 @@
<PHRASE Label="la_title_MailingLists" Module="Core" Type="1">TWFpbGluZ3M=</PHRASE>
<PHRASE Label="la_title_Messages" Module="Core" Type="1">TWVzc2FnZXM=</PHRASE>
<PHRASE Label="la_title_Module_Status" Module="Core" Type="1">TW9kdWxlcw==</PHRASE>
- <PHRASE Label="la_title_NewAgent" Module="Core" Type="1">TmV3IEFnZW50</PHRASE>
+ <PHRASE Label="la_title_NewEventSchedule" Module="Core" Type="1">TmV3IEV2ZW50IFNjaGVkdWxl</PHRASE>
<PHRASE Label="la_title_NewEmailEvent" Module="Core" Type="1">TmV3IEVtYWlsIEV2ZW50</PHRASE>
<PHRASE Label="la_title_NewFile" Module="Core" Type="1">TmV3IEZpbGU=</PHRASE>
<PHRASE Label="la_title_NewReply" Module="Core" Type="1">TmV3IFJlcGx5</PHRASE>
@@ -1375,7 +1375,7 @@
<PHRASE Label="la_ToolTip_ImportLanguage" Module="Core" Type="1">SW1wb3J0IExhbmd1YWdl</PHRASE>
<PHRASE Label="la_ToolTip_MoveDown" Module="Core" Type="1">TW92ZSBEb3du</PHRASE>
<PHRASE Label="la_ToolTip_MoveUp" Module="Core" Type="1">TW92ZSBVcA==</PHRASE>
- <PHRASE Label="la_ToolTip_NewAgent" Module="Core" Type="1">TmV3IEFnZW50</PHRASE>
+ <PHRASE Label="la_ToolTip_NewEventSchedule" Module="Core" Type="1">TmV3IEV2ZW50IFNjaGVkdWxl</PHRASE>
<PHRASE Label="la_ToolTip_NewBaseStyle" Module="Core" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_ToolTip_NewBlockStyle" Module="Core" Type="1">TmV3IEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_ToolTip_NewCountryState" Module="Core" Type="1">TmV3IENvdW50cnkvU3RhdGU=</PHRASE>
@@ -1454,7 +1454,7 @@
<PHRASE Label="la_Unicode" Module="Core" Type="1">VW5pY29kZQ==</PHRASE>
<PHRASE Label="la_updating_config" Module="Core" Type="1">VXBkYXRpbmcgQ29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_Upload" Module="Core" Type="1">VXBsb2Fk</PHRASE>
- <PHRASE Label="la_UseCronForRegularEvent" Module="Core" Type="1">VXNlIENyb24gdG8gcnVuIEFnZW50cw==</PHRASE>
+ <PHRASE Label="la_UseCronForRegularEvent" Module="Core" Type="1">VXNlIENyb24gdG8gcnVuIFNjaGVkdWxlZCBFdmVudHM=</PHRASE>
<PHRASE Label="la_users_admin_group" Module="Core" Type="1">QXNzaWduIGFkbWluaXN0cmF0b3JzIHRvIGdyb3Vw</PHRASE>
<PHRASE Label="la_users_allow_new" Module="Core" Type="1">QWxsb3cgbmV3IHVzZXIgcmVnaXN0cmF0aW9u</PHRASE>
<PHRASE Label="la_users_assign_all_to" Module="Core" Type="1">QXNzaWduIEFsbCBVc2VycyBUbyBHcm91cA==</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14646)
+++ core/install/install_data.sql (working copy)
@@ -552,10 +552,10 @@
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:service.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:service.edit', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.delete', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.edit', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.add', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:event_schedules.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:event_schedules.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:event_schedules.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:event_schedules.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.edit', 11, 1, 1, 0);
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14646)
+++ core/install/install_schema.sql (working copy)
@@ -660,10 +660,10 @@
KEY QueryCrc (QueryCrc)
);
-CREATE TABLE Agents (
- AgentId int(11) NOT NULL auto_increment,
- AgentName varchar(255) NOT NULL default '',
- AgentType tinyint(3) unsigned NOT NULL default '1',
+CREATE TABLE EventSchedules (
+ EventScheduleId int(11) NOT NULL auto_increment,
+ EventScheduleName varchar(255) NOT NULL default '',
+ EventScheduleType tinyint(3) unsigned NOT NULL default '1',
Status tinyint(3) unsigned NOT NULL default '1',
Event varchar(255) NOT NULL default '',
RunInterval int(10) unsigned NOT NULL default '0',
@@ -673,11 +673,11 @@
NextRunOn int(11) default NULL,
RunTime int(10) unsigned NOT NULL default '0',
SiteDomainLimitation varchar(255) NOT NULL,
- PRIMARY KEY (AgentId),
+ PRIMARY KEY (EventScheduleId),
KEY Status (Status),
KEY RunInterval (RunInterval),
KEY RunMode (RunMode),
- KEY AgentType (AgentType),
+ KEY EventScheduleType (EventScheduleType),
KEY LastRunOn (LastRunOn),
KEY LastRunStatus (LastRunStatus),
KEY RunTime (RunTime),
Index: core/install/remove_schema.sql
===================================================================
--- core/install/remove_schema.sql (revision 14646)
+++ core/install/remove_schema.sql (working copy)
@@ -33,7 +33,7 @@
DROP TABLE SessionLogs;
DROP TABLE StatisticsCapture;
DROP TABLE SlowSqlCapture;
-DROP TABLE Agents;
+DROP TABLE EventSchedules;
DROP TABLE SpellingDictionary;
DROP TABLE Thesaurus;
DROP TABLE LocalesList;
Index: core/install/steps_db.xml
===================================================================
--- core/install/steps_db.xml (revision 14646)
+++ core/install/steps_db.xml (working copy)
@@ -87,12 +87,12 @@
<p><b>Additional Recommendations:</b></p>
<p><b><i>1. Use Cron</i></b> (<a href="http://en.wikipedia.org/wiki/Cron" target="_blank">UNIX/BSD/Linux</a>) or <b>Task Scheduler</b> (<a href="http://en.wikipedia.org/wiki/Task_Scheduler" target="_blank">Windows</a>) to run Regular Events in your In-Portal.<br />
- It's highly recommended to setup your cron to run <b>every minute</b> so all system events that are enabled will run in the background based on their schedule. These events can be managed in Admin Console via <b><i>Configuration -> Website -> Agents</i></b> section.
+ It's highly recommended to setup your cron to run <b>every minute</b> so all system events that are enabled will run in the background based on their schedule. These events can be managed in Admin Console via <b><i>Configuration -> Website -> Event Schedules</i></b> section.
<p>In-Portal <b>cron</b> file is located in <b>/tools/cron.php</b> folder and can be setup using hosting Control Panel or <a href="http://en.wikipedia.org/wiki/Cron" target="_blank">manually</a>. In Plesk or CPanel interfaces use dialog to add a new cron job and specify the following (use correct paths)<br />
<b>/absolute/path/to/bin/php -f /absolute/path/to/in-portal/tools/cron.php</b></p>
- <p><b><i>2. Adjust Agents</i></b><br />
- As was explained in the previous recommendation there is a <b><i>Configuration -> Website -> Agents</i></b> section where you can control Events triggered by the system. These events do their job to cleanup the data, old image files, check the data integrity, RSS feeds and other processes required for your In-Portal to run efficiently. We do recommend to review and enable/disable these events based on your website needs.</p>
+ <p><b><i>2. Adjust Event Schedules</i></b><br />
+ As was explained in the previous recommendation there is a <b><i>Configuration -> Website -> Event Schedules</i></b> section where you can control Events triggered by the system. These events do their job to cleanup the data, old image files, check the data integrity, RSS feeds and other processes required for your In-Portal to run efficiently. We do recommend to review and enable/disable these events based on your website needs.</p>
<p><b><i>3. Set Mail Server</i></b><br />
It's recommended to review and adjust your mail server settings once your In-Portal is up and running. This can be done in Admin Console under <b><i>Configuration -> Website -> Advanced</i></b> section.</p>
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14646)
+++ core/install/upgrades.sql (working copy)
@@ -2142,3 +2142,74 @@
ALTER TABLE Skins ADD DisplaySiteNameInHeader TINYINT(1) NOT NULL DEFAULT '1';
DELETE FROM PersistantSessionData WHERE VariableName LIKE 'formsubs_Sort%' AND VariableValue = 'FormFieldId';
+
+CREATE TABLE EventSchedules (
+ EventScheduleId int(11) NOT NULL auto_increment,
+ EventScheduleName varchar(255) NOT NULL default '',
+ EventScheduleType tinyint(3) unsigned NOT NULL default '1',
+ Status tinyint(3) unsigned NOT NULL default '1',
+ Event varchar(255) NOT NULL default '',
+ RunInterval int(10) unsigned NOT NULL default '0',
+ RunMode tinyint(3) unsigned NOT NULL default '2',
+ LastRunOn int(10) unsigned default NULL,
+ LastRunStatus tinyint(3) unsigned NOT NULL default '1',
+ NextRunOn int(11) default NULL,
+ RunTime int(10) unsigned NOT NULL default '0',
+ SiteDomainLimitation varchar(255) NOT NULL,
+ PRIMARY KEY (EventScheduleId),
+ KEY Status (Status),
+ KEY RunInterval (RunInterval),
+ KEY RunMode (RunMode),
+ KEY EventScheduleType (EventScheduleType),
+ KEY LastRunOn (LastRunOn),
+ KEY LastRunStatus (LastRunStatus),
+ KEY RunTime (RunTime),
+ KEY NextRunOn (NextRunOn),
+ KEY SiteDomainLimitation (SiteDomainLimitation)
+);
+
+DROP TABLE Agents;
+
+UPDATE Permissions SET Permission = REPLACE(Permission, 'in-portal:agents', 'in-portal:event_schedules');
+
+UPDATE Phrase
+ SET l<%PRIMARY_LANGUAGE%>_Translation = 'Use Cron to run Scheduled Events'
+ WHERE PhraseKey = 'LA_USECRONFORREGULAREVENT' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Use Cron to run Agents';
+
+UPDATE Phrase
+ SET Phrase = 'la_title_EventSchedules',
+ PhraseKey = 'LA_TITLE_EVENTSCHEDULES',
+ l<%PRIMARY_LANGUAGE%>_Translation = 'Event Schedules'
+ WHERE Phrase = 'la_title_Agents';
+
+UPDATE Phrase
+ SET Phrase = 'la_title_AddingEventSchedule',
+ PhraseKey = 'LA_TITLE_ADDINGEVENTSCHEDULE',
+ l<%PRIMARY_LANGUAGE%>_Translation = 'Adding Event Schedule'
+ WHERE Phrase = 'la_title_AddingAgent';
+
+UPDATE Phrase
+ SET Phrase = 'la_title_EditingEventSchedule',
+ PhraseKey = 'LA_TITLE_EDITINGEVENTSCHEDULE',
+ l<%PRIMARY_LANGUAGE%>_Translation = 'Editing Event Schedule'
+ WHERE Phrase = 'la_title_EditingAgent';
+
+UPDATE Phrase
+ SET Phrase = 'la_title_NewEventSchedule',
+ PhraseKey = 'LA_TITLE_NEWEVENTSCHEDULE',
+ l<%PRIMARY_LANGUAGE%>_Translation = 'New Event Schedule'
+ WHERE Phrase = 'la_title_NewAgent';
+
+UPDATE Phrase
+ SET Phrase = 'la_ToolTip_NewEventSchedule',
+ PhraseKey = 'LA_TOOLTIP_NEWEVENTSCHEDULE',
+ l<%PRIMARY_LANGUAGE%>_Translation = 'New Event Schedule'
+ WHERE Phrase = 'la_ToolTip_NewAgent';
+
+UPDATE Phrase
+ SET l<%PRIMARY_LANGUAGE%>_Translation = '<ul>\r\n <li>Scans <strong><i>"core"</i></strong> and <strong><i>"modules"</i></strong> folders to cache the location of all <strong><i>Unit Config</i></strong> files. The execution time depends on the number of <strong><i>Unit Config</i></strong> files found.</li>\r\n <li>Resets various cached system data such as defined PHP Classes (mapping between the class name and physical filename and location of the class), Hooks, Event Schedules, Cached Configuration Variables, Replacement Templates, Rewrite Listeners and Loaded Modules. Data is read and collected from <strong><i>Unit Config</i></strong> files that already been scanned and cached by the system.</li>\r\n <li>Deletes compiled skins for Admin Console (css files).</li>\r\n</ul>'
+ WHERE Phrase = 'la_hint_SystemToolsResetConfigsAndParsedData';
+
+UPDATE Phrase
+ SET l<%PRIMARY_LANGUAGE%>_Translation = '<ul>\r\n <li>Resets various cached system data such as defined PHP Classes (mapping between the class name and physical filename and location of the class), Hooks, Event Schedules, Cached Configuration Variables, Replacement Templates, Rewrite Listeners and Loaded Modules. Data is read and collected from <strong><i>Unit Config</i></strong> files that already been scanned and cached by the system.</li>\r\n</ul>'
+ WHERE Phrase = 'la_hint_SystemToolsResetParsedCachedData';
\ No newline at end of file
Index: core/kernel/application.php
===================================================================
--- core/kernel/application.php (revision 14646)
+++ core/kernel/application.php (working copy)
@@ -697,7 +697,7 @@
$this->registerClass('kEventManager', KERNEL_PATH . '/event_manager.php', 'EventManager', 'kiCacheable');
$this->registerClass('kHookManager', KERNEL_PATH . '/managers/hook_manager.php', null, 'kiCacheable');
- $this->registerClass('kAgentManager', KERNEL_PATH . '/managers/agent_manager.php', null, 'kiCacheable');
+ $this->registerClass('kEventScheduleManager', KERNEL_PATH . '/managers/event_schedule_manager.php', null, 'kiCacheable');
$this->registerClass('kRequestManager', KERNEL_PATH . '/managers/request_manager.php');
$this->registerClass('kUrlManager', KERNEL_PATH . '/managers/url_manager.php');
$this->registerClass('kCacheManager', KERNEL_PATH . '/managers/cache_manager.php', null, 'kiCacheable');
@@ -931,7 +931,7 @@
}
$this->EventManager->ProcessRequest();
- $this->EventManager->runAgents(reBEFORE);
+ $this->EventManager->runEventSchedules(reBEFORE);
$this->RequestProcessed = true;
}
@@ -1043,7 +1043,7 @@
}
if ($debug_mode) {
- $this->EventManager->runAgents(reAFTER);
+ $this->EventManager->runEventSchedules(reAFTER);
$this->Session->SaveData();
if (kUtil::constOn('DBG_CACHE')) {
@@ -1077,7 +1077,7 @@
flush();
if (!$debug_mode) {
- $this->EventManager->runAgents(reAFTER);
+ $this->EventManager->runEventSchedules(reAFTER);
$this->Session->SaveData();
}
@@ -1743,18 +1743,18 @@
}
/**
- * Add new agent
+ * Add new event schedule
*
* @param string $short_name name to be used to store last maintenace run info
* @param string $event_name
* @param int $run_interval run interval in seconds
- * @param int $type before or after agent
+ * @param int $type before or after event schedule
* @param int $status
* @access public
*/
- public function registerAgent($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
+ public function registerEventSchedule($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
{
- $this->EventManager->registerAgent($short_name, $event_name, $run_interval, $type, $status);
+ $this->EventManager->registerEventSchedule($short_name, $event_name, $run_interval, $type, $status);
}
/**
Index: core/kernel/constants.php
===================================================================
--- core/kernel/constants.php (revision 14646)
+++ core/kernel/constants.php (working copy)
@@ -63,9 +63,9 @@
define('EDITING_MODE_CONTENT', 2); // content blocks + phrase editing
define('EDITING_MODE_DESIGN', 3); // all other blocks
- class Agent {
- const AGENT_TYPE_USER = 1;
- const AGENT_TYPE_SYSTEM = 2;
+ class EventSchedule {
+ const EVENT_SCHEDULE_TYPE_USER = 1;
+ const EVENT_SCHEDULE_TYPE_SYSTEM = 2;
const LAST_RUN_SUCCEDED = 1;
const LAST_RUN_FAILED = 0;
@@ -162,10 +162,10 @@
const USER = 0;
const ADMIN = 1;
}
-
+
// selectors
define('STYLE_BASE', 1);
- define('STYLE_BLOCK', 2);
+ define('STYLE_BLOCK', 2);
class Language {
const SYNCHRONIZE_TO_OTHERS = 1;
Index: core/kernel/event_manager.php
===================================================================
--- core/kernel/event_manager.php (revision 14646)
+++ core/kernel/event_manager.php (working copy)
@@ -25,12 +25,12 @@
protected $Hooks = null;
/**
- * Instance of agent manager
+ * Instance of event schedule manager
*
- * @var kAgentManager
+ * @var kEventScheduleManager
* @access protected
*/
- protected $Agents = null;
+ protected $EventSchedules = null;
/**
* Instance of request manager
@@ -66,7 +66,7 @@
parent::__construct();
$this->Hooks =& $this->Application->makeClass('kHookManager');
- $this->Agents =& $this->Application->makeClass('kAgentManager');
+ $this->EventSchedules =& $this->Application->makeClass('kEventScheduleManager');
$this->Request =& $this->Application->makeClass('kRequestManager');
}
@@ -79,7 +79,7 @@
public function setFromCache(&$data)
{
$this->Hooks->setFromCache($data);
- $this->Agents->setFromCache($data);
+ $this->EventSchedules->setFromCache($data);
$this->buildEvents = $data['EventManager.buildEvents'];
}
@@ -94,7 +94,7 @@
{
return array_merge(
$this->Hooks->getToCache(),
- $this->Agents->getToCache(),
+ $this->EventSchedules->getToCache(),
Array (
'EventManager.buildEvents' => $this->buildEvents,
)
@@ -102,54 +102,54 @@
}
/**
- * Returns information about registered agents
+ * Returns information about registered event schedules
*
* @param bool $from_cache
* @return Array
* @access public
*/
- public function getAgents($from_cache = false)
+ public function getEventSchedules($from_cache = false)
{
- return $this->Agents->getAll($from_cache);
+ return $this->EventSchedules->getAll($from_cache);
}
/**
- * Add new agent
+ * Add new event schedule
*
* @param string $short_name name to be used to store last maintenace run info
* @param string $event_name
* @param int $run_interval run interval in seconds
- * @param int $type before or after agent
+ * @param int $type before or after event schedule
* @param int $status
* @access public
*/
- public function registerAgent($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
+ public function registerEventSchedule($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
{
- $this->Agents->add($short_name, $event_name, $run_interval, $type, $status);
+ $this->EventSchedules->add($short_name, $event_name, $run_interval, $type, $status);
}
/**
- * Run registred agents with specified event type
+ * Run registred event schedules with specified event type
*
* @param int $event_type
* @param bool $from_cron
* @access public
*/
- public function runAgents($event_type = reBEFORE, $from_cron = false)
+ public function runEventSchedules($event_type = reBEFORE, $from_cron = false)
{
- $this->Agents->runAgents($event_type, $from_cron);
+ $this->EventSchedules->runEventSchedules($event_type, $from_cron);
}
/**
- * Runs agent based on given data
+ * Runs event schedule based on given data
*
- * @param Array $agent_data
+ * @param Array $event_schedule_data
* @return bool
* @access public
*/
- public function runAgent($agent_data)
+ public function runEventSchedule($event_schedule_data)
{
- return $this->Agents->runAgent($agent_data);
+ return $this->EventSchedules->runEventSchedule($event_schedule_data);
}
/**
Index: core/kernel/managers/agent_manager.php
===================================================================
--- core/kernel/managers/agent_manager.php (revision 14646)
+++ core/kernel/managers/agent_manager.php (working copy)
@@ -1,248 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Portal
-* @copyright Copyright (C) 1997 - 2010 Intechnic. All rights reserved.
-* @license GNU/GPL
-* In-Portal is Open Source software.
-* This means that this software may have been modified pursuant
-* the GNU General Public License, and as distributed it includes
-* or is derivative of works licensed under the GNU General Public License
-* or other free or open source software licenses.
-* See http://www.in-portal.org/license for copyright notices and details.
-*/
-
-defined('FULL_PATH') or die('restricted access!');
-
-class kAgentManager extends kBase implements kiCacheable {
-
- /**
- * Events, that should be run before parser initialization
- *
- * @var Array
- * @access protected
- */
- protected $beforeAgents = Array ();
-
- /**
- * Events, that should be run after parser initialization
- *
- * @var Array
- * @access protected
- */
- protected $afterAgents = Array ();
-
- /**
- * Sets data from cache to object
- *
- * @param Array $data
- * @access public
- */
- public function setFromCache(&$data)
- {
- $this->beforeAgents = $data['EventManager.beforeRegularEvents'];
- $this->afterAgents = $data['EventManager.afterRegularEvents'];
- }
-
- /**
- * Gets object data for caching
- *
- * @return Array
- * @access public
- */
- public function getToCache()
- {
- return Array (
- 'EventManager.beforeRegularEvents' => $this->beforeAgents,
- 'EventManager.afterRegularEvents' => $this->afterAgents,
- );
- }
-
- /**
- * Returns information about registered agents
- *
- * @param bool $from_cache
- * @return Array
- * @access public
- */
- public function getAll($from_cache = false)
- {
- static $agents = null;
-
- if ($from_cache) {
- return Array (
- reBEFORE => $this->beforeAgents,
- reAFTER => $this->afterAgents,
- );
- }
-
- if ( !isset($agents) ) {
- $sql = 'SELECT *
- FROM ' . $this->Application->getUnitOption('agent', 'TableName') . '
- WHERE Status = ' . STATUS_ACTIVE . ' AND LastRunStatus <> ' . Agent::LAST_RUN_RUNNING;
- $all_agents = $this->Conn->Query($sql);
-
- $agents = Array (
- reBEFORE => Array (),
- reAFTER => Array (),
- );
-
- foreach ($all_agents as $agent_data) {
- $agents[ $agent_data['RunMode'] ][ $agent_data['AgentName'] ] = Array (
- 'EventName' => $agent_data['Event'],
- 'RunInterval' => (int)$agent_data['RunInterval'],
- 'LastRunOn' => (int)$agent_data['LastRunOn'],
- 'NextRunOn' => (int)$agent_data['NextRunOn'],
- 'Status' => $agent_data['Status'],
- 'SiteDomainLimitation' => $agent_data['SiteDomainLimitation'],
- );
- }
- }
-
- return $agents;
- }
-
- /**
- * Returns agents by type
- *
- * @param int $type
- * @return Array
- * @access protected
- */
- protected function &getAgentsByType($type)
- {
- if ($type == reBEFORE) {
- return $this->beforeAgents;
- }
-
- return $this->afterAgents;
- }
-
- /**
- * Add new agent
- *
- * @param string $short_name name to be used to store last maintenace run info
- * @param string $event_name
- * @param int $run_interval run interval in seconds
- * @param int $type before or after agent
- * @access public
- */
- public function add($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
- {
- $agents =& $this->getAgentsByType($type);
-
- $agents[$short_name] = Array (
- 'EventName' => $event_name, 'RunInterval' => $run_interval, 'Status' => $status
- );
- }
-
- /**
- * Run registred agents with specified event type
- *
- * @param int $event_type
- * @param bool $from_cron
- * @access public
- */
- public function runAgents($event_type = reBEFORE, $from_cron = false)
- {
- if ( defined('IS_INSTALL') ) {
- return ;
- }
-
- if ( !$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent') ) {
- // if RegularEvents are set to run from cron
- return ;
- }
-
- $agents = $this->getAll();
- $events_source = $agents[$event_type];
-
- $user_id = $this->Application->RecallVar('user_id');
- $this->Application->StoreVar('user_id', USER_ROOT, true); // to prevent permission checking inside events, true for optional storage
-
- $site_helper =& $this->Application->recallObject('SiteHelper');
- /* @var $site_helper SiteHelper */
-
- $site_domain_id = $site_helper->getDomainByName('DomainName', DOMAIN);
-
- foreach ($events_source as $short_name => $event_data) {
- if ( $site_domain_id && $event_data['SiteDomainLimitation'] != '' ) {
- $site_domains = explode('|', substr($event_data['SiteDomainLimitation'], 1, -1));
-
- if ( !in_array($site_domain_id, $site_domains) ) {
- // agent isn't allowed on this site domain
- continue;
- }
- }
-
- $next_run = $event_data['NextRunOn'];
-
- if ($next_run && ($next_run > adodb_mktime())) {
- continue;
- }
-
- $event_data['AgentName'] = $short_name;
- $this->runAgent($event_data);
- }
-
- $this->Application->StoreVar('user_id', $user_id, $user_id == USER_GUEST);
- }
-
- /**
- * Runs agent based on given data
- *
- * @param Array $agent_data
- * @return bool
- * @access public
- */
- public function runAgent($agent_data)
- {
- $event = new kEvent($agent_data['EventName']);
-
- if ( !$this->Application->prefixRegistred($event->Prefix) ) {
- // don't process agents, left from disabled modules
- return false;
- }
-
- $start_time = adodb_mktime();
-
- // remember, when agent execution started
- $fields_hash = Array (
- 'LastRunOn' => $start_time,
- 'LastRunStatus' => Agent::LAST_RUN_RUNNING,
- 'NextRunOn' => $start_time + $agent_data['RunInterval'],
- );
-
- $this->Conn->doUpdate(
- $fields_hash,
- $this->Application->getUnitOption('agent', 'TableName'),
- 'AgentName = ' . $this->Conn->qstr($agent_data['AgentName'])
- );
-
- $event->redirect = false;
- $this->Application->HandleEvent($event);
-
- $now = adodb_mktime();
- $next_run = $agent_data['RunInterval'] ? $start_time + $agent_data['RunInterval'] : $now;
-
- while ($next_run < $now) {
- // in case event execution took longer, then RunInterval (don't use <=, because RunInterval can be 0)
- $next_run += $agent_data['RunInterval'];
- }
-
- // remember, when agent execution ended
- $fields_hash = Array (
- 'NextRunOn' => $next_run,
- 'RunTime' => round(($now - $start_time) / 60),
- 'LastRunStatus' => $event->status == kEvent::erSUCCESS ? Agent::LAST_RUN_SUCCEDED : Agent::LAST_RUN_FAILED,
- );
-
- $this->Conn->doUpdate(
- $fields_hash,
- $this->Application->getUnitOption('agent', 'TableName'),
- 'AgentName = ' . $this->Conn->qstr($agent_data['AgentName'])
- );
-
- return true;
- }
-}
\ No newline at end of file
Index: core/kernel/managers/cache_manager.php
===================================================================
--- core/kernel/managers/cache_manager.php (revision 14646)
+++ core/kernel/managers/cache_manager.php (working copy)
@@ -50,7 +50,7 @@
protected $temporaryCache = Array (
'registerAggregateTag' => Array (),
- 'registerAgent' => Array (),
+ 'registerEventSchedule' => Array (),
'registerHook' => Array (),
'registerBuildEvent' => Array (),
'registerAggregateTag' => Array (),
@@ -204,7 +204,7 @@
$this->DeleteUnitCache();
}
-
+
/**
* Loads data, that was cached during unit config parsing
*
Index: core/kernel/managers/event_schedule_manager.php
===================================================================
--- core/kernel/managers/event_schedule_manager.php (revision 0)
+++ core/kernel/managers/event_schedule_manager.php (revision 0)
@@ -0,0 +1,248 @@
+<?php
+/**
+* @version $Id: event_schedule_manager.php 14605 2011-10-03 09:15:55Z alex $
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2010 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class kEventScheduleManager extends kBase implements kiCacheable {
+
+ /**
+ * Events, that should be run before parser initialization
+ *
+ * @var Array
+ * @access protected
+ */
+ protected $beforeEventSchedules = Array ();
+
+ /**
+ * Events, that should be run after parser initialization
+ *
+ * @var Array
+ * @access protected
+ */
+ protected $afterEventSchedules = Array ();
+
+ /**
+ * Sets data from cache to object
+ *
+ * @param Array $data
+ * @access public
+ */
+ public function setFromCache(&$data)
+ {
+ $this->beforeEventSchedules = $data['EventManager.beforeRegularEvents'];
+ $this->afterEventSchedules = $data['EventManager.afterRegularEvents'];
+ }
+
+ /**
+ * Gets object data for caching
+ *
+ * @return Array
+ * @access public
+ */
+ public function getToCache()
+ {
+ return Array (
+ 'EventManager.beforeRegularEvents' => $this->beforeEventSchedules,
+ 'EventManager.afterRegularEvents' => $this->afterEventSchedules,
+ );
+ }
+
+ /**
+ * Returns information about registered event_schedules
+ *
+ * @param bool $from_cache
+ * @return Array
+ * @access public
+ */
+ public function getAll($from_cache = false)
+ {
+ static $event_schedules = null;
+
+ if ($from_cache) {
+ return Array (
+ reBEFORE => $this->beforeEventSchedules,
+ reAFTER => $this->afterEventSchedules,
+ );
+ }
+
+ if ( !isset($event_schedules) ) {
+ $sql = 'SELECT *
+ FROM ' . $this->Application->getUnitOption('event-schedule', 'TableName') . '
+ WHERE Status = ' . STATUS_ACTIVE . ' AND LastRunStatus <> ' . EventSchedule::LAST_RUN_RUNNING;
+ $all_event_schedules = $this->Conn->Query($sql);
+
+ $event_schedules = Array (
+ reBEFORE => Array (),
+ reAFTER => Array (),
+ );
+
+ foreach ($all_event_schedules as $event_schedule_data) {
+ $event_schedules[ $event_schedule_data['RunMode'] ][ $event_schedule_data['EventScheduleName'] ] = Array (
+ 'EventName' => $event_schedule_data['Event'],
+ 'RunInterval' => (int)$event_schedule_data['RunInterval'],
+ 'LastRunOn' => (int)$event_schedule_data['LastRunOn'],
+ 'NextRunOn' => (int)$event_schedule_data['NextRunOn'],
+ 'Status' => $event_schedule_data['Status'],
+ 'SiteDomainLimitation' => $event_schedule_data['SiteDomainLimitation'],
+ );
+ }
+ }
+
+ return $event_schedules;
+ }
+
+ /**
+ * Returns event_schedules by type
+ *
+ * @param int $type
+ * @return Array
+ * @access protected
+ */
+ protected function &getEventSchedulesByType($type)
+ {
+ if ($type == reBEFORE) {
+ return $this->beforeEventSchedules;
+ }
+
+ return $this->afterEventSchedules;
+ }
+
+ /**
+ * Add new event_schedule
+ *
+ * @param string $short_name name to be used to store last maintenace run info
+ * @param string $event_name
+ * @param int $run_interval run interval in seconds
+ * @param int $type before or after event_schedule
+ * @access public
+ */
+ public function add($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
+ {
+ $event_schedules =& $this->getEventSchedulesByType($type);
+
+ $event_schedules[$short_name] = Array (
+ 'EventName' => $event_name, 'RunInterval' => $run_interval, 'Status' => $status
+ );
+ }
+
+ /**
+ * Run registred event_schedules with specified event type
+ *
+ * @param int $event_type
+ * @param bool $from_cron
+ * @access public
+ */
+ public function runEventSchedules($event_type = reBEFORE, $from_cron = false)
+ {
+ if ( defined('IS_INSTALL') ) {
+ return ;
+ }
+
+ if ( !$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent') ) {
+ // if RegularEvents are set to run from cron
+ return ;
+ }
+
+ $event_schedules = $this->getAll();
+ $events_source = $event_schedules[$event_type];
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $this->Application->StoreVar('user_id', USER_ROOT, true); // to prevent permission checking inside events, true for optional storage
+
+ $site_helper =& $this->Application->recallObject('SiteHelper');
+ /* @var $site_helper SiteHelper */
+
+ $site_domain_id = $site_helper->getDomainByName('DomainName', DOMAIN);
+
+ foreach ($events_source as $short_name => $event_data) {
+ if ( $site_domain_id && $event_data['SiteDomainLimitation'] != '' ) {
+ $site_domains = explode('|', substr($event_data['SiteDomainLimitation'], 1, -1));
+
+ if ( !in_array($site_domain_id, $site_domains) ) {
+ // event_schedule isn't allowed on this site domain
+ continue;
+ }
+ }
+
+ $next_run = $event_data['NextRunOn'];
+
+ if ($next_run && ($next_run > adodb_mktime())) {
+ continue;
+ }
+
+ $event_data['EventScheduleName'] = $short_name;
+ $this->runEventSchedule($event_data);
+ }
+
+ $this->Application->StoreVar('user_id', $user_id, $user_id == USER_GUEST);
+ }
+
+ /**
+ * Runs event_schedule based on given data
+ *
+ * @param Array $event_schedule_data
+ * @return bool
+ * @access public
+ */
+ public function runEventSchedule($event_schedule_data)
+ {
+ $event = new kEvent($event_schedule_data['EventName']);
+
+ if ( !$this->Application->prefixRegistred($event->Prefix) ) {
+ // don't process event_schedules, left from disabled modules
+ return false;
+ }
+
+ $start_time = adodb_mktime();
+
+ // remember, when event_schedule execution started
+ $fields_hash = Array (
+ 'LastRunOn' => $start_time,
+ 'LastRunStatus' => EventSchedule::LAST_RUN_RUNNING,
+ 'NextRunOn' => $start_time + $event_schedule_data['RunInterval'],
+ );
+
+ $this->Conn->doUpdate(
+ $fields_hash,
+ $this->Application->getUnitOption('event-schedule', 'TableName'),
+ 'EventScheduleName = ' . $this->Conn->qstr($event_schedule_data['EventScheduleName'])
+ );
+
+ $event->redirect = false;
+ $this->Application->HandleEvent($event);
+
+ $now = adodb_mktime();
+ $next_run = $event_schedule_data['RunInterval'] ? $start_time + $event_schedule_data['RunInterval'] : $now;
+
+ while ($next_run < $now) {
+ // in case event execution took longer, then RunInterval (don't use <=, because RunInterval can be 0)
+ $next_run += $event_schedule_data['RunInterval'];
+ }
+
+ // remember, when event_schedule execution ended
+ $fields_hash = Array (
+ 'NextRunOn' => $next_run,
+ 'RunTime' => round(($now - $start_time) / 60),
+ 'LastRunStatus' => $event->status == kEvent::erSUCCESS ? EventSchedule::LAST_RUN_SUCCEDED : EventSchedule::LAST_RUN_FAILED,
+ );
+
+ $this->Conn->doUpdate(
+ $fields_hash,
+ $this->Application->getUnitOption('event-schedule', 'TableName'),
+ 'EventScheduleName = ' . $this->Conn->qstr($event_schedule_data['EventScheduleName'])
+ );
+
+ return true;
+ }
+}
\ No newline at end of file
Index: core/kernel/session/session.php
===================================================================
--- core/kernel/session/session.php (revision 14646)
+++ core/kernel/session/session.php (working copy)
@@ -289,7 +289,7 @@
return ;
}
-// $this->DeleteExpired(); // called from u:OnDeleteExpiredSessions agent now
+// $this->DeleteExpired(); // called from u:OnDeleteExpiredSessions event schedule now
if ($this->expired || ($this->CachedSID && !$this->_fromGet && !$this->SessionSet)) {
$this->RemoveSessionCookie();
@@ -480,7 +480,7 @@
if (!$get_sid) {
$http_query =& $this->Application->recallObject('HTTPQuery');
/* @var $http_query kHTTPQuery */
-
+
$get_sid = getArrayValue($http_query->Get, $this->GETName);
}
Index: core/kernel/utility/unit_config_reader.php
===================================================================
--- core/kernel/utility/unit_config_reader.php (revision 14646)
+++ core/kernel/utility/unit_config_reader.php (working copy)
@@ -415,7 +415,7 @@
function parseConfig($prefix)
{
$this->parseClasses($prefix);
- $this->parseAgents($prefix);
+ $this->parseEventSchedules($prefix);
$this->parseHooks($prefix);
$this->parseAggregatedTags($prefix);
}
@@ -453,7 +453,7 @@
}
}
- protected function parseAgents($prefix)
+ protected function parseEventSchedules($prefix)
{
$config =& $this->configData[$prefix];
@@ -465,7 +465,7 @@
foreach ($regular_events as $short_name => $regular_event_info) {
$event_status = array_key_exists('Status', $regular_event_info) ? $regular_event_info['Status'] : STATUS_ACTIVE;
- $this->Application->delayUnitProcessing('registerAgent', Array ( $short_name, $config['Prefix'] . ':' . $regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'], $event_status ));
+ $this->Application->delayUnitProcessing('registerEventSchedule', Array ( $short_name, $config['Prefix'] . ':' . $regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'], $event_status ));
}
}
Index: core/units/admin/admin_events_handler.php
===================================================================
--- core/units/admin/admin_events_handler.php (revision 14646)
+++ core/units/admin/admin_events_handler.php (working copy)
@@ -1406,7 +1406,7 @@
}
/**
- * [AGENT]
+ * [EVENT SCHEDULE]
* 1. Delete all Debug files from system/.restricted folder (format debug_@977827436@.txt)
* 2. Run MySQL OPTIMIZE SQL one by one on all In-Portal tables (found by prefix).
*
Index: core/units/agents/agent_eh.php
===================================================================
--- core/units/agents/agent_eh.php (revision 14646)
+++ core/units/agents/agent_eh.php (working copy)
@@ -1,181 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Portal
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license GNU/GPL
-* In-Portal is Open Source software.
-* This means that this software may have been modified pursuant
-* the GNU General Public License, and as distributed it includes
-* or is derivative of works licensed under the GNU General Public License
-* or other free or open source software licenses.
-* See http://www.in-portal.org/license for copyright notices and details.
-*/
-
- defined('FULL_PATH') or die('restricted access!');
-
- class AgentEventHandler extends kDBEventHandler {
-
- /**
- * Allows to override standart permission mapping
- *
- */
- function mapPermissions()
- {
- parent::mapPermissions();
-
- $permissions = Array (
- 'OnMassCancel' => Array ('self' => 'add|edit'),
- 'OnRunAgents' => Array ('self' => 'add|edit'),
- );
-
- $this->permMapping = array_merge($this->permMapping, $permissions);
- }
-
- /**
- * [HOOK] Refreshes agents list in database based on cached data from unit configs
- *
- * @param kEvent $event
- */
- function OnRefreshAgents(&$event)
- {
- $regular_events = $this->Application->EventManager->getAgents(true);
-
- $object =& $event->getObject( Array ('skip_autoload' => true) );
- /* @var $object kDBItem */
-
- $processed_ids = Array ();
- $agents = $this->Conn->Query($object->GetSelectSQL(), 'AgentName');
-
- foreach ($regular_events as $run_mode => $events) {
-
- foreach ($events as $agent_name => $agent_params) {
- if ( !isset($agents[$agent_name]) ) {
- $fields_hash = Array (
- 'Event' => $agent_params['EventName'],
- 'AgentName' => $agent_name,
- 'AgentType' => Agent::AGENT_TYPE_SYSTEM,
- 'Status' => array_key_exists('Status', $agent_params) ? $agent_params['Status'] : STATUS_ACTIVE,
- 'RunInterval' => $agent_params['RunInterval'],
- 'RunMode' => $run_mode,
- );
-
- $object->Clear();
- $object->SetDBFieldsFromHash($fields_hash);
- $object->Create();
- }
- else {
- $object->LoadFromHash( $agents[$agent_name] );
- }
-
- $processed_ids[] = $object->GetID();
- }
-
- }
-
- // delete all non-processed agents (ones, that were deleted from unit configs)
- $sql = 'SELECT ' . $object->IDField . '
- FROM ' . $object->TableName . '
- WHERE (AgentType = ' . Agent::AGENT_TYPE_SYSTEM . ') AND (' . $object->IDField . ' NOT IN (' . implode(',', $processed_ids) . '))';
- $delete_ids = $this->Conn->GetCol($sql);
-
- if ($delete_ids) {
- $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
- /* @var $temp_handler kTempTablesHandler */
-
- $temp_handler->DeleteItems($event->Prefix, $event->Special, $delete_ids);
- }
-
- $this->Application->removeObject($event->getPrefixSpecial());
- }
-
- /**
- * Don't allow to delete other user's messages
- *
- * @param kEvent $event
- * @param string $type
- * @return void
- * @access protected
- */
- protected function customProcessing(&$event, $type)
- {
- if ($event->Name == 'OnMassDelete' && $type == 'before') {
- if ($this->Application->isDebugMode()) {
- // allow to delete system agents in debug mode
- return ;
- }
-
- $ids = $event->getEventParam('ids');
- if ($ids) {
- $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
- $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
-
- $sql = 'SELECT ' . $id_field . '
- FROM ' . $table_name . '
- WHERE ' . $id_field . ' IN (' . implode(',', $ids) . ') AND AgentType <> ' . Agent::AGENT_TYPE_SYSTEM;
- $allowed_ids = $this->Conn->GetCol($sql);
-
- $event->setEventParam('ids', $allowed_ids);
- }
- }
- }
-
- /**
- * Cancels agents, that are currenty running
- *
- * @param kEvent $event
- */
- function OnMassCancel(&$event)
- {
- $ids = $this->StoreSelectedIDs($event);
-
- if ($ids) {
- $object =& $event->getObject( Array ('skip_autoload' => true) );
- /* @var $object kDBItem */
-
- foreach ($ids as $id) {
- $object->Load($id);
-
- if ($object->GetDBField('LastRunStatus') == Agent::LAST_RUN_RUNNING) {
- // only changes status, doesn't affect currency running agents
- $object->SetDBField('LastRunStatus', Agent::LAST_RUN_FAILED);
- $object->Update();
- }
- }
- }
-
- $this->clearSelectedIDs($event);
- }
-
- /**
- * Runs selected agents
- *
- * @param kEvent $event
- */
- function OnRunAgents(&$event)
- {
- $ids = $this->StoreSelectedIDs($event);
-
- if ($ids) {
- $object =& $event->getObject( Array ('skip_autoload' => true) );
- /* @var $object kDBItem */
-
- $where_clause = Array (
- $object->TableName . '.' . $object->IDField . ' IN (' . implode(',', $ids) . ')',
- $object->TableName . '.Status = ' . STATUS_ACTIVE,
- $object->TableName . '.LastRunStatus <> ' . Agent::LAST_RUN_RUNNING,
- );
-
- $sql = $object->GetSelectSQL() . '
- WHERE (' . implode(') AND (', $where_clause) . ')';
- $agents = $this->Conn->Query($sql);
-
- foreach ($agents as $agent_data) {
- $agent_data['EventName'] = $agent_data['Event'];
- $this->Application->EventManager->runAgent($agent_data);
- }
- }
-
- $this->clearSelectedIDs($event);
- }
- }
\ No newline at end of file
Index: core/units/agents/agents_config.php
===================================================================
--- core/units/agents/agents_config.php (revision 14646)
+++ core/units/agents/agents_config.php (working copy)
@@ -1,165 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Portal
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license GNU/GPL
-* In-Portal is Open Source software.
-* This means that this software may have been modified pursuant
-* the GNU General Public License, and as distributed it includes
-* or is derivative of works licensed under the GNU General Public License
-* or other free or open source software licenses.
-* See http://www.in-portal.org/license for copyright notices and details.
-*/
-
-defined('FULL_PATH') or die('restricted access!');
-
- $config = Array (
- 'Prefix' => 'agent',
- 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
- 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
- 'EventHandlerClass' => Array ('class' => 'AgentEventHandler', 'file' => 'agent_eh.php', 'build_event' => 'OnBuild'),
- 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
-
- 'AutoLoad' => true,
-
- 'QueryString' => Array (
- 1 => 'id',
- 2 => 'Page',
- 3 => 'PerPage',
- 4 => 'event',
- 5 => 'mode',
- ),
-
- 'Hooks' => Array (
- Array (
- 'Mode' => hAFTER,
- 'Conditional' => false,
- 'HookToPrefix' => 'adm',
- 'HookToSpecial' => '*',
- 'HookToEvent' => Array ('OnAfterCacheRebuild'),
- 'DoPrefix' => '',
- 'DoSpecial' => '*',
- 'DoEvent' => 'OnRefreshAgents',
- ),
- ),
-
- 'IDField' => 'AgentId',
-
- 'TableName' => TABLE_PREFIX . 'Agents',
-
- 'TitleField' => 'AgentName',
-
- 'StatusField' => Array ('Status'),
-
- 'TitlePresets' => Array (
- 'default' => Array (
- 'new_status_labels' => Array ('agent' => '!la_title_AddingAgent!'),
- 'edit_status_labels' => Array ('agent' => '!la_title_EditingAgent!'),
- 'new_titlefield' => Array ('agent' => '!la_title_NewAgent!'),
- ),
-
- 'agent_list' => Array (
- 'prefixes' => Array ('agent_List'), 'format' => "!la_title_Agents!",
- 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'process', 'cancel', 'view', 'dbl-click'),
- ),
-
- 'agent_edit' => Array ('prefixes' => Array ('agent'), 'format' => "#agent_status# '#agent_titlefield#'",
- 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
- ),
- ),
-
- 'PermSection' => Array('main' => 'in-portal:agents'),
-
- 'Sections' => Array (
- 'in-portal:agents' => Array (
- 'parent' => 'in-portal:website_setting_folder',
- 'icon' => 'conf_agents',
- 'label' => 'la_title_Agents',
- 'url' => Array('t' => 'agents/agent_list', 'pass' => 'm'),
- 'permissions' => Array('view', 'add', 'edit', 'delete'),
- 'priority' => 6,
- 'type' => stTREE,
- ),
- ),
-
- 'ListSQLs' => Array (
- '' => ' SELECT %1$s.* %2$s FROM %1$s',
- ),
-
- 'ListSortings' => Array (
- '' => Array (
- 'Sorting' => Array ('AgentName' => 'asc'),
- )
- ),
-
- 'Fields' => Array (
- 'AgentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
-
- 'AgentName' => Array (
- 'type' => 'string', 'max_len' => 255,
- 'unique' => Array (),
- 'required' => 1, 'not_null' => 1, 'default' => ''
- ),
-
- 'AgentType' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_User', 2 => 'la_opt_System'), 'use_phrases' => 1,
- 'required' => 1, 'not_null' => 1, 'default' => 1
- ),
- 'Status' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1,
- 'required' => 1, 'not_null' => 1, 'default' => 1
- ),
- 'Event' => Array (
- 'type' => 'string', 'max_len' => 255,
- 'formatter' => 'kFormatter', 'regexp' => '/^[a-z-]*[.]{0,1}[a-z-]*:On[A-Za-z0-9]*$/',
- 'required' => 1, 'not_null' => 1, 'default' => ''
- ),
- 'RunInterval' => Array ('type' => 'int', 'required' => 1, 'not_null' => 1, 'default' => 0),
- 'RunMode' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options' => Array (reBEFORE => 'la_opt_Before', reAFTER => 'la_opt_After'), 'use_phrases' => 1,
- 'required' => 1, 'not_null' => 1, 'default' => 2
- ),
- 'LastRunOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
-
- 'LastRunStatus' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Success', 0 => 'la_opt_Failed', 2 => 'la_opt_Running'), 'use_phrases' => 1,
- 'not_null' => 1, 'default' => 1
- ),
-
- 'NextRunOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
- 'RunTime' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'SiteDomainLimitation' => Array (
- 'type' => 'string', 'max_len' => 255,
- 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'SiteDomains ORDER BY DomainName ASC', 'option_key_field' => 'DomainId', 'option_title_field' => 'DomainName', 'multiple' => 1,
- 'not_null' => 1, 'default' => ''
- ),
- ),
-
- 'Grids' => Array (
- 'Default' => Array (
- 'Icons' => Array (
- 'default' => 'icon16_item.png',
- 0 => 'icon16_disabled.png',
- ),
- 'Fields' => Array (
- 'AgentId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
- 'AgentName' => Array ('title' => 'column:la_fld_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
- 'AgentType' => Array ('title' => 'column:la_fld_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ),
- 'Event' => Array ('filter_block' => 'grid_like_filter', 'width' => 280, ),
- 'RunInterval' => Array ('filter_block' => 'grid_range_filter', 'width' => 100, ),
- 'RunMode' => Array ('filter_block' => 'grid_options_filter', 'width' => 85, ),
- 'LastRunOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
- 'RunTime' => Array ('filter_block' => 'grid_float_range_filter', 'width' => 145, ),
- 'LastRunStatus' => Array ('filter_block' => 'grid_options_filter', 'width' => 120, ),
- 'NextRunOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
- 'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 65, ),
- 'SiteDomainLimitation' => Array ('data_block' => 'grid_picker_td', 'filter_block' => 'grid_multioptions_filter', 'separator' => ', ', 'width' => 145),
- ),
- ),
- ),
- );
\ No newline at end of file
Index: core/units/event_schedules/event_schedule_eh.php
===================================================================
--- core/units/event_schedules/event_schedule_eh.php (revision 0)
+++ core/units/event_schedules/event_schedule_eh.php (revision 0)
@@ -0,0 +1,181 @@
+<?php
+/**
+* @version $Id: event_schedule_eh.php 14628 2011-10-04 09:36:30Z alex $
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+ defined('FULL_PATH') or die('restricted access!');
+
+ class EventScheduleEventHandler extends kDBEventHandler {
+
+ /**
+ * Allows to override standart permission mapping
+ *
+ */
+ function mapPermissions()
+ {
+ parent::mapPermissions();
+
+ $permissions = Array (
+ 'OnMassCancel' => Array ('self' => 'add|edit'),
+ 'OnRunEventSchedules' => Array ('self' => 'add|edit'),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * [HOOK] Refreshes event-schedules list in database based on cached data from unit configs
+ *
+ * @param kEvent $event
+ */
+ function OnRefreshEventSchedules(&$event)
+ {
+ $regular_events = $this->Application->EventManager->getEventSchedules(true);
+
+ $object =& $event->getObject( Array ('skip_autoload' => true) );
+ /* @var $object kDBItem */
+
+ $processed_ids = Array ();
+ $event_schedules = $this->Conn->Query($object->GetSelectSQL(), 'EventScheduleName');
+
+ foreach ($regular_events as $run_mode => $events) {
+
+ foreach ($events as $event_schedule_name => $event_schedule_params) {
+ if ( !isset($event_schedules[$event_schedule_name]) ) {
+ $fields_hash = Array (
+ 'Event' => $event_schedule_params['EventName'],
+ 'EventScheduleName' => $event_schedule_name,
+ 'EventScheduleType' => EventSchedule::EVENT_SCHEDULE_TYPE_SYSTEM,
+ 'Status' => array_key_exists('Status', $event_schedule_params) ? $event_schedule_params['Status'] : STATUS_ACTIVE,
+ 'RunInterval' => $event_schedule_params['RunInterval'],
+ 'RunMode' => $run_mode,
+ );
+
+ $object->Clear();
+ $object->SetDBFieldsFromHash($fields_hash);
+ $object->Create();
+ }
+ else {
+ $object->LoadFromHash( $event_schedules[$event_schedule_name] );
+ }
+
+ $processed_ids[] = $object->GetID();
+ }
+
+ }
+
+ // delete all non-processed event-schedules (ones, that were deleted from unit configs)
+ $sql = 'SELECT ' . $object->IDField . '
+ FROM ' . $object->TableName . '
+ WHERE (EventScheduleType = ' . EventSchedule::EVENT_SCHEDULE_TYPE_SYSTEM . ') AND (' . $object->IDField . ' NOT IN (' . implode(',', $processed_ids) . '))';
+ $delete_ids = $this->Conn->GetCol($sql);
+
+ if ($delete_ids) {
+ $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
+ /* @var $temp_handler kTempTablesHandler */
+
+ $temp_handler->DeleteItems($event->Prefix, $event->Special, $delete_ids);
+ }
+
+ $this->Application->removeObject($event->getPrefixSpecial());
+ }
+
+ /**
+ * Don't allow to delete other user's messages
+ *
+ * @param kEvent $event
+ * @param string $type
+ * @return void
+ * @access protected
+ */
+ protected function customProcessing(&$event, $type)
+ {
+ if ($event->Name == 'OnMassDelete' && $type == 'before') {
+ if ($this->Application->isDebugMode()) {
+ // allow to delete system event-schedules in debug mode
+ return ;
+ }
+
+ $ids = $event->getEventParam('ids');
+ if ($ids) {
+ $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
+ $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
+
+ $sql = 'SELECT ' . $id_field . '
+ FROM ' . $table_name . '
+ WHERE ' . $id_field . ' IN (' . implode(',', $ids) . ') AND EventScheduleType <> ' . EventSchedule::EVENT_SCHEDULE_TYPE_SYSTEM;
+ $allowed_ids = $this->Conn->GetCol($sql);
+
+ $event->setEventParam('ids', $allowed_ids);
+ }
+ }
+ }
+
+ /**
+ * Cancels event-schedules, that are currenty running
+ *
+ * @param kEvent $event
+ */
+ function OnMassCancel(&$event)
+ {
+ $ids = $this->StoreSelectedIDs($event);
+
+ if ($ids) {
+ $object =& $event->getObject( Array ('skip_autoload' => true) );
+ /* @var $object kDBItem */
+
+ foreach ($ids as $id) {
+ $object->Load($id);
+
+ if ($object->GetDBField('LastRunStatus') == EventSchedule::LAST_RUN_RUNNING) {
+ // only changes status, doesn't affect currency running event-schedules
+ $object->SetDBField('LastRunStatus', EventSchedule::LAST_RUN_FAILED);
+ $object->Update();
+ }
+ }
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+
+ /**
+ * Runs selected event-schedules
+ *
+ * @param kEvent $event
+ */
+ function OnRunEventSchedules(&$event)
+ {
+ $ids = $this->StoreSelectedIDs($event);
+
+ if ($ids) {
+ $object =& $event->getObject( Array ('skip_autoload' => true) );
+ /* @var $object kDBItem */
+
+ $where_clause = Array (
+ $object->TableName . '.' . $object->IDField . ' IN (' . implode(',', $ids) . ')',
+ $object->TableName . '.Status = ' . STATUS_ACTIVE,
+ $object->TableName . '.LastRunStatus <> ' . EventSchedule::LAST_RUN_RUNNING,
+ );
+
+ $sql = $object->GetSelectSQL() . '
+ WHERE (' . implode(') AND (', $where_clause) . ')';
+ $event_schedules = $this->Conn->Query($sql);
+
+ foreach ($event_schedules as $event_schedule_data) {
+ $event_schedule_data['EventName'] = $event_schedule_data['Event'];
+ $this->Application->EventManager->runEventSchedule($event_schedule_data);
+ }
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+ }
\ No newline at end of file
Index: core/units/event_schedules/event_schedules_config.php
===================================================================
--- core/units/event_schedules/event_schedules_config.php (revision 0)
+++ core/units/event_schedules/event_schedules_config.php (revision 0)
@@ -0,0 +1,165 @@
+<?php
+/**
+* @version $Id: event_schedules_config.php 14605 2011-10-03 09:15:55Z alex $
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+ $config = Array (
+ 'Prefix' => 'event-schedule',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'EventScheduleEventHandler', 'file' => 'event_schedule_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'PerPage',
+ 4 => 'event',
+ 5 => 'mode',
+ ),
+
+ 'Hooks' => Array (
+ Array (
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'adm',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array ('OnAfterCacheRebuild'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnRefreshEventSchedules',
+ ),
+ ),
+
+ 'IDField' => 'EventScheduleId',
+
+ 'TableName' => TABLE_PREFIX . 'EventSchedules',
+
+ 'TitleField' => 'EventScheduleName',
+
+ 'StatusField' => Array ('Status'),
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('event-schedule' => '!la_title_AddingEventSchedule!'),
+ 'edit_status_labels' => Array ('event-schedule' => '!la_title_EditingEventSchedule!'),
+ 'new_titlefield' => Array ('event-schedule' => '!la_title_NewEventSchedule!'),
+ ),
+
+ 'event_schedule_list' => Array (
+ 'prefixes' => Array ('event-schedule_List'), 'format' => "!la_title_EventSchedules!",
+ 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'process', 'cancel', 'view', 'dbl-click'),
+ ),
+
+ 'event_schedule_edit' => Array ('prefixes' => Array ('event-schedule'), 'format' => "#event-schedule_status# '#event-schedule_titlefield#'",
+ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:event_schedules'),
+
+ 'Sections' => Array (
+ 'in-portal:event_schedules' => Array (
+ 'parent' => 'in-portal:website_setting_folder',
+ 'icon' => 'conf_event_schedules',
+ 'label' => 'la_title_EventSchedules',
+ 'url' => Array('t' => 'event_schedules/event_schedule_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('EventScheduleName' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'EventScheduleId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+
+ 'EventScheduleName' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'unique' => Array (),
+ 'required' => 1, 'not_null' => 1, 'default' => ''
+ ),
+
+ 'EventScheduleType' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_User', 2 => 'la_opt_System'), 'use_phrases' => 1,
+ 'required' => 1, 'not_null' => 1, 'default' => 1
+ ),
+ 'Status' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1,
+ 'required' => 1, 'not_null' => 1, 'default' => 1
+ ),
+ 'Event' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'formatter' => 'kFormatter', 'regexp' => '/^[a-z-]*[.]{0,1}[a-z-]*:On[A-Za-z0-9]*$/',
+ 'required' => 1, 'not_null' => 1, 'default' => ''
+ ),
+ 'RunInterval' => Array ('type' => 'int', 'required' => 1, 'not_null' => 1, 'default' => 0),
+ 'RunMode' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (reBEFORE => 'la_opt_Before', reAFTER => 'la_opt_After'), 'use_phrases' => 1,
+ 'required' => 1, 'not_null' => 1, 'default' => 2
+ ),
+ 'LastRunOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
+
+ 'LastRunStatus' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Success', 0 => 'la_opt_Failed', 2 => 'la_opt_Running'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 1
+ ),
+
+ 'NextRunOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'RunTime' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'SiteDomainLimitation' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'SiteDomains ORDER BY DomainName ASC', 'option_key_field' => 'DomainId', 'option_title_field' => 'DomainName', 'multiple' => 1,
+ 'not_null' => 1, 'default' => ''
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ ),
+ 'Fields' => Array (
+ 'EventScheduleId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
+ 'EventScheduleName' => Array ('title' => 'column:la_fld_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'EventScheduleType' => Array ('title' => 'column:la_fld_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ),
+ 'Event' => Array ('filter_block' => 'grid_like_filter', 'width' => 280, ),
+ 'RunInterval' => Array ('filter_block' => 'grid_range_filter', 'width' => 100, ),
+ 'RunMode' => Array ('filter_block' => 'grid_options_filter', 'width' => 85, ),
+ 'LastRunOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'RunTime' => Array ('filter_block' => 'grid_float_range_filter', 'width' => 145, ),
+ 'LastRunStatus' => Array ('filter_block' => 'grid_options_filter', 'width' => 120, ),
+ 'NextRunOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 65, ),
+ 'SiteDomainLimitation' => Array ('data_block' => 'grid_picker_td', 'filter_block' => 'grid_multioptions_filter', 'separator' => ', ', 'width' => 145),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: core/units/images/image_event_handler.php
===================================================================
--- core/units/images/image_event_handler.php (revision 14646)
+++ core/units/images/image_event_handler.php (working copy)
@@ -366,7 +366,7 @@
}
/**
- * [AGENT] Remove unused images from "/system/images" and "/system/images/pending" folders
+ * [EVENT SCHEDULE] Remove unused images from "/system/images" and "/system/images/pending" folders
*
* @param kEvent $event
*/
@@ -457,7 +457,7 @@
}
/**
- * [AGENT] Remove all images from "/system/images/resized" and "/system/images/pending/resized" folders
+ * [EVENT SCHEDULE] Remove all images from "/system/images/resized" and "/system/images/pending/resized" folders
*
* @param kEvent $event
*/
Index: core/units/users/users_event_handler.php
===================================================================
--- core/units/users/users_event_handler.php (revision 14646)
+++ core/units/users/users_event_handler.php (working copy)
@@ -225,7 +225,7 @@
}
/**
- * [AGENT] Deletes expired sessions
+ * [EVENT SCHEDULE] Deletes expired sessions
*
* @param kEvent $event
*/
Index: tools/cron.php
===================================================================
--- tools/cron.php (revision 14646)
+++ tools/cron.php (working copy)
@@ -36,8 +36,8 @@
$application->Init();
// events from request are not processed, only predefined regular events
- $application->EventManager->runAgents(reBEFORE, true);
- $application->EventManager->runAgents(reAFTER, true);
+ $application->EventManager->runEventSchedules(reBEFORE, true);
+ $application->EventManager->runEventSchedules(reAFTER, true);
$application->Done();
rename_agents_to_scheduled_tasks_core_v2.patch [^] (70,076 bytes) 2011-12-16 09:00
[Show Content]
Index: admin/system_presets/simple/agents_agent.php
===================================================================
--- admin/system_presets/simple/agents_agent.php (revision 14858)
+++ admin/system_presets/simple/agents_agent.php (working copy)
@@ -4,26 +4,26 @@
// section removal
$remove_sections = Array (
- 'in-portal:agents',
+ 'in-portal:scheduled_tasks',
);
// sections shown with debug on
$debug_only_sections = Array (
-// 'in-portal:agents',
+// 'in-portal:scheduled_tasks',
);
// toolbar buttons
$remove_buttons = Array (
-// list of agents
-// 'agent_list' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'process', 'cancel', 'view', 'dbl-click'),
+// list of scheduled tasks
+// 'scheduled_task_list' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'process', 'cancel', 'view', 'dbl-click'),
-// edit agent
-// 'agent_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+// edit scheduled task
+// 'scheduled_task_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
);
// fields to hide
$hidden_fields = Array (
- /* 'AgentId', 'AgentName', 'AgentType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
+ /* 'ScheduledTaskId', 'Name', 'Type', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
'LastRunStatus', 'NextRunOn', 'RunTime', */
);
@@ -33,7 +33,7 @@
// fields to make required
$required_fields = Array (
- /* 'AgentId', 'AgentName', 'AgentType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
+ /* 'ScheduledTaskId', 'Name', 'Type', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
'LastRunStatus', 'NextRunOn', 'RunTime', */
);
@@ -47,5 +47,5 @@
// hide columns in grids
$hide_columns = Array (
// currently not in user
-// 'Default' => Array ( 'AgentId', 'AgentName', 'AgentType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn', 'LastRunStatus', 'NextRunOn', ),
+// 'Default' => Array ( 'ScheduledTaskId', 'Name', 'Type', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn', 'LastRunStatus', 'NextRunOn', ),
);
\ No newline at end of file
Index: core/admin_templates/agents/agent_edit.tpl
===================================================================
--- core/admin_templates/agents/agent_edit.tpl (revision 14858)
+++ core/admin_templates/agents/agent_edit.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="750" height="600"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_edit"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:scheduled_tasks" prefix="scheduled-task" title_preset="scheduled_task_edit"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -11,27 +11,27 @@
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
- submit_event('agent', '<inp2:agent_SaveEvent/>');
+ submit_event('scheduled-task', '<inp2:scheduled-task_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- cancel_edit('agent', 'OnCancelEdit','<inp2:agent_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ cancel_edit('scheduled-task', 'OnCancelEdit','<inp2:scheduled-task_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
- reset_form('agent', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ reset_form('scheduled-task', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
- go_to_id('agent', '<inp2:agent_PrevId/>');
+ go_to_id('scheduled-task', '<inp2:scheduled-task_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
- go_to_id('agent', '<inp2:agent_NextId/>');
+ go_to_id('scheduled-task', '<inp2:scheduled-task_NextId/>');
}
) );
@@ -39,15 +39,15 @@
a_toolbar.Render();
- <inp2:m_if check="agent_IsSingle" >
+ <inp2:m_if check="scheduled-task_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
- <inp2:m_if check="agent_IsLast" >
+ <inp2:m_if check="scheduled-task_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
- <inp2:m_if check="agent_IsFirst" >
+ <inp2:m_if check="scheduled-task_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
@@ -57,38 +57,38 @@
</tbody>
</table>
-<inp2:agent_SaveWarning name="grid_save_warning"/>
-<inp2:agent_ErrorWarning name="form_error_warning"/>
+<inp2:scheduled-task_SaveWarning name="grid_save_warning"/>
+<inp2:scheduled-task_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
- <inp2:m_RenderElement name="inp_id_label" prefix="agent" field="AgentId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_id_label" prefix="scheduled-task" field="ScheduledTaskId" title="la_fld_Id"/>
- <inp2:m_if check="agent_Field" name="AgentType" equals_to="1" db="db">
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="AgentName" title="la_fld_Name"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentType" title="la_fld_Type" has_empty="1"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="agent" field="Status" has_empty="1"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="Event"/>
+ <inp2:m_if check="scheduled-task_Field" name="Type" equals_to="1" db="db">
+ <inp2:m_RenderElement name="inp_edit_box" prefix="scheduled-task" field="Name"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="Type" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="scheduled-task" field="Status" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="scheduled-task" field="Event"/>
<inp2:m_else/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentName" title="la_fld_Name"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="AgentType" title="la_fld_Type" has_empty="1"/>
- <inp2:m_RenderElement name="inp_edit_radio" prefix="agent" field="Status" has_empty="1"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="Event"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="Name"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="Type" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="scheduled-task" field="Status" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="Event"/>
</inp2:m_if>
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="RunInterval"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="agent" field="RunMode" has_empty="1"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="LastRunOn"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="LastRunStatus"/>
- <inp2:m_RenderElement name="inp_edit_date_time" prefix="agent" field="NextRunOn"/>
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="RunTime"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="agent" field="Timeout" style="width: 50px"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="scheduled-task" field="RunInterval"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="scheduled-task" field="RunMode" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="LastRunOn"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="LastRunStatus"/>
+ <inp2:m_RenderElement name="inp_edit_date_time" prefix="scheduled-task" field="NextRunOn"/>
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="RunTime"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="scheduled-task" field="Timeout" style="width: 50px"/>
- <inp2:m_if check="agent_Field" name="LastTimeoutOn" db="db">
- <inp2:m_RenderElement name="inp_label" prefix="agent" field="LastTimeoutOn"/>
+ <inp2:m_if check="scheduled-task_Field" name="LastTimeoutOn" db="db">
+ <inp2:m_RenderElement name="inp_label" prefix="scheduled-task" field="LastTimeoutOn"/>
</inp2:m_if>
- <inp2:m_RenderElement name="inp_edit_checkboxes" prefix="agent" field="SiteDomainLimitation"/>
+ <inp2:m_RenderElement name="inp_edit_checkboxes" prefix="scheduled-task" field="SiteDomainLimitation"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
Index: core/admin_templates/agents/agent_list.tpl
===================================================================
--- core/admin_templates/agents/agent_list.tpl (revision 14858)
+++ core/admin_templates/agents/agent_list.tpl (working copy)
@@ -1,5 +1,5 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:agents" prefix="agent" title_preset="agent_list" pagination="1"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:scheduled_tasks" prefix="scheduled-task" title_preset="scheduled_task_list" pagination="1"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -10,19 +10,19 @@
//do not rename - this function is used in default grid for double click!
function edit()
{
- std_edit_item('agent', 'agents/agent_edit');
+ std_edit_item('scheduled-task', 'agents/agent_edit');
}
var a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewAgent" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewScheduledTask" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
- std_precreate_item('agent', 'agents/agent_edit');
+ std_precreate_item('scheduled-task', 'agents/agent_edit');
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
- std_delete_items('agent')
+ std_delete_items('scheduled-task')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
@@ -32,7 +32,7 @@
'approve',
'<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
function() {
- submit_event('agent', 'OnMassApprove');
+ submit_event('scheduled-task', 'OnMassApprove');
}
)
);
@@ -42,7 +42,7 @@
'decline',
'<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
function() {
- submit_event('agent', 'OnMassDecline');
+ submit_event('scheduled-task', 'OnMassDecline');
}
)
);
@@ -54,7 +54,7 @@
'process',
'<inp2:m_phrase label="la_ToolTip_Run" escape="1"/>',
function() {
- submit_event('agent', 'OnRunAgents');
+ submit_event('scheduled-task', 'OnRun');
}
)
);
@@ -64,7 +64,7 @@
'cancel',
'<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
function() {
- submit_event('agent', 'OnMassCancel');
+ submit_event('scheduled-task', 'OnMassCancel');
}
)
);
@@ -79,13 +79,13 @@
a_toolbar.Render();
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="agent" grid="Default"/>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="scheduled-task" grid="Default"/>
</tr>
</tbody>
</table>
-<inp2:m_RenderElement name="grid" PrefixSpecial="agent" IdField="AgentId" grid="Default"/>
+<inp2:m_RenderElement name="grid" PrefixSpecial="scheduled-task" IdField="ScheduledTaskId" grid="Default"/>
<script type="text/javascript">
- Grids['agent'].SetDependantToolbarButtons( new Array('edit','delete', 'approve', 'decline', 'process', 'cancel') );
+ Grids['scheduled-task'].SetDependantToolbarButtons( new Array('edit','delete', 'approve', 'decline', 'process', 'cancel') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14858)
+++ core/install/english.lang (working copy)
@@ -674,9 +674,9 @@
<PHRASE Label="la_hint_SystemToolsRefreshThemeFiles" Module="Core" Type="1">PHVsPg0KICA8bGk+U2NhbnMgZm9yIG5ld2x5IGFkZGVkIEZyb250LWVuZCBUaGVtZSB0ZW1wbGF0ZXMgYWNyb3NzIGFsbCA8c3Ryb25nPjxpPmVuYWJsZWQ8L2k+PC9zdHJvbmc+IHRoZW1lcy4gVGhpcyBhY3Rpb24gaXMgcGVyZm9ybWVkIGF1dG9tYXRpY2FsbHkgd2hlbiBhIG5ldyB0aGVtZSBpcyBhZGRlZCBvciBleGlzdGluZyB0aGVtZSBpcyBlbmFibGVkLjwvbGk+DQogIDxsaT5BZGRpdGlvbmFsbHksIGRlbGV0ZXMgYWxsIGNvbXByZXNzZWQgYW5kIGNhY2hlZCBKYXZhc2NyaXB0L0NTUyBmaWxlcyAoLmpzIC5jc3MpIGxvYWRlZCB1c2luZyA8c3Ryb25nPjxpPiZsdDtpbnAyOm1fQ29tcHJlc3MgLi4uLyZndDs8L2k+PC9zdHJvbmc+IHRhZy48L2xpPg0KICA8bGk+VGhpcyBmdW5jdGlvbiBpcyBhbHNvIGF2YWlsYWJsZSBhcyBhICJSZWZyZXNoIiBidXR0b24gaW4gdGhlIFRoZW1lcyBzZWN0aW9uIHRvb2xiYXIgaW4gQWRtaW4gQ29uc29sZS48L2xpPg0KICA8bGk+VGhpcyBvcHRpb24gc2hvdWxkIGJlIHVzZWQgaW4gY2FzZSB3aGVuICI0MDQgTm90IEZvdW5kIiBwYWdlIGlzIHNob3duIGluc3RlYWQgb2YgZXhwZWN0ZWQgbmV3bHkgYWRkZWQgcGFnZSBvciB0ZW1wbGF0ZS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetAdminConsoleSections" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHRoZSBjYWNoZSBvZiBBZG1pbiBDb25zb2xlIHNlY3Rpb25zIChsZWZ0IG1lbnUpLiBUaGUgZGVmaW5pdGlvbnMgb2Ygc2VjdGlvbnMgYXJlIHJlYWQgYW5kIGNvbGxlY3RlZCBmcm9tIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIHRoYXQgYWxyZWFkeSBiZWVuIHNjYW5uZWQgYW5kIGNhY2hlZCBieSB0aGUgc3lzdGVtLjwvbGk+DQogIDxsaT5Vc2UgdGhpcyByZXNldCBvcHRpb24gaWYgYSBuZXdseSBhZGRlZCBzZWN0aW9uIGRvZXNuJ3QgYXBwZWFyIGluIHRoZSBsZWZ0IEFkbWluIENvbnNvbGUgbWVudS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetAllKeys" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIDxzdHJvbmc+PGk+QWxsIERhdGE8L2k+PC9zdHJvbmc+IHN0b3JlZCBpbiB0aGUgTWVtb3J5IENhY2hlLCBpbmNsdWRpbmcgYnV0IG5vdCBsaW1pdGVkIHRvIFN5c3RlbSBEYXRhIGFuZCBEYXRhYmFzZSBJdGVtcy48L2xpPg0KICA8bGk+VXNlIHdpdGggY2F1dGlvbiBkdWUgdG8gcG9zc2liaWxpdHkgb2YgbG9uZyBleGVjdXRpb24gdGltZS48L2xpPg0KPC91bD4=</PHRASE>
- <PHRASE Label="la_hint_SystemToolsResetConfigsAndParsedData" Module="Core" Type="1">PHVsPg0KICA8bGk+U2NhbnMgPHN0cm9uZz48aT4iY29yZSI8L2k+PC9zdHJvbmc+IGFuZCA8c3Ryb25nPjxpPiJtb2R1bGVzIjwvaT48L3N0cm9uZz4gZm9sZGVycyB0byBjYWNoZSB0aGUgbG9jYXRpb24gb2YgYWxsIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzLiBUaGUgZXhlY3V0aW9uIHRpbWUgZGVwZW5kcyBvbiB0aGUgbnVtYmVyIG9mIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIGZvdW5kLjwvbGk+DQogIDxsaT5SZXNldHMgdmFyaW91cyBjYWNoZWQgc3lzdGVtIGRhdGEgc3VjaCBhcyBkZWZpbmVkIFBIUCBDbGFzc2VzIChtYXBwaW5nIGJldHdlZW4gdGhlIGNsYXNzIG5hbWUgYW5kIHBoeXNpY2FsIGZpbGVuYW1lIGFuZCBsb2NhdGlvbiBvZiB0aGUgY2xhc3MpLCBIb29rcywgQWdlbnRzLCBDYWNoZWQgQ29uZmlndXJhdGlvbiBWYXJpYWJsZXMsIFJlcGxhY2VtZW50IFRlbXBsYXRlcywgUmV3cml0ZSBMaXN0ZW5lcnMgYW5kIExvYWRlZCBNb2R1bGVzLiBEYXRhIGlzIHJlYWQgYW5kIGNvbGxlY3RlZCBmcm9tIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIHRoYXQgYWxyZWFkeSBiZWVuIHNjYW5uZWQgYW5kIGNhY2hlZCBieSB0aGUgc3lzdGVtLjwvbGk+DQogIDxsaT5EZWxldGVzIGNvbXBpbGVkIHNraW5zIGZvciBBZG1pbiBDb25zb2xlIChjc3MgZmlsZXMpLjwvbGk+DQo8L3VsPg==</PHRASE>
+ <PHRASE Label="la_hint_SystemToolsResetConfigsAndParsedData" Module="Core" Type="1">PHVsPg0KICA8bGk+U2NhbnMgPHN0cm9uZz48aT4iY29yZSI8L2k+PC9zdHJvbmc+IGFuZCA8c3Ryb25nPjxpPiJtb2R1bGVzIjwvaT48L3N0cm9uZz4gZm9sZGVycyB0byBjYWNoZSB0aGUgbG9jYXRpb24gb2YgYWxsIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzLiBUaGUgZXhlY3V0aW9uIHRpbWUgZGVwZW5kcyBvbiB0aGUgbnVtYmVyIG9mIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIGZvdW5kLjwvbGk+DQogIDxsaT5SZXNldHMgdmFyaW91cyBjYWNoZWQgc3lzdGVtIGRhdGEgc3VjaCBhcyBkZWZpbmVkIFBIUCBDbGFzc2VzIChtYXBwaW5nIGJldHdlZW4gdGhlIGNsYXNzIG5hbWUgYW5kIHBoeXNpY2FsIGZpbGVuYW1lIGFuZCBsb2NhdGlvbiBvZiB0aGUgY2xhc3MpLCBIb29rcywgU2NoZWR1bGVkIFRhc2tzLCBDYWNoZWQgQ29uZmlndXJhdGlvbiBWYXJpYWJsZXMsIFJlcGxhY2VtZW50IFRlbXBsYXRlcywgUmV3cml0ZSBMaXN0ZW5lcnMgYW5kIExvYWRlZCBNb2R1bGVzLiBEYXRhIGlzIHJlYWQgYW5kIGNvbGxlY3RlZCBmcm9tIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGVzIHRoYXQgYWxyZWFkeSBiZWVuIHNjYW5uZWQgYW5kIGNhY2hlZCBieSB0aGUgc3lzdGVtLjwvbGk+DQogIDxsaT5EZWxldGVzIGNvbXBpbGVkIHNraW5zIGZvciBBZG1pbiBDb25zb2xlIChjc3MgZmlsZXMpLjwvbGk+DQo8L3VsPg==</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetModRewriteCache" Module="Core" Type="1">PHVsPg0KICA8bGk+RGVsZXRlcyB0aGUgbWFwcGluZyBiZXR3ZWVuIHRoZSBGcm9udC1lbmQgVVJMcyBhbmQgYWN0dWFsIFRoZW1lIFRlbXBsYXRlcy4gVGhpcyBtYXBwaW5nIGlzIHVwZGF0ZWQgYXV0b21hdGljYWxseSwgd2hlbiB0aGUgd2Vic2l0ZSBTdHJ1Y3R1cmUgb3IgU2VjdGlvbnMgYXJlIGNoYW5nZWQuPC9saT4NCiAgPGxpPlVzZSB0aGlzIG9wdGlvbiBvbmx5IGluIGNhc2UgaWYgTW9kUmV3cml0ZSBtb2RlIGlzIGVuYWJsZWQgYW5kIGRpc3BsYXllZCBwYWdlIGRpZmZlcnMgZnJvbSB0aGUgcGFnZSB0aGF0IGl0IHNob3VsZCBiZSwgd2hlbiBnaXZlbiBVUkwgaXMgdmlzaXRlZC48L2xpPg0KPC91bD4=</PHRASE>
- <PHRASE Label="la_hint_SystemToolsResetParsedCachedData" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHZhcmlvdXMgY2FjaGVkIHN5c3RlbSBkYXRhIHN1Y2ggYXMgZGVmaW5lZCBQSFAgQ2xhc3NlcyAobWFwcGluZyBiZXR3ZWVuIHRoZSBjbGFzcyBuYW1lIGFuZCBwaHlzaWNhbCBmaWxlbmFtZSBhbmQgbG9jYXRpb24gb2YgdGhlIGNsYXNzKSwgSG9va3MsIEFnZW50cywgQ2FjaGVkIENvbmZpZ3VyYXRpb24gVmFyaWFibGVzLCBSZXBsYWNlbWVudCBUZW1wbGF0ZXMsIFJld3JpdGUgTGlzdGVuZXJzIGFuZCBMb2FkZWQgTW9kdWxlcy4gRGF0YSBpcyByZWFkIGFuZCBjb2xsZWN0ZWQgZnJvbSA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnPC9pPjwvc3Ryb25nPiBmaWxlcyB0aGF0IGFscmVhZHkgYmVlbiBzY2FubmVkIGFuZCBjYWNoZWQgYnkgdGhlIHN5c3RlbS48L2xpPg0KPC91bD4=</PHRASE>
+ <PHRASE Label="la_hint_SystemToolsResetParsedCachedData" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHZhcmlvdXMgY2FjaGVkIHN5c3RlbSBkYXRhIHN1Y2ggYXMgZGVmaW5lZCBQSFAgQ2xhc3NlcyAobWFwcGluZyBiZXR3ZWVuIHRoZSBjbGFzcyBuYW1lIGFuZCBwaHlzaWNhbCBmaWxlbmFtZSBhbmQgbG9jYXRpb24gb2YgdGhlIGNsYXNzKSwgSG9va3MsIFNjaGVkdWxlZCBUYXNrcywgQ2FjaGVkIENvbmZpZ3VyYXRpb24gVmFyaWFibGVzLCBSZXBsYWNlbWVudCBUZW1wbGF0ZXMsIFJld3JpdGUgTGlzdGVuZXJzIGFuZCBMb2FkZWQgTW9kdWxlcy4gRGF0YSBpcyByZWFkIGFuZCBjb2xsZWN0ZWQgZnJvbSA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnPC9pPjwvc3Ryb25nPiBmaWxlcyB0aGF0IGFscmVhZHkgYmVlbiBzY2FubmVkIGFuZCBjYWNoZWQgYnkgdGhlIHN5c3RlbS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetSMSMenuCache" Module="Core" Type="1">PHVsPg0KICA8bGk+RGVsZXRlcyB0aGUgY2FjaGVkIHZlcnNpb24gb2YgRnJvbnQtZW5kIG1lbnUgKGRpc3BsYXllZCB2aWEgPHN0cm9uZz48aT4mbHQ7aW5wMjpzdF9DYWNoZWRNZW51IC4uLi8mZ3Q7PC9pPjwvc3Ryb25nPiB0YWcpLiBUaGlzIGNhY2hlIGlzIHVwZGF0ZWQgYXV0b21hdGljYWxseSwgd2hlbiB0aGUgd2Vic2l0ZSBzdHJ1Y3R1cmUgb3Igc2VjdGlvbnMgYXJlIGNoYW5nZWQuPC9saT4NCiAgPGxpPlVzZSB0aGlzIG9wdGlvbiBvbmx5IGluIGNhc2UgaWYgZGlzcGxheWVkIG1lbnUgb24gdGhlIEZyb250LWVuZCBkb2Vzbid0IG1hdGNoIHRoZSBtZW51IGRlZmluZWQgaW4gQWRtaW4gQ29uc29sZS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsShowDatabaseTableStructure" Module="Core" Type="1">PHVsPg0KICA8bGk+U2hvd3MgdGhlIHN0cnVjdHVyZSBvZiB0aGUgZGF0YWJhc2UgdGFibGUgbG9hZGluZyBpdCBieSB0aGUgVGFibGUgTmFtZSAodGFibGUgcHJlZml4IGlzIG9wdGlvbmFsKSBvciA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnIFByZWZpeDwvaT48L3N0cm9uZz4gYXNzb2NpYXRlZCB3aXRoIHRoaXMgdGFibGUuPC9saT4NCjwvdWw+</PHRASE>
<PHRASE Label="la_hint_SystemToolsSynchronizeDBRevisions" Module="Core" Type="1">PHVsPg0KPGxpPkFzIGEgcmVzdWx0LCBzY3JpcHQgd2lsbCBWYWxpZGF0ZSBjdXJyZW50IDxiPjx1PnByb2plY3RfdXBncmFkZXMuc3FsPC91PjwvYj4gZmlsZSBhbmQgb3V0bGluZSBhbnkgZXJyb3JzIG9yIGluY29uc2lzdGVuY2llcywgYW5kIGF1dG8tcG9wdWxhdGUgYWxsIG1pc3NpbmcgREIgUmV2aXNpb25zIGZyb20gdGhlIGZpbGUgaW50byBBcHBsaWVkREJSZXZpc2lvbnMuPC9saT4NCjxsaT48YiBzdHlsZT0iY29sb3I6cmVkIj5OT1RFOjwvYj4gRGV2ZWxvcGVycyBzaG91bGQgT05MWSBydW4gdGhpcyBiZWZvcmUgdGhleSBwZXJmb3JtIFJlcG9zaXRvcnkgVXBkYXRlcyBvbiB0aGVpIHdvcmtpbmcgY29weSE8L2xpPg0KPC91bD4=</PHRASE>
@@ -1223,7 +1223,6 @@
<PHRASE Label="la_Text_Users" Module="Core" Type="1">VXNlcnM=</PHRASE>
<PHRASE Label="la_Text_Version" Module="Core" Type="1">VmVyc2lvbg==</PHRASE>
<PHRASE Label="la_Text_View" Module="Core" Type="1">Vmlldw==</PHRASE>
- <PHRASE Label="la_title_AddingAgent" Module="Core" Type="1">QWRkaW5nIEFnZW50</PHRASE>
<PHRASE Label="la_title_AddingBanRule" Module="Core" Type="1">QWRkaW5nIEJhbiBSdWxl</PHRASE>
<PHRASE Label="la_title_AddingCountryState" Module="Core" Type="1">QWRkaW5nIENvdW50cnkvU3RhdGU=</PHRASE>
<PHRASE Label="la_title_addingCustom" Module="Core" Type="1">QWRkaW5nIEN1c3RvbSBGaWVsZA==</PHRASE>
@@ -1231,6 +1230,7 @@
<PHRASE Label="la_title_AddingMailingList" Module="Core" Type="1">QWRkaW5nIE1haWxpbmcgTGlzdA==</PHRASE>
<PHRASE Label="la_title_AddingPermissionType" Module="Core" Type="1">QWRkaW5nIFBlcm1pc3Npb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_title_AddingPromoBlock" Module="Core" Type="1">QWRkaW5nIFByb21vIEJsb2Nr</PHRASE>
+ <PHRASE Label="la_title_AddingScheduledTask" Module="Core" Type="1">QWRkaW5nIFNjaGVkdWxlZCBUYXNr</PHRASE>
<PHRASE Label="la_title_AddingSiteDomain" Module="Core" Type="1">QWRkaW5nIFNpdGUgRG9tYWlu</PHRASE>
<PHRASE Label="la_title_AddingSkin" Module="Core" Type="1">QWRkaW5nIFNraW4=</PHRASE>
<PHRASE Label="la_title_AddingSpellingDictionary" Module="Core" Type="1">QWRkaW5nIFNwZWxsaW5nIERpY3Rpb25hcnk=</PHRASE>
@@ -1258,7 +1258,6 @@
<PHRASE Label="la_title_Administrators" Module="Core" Type="1">QWRtaW5pc3RyYXRvcnM=</PHRASE>
<PHRASE Label="la_title_Advanced" Module="Core" Type="1">QWR2YW5jZWQ=</PHRASE>
<PHRASE Label="la_title_AdvancedView" Module="Core" Type="1">U2hvd2luZyBhbGwgcmVnYXJkbGVzcyBvZiBTdHJ1Y3R1cmU=</PHRASE>
- <PHRASE Label="la_title_Agents" Module="Core" Type="1">QWdlbnRz</PHRASE>
<PHRASE Label="la_title_BaseStyles" Module="Core" Type="1">QmFzZSBTdHlsZXM=</PHRASE>
<PHRASE Label="la_title_BlockStyles" Module="Core" Type="1">QmxvY2sgU3R5bGVz</PHRASE>
<PHRASE Label="la_title_BounceSettings" Module="Core" Type="1">Qm91bmNlIFBPUDMgU2VydmVyIFNldHRpbmdz</PHRASE>
@@ -1272,7 +1271,6 @@
<PHRASE Label="la_title_CSVImport" Module="Core" Type="1">Q1NWIEltcG9ydA==</PHRASE>
<PHRASE Label="la_title_Custom" Module="Core" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_title_CustomFields" Module="Core" Type="1">Q3VzdG9tIEZpZWxkcw==</PHRASE>
- <PHRASE Label="la_title_EditingAgent" Module="Core" Type="1">RWRpdGluZyBBZ2VudA==</PHRASE>
<PHRASE Label="la_title_EditingBanRule" Module="Core" Type="1">RWRpdGluZyBCYW4gUnVsZQ==</PHRASE>
<PHRASE Label="la_title_EditingChangeLog" Module="Core" Type="1">RWRpdGluZyBDaGFuZ2VzIExvZw==</PHRASE>
<PHRASE Label="la_title_EditingContentAutosaved" Module="Core" Type="1">Q29udGVudCBFZGl0b3IgLSBBdXRvLXNhdmVkIGF0ICVz</PHRASE>
@@ -1283,6 +1281,7 @@
<PHRASE Label="la_title_EditingMembership" Module="Core" Type="1">RWRpdGluZyBNZW1iZXJzaGlw</PHRASE>
<PHRASE Label="la_title_EditingPermissionType" Module="Core" Type="1">RWRpdGluZyBQZXJtaXNzaW9uIFR5cGU=</PHRASE>
<PHRASE Label="la_title_EditingPromoBlock" Module="Core" Type="1">RWRpdGluZyBQcm9tbyBCbG9jaw==</PHRASE>
+ <PHRASE Label="la_title_EditingScheduledTask" Module="Core" Type="1">RWRpdGluZyBTY2hlZHVsZWQgVGFzaw==</PHRASE>
<PHRASE Label="la_title_EditingSiteDomain" Module="Core" Type="1">RWRpdGluZyBTaXRlIERvbWFpbg==</PHRASE>
<PHRASE Label="la_title_EditingSkin" Module="Core" Type="1">RWRpdGluZyBTa2lu</PHRASE>
<PHRASE Label="la_title_EditingSpamReport" Module="Core" Type="1">RWRpdGluZyBTUEFNIFJlcG9ydA==</PHRASE>
@@ -1333,10 +1332,10 @@
<PHRASE Label="la_title_MailingLists" Module="Core" Type="1">TWFpbGluZ3M=</PHRASE>
<PHRASE Label="la_title_Messages" Module="Core" Type="1">TWVzc2FnZXM=</PHRASE>
<PHRASE Label="la_title_Module_Status" Module="Core" Type="1">TW9kdWxlcw==</PHRASE>
- <PHRASE Label="la_title_NewAgent" Module="Core" Type="1">TmV3IEFnZW50</PHRASE>
<PHRASE Label="la_title_NewEmailEvent" Module="Core" Type="1">TmV3IEVtYWlsIEV2ZW50</PHRASE>
<PHRASE Label="la_title_NewFile" Module="Core" Type="1">TmV3IEZpbGU=</PHRASE>
<PHRASE Label="la_title_NewReply" Module="Core" Type="1">TmV3IFJlcGx5</PHRASE>
+ <PHRASE Label="la_title_NewScheduledTask" Module="Core" Type="1">TmV3IFNjaGVkdWxlZCBUYXNr</PHRASE>
<PHRASE Label="la_title_NewTheme" Module="Core" Type="1">TmV3IFRoZW1l</PHRASE>
<PHRASE Label="la_title_NewThemeFile" Module="Core" Type="1">TmV3IFRoZW1lIFRlbXBsYXRl</PHRASE>
<PHRASE Label="la_title_New_BaseStyle" Module="Core" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
@@ -1356,6 +1355,7 @@
<PHRASE Label="la_title_Relations" Module="Core" Type="1">UmVsYXRpb25z</PHRASE>
<PHRASE Label="la_title_ReplySettings" Module="Core" Type="1">UmVwbHkgUE9QMyBTZXJ2ZXIgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_title_Reviews" Module="Core" Type="1">Q29tbWVudHM=</PHRASE>
+ <PHRASE Label="la_title_ScheduledTasks" Module="Core" Type="1">U2NoZWR1bGVkIFRhc2tz</PHRASE>
<PHRASE Label="la_title_SelectGroup" Module="Core" Type="1">U2VsZWN0IEdyb3VwKHMp</PHRASE>
<PHRASE Label="la_title_SelectUser" Module="Core" Type="1">U2VsZWN0IFVzZXI=</PHRASE>
<PHRASE Label="LA_TITLE_SENDEMAIL" Module="Core" Type="1">U2VuZCBFLW1haWw=</PHRASE>
@@ -1433,7 +1433,6 @@
<PHRASE Label="la_ToolTip_LoginAs" Module="Core" Type="1">TG9naW4gQXM=</PHRASE>
<PHRASE Label="la_ToolTip_MoveDown" Module="Core" Type="1">TW92ZSBEb3du</PHRASE>
<PHRASE Label="la_ToolTip_MoveUp" Module="Core" Type="1">TW92ZSBVcA==</PHRASE>
- <PHRASE Label="la_ToolTip_NewAgent" Module="Core" Type="1">TmV3IEFnZW50</PHRASE>
<PHRASE Label="la_ToolTip_NewBaseStyle" Module="Core" Type="1">TmV3IEJhc2UgU3R5bGU=</PHRASE>
<PHRASE Label="la_ToolTip_NewBlockStyle" Module="Core" Type="1">TmV3IEJsb2NrIFN0eWxl</PHRASE>
<PHRASE Label="la_ToolTip_NewCountryState" Module="Core" Type="1">TmV3IENvdW50cnkvU3RhdGU=</PHRASE>
@@ -1443,6 +1442,7 @@
<PHRASE Label="la_ToolTip_NewPermission" Module="Core" Type="1">TmV3IFBlcm1pc3Npb24=</PHRASE>
<PHRASE Label="la_ToolTip_NewPhrase" Module="Core" Type="1">TmV3IFBocmFzZQ==</PHRASE>
<PHRASE Label="la_ToolTip_NewReview" Module="Core" Type="1">TmV3IENvbW1lbnQ=</PHRASE>
+ <PHRASE Label="la_ToolTip_NewScheduledTask" Module="Core" Type="1">TmV3IFNjaGVkdWxlZCBUYXNr</PHRASE>
<PHRASE Label="la_ToolTip_NewSearchConfig" Module="Core" Type="1">TmV3IFNlYXJjaCBGaWVsZA==</PHRASE>
<PHRASE Label="la_ToolTip_NewSiteDomain" Module="Core" Type="1">TmV3IFNpdGUgRG9tYWlu</PHRASE>
<PHRASE Label="la_ToolTip_NewStopWord" Module="Core" Type="1">TmV3IFN0b3AgV29yZA==</PHRASE>
@@ -1517,7 +1517,7 @@
<PHRASE Label="la_Unicode" Module="Core" Type="1">VW5pY29kZQ==</PHRASE>
<PHRASE Label="la_updating_config" Module="Core" Type="1">VXBkYXRpbmcgQ29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_Upload" Module="Core" Type="1">VXBsb2Fk</PHRASE>
- <PHRASE Label="la_UseCronForRegularEvent" Module="Core" Type="1">VXNlIENyb24gdG8gcnVuIEFnZW50cw==</PHRASE>
+ <PHRASE Label="la_UseCronForRegularEvent" Module="Core" Type="1">VXNlIENyb24gdG8gcnVuIFNjaGVkdWxlZCBUYXNrcw==</PHRASE>
<PHRASE Label="la_users_admin_group" Module="Core" Type="1">QXNzaWduIGFkbWluaXN0cmF0b3JzIHRvIGdyb3Vw</PHRASE>
<PHRASE Label="la_users_allow_new" Module="Core" Type="1">QWxsb3cgbmV3IHVzZXIgcmVnaXN0cmF0aW9u</PHRASE>
<PHRASE Label="la_users_assign_all_to" Module="Core" Type="1">QXNzaWduIEFsbCBVc2VycyBUbyBHcm91cA==</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14858)
+++ core/install/install_data.sql (working copy)
@@ -85,7 +85,7 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'OutputCompressionLevel', '7', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_OutputCompressionLevel', 'text', '', '', 60.02, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseTemplateCompression', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_UseTemplateCompression', 'checkbox', '', '', 60.03, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'TrimRequiredFields', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_TrimRequiredFields', 'checkbox', '', '', 60.04, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseCronForRegularEvent', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_UseCronForRegularEvent', 'checkbox', NULL, NULL, 60.05, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RunScheduledTasksFromCron', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_UseCronForRegularEvent', 'checkbox', NULL, NULL, 60.05, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseChangeLog', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_UseChangeLog', 'checkbox', '', '', 60.06, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Backup_Path', '/home/alex/web/in-portal.rc/system/backupdata', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_backup_path', 'text', '', '', 60.07, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SystemTagCache', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 60.08, 0, 0, NULL);
@@ -564,10 +564,10 @@
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:service.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:service.edit', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.delete', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.edit', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.add', 11, 1, 1, 0);
-INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:scheduled_tasks.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:scheduled_tasks.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:scheduled_tasks.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:scheduled_tasks.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.edit', 11, 1, 1, 0);
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14861)
+++ core/install/upgrades.sql (working copy)
@@ -2379,4 +2379,37 @@
INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.VIEW', 11, 1, 0, 1);
INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.RESTORE', 11, 1, 0, 1);
-ALTER TABLE EmailQueue ADD `LogData` TEXT;
\ No newline at end of file
+ALTER TABLE EmailQueue ADD `LogData` TEXT;
+
+UPDATE Permissions
+SET Permission = REPLACE(Permission, 'agents', 'scheduled_tasks')
+WHERE Permission LIKE 'in-portal:agents%';
+
+DELETE FROM Phrase
+WHERE PhraseKey IN (
+ 'LA_TITLE_ADDINGAGENT', 'LA_TITLE_EDITINGAGENT', 'LA_TITLE_NEWAGENT', 'LA_TITLE_AGENTS', 'LA_TOOLTIP_NEWAGENT'
+);
+
+UPDATE Phrase
+SET l<%PRIMARY_LANGUAGE%>_Translation = REPLACE(l<%PRIMARY_LANGUAGE%>_Translation, 'Agents', 'Scheduled Tasks')
+WHERE PhraseKey IN (
+ 'LA_USECRONFORREGULAREVENT', 'LA_HINT_SYSTEMTOOLSRESETPARSEDCACHEDDATA', 'LA_HINT_SYSTEMTOOLSRESETCONFIGSANDPARSEDDATA'
+);
+
+DELETE FROM PersistantSessionData
+WHERE VariableName LIKE 'agent%';
+
+RENAME TABLE Agents TO ScheduledTasks;
+
+ALTER TABLE ScheduledTasks
+ CHANGE AgentId ScheduledTaskId INT(11) NOT NULL AUTO_INCREMENT,
+ CHANGE AgentName Name VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE AgentType `Type` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1';
+
+ALTER TABLE ScheduledTasks
+ DROP INDEX AgentType,
+ ADD INDEX `Type` (`Type`);
+
+UPDATE ConfigurationValues
+SET VariableName = 'RunScheduledTasksFromCron'
+WHERE VariableName = 'UseCronForRegularEvent';
\ No newline at end of file
Index: core/kernel/application.php
===================================================================
--- core/kernel/application.php (revision 14858)
+++ core/kernel/application.php (working copy)
@@ -686,7 +686,7 @@
$this->registerClass('kEventManager', KERNEL_PATH . '/event_manager.php', 'EventManager', 'kiCacheable');
$this->registerClass('kHookManager', KERNEL_PATH . '/managers/hook_manager.php', null, 'kiCacheable');
- $this->registerClass('kAgentManager', KERNEL_PATH . '/managers/agent_manager.php', null, 'kiCacheable');
+ $this->registerClass('kScheduledTaskManager', KERNEL_PATH . '/managers/agent_manager.php', null, 'kiCacheable');
$this->registerClass('kRequestManager', KERNEL_PATH . '/managers/request_manager.php');
$this->registerClass('kUrlManager', KERNEL_PATH . '/managers/url_manager.php');
@@ -1025,7 +1025,7 @@
}
if ($debug_mode) {
- $this->EventManager->runAgents(reAFTER);
+ $this->EventManager->runScheduledTasks(reAFTER);
$this->Session->SaveData();
if (kUtil::constOn('DBG_CACHE')) {
@@ -1059,7 +1059,7 @@
flush();
if (!$debug_mode) {
- $this->EventManager->runAgents(reAFTER);
+ $this->EventManager->runScheduledTasks(reAFTER);
$this->Session->SaveData();
}
@@ -1782,18 +1782,18 @@
}
/**
- * Add new agent
+ * Add new scheduled task
*
- * @param string $short_name name to be used to store last maintenace run info
+ * @param string $short_name name to be used to store last maintenance run info
* @param string $event_name
* @param int $run_interval run interval in seconds
- * @param int $type before or after agent
+ * @param int $type before or after scheduled task
* @param int $status
* @access public
*/
- public function registerAgent($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
+ public function registerScheduledTask($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
{
- $this->EventManager->registerAgent($short_name, $event_name, $run_interval, $type, $status);
+ $this->EventManager->registerScheduledTask($short_name, $event_name, $run_interval, $type, $status);
}
/**
Index: core/kernel/constants.php
===================================================================
--- core/kernel/constants.php (revision 14868)
+++ core/kernel/constants.php (working copy)
@@ -63,11 +63,11 @@
define('EDITING_MODE_CONTENT', 2); // content blocks + phrase editing
define('EDITING_MODE_DESIGN', 3); // all other blocks
- class Agent {
- const AGENT_TYPE_USER = 1;
- const AGENT_TYPE_SYSTEM = 2;
+ class ScheduledTask {
+ const TYPE_USER = 1;
+ const TYPE_SYSTEM = 2;
- const LAST_RUN_SUCCEDED = 1;
+ const LAST_RUN_SUCCEEDED = 1;
const LAST_RUN_FAILED = 0;
const LAST_RUN_RUNNING = 2;
}
Index: core/kernel/event_manager.php
===================================================================
--- core/kernel/event_manager.php (revision 14858)
+++ core/kernel/event_manager.php (working copy)
@@ -25,12 +25,12 @@
protected $Hooks = null;
/**
- * Instance of agent manager
+ * Instance of scheduled task manager
*
- * @var kAgentManager
+ * @var kScheduledTaskManager
* @access protected
*/
- protected $Agents = null;
+ protected $ScheduledTasks = null;
/**
* Instance of request manager
@@ -66,7 +66,7 @@
parent::__construct();
$this->Hooks =& $this->Application->makeClass('kHookManager');
- $this->Agents =& $this->Application->makeClass('kAgentManager');
+ $this->ScheduledTasks =& $this->Application->makeClass('kScheduledTaskManager');
$this->Request =& $this->Application->makeClass('kRequestManager');
}
@@ -79,7 +79,7 @@
public function setFromCache(&$data)
{
$this->Hooks->setFromCache($data);
- $this->Agents->setFromCache($data);
+ $this->ScheduledTasks->setFromCache($data);
$this->buildEvents = $data['EventManager.buildEvents'];
}
@@ -94,7 +94,7 @@
{
return array_merge(
$this->Hooks->getToCache(),
- $this->Agents->getToCache(),
+ $this->ScheduledTasks->getToCache(),
Array (
'EventManager.buildEvents' => $this->buildEvents,
)
@@ -102,58 +102,58 @@
}
/**
- * Returns information about registered agents
+ * Returns information about registered scheduled tasks
*
* @param bool $from_cache
* @return Array
* @access public
*/
- public function getAgents($from_cache = false)
+ public function getScheduledTasks($from_cache = false)
{
- return $this->Agents->getAll($from_cache);
+ return $this->ScheduledTasks->getAll($from_cache);
}
/**
- * Add new agent
+ * Add new scheduled task
*
- * @param string $short_name name to be used to store last maintenace run info
+ * @param string $short_name name to be used to store last maintenance run info
* @param string $event_name
* @param int $run_interval run interval in seconds
- * @param int $type before or after agent
+ * @param int $type before or after scheduled task
* @param int $status
* @access public
*/
- public function registerAgent($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
+ public function registerScheduledTask($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
{
- $this->Agents->add($short_name, $event_name, $run_interval, $type, $status);
+ $this->ScheduledTasks->add($short_name, $event_name, $run_interval, $type, $status);
}
/**
- * Run registred agents with specified event type
+ * Run registered scheduled tasks with specified event type
*
* @param int $event_type
* @param bool $from_cron
* @access public
*/
- public function runAgents($event_type = reBEFORE, $from_cron = false)
+ public function runScheduledTasks($event_type = reBEFORE, $from_cron = false)
{
- $this->Agents->runAgents($event_type, $from_cron);
+ $this->ScheduledTasks->runAll($event_type, $from_cron);
}
/**
- * Runs agent based on given data
+ * Runs scheduled task based on given data
*
- * @param Array $agent_data
+ * @param Array $scheduled_task_data
* @return bool
* @access public
*/
- public function runAgent($agent_data)
+ public function runScheduledTask($scheduled_task_data)
{
- return $this->Agents->runAgent($agent_data);
+ return $this->ScheduledTasks->run($scheduled_task_data);
}
/**
- * Registers Hook from subprefix event to master prefix event
+ * Registers Hook from sub-prefix event to master prefix event
*
* Pattern: Observer
*
Index: core/kernel/managers/agent_manager.php
===================================================================
--- core/kernel/managers/agent_manager.php (revision 14858)
+++ core/kernel/managers/agent_manager.php (working copy)
@@ -14,7 +14,7 @@
defined('FULL_PATH') or die('restricted access!');
-class kAgentManager extends kBase implements kiCacheable {
+class kScheduledTaskManager extends kBase implements kiCacheable {
/**
* Events, that should be run before parser initialization
@@ -22,7 +22,7 @@
* @var Array
* @access protected
*/
- protected $beforeAgents = Array ();
+ protected $before = Array ();
/**
* Events, that should be run after parser initialization
@@ -30,7 +30,7 @@
* @var Array
* @access protected
*/
- protected $afterAgents = Array ();
+ protected $after = Array ();
/**
* Sets data from cache to object
@@ -40,8 +40,8 @@
*/
public function setFromCache(&$data)
{
- $this->beforeAgents = $data['EventManager.beforeRegularEvents'];
- $this->afterAgents = $data['EventManager.afterRegularEvents'];
+ $this->before = $data['EventManager.beforeRegularEvents'];
+ $this->after = $data['EventManager.afterRegularEvents'];
}
/**
@@ -53,13 +53,13 @@
public function getToCache()
{
return Array (
- 'EventManager.beforeRegularEvents' => $this->beforeAgents,
- 'EventManager.afterRegularEvents' => $this->afterAgents,
+ 'EventManager.beforeRegularEvents' => $this->before,
+ 'EventManager.afterRegularEvents' => $this->after,
);
}
/**
- * Returns information about registered agents
+ * Returns information about registered scheduled tasks
*
* @param bool $from_cache
* @return Array
@@ -67,99 +67,99 @@
*/
public function getAll($from_cache = false)
{
- static $agents = null;
+ static $scheduled_tasks = null;
if ($from_cache) {
return Array (
- reBEFORE => $this->beforeAgents,
- reAFTER => $this->afterAgents,
+ reBEFORE => $this->before,
+ reAFTER => $this->after,
);
}
- if ( !isset($agents) ) {
- $timeout_clause = 'LastRunStatus = ' . Agent::LAST_RUN_RUNNING . ' AND Timeout > 0 AND ' . adodb_mktime() . ' - LastRunOn > Timeout';
+ if ( !isset($scheduled_tasks) ) {
+ $timeout_clause = 'LastRunStatus = ' . ScheduledTask::LAST_RUN_RUNNING . ' AND Timeout > 0 AND ' . adodb_mktime() . ' - LastRunOn > Timeout';
$sql = 'SELECT *
- FROM ' . $this->Application->getUnitOption('agent', 'TableName') . '
- WHERE (Status = ' . STATUS_ACTIVE . ') AND ((LastRunStatus != ' . Agent::LAST_RUN_RUNNING . ') OR (' . $timeout_clause . '))';
- $all_agents = $this->Conn->Query($sql);
+ FROM ' . $this->Application->getUnitOption('scheduled-task', 'TableName') . '
+ WHERE (Status = ' . STATUS_ACTIVE . ') AND ((LastRunStatus != ' . ScheduledTask::LAST_RUN_RUNNING . ') OR (' . $timeout_clause . '))';
+ $all_scheduled_tasks = $this->Conn->Query($sql);
- $agents = Array (
+ $scheduled_tasks = Array (
reBEFORE => Array (),
reAFTER => Array (),
);
- foreach ($all_agents as $agent_data) {
- $agents[ $agent_data['RunMode'] ][ $agent_data['AgentName'] ] = Array (
- 'EventName' => $agent_data['Event'],
- 'RunInterval' => (int)$agent_data['RunInterval'],
- 'LastRunOn' => (int)$agent_data['LastRunOn'],
- 'NextRunOn' => (int)$agent_data['NextRunOn'],
- 'Status' => $agent_data['Status'],
- 'LastRunStatus' => $agent_data['LastRunStatus'],
- 'SiteDomainLimitation' => $agent_data['SiteDomainLimitation'],
+ foreach ($all_scheduled_tasks as $scheduled_task_data) {
+ $scheduled_tasks[ $scheduled_task_data['RunMode'] ][ $scheduled_task_data['Name'] ] = Array (
+ 'EventName' => $scheduled_task_data['Event'],
+ 'RunInterval' => (int)$scheduled_task_data['RunInterval'],
+ 'LastRunOn' => (int)$scheduled_task_data['LastRunOn'],
+ 'NextRunOn' => (int)$scheduled_task_data['NextRunOn'],
+ 'Status' => $scheduled_task_data['Status'],
+ 'LastRunStatus' => $scheduled_task_data['LastRunStatus'],
+ 'SiteDomainLimitation' => $scheduled_task_data['SiteDomainLimitation'],
);
}
}
- return $agents;
+ return $scheduled_tasks;
}
/**
- * Returns agents by type
+ * Returns scheduled tasks by type
*
* @param int $type
* @return Array
* @access protected
*/
- protected function &getAgentsByType($type)
+ protected function &getByType($type)
{
if ($type == reBEFORE) {
- return $this->beforeAgents;
+ return $this->before;
}
- return $this->afterAgents;
+ return $this->after;
}
/**
- * Add new agent
+ * Add new scheduled task
*
* @param string $short_name name to be used to store last maintenance run info
* @param string $event_name
* @param int $run_interval run interval in seconds
- * @param int $type before or after agent
+ * @param int $type before or after scheduled task
* @param int $status
* @access public
*/
public function add($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE)
{
- $agents =& $this->getAgentsByType($type);
+ $scheduled_tasks =& $this->getByType($type);
- $agents[$short_name] = Array (
+ $scheduled_tasks[$short_name] = Array (
'EventName' => $event_name, 'RunInterval' => $run_interval, 'Status' => $status
);
}
/**
- * Run registered agents with specified event type
+ * Run registered scheduled tasks with specified event type
*
* @param int $event_type
* @param bool $from_cron
* @access public
*/
- public function runAgents($event_type = reBEFORE, $from_cron = false)
+ public function runAll($event_type = reBEFORE, $from_cron = false)
{
if ( defined('IS_INSTALL') ) {
return ;
}
- if ( !$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent') ) {
- // if RegularEvents are set to run from cron
+ if ( !$from_cron && $this->Application->ConfigValue('RunScheduledTasksFromCron') ) {
+ // if scheduled tasks are set to run from cron
return ;
}
- $agents = $this->getAll();
- $events_source = $agents[$event_type];
+ $scheduled_tasks = $this->getAll();
+ $events_source = $scheduled_tasks[$event_type];
$user_id = $this->Application->RecallVar('user_id');
$this->Application->StoreVar('user_id', USER_ROOT, true); // to prevent permission checking inside events, true for optional storage
@@ -174,14 +174,14 @@
$site_domains = explode('|', substr($event_data['SiteDomainLimitation'], 1, -1));
if ( !in_array($site_domain_id, $site_domains) ) {
- // agent isn't allowed on this site domain
+ // scheduled task isn't allowed on this site domain
continue;
}
}
// remember LastTimeoutOn only for events that are still running and will be reset
- if ( $event_data['LastRunStatus'] == Agent::LAST_RUN_RUNNING ) {
- $this->updateAgent($short_name, Array ('LastTimeoutOn' => adodb_mktime()));
+ if ( $event_data['LastRunStatus'] == ScheduledTask::LAST_RUN_RUNNING ) {
+ $this->update($short_name, Array ('LastTimeoutOn' => adodb_mktime()));
}
$next_run = $event_data['NextRunOn'];
@@ -190,77 +190,77 @@
continue;
}
- $event_data['AgentName'] = $short_name;
- $this->runAgent($event_data);
+ $event_data['Name'] = $short_name;
+ $this->run($event_data);
}
$this->Application->StoreVar('user_id', $user_id, $user_id == USER_GUEST);
}
/**
- * Runs agent based on given data
+ * Runs scheduled task based on given data
*
- * @param Array $agent_data
+ * @param Array $scheduled_task_data
* @return bool
* @access public
*/
- public function runAgent($agent_data)
+ public function run($scheduled_task_data)
{
- $event = new kEvent($agent_data['EventName']);
+ $event = new kEvent($scheduled_task_data['EventName']);
if ( !$this->Application->prefixRegistred($event->Prefix) ) {
- // don't process agents, left from disabled modules
+ // don't process scheduled tasks, left from disabled modules
return false;
}
$start_time = adodb_mktime();
- // remember, when agent execution started
+ // remember, when scheduled task execution started
$fields_hash = Array (
'LastRunOn' => $start_time,
- 'LastRunStatus' => Agent::LAST_RUN_RUNNING,
- 'NextRunOn' => $start_time + $agent_data['RunInterval'],
+ 'LastRunStatus' => ScheduledTask::LAST_RUN_RUNNING,
+ 'NextRunOn' => $start_time + $scheduled_task_data['RunInterval'],
);
- $this->updateAgent($agent_data['AgentName'], $fields_hash);
+ $this->update($scheduled_task_data['Name'], $fields_hash);
$event->redirect = false;
$this->Application->HandleEvent($event);
$now = adodb_mktime();
- $next_run = $agent_data['RunInterval'] ? $start_time + $agent_data['RunInterval'] : $now;
+ $next_run = $scheduled_task_data['RunInterval'] ? $start_time + $scheduled_task_data['RunInterval'] : $now;
while ($next_run < $now) {
// in case event execution took longer, then RunInterval (don't use <=, because RunInterval can be 0)
- $next_run += $agent_data['RunInterval'];
+ $next_run += $scheduled_task_data['RunInterval'];
}
- // remember, when agent execution ended
+ // remember, when scheduled task execution ended
$fields_hash = Array (
'NextRunOn' => $next_run,
'RunTime' => round(($now - $start_time) / 60),
- 'LastRunStatus' => $event->status == kEvent::erSUCCESS ? Agent::LAST_RUN_SUCCEDED : Agent::LAST_RUN_FAILED,
+ 'LastRunStatus' => $event->status == kEvent::erSUCCESS ? ScheduledTask::LAST_RUN_SUCCEEDED : ScheduledTask::LAST_RUN_FAILED,
);
- $this->updateAgent($agent_data['AgentName'], $fields_hash);
+ $this->update($scheduled_task_data['Name'], $fields_hash);
return true;
}
/**
- * Updates agent record with latest changes about it's invocation progress
+ * Updates scheduled task record with latest changes about it's invocation progress
*
- * @param string $agent_name
+ * @param string $scheduled_task_name
* @param Array $fields_hash
* @return void
* @access protected
*/
- protected function updateAgent($agent_name, $fields_hash)
+ protected function update($scheduled_task_name, $fields_hash)
{
$this->Conn->doUpdate(
$fields_hash,
- $this->Application->getUnitOption('agent', 'TableName'),
- 'AgentName = ' . $this->Conn->qstr($agent_name)
+ $this->Application->getUnitOption('scheduled-task', 'TableName'),
+ 'Name = ' . $this->Conn->qstr($scheduled_task_name)
);
}
}
\ No newline at end of file
Index: core/kernel/managers/cache_manager.php
===================================================================
--- core/kernel/managers/cache_manager.php (revision 14858)
+++ core/kernel/managers/cache_manager.php (working copy)
@@ -58,7 +58,7 @@
protected $temporaryCache = Array (
'registerAggregateTag' => Array (),
- 'registerAgent' => Array (),
+ 'registerScheduledTask' => Array (),
'registerHook' => Array (),
'registerBuildEvent' => Array (),
'registerAggregateTag' => Array (),
@@ -401,7 +401,7 @@
// tracking related
'UseChangeLog', 'UseVisitorTracking', 'ModRewriteUrlEnding', 'ForceModRewriteUrlEnding',
- 'UseCronForRegularEvent',
+ 'RunScheduledTasksFromCron',
);
$escaped_config_vars = array_map(Array (&$this->Conn, 'qstr'), $config_vars);
Index: core/kernel/managers/request_manager.php
===================================================================
--- core/kernel/managers/request_manager.php (revision 14858)
+++ core/kernel/managers/request_manager.php (working copy)
@@ -66,7 +66,7 @@
$this->Application->SetVar('events', $events);
$this->Application->SetVar('passed', implode(',', $all_passed));
- $this->Application->EventManager->runAgents(reBEFORE);
+ $this->Application->EventManager->runScheduledTasks(reBEFORE);
$this->processed = true;
}
Index: core/kernel/session/session.php
===================================================================
--- core/kernel/session/session.php (revision 14858)
+++ core/kernel/session/session.php (working copy)
@@ -289,7 +289,7 @@
return ;
}
-// $this->DeleteExpired(); // called from u:OnDeleteExpiredSessions agent now
+// $this->DeleteExpired(); // called from u:OnDeleteExpiredSessions scheduled task now
if ($this->expired || ($this->CachedSID && !$this->_fromGet && !$this->SessionSet)) {
$this->RemoveSessionCookie();
Index: core/kernel/utility/unit_config_reader.php
===================================================================
--- core/kernel/utility/unit_config_reader.php (revision 14858)
+++ core/kernel/utility/unit_config_reader.php (working copy)
@@ -419,7 +419,7 @@
function parseConfig($prefix)
{
$this->parseClasses($prefix);
- $this->parseAgents($prefix);
+ $this->parseScheduledTasks($prefix);
$this->parseHooks($prefix);
$this->parseAggregatedTags($prefix);
}
@@ -457,19 +457,19 @@
}
}
- protected function parseAgents($prefix)
+ protected function parseScheduledTasks($prefix)
{
$config =& $this->configData[$prefix];
- if ( !isset($config['RegularEvents']) || !$config['RegularEvents'] ) {
+ if ( !isset($config['ScheduledTasks']) || !$config['ScheduledTasks'] ) {
return ;
}
- $regular_events = $config['RegularEvents'];
+ $scheduled_tasks = $config['ScheduledTasks'];
- foreach ($regular_events as $short_name => $regular_event_info) {
- $event_status = array_key_exists('Status', $regular_event_info) ? $regular_event_info['Status'] : STATUS_ACTIVE;
- $this->Application->delayUnitProcessing('registerAgent', Array ( $short_name, $config['Prefix'] . ':' . $regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'], $event_status ));
+ 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, $config['Prefix'] . ':' . $scheduled_task_info['EventName'], $scheduled_task_info['RunInterval'], $scheduled_task_info['Type'], $event_status ));
}
}
Index: core/units/admin/admin_config.php
===================================================================
--- core/units/admin/admin_config.php (revision 14858)
+++ core/units/admin/admin_config.php (working copy)
@@ -24,7 +24,7 @@
1 => 'event',
),
- 'RegularEvents' => Array(
+ 'ScheduledTasks' => Array(
'optimize_performance' => Array('EventName' => 'OnOptimizePerformance', 'RunInterval' => 86400, 'Type' => reAFTER),
),
Index: core/units/admin/admin_events_handler.php
===================================================================
--- core/units/admin/admin_events_handler.php (revision 14870)
+++ core/units/admin/admin_events_handler.php (working copy)
@@ -1061,7 +1061,7 @@
}
/**
- * [AGENT]
+ * [SCHEDULED TASK]
* 1. Delete all Debug files from system/.restricted folder (format debug_@977827436@.txt)
* 2. Run MySQL OPTIMIZE SQL one by one on all In-Portal tables (found by prefix).
*
Index: core/units/agents/agent_eh.php
===================================================================
--- core/units/agents/agent_eh.php (revision 14858)
+++ core/units/agents/agent_eh.php (working copy)
@@ -14,7 +14,7 @@
defined('FULL_PATH') or die('restricted access!');
- class AgentEventHandler extends kDBEventHandler {
+ class ScheduledTaskEventHandler extends kDBEventHandler {
/**
* Allows to override standard permission mapping
@@ -26,37 +26,37 @@
$permissions = Array (
'OnMassCancel' => Array ('self' => 'add|edit'),
- 'OnRunAgents' => Array ('self' => 'add|edit'),
+ 'OnRun' => Array ('self' => 'add|edit'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
- * [HOOK] Refreshes agents list in database based on cached data from unit configs
+ * [HOOK] Refreshes scheduled task list in database based on cached data from unit configs
*
* @param kEvent $event
*/
- function OnRefreshAgents(&$event)
+ function OnRefresh(&$event)
{
- $regular_events = $this->Application->EventManager->getAgents(true);
+ $scheduled_tasks_from_cache = $this->Application->EventManager->getScheduledTasks(true);
$object =& $event->getObject( Array ('skip_autoload' => true) );
/* @var $object kDBItem */
$processed_ids = Array ();
- $agents = $this->Conn->Query($object->GetSelectSQL(), 'AgentName');
+ $scheduled_tasks_from_db = $this->Conn->Query($object->GetSelectSQL(), 'Name');
- foreach ($regular_events as $run_mode => $events) {
+ foreach ($scheduled_tasks_from_cache as $run_mode => $events) {
- foreach ($events as $agent_name => $agent_params) {
- if ( !isset($agents[$agent_name]) ) {
+ foreach ($events as $scheduled_task_name => $scheduled_task_params) {
+ if ( !isset($scheduled_tasks_from_db[$scheduled_task_name]) ) {
$fields_hash = Array (
- 'Event' => $agent_params['EventName'],
- 'AgentName' => $agent_name,
- 'AgentType' => Agent::AGENT_TYPE_SYSTEM,
- 'Status' => array_key_exists('Status', $agent_params) ? $agent_params['Status'] : STATUS_ACTIVE,
- 'RunInterval' => $agent_params['RunInterval'],
+ 'Event' => $scheduled_task_params['EventName'],
+ 'Name' => $scheduled_task_name,
+ 'Type' => ScheduledTask::TYPE_SYSTEM,
+ 'Status' => array_key_exists('Status', $scheduled_task_params) ? $scheduled_task_params['Status'] : STATUS_ACTIVE,
+ 'RunInterval' => $scheduled_task_params['RunInterval'],
'RunMode' => $run_mode,
);
@@ -65,7 +65,7 @@
$object->Create();
}
else {
- $object->LoadFromHash( $agents[$agent_name] );
+ $object->LoadFromHash( $scheduled_tasks_from_db[$scheduled_task_name] );
}
$processed_ids[] = $object->GetID();
@@ -73,10 +73,10 @@
}
- // delete all non-processed agents (ones, that were deleted from unit configs)
+ // delete all non-processed scheduled tasks (ones, that were deleted from unit configs)
$sql = 'SELECT ' . $object->IDField . '
FROM ' . $object->TableName . '
- WHERE (AgentType = ' . Agent::AGENT_TYPE_SYSTEM . ') AND (' . $object->IDField . ' NOT IN (' . implode(',', $processed_ids) . '))';
+ WHERE (Type = ' . ScheduledTask::TYPE_SYSTEM . ') AND (' . $object->IDField . ' NOT IN (' . implode(',', $processed_ids) . '))';
$delete_ids = $this->Conn->GetCol($sql);
if ($delete_ids) {
@@ -101,7 +101,7 @@
{
if ($event->Name == 'OnMassDelete' && $type == 'before') {
if ($this->Application->isDebugMode()) {
- // allow to delete system agents in debug mode
+ // allow to delete system scheduled tasks in debug mode
return ;
}
@@ -112,7 +112,7 @@
$sql = 'SELECT ' . $id_field . '
FROM ' . $table_name . '
- WHERE ' . $id_field . ' IN (' . implode(',', $ids) . ') AND AgentType <> ' . Agent::AGENT_TYPE_SYSTEM;
+ WHERE ' . $id_field . ' IN (' . implode(',', $ids) . ') AND Type <> ' . ScheduledTask::TYPE_SYSTEM;
$allowed_ids = $this->Conn->GetCol($sql);
$event->setEventParam('ids', $allowed_ids);
@@ -121,7 +121,7 @@
}
/**
- * Cancels agents, that are currently running
+ * Cancels scheduled tasks, that are currently running
*
* @param kEvent $event
*/
@@ -136,9 +136,9 @@
foreach ($ids as $id) {
$object->Load($id);
- if ($object->GetDBField('LastRunStatus') == Agent::LAST_RUN_RUNNING) {
- // only changes status, doesn't affect currency running agents
- $object->SetDBField('LastRunStatus', Agent::LAST_RUN_FAILED);
+ if ($object->GetDBField('LastRunStatus') == ScheduledTask::LAST_RUN_RUNNING) {
+ // only changes status, doesn't affect currency running scheduled tasks
+ $object->SetDBField('LastRunStatus', ScheduledTask::LAST_RUN_FAILED);
$object->Update();
}
}
@@ -148,11 +148,11 @@
}
/**
- * Runs selected agents
+ * Runs selected scheduled tasks
*
* @param kEvent $event
*/
- function OnRunAgents(&$event)
+ function OnRun(&$event)
{
$ids = $this->StoreSelectedIDs($event);
@@ -163,16 +163,16 @@
$where_clause = Array (
$object->TableName . '.' . $object->IDField . ' IN (' . implode(',', $ids) . ')',
$object->TableName . '.Status = ' . STATUS_ACTIVE,
- $object->TableName . '.LastRunStatus <> ' . Agent::LAST_RUN_RUNNING,
+ $object->TableName . '.LastRunStatus <> ' . ScheduledTask::LAST_RUN_RUNNING,
);
$sql = $object->GetSelectSQL() . '
WHERE (' . implode(') AND (', $where_clause) . ')';
- $agents = $this->Conn->Query($sql);
+ $scheduled_tasks = $this->Conn->Query($sql);
- foreach ($agents as $agent_data) {
- $agent_data['EventName'] = $agent_data['Event'];
- $this->Application->EventManager->runAgent($agent_data);
+ foreach ($scheduled_tasks as $scheduled_task_data) {
+ $scheduled_task_data['EventName'] = $scheduled_task_data['Event'];
+ $this->Application->EventManager->runScheduledTask($scheduled_task_data);
}
}
Index: core/units/agents/agents_config.php
===================================================================
--- core/units/agents/agents_config.php (revision 14858)
+++ core/units/agents/agents_config.php (working copy)
@@ -15,10 +15,10 @@
defined('FULL_PATH') or die('restricted access!');
$config = Array (
- 'Prefix' => 'agent',
+ 'Prefix' => 'scheduled-task',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
- 'EventHandlerClass' => Array ('class' => 'AgentEventHandler', 'file' => 'agent_eh.php', 'build_event' => 'OnBuild'),
+ 'EventHandlerClass' => Array ('class' => 'ScheduledTaskEventHandler', 'file' => 'agent_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
@@ -40,42 +40,43 @@
'HookToEvent' => Array ('OnAfterCacheRebuild'),
'DoPrefix' => '',
'DoSpecial' => '*',
- 'DoEvent' => 'OnRefreshAgents',
+ 'DoEvent' => 'OnRefresh',
),
),
- 'IDField' => 'AgentId',
+ 'IDField' => 'ScheduledTaskId',
- 'TableName' => TABLE_PREFIX . 'Agents',
+ 'TableName' => TABLE_PREFIX . 'ScheduledTasks',
- 'TitleField' => 'AgentName',
+ 'TitleField' => 'Name',
'StatusField' => Array ('Status'),
'TitlePresets' => Array (
'default' => Array (
- 'new_status_labels' => Array ('agent' => '!la_title_AddingAgent!'),
- 'edit_status_labels' => Array ('agent' => '!la_title_EditingAgent!'),
- 'new_titlefield' => Array ('agent' => '!la_title_NewAgent!'),
+ 'new_status_labels' => Array ('scheduled-task' => '!la_title_AddingScheduledTask!'),
+ 'edit_status_labels' => Array ('scheduled-task' => '!la_title_EditingScheduledTask!'),
+ 'new_titlefield' => Array ('scheduled-task' => '!la_title_NewScheduledTask!'),
),
- 'agent_list' => Array (
- 'prefixes' => Array ('agent_List'), 'format' => "!la_title_Agents!",
+ 'scheduled_task_list' => Array (
+ 'prefixes' => Array ('scheduled-task_List'), 'format' => "!la_title_ScheduledTasks!",
'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'process', 'cancel', 'view', 'dbl-click'),
),
- 'agent_edit' => Array ('prefixes' => Array ('agent'), 'format' => "#agent_status# '#agent_titlefield#'",
+ 'scheduled_task_edit' => Array (
+ 'prefixes' => Array ('scheduled-task'), 'format' => "#scheduled-task_status# '#scheduled-task_titlefield#'",
'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
- ),
+ ),
),
- 'PermSection' => Array('main' => 'in-portal:agents'),
+ 'PermSection' => Array('main' => 'in-portal:scheduled_tasks'),
'Sections' => Array (
- 'in-portal:agents' => Array (
+ 'in-portal:scheduled_tasks' => Array (
'parent' => 'in-portal:website_setting_folder',
'icon' => 'conf_agents',
- 'label' => 'la_title_Agents',
+ 'label' => 'la_title_ScheduledTasks',
'url' => Array('t' => 'agents/agent_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 6,
@@ -89,20 +90,20 @@
'ListSortings' => Array (
'' => Array (
- 'Sorting' => Array ('AgentName' => 'asc'),
+ 'Sorting' => Array ('Name' => 'asc'),
)
),
'Fields' => Array (
- 'AgentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ScheduledTaskId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'AgentName' => Array (
+ 'Name' => Array (
'type' => 'string', 'max_len' => 255,
'unique' => Array (),
'required' => 1, 'not_null' => 1, 'default' => ''
),
- 'AgentType' => Array (
+ 'Type' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_User', 2 => 'la_opt_System'), 'use_phrases' => 1,
'required' => 1, 'not_null' => 1, 'default' => 1
@@ -153,9 +154,9 @@
0 => 'icon16_disabled.png',
),
'Fields' => Array (
- 'AgentId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
- 'AgentName' => Array ('title' => 'column:la_fld_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
- 'AgentType' => Array ('title' => 'column:la_fld_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ),
+ 'ScheduledTaskId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
+ 'Name' => Array ('filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'Type' => Array ('filter_block' => 'grid_options_filter', 'width' => 60, ),
'Event' => Array ('filter_block' => 'grid_like_filter', 'width' => 280, ),
'RunInterval' => Array ('filter_block' => 'grid_range_filter', 'width' => 100, ),
'RunMode' => Array ('filter_block' => 'grid_options_filter', 'width' => 85, ),
Index: core/units/forms/forms/forms_config.php
===================================================================
--- core/units/forms/forms/forms_config.php (revision 14858)
+++ core/units/forms/forms/forms_config.php (working copy)
@@ -30,7 +30,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array (
+ 'ScheduledTasks' => Array (
'check_submission_repies' => Array('EventName' => 'OnProcessReplies', 'RunInterval' => 3600, 'Type' => reAFTER),
'check_bounced_submission_repies' => Array('EventName' => 'OnProcessBouncedReplies', 'RunInterval' => 18000, 'Type' => reAFTER),
),
Index: core/units/images/image_event_handler.php
===================================================================
--- core/units/images/image_event_handler.php (revision 14868)
+++ core/units/images/image_event_handler.php (working copy)
@@ -368,7 +368,7 @@
}
/**
- * [AGENT] Remove unused images from "/system/images" and "/system/images/pending" folders
+ * [SCHEDULED TASK] Remove unused images from "/system/images" and "/system/images/pending" folders
*
* @param kEvent $event
*/
@@ -459,7 +459,7 @@
}
/**
- * [AGENT] Remove all images from "/system/images/resized" and "/system/images/pending/resized" folders
+ * [SCHEDULED TASK] Remove all images from "/system/images/resized" and "/system/images/pending/resized" folders
*
* @param kEvent $event
*/
Index: core/units/images/images_config.php
===================================================================
--- core/units/images/images_config.php (revision 14858)
+++ core/units/images/images_config.php (working copy)
@@ -69,7 +69,7 @@
4 => 'event',
),
- 'RegularEvents' => Array (
+ 'ScheduledTasks' => Array (
'clean_catalog_images' => Array ('EventName' => 'OnCleanImages', 'RunInterval' => 604800, 'Type' => reAFTER, 'Status' => STATUS_DISABLED),
'clean_resized_catalog_images' => Array ('EventName' => 'OnCleanResizedImages', 'RunInterval' => 2592000, 'Type' => reAFTER, 'Status' => STATUS_DISABLED),
),
Index: core/units/mailing_lists/mailing_lists_config.php
===================================================================
--- core/units/mailing_lists/mailing_lists_config.php (revision 14858)
+++ core/units/mailing_lists/mailing_lists_config.php (working copy)
@@ -31,7 +31,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array (
+ 'ScheduledTasks' => Array (
'generate_mailing_queue' => Array ('EventName' => 'OnGenerateEmailQueue', 'RunInterval' => 1800, 'Type' => reAFTER),
'process_mailing_queue' => Array ('EventName' => 'OnProcessEmailQueue', 'RunInterval' => 1800, 'Type' => reAFTER),
),
Index: core/units/users/users_config.php
===================================================================
--- core/units/users/users_config.php (revision 14858)
+++ core/units/users/users_config.php (working copy)
@@ -92,7 +92,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array(
+ 'ScheduledTasks' => Array(
'membership_expiration' => Array('EventName' => 'OnCheckExpiredMembership', 'RunInterval' => 1800, 'Type' => reAFTER),
'delete_expired_sessions' => Array('EventName' => 'OnDeleteExpiredSessions', 'RunInterval' => 43200, 'Type' => reAFTER),
),
Index: core/units/users/users_event_handler.php
===================================================================
--- core/units/users/users_event_handler.php (revision 14858)
+++ core/units/users/users_event_handler.php (working copy)
@@ -232,7 +232,7 @@
}
/**
- * [AGENT] Deletes expired sessions
+ * [SCHEDULED TASK] Deletes expired sessions
*
* @param kEvent $event
*/
Index: tools/cron.php
===================================================================
--- tools/cron.php (revision 14858)
+++ tools/cron.php (working copy)
@@ -35,8 +35,8 @@
$application->Init();
// events from request are not processed, only predefined regular events
- $application->EventManager->runAgents(reBEFORE, true);
- $application->EventManager->runAgents(reAFTER, true);
+ $application->EventManager->runScheduledTasks(reBEFORE, true);
+ $application->EventManager->runScheduledTasks(reAFTER, true);
$application->Done();
rename_agents_to_scheduled_tasks_modules_v2.patch [^] (7,376 bytes) 2011-12-16 09:02
[Show Content]
Index: in-auction/units/listing/listing_config.php
===================================================================
--- in-auction/units/listing/listing_config.php (revision 14858)
+++ in-auction/units/listing/listing_config.php (working copy)
@@ -22,7 +22,7 @@
'AutoLoad' => true,
- 'RegularEvents' => Array(
+ 'ScheduledTasks' => Array(
'list_items' => Array('EventName' => 'OnListItems', 'RunInterval' => 600, 'Type' => reAFTER),
),
Index: in-auction/units/sections/ebay_eh.php
===================================================================
--- in-auction/units/sections/ebay_eh.php (revision 14858)
+++ in-auction/units/sections/ebay_eh.php (working copy)
@@ -2936,9 +2936,9 @@
}
}
- function resetAgents()
+ function resetScheduledTasks()
{
- $sql = 'UPDATE ' . TABLE_PREFIX . 'Agents
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'ScheduledTasks
SET NextRunOn = NULL';
$this->Conn->Query($sql);
}
@@ -3330,7 +3330,7 @@
$this->ClearConfigCache();
// clear cache to process all eBay interaction with new token
- $this->resetAgents();
+ $this->resetScheduledTasks();
}
function ClearConfigCache()
@@ -3344,7 +3344,7 @@
}
/**
- * Regular event - delete old listings hits records
+ * [SCHEDULED TASK] Delete old listings hits records
*
* @param kEvent $event
*/
@@ -3414,11 +3414,14 @@
$this->ClearConfigCache();
// clear cache to process all eBay interaction with new token
- $this->resetAgents();
+ $this->resetScheduledTasks();
}
/**
- * Prepare data for getting token and redrect user to ebay for login
+ * Prepare data for getting token and redirect user to ebay for login
+ *
+ * @param kEvent $event
+ * @return void
*/
function OnAuthorizeForToken(&$event)
{
@@ -3479,7 +3482,7 @@
}
/**
- * Regular event - make ReviseCheckoutStatus API calls when necessary
+ * [SCHEDULED TASK] Make ReviseCheckoutStatus API calls when necessary
*
* @param kEvent $event
*/
@@ -3539,7 +3542,7 @@
}
/**
- * Regular event - receive all new feedbacks and put its data in eBayOrderItems table
+ * [SCHEDULED TASK] Receive all new feedbacks and put its data in eBayOrderItems table
*
* @param kEvent $event
*/
@@ -3657,7 +3660,7 @@
}
/**
- * Regular event - send positive feedbacks accordingly to config settings
+ * [SCHEDULED TASK] Send positive feedbacks accordingly to config settings
*
* @param kEvent $event
*/
@@ -3773,7 +3776,7 @@
}
/**
- * Regular event - send notifications to buyers which do not leave feedback
+ * [SCHEDULED TASK] Send notifications to buyers which do not leave feedback
*
* @param kEvent $event
*/
Index: in-auction/units/sections/sections_config.php
===================================================================
--- in-auction/units/sections/sections_config.php (revision 14858)
+++ in-auction/units/sections/sections_config.php (working copy)
@@ -26,7 +26,7 @@
// Array ('pseudo' => 'img_EventHandler', 'class' => 'EImageEventHandler', 'file' => 'image_eh.php'),
),
- 'RegularEvents' => Array(
+ 'ScheduledTasks' => Array(
'seller_transactions' => Array('EventName' => 'OnGetSellerTransactions', 'RunInterval' => 600, 'Type' => reAFTER),
'seller_list' => Array('EventName' => 'OnGetSellerList', 'RunInterval' => 600, 'Type' => reAFTER),
'auto_dispute' => Array('EventName' => 'OnAutoDispute', 'RunInterval' => 600, 'Type' => reAFTER),
Index: in-commerce/units/affiliates/affiliates_config.php
===================================================================
--- in-commerce/units/affiliates/affiliates_config.php (revision 14858)
+++ in-commerce/units/affiliates/affiliates_config.php (working copy)
@@ -85,7 +85,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array(
+ 'ScheduledTasks' => Array(
'store_affiliate' => Array('EventName' => 'OnStoreAffiliate', 'RunInterval' => 0, 'Type' => reBEFORE),
'reset_affiliate_stats' => Array('EventName' => 'OnResetStatistics', 'RunInterval' => 0, 'Type' => reBEFORE),
),
Index: in-commerce/units/orders/orders_event_handler.php
===================================================================
--- in-commerce/units/orders/orders_event_handler.php (revision 14858)
+++ in-commerce/units/orders/orders_event_handler.php (working copy)
@@ -3453,7 +3453,7 @@
}
/**
- * Regular event: checks what orders should expire and renew automatically (if such flag set)
+ * [SCHEDULED TASK] Checks what orders should expire and renew automatically (if such flag set)
*
* @param kEvent $event
*/
Index: in-link/units/link_validation/link_validation_config.php
===================================================================
--- in-link/units/link_validation/link_validation_config.php (revision 14858)
+++ in-link/units/link_validation/link_validation_config.php (working copy)
@@ -44,7 +44,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array (
+ 'ScheduledTasks' => Array (
'link_validation' => Array ('EventName' => 'OnCronValidation', 'RunInterval' => 3600*24, 'Type' => reAFTER),
),
Index: in-link/units/link_validation/link_validation_eh.php
===================================================================
--- in-link/units/link_validation/link_validation_eh.php (revision 14858)
+++ in-link/units/link_validation/link_validation_eh.php (working copy)
@@ -523,7 +523,7 @@
}
/**
- * [REGULAR EVENT] Performs link validation throught cron
+ * [SCHEDULED TASK] Performs link validation through cron
*
* @param kEvent $event
*/
Index: in-link/units/listings/listings_config.php
===================================================================
--- in-link/units/listings/listings_config.php (revision 14858)
+++ in-link/units/listings/listings_config.php (working copy)
@@ -43,7 +43,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array (
+ 'ScheduledTasks' => Array (
'listings_expiration' => Array ('EventName' => 'OnCheckExpiredPaidListings', 'RunInterval' => 1800, 'Type' => reAFTER),
),
Index: in-news/units/articles/articles_config.php
===================================================================
--- in-news/units/articles/articles_config.php (revision 14874)
+++ in-news/units/articles/articles_config.php (working copy)
@@ -131,7 +131,7 @@
5 => 'mode',
),
- 'RegularEvents' => Array (
+ 'ScheduledTasks' => Array (
'rss_category_update' => Array ('EventName' => 'OnUpdateRSSAtricles', 'RunInterval' => 0, 'Type' => reBEFORE),
),
Index: in-news/units/articles/articles_event_handler.php
===================================================================
--- in-news/units/articles/articles_event_handler.php (revision 14858)
+++ in-news/units/articles/articles_event_handler.php (working copy)
@@ -59,7 +59,7 @@
/**
- * [REGULAR EVENT] Deletes expired articles + update existing articles from rss feed with new data (key - article url)
+ * [SCHEDULED TASK] Deletes expired articles + update existing articles from rss feed with new data (key - article url)
*
* @param kEvent $event
*/
rename_agents_to_scheduled_tasks_core_v2-INSTALL_SCHEMA.patch [^] (1,199 bytes) 2011-12-18 19:05
[Show Content]
Index: install/install_schema.sql
===================================================================
--- install/install_schema.sql (revision 14880)
+++ install/install_schema.sql (working copy)
@@ -664,10 +664,10 @@
KEY QueryCrc (QueryCrc)
);
-CREATE TABLE Agents (
- AgentId int(11) NOT NULL auto_increment,
- AgentName varchar(255) NOT NULL default '',
- AgentType tinyint(3) unsigned NOT NULL default '1',
+CREATE TABLE ScheduledTasks (
+ ScheduledTaskId int(11) NOT NULL auto_increment,
+ `Name` varchar(255) NOT NULL default '',
+ `Type` tinyint(3) unsigned NOT NULL default '1',
Status tinyint(3) unsigned NOT NULL default '1',
Event varchar(255) NOT NULL default '',
RunInterval int(10) unsigned NOT NULL default '0',
@@ -679,11 +679,11 @@
Timeout int(10) UNSIGNED NULL,
LastTimeoutOn int(10) unsigned default NULL,
SiteDomainLimitation varchar(255) NOT NULL,
- PRIMARY KEY (AgentId),
+ PRIMARY KEY (ScheduledTaskId),
KEY Status (Status),
KEY RunInterval (RunInterval),
KEY RunMode (RunMode),
- KEY AgentType (AgentType),
+ KEY `Type` (`Type`),
KEY LastRunOn (LastRunOn),
KEY LastRunStatus (LastRunStatus),
KEY RunTime (RunTime),
agents_renaming_fix.patch [^] (5,243 bytes) 2011-12-19 04:11
[Show Content]
Index: install/install_schema.sql
===================================================================
--- install/install_schema.sql (revision 14881)
+++ install/install_schema.sql (working copy)
@@ -665,31 +665,31 @@
);
CREATE TABLE ScheduledTasks (
- ScheduledTaskId int(11) NOT NULL auto_increment,
- `Name` varchar(255) NOT NULL default '',
- `Type` tinyint(3) unsigned NOT NULL default '1',
- Status tinyint(3) unsigned NOT NULL default '1',
- Event varchar(255) NOT NULL default '',
- RunInterval int(10) unsigned NOT NULL default '0',
- RunMode tinyint(3) unsigned NOT NULL default '2',
- LastRunOn int(10) unsigned default NULL,
- LastRunStatus tinyint(3) unsigned NOT NULL default '1',
- NextRunOn int(11) default NULL,
- RunTime int(10) unsigned NOT NULL default '0',
- Timeout int(10) UNSIGNED NULL,
- LastTimeoutOn int(10) unsigned default NULL,
+ ScheduledTaskId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(255) NOT NULL DEFAULT '',
+ `Type` tinyint(3) unsigned NOT NULL DEFAULT '1',
+ `Status` tinyint(3) unsigned NOT NULL DEFAULT '1',
+ `Event` varchar(255) NOT NULL DEFAULT '',
+ RunInterval int(10) unsigned NOT NULL DEFAULT '0',
+ RunMode tinyint(3) unsigned NOT NULL DEFAULT '2',
+ LastRunOn int(10) unsigned DEFAULT NULL,
+ LastRunStatus tinyint(3) unsigned NOT NULL DEFAULT '1',
+ NextRunOn int(11) DEFAULT NULL,
+ RunTime int(10) unsigned NOT NULL DEFAULT '0',
+ Timeout int(10) unsigned DEFAULT NULL,
+ LastTimeoutOn int(10) unsigned DEFAULT NULL,
SiteDomainLimitation varchar(255) NOT NULL,
- PRIMARY KEY (ScheduledTaskId),
- KEY Status (Status),
+ PRIMARY KEY (ScheduledTaskId),
+ KEY `Status` (`Status`),
KEY RunInterval (RunInterval),
KEY RunMode (RunMode),
- KEY `Type` (`Type`),
KEY LastRunOn (LastRunOn),
KEY LastRunStatus (LastRunStatus),
KEY RunTime (RunTime),
KEY NextRunOn (NextRunOn),
+ KEY SiteDomainLimitation (SiteDomainLimitation),
KEY Timeout (Timeout),
- KEY SiteDomainLimitation (SiteDomainLimitation)
+ KEY `Type` (`Type`)
);
CREATE TABLE SpellingDictionary (
Index: install/remove_schema.sql
===================================================================
--- install/remove_schema.sql (revision 14881)
+++ install/remove_schema.sql (working copy)
@@ -33,7 +33,7 @@
DROP TABLE SessionLogs;
DROP TABLE StatisticsCapture;
DROP TABLE SlowSqlCapture;
-DROP TABLE Agents;
+DROP TABLE ScheduledTasks;
DROP TABLE SpellingDictionary;
DROP TABLE Thesaurus;
DROP TABLE LocalesList;
Index: install/steps_db.xml
===================================================================
--- install/steps_db.xml (revision 14881)
+++ install/steps_db.xml (working copy)
@@ -87,12 +87,12 @@
<p><b>Additional Recommendations:</b></p>
<p><b><i>1. Use Cron</i></b> (<a href="http://en.wikipedia.org/wiki/Cron" target="_blank">UNIX/BSD/Linux</a>) or <b>Task Scheduler</b> (<a href="http://en.wikipedia.org/wiki/Task_Scheduler" target="_blank">Windows</a>) to run Regular Events in your In-Portal.<br />
- It's highly recommended to setup your cron to run <b>every minute</b> so all system events that are enabled will run in the background based on their schedule. These events can be managed in Admin Console via <b><i>Configuration -> Website -> Agents</i></b> section.
+ It's highly recommended to setup your cron to run <b>every minute</b> so all system events that are enabled will run in the background based on their schedule. These events can be managed in Admin Console via <b><i>Configuration -> Website -> Scheduled Tasks</i></b> section.
<p>In-Portal <b>cron</b> file is located in <b>/tools/cron.php</b> folder and can be setup using hosting Control Panel or <a href="http://en.wikipedia.org/wiki/Cron" target="_blank">manually</a>. In Plesk or CPanel interfaces use dialog to add a new cron job and specify the following (use correct paths)<br />
<b>/absolute/path/to/bin/php -f /absolute/path/to/in-portal/tools/cron.php</b></p>
- <p><b><i>2. Adjust Agents</i></b><br />
- As was explained in the previous recommendation there is a <b><i>Configuration -> Website -> Agents</i></b> section where you can control Events triggered by the system. These events do their job to cleanup the data, old image files, check the data integrity, RSS feeds and other processes required for your In-Portal to run efficiently. We do recommend to review and enable/disable these events based on your website needs.</p>
+ <p><b><i>2. Adjust Scheduled Tasks</i></b><br />
+ As was explained in the previous recommendation there is a <b><i>Configuration -> Website -> Scheduled Tasks</i></b> section where you can control Events triggered by the system. These events do their job to cleanup the data, old image files, check the data integrity, RSS feeds and other processes required for your In-Portal to run efficiently. We do recommend to review and enable/disable these events based on your website needs.</p>
<p><b><i>3. Set Mail Server</i></b><br />
It's recommended to review and adjust your mail server settings once your In-Portal is up and running. This can be done in Admin Console under <b><i>Configuration -> Website -> Advanced</i></b> section.</p>
|