Index: trunk/core/units/categories/categories_config.php =================================================================== diff -u -r3787 -r4029 --- trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 3787) +++ trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4029) @@ -21,7 +21,7 @@ ), 'IDField' => 'CategoryId', 'TitleField' => 'Name', // field, used in bluebar when editing existing item - 'ItemType' => 0, // this is used when relation to product is added from in-portal and via-versa + 'ItemType' => 1, // used for custom fields only 'TableName' => TABLE_PREFIX.'Category', 'ViewMenuPhrase' => 'la_text_Categories', @@ -31,18 +31,14 @@ ), - 'ListSQLs' => Array( ''=> 'SELECT %1$s.* %2$s, - IF(%1$s.NewItem = 2, - IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - 10*3600*24), 1, 0), - %1$s.NewItem) AS IsNew '. // 10 - Category_NewDays value from ConfigurationValues table - 'FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId'), - // key - special, value - list select sql - 'ItemSQLs' => Array( ''=> 'SELECT *, - IF(%1$s.NewItem = 2, - IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - 10*3600*24), 1, 0), - %1$s.NewItem) AS IsNew '. // 10 - Category_NewDays value from ConfigurationValues table - 'FROM %s'), + 'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId + LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'), + + 'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'), 'ListSortings' => Array( '' => Array( @@ -87,6 +83,7 @@ 'VirtualFields' => Array( 'CurrentSort' => Array('type' => 'string', 'default' => ''), + 'IsNew' => Array('type' => 'int', 'default' => 0), ), 'Grids' => Array(