Index: trunk/core/units/categories/categories_event_handler.php =================================================================== diff -u -r3445 -r4029 --- trunk/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 3445) +++ trunk/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 4029) @@ -230,6 +230,25 @@ $this->Application->StoreVar('PermCache_UpdateRequired', 1); $event->SetRedirectParam('index_file', 'category/category_maint.php'); } + + /** + * Adds calculates fields for item statuses + * + * @param kCatDBItem $object + * @param kEvent $event + */ + function prepareObject(&$object, &$event) + { + $object =& $event->getObject( Array('skip_autoload' => true) ); + + $object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2, + IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '. + $this->Application->ConfigValue('Category_DaysNew'). + '*3600*24), 1, 0), + %1$s.NewItem + )'); + + } } ?> \ No newline at end of file