Index: trunk/core/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r4017 -r4029 --- trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4017) +++ trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4029) @@ -12,9 +12,19 @@ { $object =& $event->getObject(); - $item_type=$this->Application->GetVar('cf_type'); - $object->addFilter('itemtype_filter', '%1$s.Type = '.$item_type); - //$object->AddOrderField('DisplayOrder', 'ASC'); + $item_type = $this->Application->GetVar('cf_type'); + if (!$item_type) { + $prefix = $event->getEventParam('SourcePrefix'); + $item_type = $this->Application->getUnitOption($prefix, 'ItemType'); + } + + if ($event->Special == 'general') { + $object->addFilter('generaltab_filter', '%1$s.OnGeneralTab = 1'); + } + + if ($item_type) { + $object->addFilter('itemtype_filter', '%1$s.Type = '.$item_type); + } } /**