Index: trunk/kernel/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r6093 -r6625 --- trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 6093) +++ trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 6625) @@ -1,7 +1,7 @@ setEventParam('PermSection', $section); return parent::CheckPermission($event); } - + /** * Apply any custom changes to list's sql query * @@ -26,11 +26,11 @@ function SetCustomQuery(&$event) { $object =& $event->getObject(); - + // show only items that belong to selected module $module = $this->Application->GetVar('module'); $object->addFilter('module_filter', '%1$s.ModuleName = '.$this->Conn->qstr($module)); - + // don't show disabled search items $object->addFilter('active_filter', '%1$s.SimpleSearch <> -1'); } @@ -44,12 +44,12 @@ { if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { parent::OnUpdate($event); - + $conf_update = new kEvent('conf:OnUpdate'); $conf_update->redirect = false; $this->Application->HandleEvent($conf_update); } - + $event->SetRedirectParam('opener', 's'); } @@ -58,7 +58,7 @@ parent::OnCancel($event); $event->SetRedirectParam('opener', 's'); } - + /** * [HOOK] Enter description here... * @@ -71,14 +71,14 @@ // user & system custom fields are not searchable return false; } - + $object =& $event->getObject( Array('skip_autoload' => true) ); - + $custom_id = $custom_field->GetID(); if ($object->GetDBField('CustomFieldId') != $custom_id) { $object->Load($custom_id, 'CustomFieldId'); } - + $cf_search = Array(); $cf_search['DisplayOrder'] = $custom_field->GetDBField('DisplayOrder'); $cf_search['ElementType'] = $custom_field->GetDBField('ElementType'); @@ -87,16 +87,16 @@ $cf_search['Description'] = $custom_field->GetDBField('Prompt'); $cf_search['ConfigHeader'] = $custom_field->GetDBField('Heading'); // 'la_Text_CustomFields'; $cf_search['TableName'] = 'CustomField'; - + $sql = 'SELECT Module FROM '.TABLE_PREFIX.'ItemTypes WHERE ItemType = '.$custom_field->GetDBField('Type'); - + $cf_search['ModuleName'] = $this->Conn->GetOne($sql); - + $object->SetFieldsFromHash($cf_search); $object->SetDBField('CustomFieldId', $custom_id); - + $result = $object->isLoaded() ? $object->Update() : $object->Create(); } }