Index: trunk/core/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r4043 -r4052 --- trunk/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4043) +++ trunk/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4052) @@ -13,9 +13,13 @@ { $object =& $event->getObject(); + // show only items that belong to selected module $module_owner = $this->Application->GetLinkedVar('module'); $this->Application->LinkVar('section'); $object->addFilter('module_filter', '%1$s.ModuleName = '.$this->Conn->qstr($module_owner)); + + // don't show disabled search items + $object->addFilter('active_filter', '%1$s.SimpleSearch <> -1'); } /** @@ -73,8 +77,6 @@ $cf_search['ConfigHeader'] = $custom_field->GetDBField('Heading'); // 'la_Text_CustomFields'; $cf_search['TableName'] = 'CustomField'; $cf_search['ModuleName'] = $module_name; - $cf_search['ForeignField'] = 'CustomMetaData.Value'; - $cf_search['JoinClause'] = '{ForeignTable}.ResourceId={LocalTable}.ResourceId'; $object->SetFieldsFromHash($cf_search); $result = $object->isLoaded() ? $object->Update() : $object->Create(); Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -N -r4043 -r4052 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4043) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4052) @@ -658,15 +658,23 @@ // field processing $weight_sum = 0; + + $alias_counter = 0; + + $custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields'); + if ($custom_fields) { + $custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName'); + $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId'; + } + foreach($field_list as $key => $field) { $options = $object->getFieldOptions($field); $local_table = TABLE_PREFIX.$search_config[$field]['TableName']; $weight_sum += $search_config[$field]['Priority']; // counting weight sum; used when making relevance clause // processing multilingual fields - if($options['formatter'] == 'kMultiLanguage') - { + if (getArrayValue($options, 'formatter') == 'kMultiLanguage') { $field_list[$key] = 'l'.$lang.'_'.$field; } @@ -691,30 +699,26 @@ } else { - $exploded = explode('.', $foreign_field); + $exploded = explode('.', $foreign_field); // format: table.field_name $foreign_table = TABLE_PREFIX.$exploded[0]; - - if($search_config[$field]['CustomFieldId']) { - $exploded[1] = 'l'.$lang.'_'.$exploded[1]; - } - + $alias_counter++; $alias = 't'.$alias_counter; $field_list[$key] = $alias.'.'.$exploded[1]; $join_clause = str_replace('{ForeignTable}', $alias, $search_config[$field]['JoinClause']); $join_clause = str_replace('{LocalTable}', $product_table, $join_clause); - if($search_config[$field]['CustomFieldId']) - { - $join_clause .= ' AND '.$alias.'.CustomFieldId='.$search_config[$field]['CustomFieldId']; - } + $join_clauses[] = ' LEFT JOIN '.$foreign_table.' '.$alias.' ON '.$join_clause; } } - else - { + else { // processing fields from local table + if ($search_config[$field]['CustomFieldId']) { + $local_table = 'custom_data'; + $field_list[$key] = 'l'.$lang.'_cust_'.array_search($field_list[$key], $custom_fields); + } $field_list[$key] = $local_table.'.'.$field_list[$key]; } } @@ -860,9 +864,9 @@ $revelance_parts[] = 'IF('.$field.' LIKE "%'.$keyword.'%", '.$config_elem['value']['Priority'].', 0)'; } } - $rel_keywords = $this->Application->ConfigValue('SearchRel_DefaultKeyword_products') / 100; - $rel_pop = $this->Application->ConfigValue('SearchRel_DefaultPop_products') / 100; - $rel_rating = $this->Application->ConfigValue('SearchRel_DefaultRating_products') / 100; + $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100; + $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100; + $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100; $relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords; $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop; $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating; @@ -959,6 +963,13 @@ 'isnot' => '(%1$s != %2$s OR %1$s IS NULL)'); $alias_counter = 0; + + $custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields'); + if ($custom_fields) { + $custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName'); + $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId'; + } + $weight_sum = 0; // processing fields and preparing conditions foreach($search_config as $record) @@ -974,18 +985,15 @@ $weight_sum += $record['Priority']; // counting weight sum; used when making relevance clause // processing multilingual fields - if($options['formatter'] == 'kMultiLanguage') - { + if (getArrayValue($options, 'formatter') == 'kMultiLanguage') { $field_name = 'l'.$lang.'_'.$field; } - else - { + else { $field_name = $field; } - + // processing fields from other tables - if($foreign_field = $record['ForeignField']) - { + if ($foreign_field = $record['ForeignField']) { $exploded = explode(':', $foreign_field, 2); if($exploded[0] == 'CALC') { @@ -1000,8 +1008,7 @@ $condition_mode = 'HAVING'; } - else - { + else { $exploded = explode('.', $foreign_field); $foreign_table = TABLE_PREFIX.$exploded[0]; @@ -1027,6 +1034,11 @@ else { // processing fields from local table + if ($record['CustomFieldId']) { + $local_table = 'custom_data'; + $field_name = 'l'.$lang.'_cust_'.array_search($field_name, $custom_fields); + } + $field_name = $local_table.'.'.$field_name; } @@ -1172,9 +1184,9 @@ // making relevance clause if($relevance_parts) { - $rel_keywords = $this->Application->ConfigValue('SearchRel_DefaultKeyword_products') / 100; - $rel_pop = $this->Application->ConfigValue('SearchRel_DefaultPop_products') / 100; - $rel_rating = $this->Application->ConfigValue('SearchRel_DefaultRating_products') / 100; + $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100; + $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100; + $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100; $relevance_clause = '('.implode(' + ', $relevance_parts).') / '.$weight_sum.' * '.$rel_keywords; $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop; $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating; Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r4043 -r4052 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4043) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4052) @@ -658,15 +658,23 @@ // field processing $weight_sum = 0; + + $alias_counter = 0; + + $custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields'); + if ($custom_fields) { + $custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName'); + $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId'; + } + foreach($field_list as $key => $field) { $options = $object->getFieldOptions($field); $local_table = TABLE_PREFIX.$search_config[$field]['TableName']; $weight_sum += $search_config[$field]['Priority']; // counting weight sum; used when making relevance clause // processing multilingual fields - if($options['formatter'] == 'kMultiLanguage') - { + if (getArrayValue($options, 'formatter') == 'kMultiLanguage') { $field_list[$key] = 'l'.$lang.'_'.$field; } @@ -691,30 +699,26 @@ } else { - $exploded = explode('.', $foreign_field); + $exploded = explode('.', $foreign_field); // format: table.field_name $foreign_table = TABLE_PREFIX.$exploded[0]; - - if($search_config[$field]['CustomFieldId']) { - $exploded[1] = 'l'.$lang.'_'.$exploded[1]; - } - + $alias_counter++; $alias = 't'.$alias_counter; $field_list[$key] = $alias.'.'.$exploded[1]; $join_clause = str_replace('{ForeignTable}', $alias, $search_config[$field]['JoinClause']); $join_clause = str_replace('{LocalTable}', $product_table, $join_clause); - if($search_config[$field]['CustomFieldId']) - { - $join_clause .= ' AND '.$alias.'.CustomFieldId='.$search_config[$field]['CustomFieldId']; - } + $join_clauses[] = ' LEFT JOIN '.$foreign_table.' '.$alias.' ON '.$join_clause; } } - else - { + else { // processing fields from local table + if ($search_config[$field]['CustomFieldId']) { + $local_table = 'custom_data'; + $field_list[$key] = 'l'.$lang.'_cust_'.array_search($field_list[$key], $custom_fields); + } $field_list[$key] = $local_table.'.'.$field_list[$key]; } } @@ -860,9 +864,9 @@ $revelance_parts[] = 'IF('.$field.' LIKE "%'.$keyword.'%", '.$config_elem['value']['Priority'].', 0)'; } } - $rel_keywords = $this->Application->ConfigValue('SearchRel_DefaultKeyword_products') / 100; - $rel_pop = $this->Application->ConfigValue('SearchRel_DefaultPop_products') / 100; - $rel_rating = $this->Application->ConfigValue('SearchRel_DefaultRating_products') / 100; + $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100; + $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100; + $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100; $relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords; $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop; $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating; @@ -959,6 +963,13 @@ 'isnot' => '(%1$s != %2$s OR %1$s IS NULL)'); $alias_counter = 0; + + $custom_fields = $this->Application->getUnitOption($event->Prefix, 'CustomFields'); + if ($custom_fields) { + $custom_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName'); + $join_clauses[] = ' LEFT JOIN '.$custom_table.' custom_data ON '.$product_table.'.ResourceId = custom_data.ResourceId'; + } + $weight_sum = 0; // processing fields and preparing conditions foreach($search_config as $record) @@ -974,18 +985,15 @@ $weight_sum += $record['Priority']; // counting weight sum; used when making relevance clause // processing multilingual fields - if($options['formatter'] == 'kMultiLanguage') - { + if (getArrayValue($options, 'formatter') == 'kMultiLanguage') { $field_name = 'l'.$lang.'_'.$field; } - else - { + else { $field_name = $field; } - + // processing fields from other tables - if($foreign_field = $record['ForeignField']) - { + if ($foreign_field = $record['ForeignField']) { $exploded = explode(':', $foreign_field, 2); if($exploded[0] == 'CALC') { @@ -1000,8 +1008,7 @@ $condition_mode = 'HAVING'; } - else - { + else { $exploded = explode('.', $foreign_field); $foreign_table = TABLE_PREFIX.$exploded[0]; @@ -1027,6 +1034,11 @@ else { // processing fields from local table + if ($record['CustomFieldId']) { + $local_table = 'custom_data'; + $field_name = 'l'.$lang.'_cust_'.array_search($field_name, $custom_fields); + } + $field_name = $local_table.'.'.$field_name; } @@ -1172,9 +1184,9 @@ // making relevance clause if($relevance_parts) { - $rel_keywords = $this->Application->ConfigValue('SearchRel_DefaultKeyword_products') / 100; - $rel_pop = $this->Application->ConfigValue('SearchRel_DefaultPop_products') / 100; - $rel_rating = $this->Application->ConfigValue('SearchRel_DefaultRating_products') / 100; + $rel_keywords = $this->Application->ConfigValue('SearchRel_Keyword_products') / 100; + $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_products') / 100; + $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_products') / 100; $relevance_clause = '('.implode(' + ', $relevance_parts).') / '.$weight_sum.' * '.$rel_keywords; $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop; $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating; Index: trunk/admin/install/inportal_schema.sql =================================================================== diff -u -N -r4029 -r4052 --- trunk/admin/install/inportal_schema.sql (.../inportal_schema.sql) (revision 4029) +++ trunk/admin/install/inportal_schema.sql (.../inportal_schema.sql) (revision 4052) @@ -710,12 +710,14 @@ CREATE TABLE PortalUserCustomData ( CustomDataId int(11) NOT NULL auto_increment, ResourceId int(10) unsigned NOT NULL default '0', + UNIQUE KEY ResourceId (ResourceId), PRIMARY KEY (CustomDataId) ) # -------------------------------------------------------- CREATE TABLE CategoryCustomData ( CustomDataId int(11) NOT NULL auto_increment, ResourceId int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`CustomDataId`) + UNIQUE KEY ResourceId (ResourceId), + PRIMARY KEY (CustomDataId) ) # -------------------------------------------------------- Index: trunk/kernel/admin/include/navmenu.php =================================================================== diff -u -N -r4029 -r4052 --- trunk/kernel/admin/include/navmenu.php (.../navmenu.php) (revision 4029) +++ trunk/kernel/admin/include/navmenu.php (.../navmenu.php) (revision 4052) @@ -40,8 +40,8 @@ $admin."/icons/icon46_cat_settings.gif", $admin."/icons/icon24_cat_settings.gif", NULL, "in-portal:site","in-portal:advanced_view", "in-portal:configuration_search",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_cat_settings.gif","la_updating_config"); -$objSections->AddSection("in-portal:configuration_search", "la_tab_ConfigSearch", "la_tab_ConfigSearch", $admin."/config/", - "config_search.php?&module=In-Portal§ion=in-portal:configuration_search", +$objSections->AddSection("in-portal:configuration_search", "la_tab_ConfigSearch", "la_tab_ConfigSearch", + $admin.'/index4.php?module=In-Portal§ion=in-portal:configuration_search&module_key=category','kernel4:config/config_search', $admin."/icons/icon46_settings_search.gif",$admin."/icons/icon24_settings_search.gif", NULL, "in-portal:site", "in-portal:configure_categories","in-portal:configuration_email",0,"",1, NULL,NULL,NULL,$admin."/icons/icon46_list_settings_search.gif","la_updating_config"); Index: trunk/kernel/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r4043 -r4052 --- trunk/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4043) +++ trunk/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4052) @@ -56,11 +56,23 @@ return $o; } - function PrintConfList($params){ - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); - $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); + function getModuleItemName() + { + $module = $this->Application->GetVar('module'); + $table = $this->Application->getUnitOption('confs', 'TableName'); - $list->PerPage=-1; + $sql = 'SELECT ConfigHeader + FROM '.$table.' + WHERE ModuleName = '.$this->Conn->qstr($module); + return $this->Conn->GetOne($sql); + } + + function PrintConfList($params) + { + $list =& $this->GetList($params); + $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); + + $list->PerPage = -1; $list->Query(); $o = ''; $list->GoFirst(); @@ -77,8 +89,9 @@ $list->Records = $tmp_row; $block_params = $this->prepareTagParams($params); - $block_params['name'] = $params['block']; - + $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['module_key'] = $this->Application->GetLinkedVar('module_key'); + $block_params['module_item'] = $this->getModuleItemName(); $list->GoFirst(); return $this->Application->ParseBlock($block_params, 1); Index: trunk/core/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r4043 -r4052 --- trunk/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4043) +++ trunk/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4052) @@ -56,11 +56,23 @@ return $o; } - function PrintConfList($params){ - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); - $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); + function getModuleItemName() + { + $module = $this->Application->GetVar('module'); + $table = $this->Application->getUnitOption('confs', 'TableName'); - $list->PerPage=-1; + $sql = 'SELECT ConfigHeader + FROM '.$table.' + WHERE ModuleName = '.$this->Conn->qstr($module); + return $this->Conn->GetOne($sql); + } + + function PrintConfList($params) + { + $list =& $this->GetList($params); + $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); + + $list->PerPage = -1; $list->Query(); $o = ''; $list->GoFirst(); @@ -77,8 +89,9 @@ $list->Records = $tmp_row; $block_params = $this->prepareTagParams($params); - $block_params['name'] = $params['block']; - + $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['module_key'] = $this->Application->GetLinkedVar('module_key'); + $block_params['module_item'] = $this->getModuleItemName(); $list->GoFirst(); return $this->Application->ParseBlock($block_params, 1); Index: trunk/admin/install/upgrades/inportal_upgrade_v1.1.8.sql =================================================================== diff -u -N -r3999 -r4052 --- trunk/admin/install/upgrades/inportal_upgrade_v1.1.8.sql (.../inportal_upgrade_v1.1.8.sql) (revision 3999) +++ trunk/admin/install/upgrades/inportal_upgrade_v1.1.8.sql (.../inportal_upgrade_v1.1.8.sql) (revision 4052) @@ -1,4 +1,15 @@ UPDATE SearchConfig SET CustomFieldId = NULL WHERE CustomFieldId = 0; ALTER TABLE SearchConfig CHANGE CustomFieldId CustomFieldId INT(11) NULL DEFAULT NULL; +UPDATE SearchConfig SET SimpleSearch = -1 WHERE TableName = 'PortalUser' AND ModuleName = 'In-Portal'; +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_category', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_category', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_category', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_category', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1); + +UPDATE ConfigurationValues SET Section = 'in-portal:configuration_search' WHERE VariableName LIKE 'SearchRel_%_category' OR VariableName = 'Search_ShowMultiple_category'; + +CREATE TABLE PortalUserCustomData (CustomDataId int(11) NOT NULL auto_increment, ResourceId int(10) unsigned NOT NULL default '0', UNIQUE KEY ResourceId (ResourceId), PRIMARY KEY (CustomDataId)); +CREATE TABLE CategoryCustomData (CustomDataId int(11) NOT NULL auto_increment, ResourceId int(10) unsigned NOT NULL default '0', UNIQUE KEY ResourceId (ResourceId), PRIMARY KEY (CustomDataId)); + UPDATE Modules SET Version = '1.1.8' WHERE Name = 'In-Portal'; \ No newline at end of file Index: trunk/kernel/frontaction.php =================================================================== diff -u -N -r3983 -r4052 --- trunk/kernel/frontaction.php (.../frontaction.php) (revision 3983) +++ trunk/kernel/frontaction.php (.../frontaction.php) (revision 4052) @@ -957,12 +957,15 @@ $objSearch->SetKeywords($keywords); $objSearch->AddSimpleFields(); - if(is_numeric($objConfig->Get("SearchRel_Pop_category"))) + if (is_numeric($objConfig->Get("SearchRel_Pop_category"))) { $objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100); - if(is_numeric($objConfig->Get("SearchRel_Keyword_category"))) + } + if (is_numeric($objConfig->Get("SearchRel_Keyword_category"))) { $objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100); - if(is_numeric($objConfig->Get("SearchRel_Rating_article"))) + } + if (is_numeric($objConfig->Get("SearchRel_Rating_category"))) { $objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100); + } //echo "Searching On $keywords
\n"; $objSearch->PerformSearch(1,$SortOrder,TRUE); @@ -1098,12 +1101,15 @@ $objSearch->SetKeywords($keywords); $objSearch->AddSimpleFields(); - if(is_numeric($objConfig->Get("SearchRel_Pop_category"))) + if (is_numeric($objConfig->Get("SearchRel_Pop_category"))) { $objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100); - if(is_numeric($objConfig->Get("SearchRel_Keyword_category"))) + } + if (is_numeric($objConfig->Get("SearchRel_Keyword_category"))) { $objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100); - if(is_numeric($objConfig->Get("SearchRel_Rating_article"))) + } + if (is_numeric($objConfig->Get("SearchRel_Rating_category"))) { $objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100); + } $SearchResultIdList = $objSearch->Result_IdList(); if(count($SearchResultIdList)>0) Index: trunk/kernel/admin_templates/config/config_search.tpl =================================================================== diff -u -N --- trunk/kernel/admin_templates/config/config_search.tpl (revision 0) +++ trunk/kernel/admin_templates/config/config_search.tpl (revision 4052) @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + " id="_cb_" onclick="update_checkbox(this, document.getElementById(''))" > + " name="" value=""> + + + + + + + " value="" size="3" /> + + + + + + + + + + + + + "> + + + +
[] +
+ + + + + +
+ + + + + + + + + "> + + + ][VariableValue]" VALUE="">% + + + + "> + + + ][VariableValue]" value="">%     + ][VariableValue]" value="">%     + ][VariableValue]" value="">% + + + + + + + + + + + "> + + + ][VariableValue]" id="_cb_conf[Search_ShowMultiple_][VariableValue]" onclick="update_checkbox(this, document.getElementById('conf[Search_ShowMultiple_][VariableValue]'))" > + ][VariableValue]" name="conf[Search_ShowMultiple_][VariableValue]" value=""> + + + + + + + +
+ + + +
+ + \ No newline at end of file Index: trunk/kernel/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r4043 -r4052 --- trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4043) +++ trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4052) @@ -13,9 +13,13 @@ { $object =& $event->getObject(); + // show only items that belong to selected module $module_owner = $this->Application->GetLinkedVar('module'); $this->Application->LinkVar('section'); $object->addFilter('module_filter', '%1$s.ModuleName = '.$this->Conn->qstr($module_owner)); + + // don't show disabled search items + $object->addFilter('active_filter', '%1$s.SimpleSearch <> -1'); } /** @@ -73,8 +77,6 @@ $cf_search['ConfigHeader'] = $custom_field->GetDBField('Heading'); // 'la_Text_CustomFields'; $cf_search['TableName'] = 'CustomField'; $cf_search['ModuleName'] = $module_name; - $cf_search['ForeignField'] = 'CustomMetaData.Value'; - $cf_search['JoinClause'] = '{ForeignTable}.ResourceId={LocalTable}.ResourceId'; $object->SetFieldsFromHash($cf_search); $result = $object->isLoaded() ? $object->Update() : $object->Create(); Index: trunk/kernel/include/searchitems.php =================================================================== diff -u -N -r3873 -r4052 --- trunk/kernel/include/searchitems.php (.../searchitems.php) (revision 3873) +++ trunk/kernel/include/searchitems.php (.../searchitems.php) (revision 4052) @@ -282,7 +282,7 @@ function AddSimpleFields() { - $sql = "SELECT * FROM ".GetTablePrefix()."SearchConfig WHERE TableName='".$this->SourceTable."' AND SimpleSearch=1 AND CustomFieldId=0"; + $sql = "SELECT * FROM ".GetTablePrefix()."SearchConfig WHERE TableName='".$this->SourceTable."' AND SimpleSearch=1 AND CustomFieldId IS NULL"; //echo $sql; foreach($this->Relationships as $Table=>$clause) { @@ -437,8 +437,9 @@ $SelectSQL = "SELECT "; $ifs = array(); $weightsum = 0; - foreach($this->FieldWeight as $w) + foreach($this->FieldWeight as $w) { $weightsum += $w; + } $wordcount = count($this->keywords["normal"])+count($this->keywords["required"]); $single = ($wordcount == 1); foreach($this->FieldList as $f) Index: trunk/kernel/admin_templates/incs/style.css =================================================================== diff -u -N -r3620 -r4052 --- trunk/kernel/admin_templates/incs/style.css (.../style.css) (revision 3620) +++ trunk/kernel/admin_templates/incs/style.css (.../style.css) (revision 4052) @@ -84,7 +84,7 @@ .tableborder { font-family: arial, helvetica, sans-serif; - font-size: 10pt; + font-size: 10pt; border: 1px solid #000000; border-top-width: 0px; border-collapse: collapse; Index: trunk/admin/install/inportal_data.sql =================================================================== diff -u -N -r3999 -r4052 --- trunk/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 3999) +++ trunk/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 4052) @@ -33,6 +33,12 @@ INSERT INTO ConfigurationAdmin VALUES ('Smtp_AdminMailFrom', 'la_Text_smtp_server', 'la_prompt_AdminMailFrom', 'text', NULL, NULL, 17, 1); INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category_Short', 'la_Text_General', 'la_category_perpage__short_prompt', 'text', '', '', 5, 1); INSERT INTO ConfigurationAdmin VALUES ('CookieSessions', 'la_Text_Website', 'la_prompt_session_management', 'select', NULL, '0=lu_query_string,1=lu_cookies,2=lu_auto', 8, 1); + +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_category', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_category', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_category', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_category', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1); + INSERT INTO ConfigurationAdmin VALUES ('SessionTimeout', 'la_Text_Website', 'la_prompt_session_timeout', 'text','', '', 9, 1); INSERT INTO ConfigurationAdmin VALUES ('SystemTagCache', 'la_Text_Website', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 10, 0); INSERT INTO ConfigurationAdmin VALUES ('User_SubscriberGroup', 'la_Text_General', 'la_users_subscriber_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionName, Name as OptionValue FROM PortalGroup WHERE Enabled=1 AND Personal=0', 5, 1); @@ -125,10 +131,12 @@ INSERT INTO ConfigurationValues VALUES ('RootPassVerify', '', 'In-Portal:Users', 'in-portal:configure_users') INSERT INTO ConfigurationValues VALUES ('Perpage_Category_Short', '3', 'In-Portal', 'in-portal:configure_categories') INSERT INTO ConfigurationValues VALUES ('CookieSessions', '2', 'In-Portal', 'in-portal:configure_general') -INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_category', '30', 'In-Portal', ''); -INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_category', '90', 'In-Portal', ''); -INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_category', '5', 'In-Portal', ''); -INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_category', '5', 'In-Portal', ''); + +INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_category', '30', 'In-Portal', 'in-portal:configuration_search'); +INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_category', '90', 'In-Portal', 'in-portal:configuration_search'); +INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_category', '5', 'In-Portal', 'in-portal:configuration_search'); +INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_category', '5', 'In-Portal', 'in-portal:configuration_search'); + INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultIncrease', '30', 'In-Portal', 'inportal:configure_searchdefault'); INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultKeyword', '80', 'In-Portal', 'SearchRel_DefaultKeyword'); INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultPop', '10', 'In-Portal', 'inportal:configuration_searchdefault'); @@ -280,25 +288,26 @@ INSERT INTO SearchConfig VALUES ('Category', 'CategoryId', 0, 1, 'lu_fielddesc_category_categoryid', 'lu_field_categoryid', 'In-Portal', 'la_text_category', 0, 62, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); INSERT INTO SearchConfig VALUES ('Category', 'Modified', 0, 1, 'lu_fielddesc_category_modified', 'lu_field_modified', 'In-Portal', 'la_text_category', 20, 82, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); INSERT INTO SearchConfig VALUES ('Category', 'ModifiedById', 0, 1, 'lu_fielddesc_category_modifiedbyid', 'lu_field_modifiedbyid', 'In-Portal', 'la_text_category', 21, 83, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'PortalUserId', 0, 0, 'lu_fielddesc_user_portaluserid', 'lu_field_portaluserid', 'In-Portal', 'la_text_user', 0, 173, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Login', 0, 0, 'lu_fielddesc_user_login', 'lu_field_login', 'In-Portal', 'la_text_user', 1, 174, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Password', 0, 0, 'lu_fielddesc_user_password', 'lu_field_password', 'In-Portal', 'la_text_user', 2, 175, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'tz', 0, 0, 'lu_fielddesc_user_tz', 'lu_field_tz', 'In-Portal', 'la_text_user', 17, 190, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'dob', 0, 0, 'lu_fielddesc_user_dob', 'lu_field_dob', 'In-Portal', 'la_text_user', 16, 189, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', 0, 0, 'lu_fielddesc_user_modified', 'lu_field_modified', 'In-Portal', 'la_text_user', 15, 188, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', 0, 0, 'lu_fielddesc_user_status', 'lu_field_status', 'In-Portal', 'la_text_user', 14, 187, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', 0, 0, 'lu_fielddesc_user_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_user', 13, 186, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Country', 0, 0, 'lu_fielddesc_user_country', 'lu_field_country', 'In-Portal', 'la_text_user', 12, 185, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Zip', 0, 0, 'lu_fielddesc_user_zip', 'lu_field_zip', 'In-Portal', 'la_text_user', 11, 184, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'State', 0, 0, 'lu_fielddesc_user_state', 'lu_field_state', 'In-Portal', 'la_text_user', 10, 183, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'City', 0, 0, 'lu_fielddesc_user_city', 'lu_field_city', 'In-Portal', 'la_text_user', 9, 182, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Street', 0, 0, 'lu_fielddesc_user_street', 'lu_field_street', 'In-Portal', 'la_text_user', 8, 181, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Phone', 0, 0, 'lu_fielddesc_user_phone', 'lu_field_phone', 'In-Portal', 'la_text_user', 7, 180, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', 0, 0, 'lu_fielddesc_user_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_user', 6, 179, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Email', 0, 0, 'lu_fielddesc_user_email', 'lu_field_email', 'In-Portal', 'la_text_user', 5, 178, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'LastName', 0, 0, 'lu_fielddesc_user_lastname', 'lu_field_lastname', 'In-Portal', 'la_text_user', 4, 177, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO SearchConfig VALUES ('PortalUser', 'FirstName', 0, 0, 'lu_fielddesc_user_firstname', 'lu_field_firstname', 'In-Portal', 'la_text_user', 3, 176, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'PortalUserId', -1, 0, 'lu_fielddesc_user_portaluserid', 'lu_field_portaluserid', 'In-Portal', 'la_text_user', 0, 173, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Login', -1, 0, 'lu_fielddesc_user_login', 'lu_field_login', 'In-Portal', 'la_text_user', 1, 174, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Password', -1, 0, 'lu_fielddesc_user_password', 'lu_field_password', 'In-Portal', 'la_text_user', 2, 175, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'tz', -1, 0, 'lu_fielddesc_user_tz', 'lu_field_tz', 'In-Portal', 'la_text_user', 17, 190, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'dob', -1, 0, 'lu_fielddesc_user_dob', 'lu_field_dob', 'In-Portal', 'la_text_user', 16, 189, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', -1, 0, 'lu_fielddesc_user_modified', 'lu_field_modified', 'In-Portal', 'la_text_user', 15, 188, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', -1, 0, 'lu_fielddesc_user_status', 'lu_field_status', 'In-Portal', 'la_text_user', 14, 187, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', -1, 0, 'lu_fielddesc_user_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_user', 13, 186, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Country', -1, 0, 'lu_fielddesc_user_country', 'lu_field_country', 'In-Portal', 'la_text_user', 12, 185, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Zip', -1, 0, 'lu_fielddesc_user_zip', 'lu_field_zip', 'In-Portal', 'la_text_user', 11, 184, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'State', -1, 0, 'lu_fielddesc_user_state', 'lu_field_state', 'In-Portal', 'la_text_user', 10, 183, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'City', -1, 0, 'lu_fielddesc_user_city', 'lu_field_city', 'In-Portal', 'la_text_user', 9, 182, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Street', -1, 0, 'lu_fielddesc_user_street', 'lu_field_street', 'In-Portal', 'la_text_user', 8, 181, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Phone', -1, 0, 'lu_fielddesc_user_phone', 'lu_field_phone', 'In-Portal', 'la_text_user', 7, 180, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', -1, 0, 'lu_fielddesc_user_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_user', 6, 179, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Email', -1, 0, 'lu_fielddesc_user_email', 'lu_field_email', 'In-Portal', 'la_text_user', 5, 178, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'LastName', -1, 0, 'lu_fielddesc_user_lastname', 'lu_field_lastname', 'In-Portal', 'la_text_user', 4, 177, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'FirstName', -1, 0, 'lu_fielddesc_user_firstname', 'lu_field_firstname', 'In-Portal', 'la_text_user', 3, 176, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); + INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>Category WHERE Status=1 ', NULL, 'la_prompt_ActiveCategories', '0', '1'); INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>PortalUser WHERE Status=1 ', NULL, 'la_prompt_ActiveUsers', '0', '1'); INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>UserSession', NULL, 'la_prompt_CurrentSessions', '0', '1');