Page MenuHomeIn-Portal Phabricator

D344.id859.diff
No OneTemporary

File Metadata

Created
Fri, Oct 3, 4:16 AM

D344.id859.diff

Index: core/install/english.lang
===================================================================
--- core/install/english.lang
+++ core/install/english.lang
@@ -566,6 +566,7 @@
<PHRASE Label="la_fld_MetaKeywords" Module="Core" Type="1">TWV0YSBLZXl3b3Jkcw==</PHRASE>
<PHRASE Label="la_fld_MisspelledWord" Module="Core" Type="1" Column="TWlzc3BlbGxlZCBXb3Jk">TWlzc3BlbGxlZCBXb3Jk</PHRASE>
<PHRASE Label="la_fld_Modified" Module="Core" Type="1" Column="TW9kaWZpZWQgT24=">TW9kaWZpZWQ=</PHRASE>
+ <PHRASE Label="la_fld_ModifiedBy" Module="Core" Type="1" Column="TW9kaWZpZWQgQnk=">TW9kaWZpZWQgQnk=</PHRASE>
<PHRASE Label="la_fld_Module" Module="Core" Type="1" Column="TW9kdWxl">TW9kdWxl</PHRASE>
<PHRASE Label="la_fld_ModuleName" Module="Core" Type="1">TW9kdWxl</PHRASE>
<PHRASE Label="la_fld_MultiLingual" Module="Core" Type="1">TXVsdGlsaW5ndWFs</PHRASE>
Index: core/kernel/db/cat_event_handler.php
===================================================================
--- core/kernel/db/cat_event_handler.php
+++ core/kernel/db/cat_event_handler.php
@@ -902,6 +902,13 @@
if ( $object->GetOriginalField('CategoryId') != $target_category ) {
$object->MoveToCat($target_category);
}
+
+ if ( $object->GetChangedFields() ) {
+ $now = adodb_mktime();
+ $object->SetDBField('Modified_date', $now);
+ $object->SetDBField('Modified_time', $now);
+ $object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id'));
+ }
}
/**
@@ -1027,13 +1034,6 @@
$event->CallSubEvent('OnAfterItemDelete');
}
}
-
- if ( $object->GetChangedFields() ) {
- $now = adodb_mktime();
- $object->SetDBField('Modified_date', $now);
- $object->SetDBField('Modified_time', $now);
- $object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id'));
- }
}
/**
Index: modules/in-bulletin/admin_templates/topics/topics_edit.tpl
===================================================================
--- modules/in-bulletin/admin_templates/topics/topics_edit.tpl
+++ modules/in-bulletin/admin_templates/topics/topics_edit.tpl
@@ -79,6 +79,11 @@
<inp2:m_RenderElement name="inp_edit_box" prefix="bb" field="Priority" title="la_fld_Priority" size="4"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="bb" field="CreatedOn" title="la_fld_CreatedOn"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="bb" field="Modified" title="la_fld_Modified"/>
+
+ <inp2:m_if check="bb_Field" name="ModifiedById" db="db">
+ <inp2:m_RenderElement name="inp_label" prefix="bb" field="ModifiedById" title="la_fld_ModifiedBy"/>
+ </inp2:m_if>
+
<inp2:m_RenderElement name="inp_edit_box" prefix="bb" field="MetaKeywords" title="la_fld_MetaKeywords" size="70"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="bb" field="MetaDescription" title="la_fld_MetaDescription" control_options="{min_height: 100}" cols="70" rows="8"/>
Index: modules/in-bulletin/units/topics/topics_config.php
===================================================================
--- modules/in-bulletin/units/topics/topics_config.php
+++ modules/in-bulletin/units/topics/topics_config.php
@@ -308,6 +308,7 @@
'CalculatedFields' => Array (
'' => Array (
'UserName' => 'IF (ISNULL(u.Username), IF (%1$s.OwnerId = ' . USER_ROOT . ', "root", IF (%1$s.OwnerId = ' . USER_GUEST . ', "Guest", "n/a")), IF(u.Username = "", u.Email, u.Username))',
+ 'ModifiedBy' => 'IF (ISNULL(modified.Username), IF (%1$s.ModifiedById = ' . USER_ROOT . ', "root", IF (%1$s.ModifiedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(modified.Username = "", modified.Email, modified.Username))',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'CategoryFilename' => TABLE_PREFIX.'Categories.NamedParentPath',
@@ -336,6 +337,7 @@
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sPosting last_post ON last_post.PostingId = %1$s.LastPostId
LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
@@ -354,6 +356,7 @@
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sPosting last_post ON last_post.PostingId = %1$s.LastPostId
LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'
),
@@ -371,7 +374,7 @@
'Modified' => Array (
'type' => 'int',
'formatter' => 'kDateFormatter',
- 'required' => 1, 'default' => '#NOW#',
+ 'default' => null,
),
'TopicText' => Array (
'type' => 'string',
@@ -473,6 +476,7 @@
'VirtualFields' => Array (
'Relevance' => Array ('type' => 'float', 'default' => 0),
'UserName' => Array ('type' => 'string', 'default' => ''),
+ 'ModifiedBy' => array('type' => 'string', 'default' => ''),
'CategoryId' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
@@ -540,6 +544,8 @@
'Priority' => Array ('filter_block' => 'grid_range_filter', 'width' => 65),
'UserName' => Array ('title' => 'column:la_fld_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Modified' => array('filter_block' => 'grid_date_range_filter', 'width' => 145),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'LastPostDate' => Array ('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Posts' => Array ('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
@@ -562,6 +568,8 @@
'Priority' => Array ('filter_block' => 'grid_range_filter', 'width' => 65),
'UserName' => Array ('title' => 'column:la_fld_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Modified' => array('filter_block' => 'grid_date_range_filter', 'width' => 145),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'LastPostDate' => Array ('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Posts' => Array ('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
Index: modules/in-commerce/admin_templates/products/products_edit.tpl
===================================================================
--- modules/in-commerce/admin_templates/products/products_edit.tpl
+++ modules/in-commerce/admin_templates/products/products_edit.tpl
@@ -133,6 +133,12 @@
<inp2:m_RenderElement name="inp_edit_box" prefix="p" field="Priority" title="la_fld_Priority" size="4"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="p" field="CreatedOn" title="la_fld_CreatedOn" size="12"/>
+
+ <inp2:m_if check="p_Field" name="ModifiedById" db="db">
+ <inp2:m_RenderElement name="inp_label" prefix="p" field="Modified"/>
+ <inp2:m_RenderElement name="inp_label" prefix="p" field="ModifiedById" title="la_fld_ModifiedBy"/>
+ </inp2:m_if>
+
<inp2:m_RenderElement name="inp_edit_date_time" prefix="p" field="Expire" title="la_fld_Expire" size="12"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="p" field="MetaKeywords" title="la_fld_MetaKeywords" size="70"/>
Index: modules/in-commerce/units/products/products_config.php
===================================================================
--- modules/in-commerce/units/products/products_config.php
+++ modules/in-commerce/units/products/products_config.php
@@ -363,6 +363,7 @@
'CalculatedFields' => Array (
'' => Array (
+ 'ModifiedBy' => 'IF (ISNULL(modified.Username), IF (%1$s.ModifiedById = ' . USER_ROOT . ', "root", IF (%1$s.ModifiedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(modified.Username = "", modified.Email, modified.Username))',
'AltName' => 'img.AltName',
'SameImages' => 'img.SameImages',
'LocalThumb' => 'img.LocalThumb',
@@ -386,6 +387,7 @@
),
'showall' => Array (
+ 'ModifiedBy' => 'IF (ISNULL(modified.Username), IF (%1$s.ModifiedById = ' . USER_ROOT . ', "root", IF (%1$s.ModifiedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(modified.Username = "", modified.Email, modified.Username))',
'Price' => 'COALESCE(pricing.Price, 0)',
'Manufacturer' => TABLE_PREFIX.'Manufacturers.Name',
'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat',
@@ -411,6 +413,7 @@
LEFT JOIN '.TABLE_PREFIX.'%3$sProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'Manufacturers ON '.TABLE_PREFIX.'Manufacturers.ManufacturerId = %1$s.ManufacturerId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsCustomData cust ON %1$s.ResourceId = cust.ResourceId',
'showall' => 'SELECT %1$s.* %2$s FROM %1$s
@@ -420,6 +423,7 @@
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
{PERM_JOIN}
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
@@ -440,6 +444,7 @@
LEFT JOIN '.TABLE_PREFIX.'%3$sProductFiles files ON files.ProductId = %1$s.ProductId AND files.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsPricing pricing ON pricing.ProductId = %1$s.ProductId AND pricing.IsPrimary = 1
LEFT JOIN '.TABLE_PREFIX.'Manufacturers ON '.TABLE_PREFIX.'Manufacturers.ManufacturerId = %1$s.ManufacturerId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sProductsCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
@@ -507,8 +512,8 @@
),
'not_null' => 1, 'default' => 1,
),
- 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'ModifiedById' => Array ('type' => 'int', 'default' => NULL),
+ 'Modified' => array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'ModifiedById' => array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => array('invalid_option' => '!la_error_UserNotFound!'), 'options' => array(USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'default' => null),
'CreatedById' => Array (
'type' => 'int',
'formatter' => 'kLEFTFormatter',
@@ -564,6 +569,7 @@
'VirtualFields' => Array (
'Relevance' => Array ('type' => 'float', 'default' => 0),
+ 'ModifiedBy' => array('type' => 'string', 'default' => ''),
'Qty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'regexp' => '/^[\d]+$/', 'default' => 0),
'Price' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL),
'Cost' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL),
@@ -655,6 +661,8 @@
'QtyInStock' => Array ('title' => 'column:la_fld_Qty', 'data_block' => 'qty_td', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
'QtyBackOrdered' => Array ('title' => 'column:la_fld_QtyBackOrdered', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
'OnSale' => Array ('title' => 'column:la_fld_OnSale', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'Modified' => array('filter_block' => 'grid_date_range_filter', 'width' => 140),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
/*'Weight' => Array ( 'title' => 'la_col_ProductWeight', 'filter_block' => 'grid_range_filter', 'width' => 150, ),
'CreatedOn' => Array ( 'title' => 'la_col_ProductCreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ),
'BackOrderDate' => Array ( 'title' => 'la_col_ProductBackOrderDate', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ),*/
@@ -681,7 +689,8 @@
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'QtyInStock' => Array ('title' => 'column:la_fld_Qty', 'data_block' => 'qty_td', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
'QtyBackOrdered' => Array ('title' => 'column:la_fld_QtyBackOrdered', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
-
+ 'Modified' => array('filter_block' => 'grid_date_range_filter', 'width' => 140),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
),
),
),
Index: modules/in-link/admin_templates/links/links_edit.tpl
===================================================================
--- modules/in-link/admin_templates/links/links_edit.tpl
+++ modules/in-link/admin_templates/links/links_edit.tpl
@@ -89,6 +89,12 @@
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l" field="EditorsPick" title="la_fld_EditorsPick" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="Priority" title="la_fld_Priority" size="4" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="l" field="CreatedOn" title="la_fld_CreatedOn" display_original="1"/>
+
+ <inp2:m_if check="l_Field" name="ModifiedById" db="db">
+ <inp2:m_RenderElement name="inp_label" prefix="l" field="Modified"/>
+ <inp2:m_RenderElement name="inp_label" prefix="l" field="ModifiedById" title="la_fld_ModifiedBy"/>
+ </inp2:m_if>
+
<inp2:m_RenderElement name="inp_edit_date_time" prefix="l" field="Expire" title="la_fld_Expire" size="12" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="MetaKeywords" title="la_fld_MetaKeywords" size="60"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="l" field="MetaDescription" title="la_fld_MetaDescription" cols="60" rows="5"/>
Index: modules/in-link/units/links/links_config.php
===================================================================
--- modules/in-link/units/links/links_config.php
+++ modules/in-link/units/links/links_config.php
@@ -399,6 +399,7 @@
'CalculatedFields' => Array (
'' => Array (
'UserName' => 'IF (ISNULL(u.Username), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(u.Username = "", u.Email, u.Username))',
+ 'ModifiedBy' => 'IF (ISNULL(modified.Username), IF (%1$s.ModifiedById = ' . USER_ROOT . ', "root", IF (%1$s.ModifiedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(modified.Username = "", modified.Email, modified.Username))',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'CategoryFilename' => TABLE_PREFIX.'Categories.NamedParentPath',
@@ -432,6 +433,7 @@
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
@@ -449,6 +451,7 @@
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'
),
@@ -461,7 +464,7 @@
'Description' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null),
'Url' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Modified' => array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'Expire' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'Hits' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
'CachedRating' => Array ('type' => 'string', 'not_null' => 1, 'formatter' => 'kFormatter', 'default' => 0),
@@ -508,6 +511,7 @@
'VirtualFields' => Array (
'Relevance' => Array ('type' => 'float', 'default' => 0),
'UserName' => Array ('type' => 'string', 'default' => ''),
+ 'ModifiedBy' => array('type' => 'string', 'default' => ''),
'DupeCount' => Array ('type' => 'string', 'default' => ''),
'ListingTypeId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %1$s FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name', 'option_title_field' => 'Name', 'option_key_field' => 'ListingTypeId', 'default' => 0),
@@ -591,6 +595,7 @@
'Description' => Array ('first_chars' => 100, 'width' => 100, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Modified' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'Hits' => Array ('filter_block' => 'grid_range_filter', 'width' => 60, ),
'CachedRating' => Array ('title' => 'column:la_fld_Rating', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
@@ -615,6 +620,7 @@
'Description' => Array ('first_chars' => 100, 'width' => 100, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Modified' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'Hits' => Array ('filter_block' => 'grid_range_filter', 'width' => 60, ),
'CachedRating' => Array ('title' => 'column:la_fld_Rating', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
Index: modules/in-news/admin_templates/articles/articles_edit.tpl
===================================================================
--- modules/in-news/admin_templates/articles/articles_edit.tpl
+++ modules/in-news/admin_templates/articles/articles_edit.tpl
@@ -104,6 +104,12 @@
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="n" field="LeadCatStory" title="la_fld_LeadCatStory" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="n" field="Priority" title="la_fld_Priority" size="4" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="n" field="CreatedOn" title="la_fld_CreatedOn" display_original="1"/>
+
+ <inp2:m_if check="n_Field" name="ModifiedById" db="db">
+ <inp2:m_RenderElement name="inp_label" prefix="n" field="Modified"/>
+ <inp2:m_RenderElement name="inp_label" prefix="n" field="ModifiedById" title="la_fld_ModifiedBy"/>
+ </inp2:m_if>
+
<inp2:m_RenderElement name="inp_edit_date_time" prefix="n" field="StartDate" title="la_fld_StartDate" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="n" field="EndOn" title="la_fld_EndOn" display_original="1"/>
Index: modules/in-news/units/articles/articles_config.php
===================================================================
--- modules/in-news/units/articles/articles_config.php
+++ modules/in-news/units/articles/articles_config.php
@@ -335,6 +335,7 @@
'CalculatedFields' => Array (
'' => Array (
'UserName' => 'IF (ISNULL(u.Username), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(u.Username = "", u.Email, u.Username))',
+ 'ModifiedBy' => 'IF (ISNULL(modified.Username), IF (%1$s.ModifiedById = ' . USER_ROOT . ', "root", IF (%1$s.ModifiedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(modified.Username = "", modified.Email, modified.Username))',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'CategoryFilename' => TABLE_PREFIX.'Categories.NamedParentPath',
@@ -362,6 +363,7 @@
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
{PERM_JOIN}
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sNewsCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
@@ -379,6 +381,7 @@
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN ' . TABLE_PREFIX . 'Users modified ON %1$s.ModifiedById = modified.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sNewsCustomData cust ON %1$s.ResourceId = cust.ResourceId'
),
@@ -443,7 +446,7 @@
'PopItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'HotItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'Archived' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 2 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
- 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Modified' => array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'default' => NULL),
'OrgId' => Array ('type' => 'int', 'default' => null),
'MetaKeywords' => Array ('type' => 'string', 'default' => null),
@@ -455,6 +458,7 @@
'MoreCategories' => Array ('type' => 'string', 'default' => ''),
'UserName' => Array ('type' => 'string', 'default' => ''),
+ 'ModifiedBy' => array('type' => 'string', 'default' => ''),
'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
'cust_RssOriginalURL' => Array ('type' => 'string', 'default' => ''),
@@ -538,6 +542,8 @@
'LeadCatStory' => Array ('filter_block' => 'grid_options_filter', 'width' => 85, ),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 140, ),
+ 'Modified' => array('filter_block' => 'grid_date_range_filter', 'width' => 140),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
'StartDate' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'EndOn' => Array ('data_block' => 'article_expire_td', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
),
@@ -562,6 +568,8 @@
'LeadCatStory' => Array ('filter_block' => 'grid_options_filter', 'width' => 85, ),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 140, ),
+ 'Modified' => array('filter_block' => 'grid_date_range_filter', 'width' => 140),
+ 'ModifiedBy' => array('filter_block' => 'grid_like_filter', 'width' => 100),
'StartDate' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'EndOn' => Array ('data_block' => 'article_expire_td', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
),

Event Timeline