Index: branches/5.0.x/core/kernel/db/cat_dbitem.php =================================================================== diff -u -r12511 -r12535 --- branches/5.0.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 12511) +++ branches/5.0.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 12535) @@ -1,6 +1,6 @@ SetDBField('Modified_date', adodb_mktime() ); $this->SetDBField('Modified_time', adodb_mktime() ); - if ($this->mode != 't' && !$this->Application->IsAdmin()) { - $owner_field = $this->Application->getUnitOption($this->Prefix, 'OwnerField'); - if (!$owner_field) { - $owner_field = 'CreatedById'; - } + $is_admin = $this->Application->IsAdmin(); + $owner_field = $this->Application->getUnitOption($this->Prefix, 'OwnerField'); + + if (!$owner_field) { + $owner_field = 'CreatedById'; + } + + if ((!$this->IsTempTable() && !$is_admin) || ($is_admin && !$this->GetDBField($owner_field))) { $this->SetDBField($owner_field, $this->Application->RecallVar('user_id')); } Index: branches/5.0.x/core/units/languages/languages_config.php =================================================================== diff -u -r12495 -r12535 --- branches/5.0.x/core/units/languages/languages_config.php (.../languages_config.php) (revision 12495) +++ branches/5.0.x/core/units/languages/languages_config.php (.../languages_config.php) (revision 12535) @@ -1,6 +1,6 @@ Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks!", - 'toolbar_button' => Array ('new_item', 'edit', 'delete', 'export', 'import', 'setprimary', 'refresh', 'view', 'dbl-click'), + 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'export', 'import', 'setprimary', 'refresh', 'view', 'dbl-click'), ), 'languages_edit_general' => Array( 'prefixes' => Array('lang'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_General!"), Index: branches/5.0.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -r12525 -r12535 --- branches/5.0.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 12525) +++ branches/5.0.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 12535) @@ -1,6 +1,6 @@ preparePriorities($event, true, 'ParentId = ' . $category_id); + + // 4. set default owner + $object->SetDBField('CreatedById', $this->Application->RecallVar('user_id')); } /** @@ -1241,6 +1244,11 @@ { parent::OnBeforeItemUpdate($event); + $object =& $event->getObject(); + /* @var $object kDBItem */ + + $object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); + $this->_beforeItemChange($event); } @@ -1467,6 +1475,10 @@ $object =& $event->getObject(); /* @var $object kDBItem */ + $now = adodb_mktime(); + + $object->SetDBField('Modified_date', $now); + $object->SetDBField('Modified_time', $now); $object->SetDBField('Template', $this->_stripTemplateExtension( $object->GetDBField('Template') )); if ($object->GetDBField('IsSystem') == 1) { Index: branches/5.0.x/core/units/agents/agents_config.php =================================================================== diff -u -r12495 -r12535 --- branches/5.0.x/core/units/agents/agents_config.php (.../agents_config.php) (revision 12495) +++ branches/5.0.x/core/units/agents/agents_config.php (.../agents_config.php) (revision 12535) @@ -1,6 +1,6 @@ Array ( 'prefixes' => Array ('agent_List'), 'format' => "!la_title_Agents!", - 'toolbar_button' => Array ('new_agent', 'edit', 'delete', 'approve', 'decline', 'cancel', 'view', 'dbl-click'), + 'toolbar_buttons' => Array ('new_agent', 'edit', 'delete', 'approve', 'decline', 'cancel', 'view', 'dbl-click'), ), 'agent_edit' => Array ('prefixes' => Array ('agent'), 'format' => "#agent_status# '#agent_titlefield#'", - 'toolbar_button' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), + 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), ), ), Index: branches/5.0.x/core/units/email_events/email_events_config.php =================================================================== diff -u -r12495 -r12535 --- branches/5.0.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 12495) +++ branches/5.0.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 12535) @@ -1,6 +1,6 @@ Array ( 'prefixes' => Array ('emailevents'), 'format' => "#emailevents_status# '#emailevents_titlefield#'", - 'toolbar_button' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), + 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), ), 'email_send_form' => Array ('prefixes' => Array (), 'format' => '!la_title_SendEmail!'), Index: branches/5.0.x/admin/system_presets/simple/thesaurus_thesaurus.php =================================================================== diff -u -r12329 -r12535 --- branches/5.0.x/admin/system_presets/simple/thesaurus_thesaurus.php (.../thesaurus_thesaurus.php) (revision 12329) +++ branches/5.0.x/admin/system_presets/simple/thesaurus_thesaurus.php (.../thesaurus_thesaurus.php) (revision 12535) @@ -9,7 +9,7 @@ // sections shown with debug on $debug_only_sections = Array ( - 'in-portal:thesaurus', +// 'in-portal:thesaurus', ); // toolbar buttons Index: branches/5.0.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -r12511 -r12535 --- branches/5.0.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12511) +++ branches/5.0.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12535) @@ -1,6 +1,6 @@ Application->SetVar('t', $error_template); $this->Application->SetVar('m_cat_id', $themes_helper->getPageByTemplate($error_template)); + // in case if missing item is recalled first from event (not from template) + $this->Application->InitParser(); $this->Application->HTML = $this->Application->ParseBlock( Array ('name' => $error_template) ); $this->Application->Done(); exit; Index: branches/5.0.x/core/units/categories/categories_item.php =================================================================== diff -u -r12511 -r12535 --- branches/5.0.x/core/units/categories/categories_item.php (.../categories_item.php) (revision 12511) +++ branches/5.0.x/core/units/categories/categories_item.php (.../categories_item.php) (revision 12535) @@ -1,6 +1,6 @@ SetDBField('CreatedById', $this->Application->RecallVar('user_id') ); - $this->SetDBField('CreatedOn_date', adodb_mktime() ); - $this->SetDBField('CreatedOn_time', adodb_mktime() ); + $is_admin = $this->Application->IsAdmin(); + if ((!$this->IsTempTable() && !$is_admin) || ($is_admin && !$this->GetDBField('CreatedById'))) { + $this->SetDBField('CreatedById', $this->Application->RecallVar('user_id')); + } + $parent_category = $this->GetDBField('ParentId') > 0 ? $this->GetDBField('ParentId') : $this->Application->GetVar('m_cat_id'); $this->SetDBField('ParentId', $parent_category); Index: branches/5.0.x/admin/system_presets/simple/categories_c.php =================================================================== diff -u -r12519 -r12535 --- branches/5.0.x/admin/system_presets/simple/categories_c.php (.../categories_c.php) (revision 12519) +++ branches/5.0.x/admin/system_presets/simple/categories_c.php (.../categories_c.php) (revision 12535) @@ -42,7 +42,7 @@ $hidden_fields = Array ( 'CategoryId', /*'Type',*/ 'SymLinkCategoryId', /*'ParentId', 'Name', 'Filename', 'AutomaticFilename',*/ 'Description', 'CreatedOn', 'EditorsPick', 'Status', /*'Priority', 'MetaKeywords', 'CachedDescendantCatsQty', - 'CachedNavbar', 'CreatedById', 'ResourceId', 'ParentPath', 'TreeLeft', 'TreeRight', 'NamedParentPath', + 'CachedNavbar',*/ 'CreatedById', /*'ResourceId', 'ParentPath', 'TreeLeft', 'TreeRight', 'NamedParentPath', 'MetaDescription', 'HotItem',*/ 'NewItem', /*'PopItem', 'Modified', 'ModifiedById', 'CachedTemplate',*/ 'Template', 'UseExternalUrl', 'ExternalUrl', 'UseMenuIconUrl', 'MenuIconUrl', 'Title', 'MenuTitle', /*'MetaTitle', 'IndexTools', 'IsIndex', 'IsMenu', 'IsSystem',*/ 'FormId', 'FormSubmittedTemplate', Index: branches/5.0.x/core/admin_templates/categories/categories_edit.tpl =================================================================== diff -u -r12231 -r12535 --- branches/5.0.x/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 12231) +++ branches/5.0.x/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 12535) @@ -63,10 +63,11 @@
- + +