Changeset 11689
- Timestamp:
- 08/23/07 09:36:59 (1 year ago)
- Files:
-
- branches/MidCOM_2_8/org.openpsa.products/config/config.inc (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.products/config/schemadb_config.inc (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.products/handler/product/search.php (modified) (4 diffs)
- branches/MidCOM_2_8/org.openpsa.products/locale/default.en.txt (modified) (6 diffs)
- branches/MidCOM_2_8/org.openpsa.products/locale/default.fi.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/org.openpsa.products/config/config.inc
r5789 r11689 7 7 'schemadb_group' => 'file:/org/openpsa/products/config/schemadb_group_default.inc', 8 8 'schemadb_businessarea' => 'file:/org/openpsa/products/config/schemadb_businessarea_default.inc', 9 9 10 /* Whether to enable adding subcomponents to products */ 10 11 'enable_components' => true, 11 12 'root_group' => 0, 12 13 'root_businessarea' => 0, 14 15 // Search related 13 16 'search_first' => false, 14 17 'search_default_to_all' => true, 18 // How the search results should be indexed. You can use metadata and linked options, for example metadata.score 19 'search_index_order' => array('productGroup', 'code'), 20 15 21 'group_list_products' => true, 16 22 'products_per_page' => 30, branches/MidCOM_2_8/org.openpsa.products/config/schemadb_config.inc
r5115 r11689 30 30 ), 31 31 ), 32 'search_default_to_all' => array 33 ( 34 'description' => 'search all items on default', 35 'datatype' => 'text', 36 'location' => 'config', 37 'config_domain' => 'org.openpsa.products', 38 'config_key' => 'search_default_to_all', 39 'widget' => 'config_radiobox', 40 'widget_radiobox_choices' => array 41 ( 42 '' => 'default setting', 43 '1' => 'yes', 44 '0' => 'no', 45 ), 46 ), 47 'search_index_order' => array 48 ( 49 'description' => 'search index order', 50 'datatype' => 'text', 51 'location' => 'config', 52 'config_domain' => 'org.openpsa.products', 53 'config_key' => 'search_index_order', 54 ), 32 55 'products_per_page' => array 33 56 ( branches/MidCOM_2_8/org.openpsa.products/handler/product/search.php
r11639 r11689 192 192 $qb->end_group(); 193 193 194 foreach ($this->_config->get('search_index_order') as $ordering) 195 { 196 if (preg_match('/\s*reversed?\s*/', $ordering)) 197 { 198 $reversed = true; 199 $ordering = preg_replace('/\s*reversed?\s*/', '', $ordering); 200 } 201 else 202 { 203 $reversed = false; 204 } 205 206 if ($ordering === 'metadata.score') 207 { 208 if (version_compare(mgd_version(), '1.8.2', '<')) 209 { 210 $ordering = 'score'; 211 $reversed = false; 212 } 213 } 214 215 if ( strpos($ordering, '.') 216 && !class_exists('midgard_query_builder')) 217 { 218 debug_add("Ordering by linked properties requires 1.8 series Midgard", MIDCOM_LOG_WARN); 219 continue; 220 } 221 222 if ($reversed) 223 { 224 $qb->add_order($ordering, 'DESC'); 225 } 226 else 227 { 228 $qb->add_order($ordering); 229 } 230 } 231 194 232 $products = $qb->execute(); 195 233 … … 268 306 $qb->end_group(); 269 307 } 308 309 foreach ($this->_config->get('search_index_order') as $ordering) 310 { 311 if (preg_match('/\s*reversed?\s*/', $ordering)) 312 { 313 $reversed = true; 314 $ordering = preg_replace('/\s*reversed?\s*/', '', $ordering); 315 } 316 else 317 { 318 $reversed = false; 319 } 320 321 if ($ordering === 'metadata.score') 322 { 323 if (version_compare(mgd_version(), '1.8.2', '<')) 324 { 325 $ordering = 'score'; 326 $reversed = false; 327 } 328 } 329 330 if ( strpos($ordering, '.') 331 && !class_exists('midgard_query_builder')) 332 { 333 debug_add("Ordering by linked properties requires 1.8 series Midgard", MIDCOM_LOG_WARN); 334 continue; 335 } 336 337 if ($reversed) 338 { 339 $qb->add_order($ordering, 'DESC'); 340 } 341 else 342 { 343 $qb->add_order($ordering); 344 } 345 } 270 346 271 347 //mgd_debug_start(); … … 400 476 401 477 $filtered_products = array(); 478 479 foreach ($this->_config->get('search_index_order') as $ordering) 480 { 481 if (preg_match('/\s*reversed?\s*/', $ordering)) 482 { 483 $reversed = true; 484 $ordering = preg_replace('/\s*reversed?\s*/', '', $ordering); 485 } 486 else 487 { 488 $reversed = false; 489 } 490 491 if ($ordering === 'metadata.score') 492 { 493 if (version_compare(mgd_version(), '1.8.2', '<')) 494 { 495 $ordering = 'score'; 496 $reversed = false; 497 } 498 } 499 500 if ( strpos($ordering, '.') 501 && !class_exists('midgard_query_builder')) 502 { 503 debug_add("Ordering by linked properties requires 1.8 series Midgard", MIDCOM_LOG_WARN); 504 continue; 505 } 506 507 if ($reversed) 508 { 509 $qb->add_order($ordering, 'DESC'); 510 } 511 else 512 { 513 $qb->add_order($ordering); 514 } 515 } 402 516 403 517 $initial_products = $qb->execute(); … … 486 600 } 487 601 602 foreach ($this->_config->get('search_index_order') as $ordering) 603 { 604 if (preg_match('/\s*reversed?\s*/', $ordering)) 605 { 606 $reversed = true; 607 $ordering = preg_replace('/\s*reversed?\s*/', '', $ordering); 608 } 609 else 610 { 611 $reversed = false; 612 } 613 614 if ($ordering === 'metadata.score') 615 { 616 if (version_compare(mgd_version(), '1.8.2', '<')) 617 { 618 $ordering = 'score'; 619 $reversed = false; 620 } 621 } 622 623 if ( strpos($ordering, '.') 624 && !class_exists('midgard_query_builder')) 625 { 626 debug_add("Ordering by linked properties requires 1.8 series Midgard", MIDCOM_LOG_WARN); 627 continue; 628 } 629 630 if ($reversed) 631 { 632 $qb->add_order($ordering, 'DESC'); 633 } 634 else 635 { 636 $qb->add_order($ordering); 637 } 638 } 639 488 640 $initial_products = $qb->execute(); 489 641 branches/MidCOM_2_8/org.openpsa.products/locale/default.en.txt
r5551 r11689 20 20 ---STRINGEND 21 21 22 ---STRING business area schema database 23 Business area schema database 24 ---STRINGEND 25 22 26 ---STRING code 23 27 Code … … 48 52 ---STRINGEND 49 53 54 ---STRING fields available for matching are defined in schema 55 Fields available for matching are defined in schema 56 ---STRINGEND 57 58 ---STRING file to import 59 File to import 60 ---STRINGEND 61 62 ---STRING first row is headers 63 First row is headers 64 ---STRINGEND 65 50 66 ---STRING groups 51 67 Product groups … … 56 72 ---STRINGEND 57 73 74 ---STRING import 75 Import 76 ---STRINGEND 77 78 ---STRING iso-latin-1 encoding 79 ISO-Latin-1 encoding 80 ---STRINGEND 81 82 ---STRING list group products 83 List group products 84 ---STRINGEND 85 58 86 ---STRING material goods 59 87 Material goods … … 64 92 ---STRINGEND 65 93 94 ---STRING number of items in feed 95 Number of items in feed 96 ---STRINGEND 97 66 98 ---STRING org.openpsa.products 67 99 Product database … … 116 148 ---STRINGEND 117 149 150 ---STRING search all items on default 151 Search all items on default 152 ---STRINGEND 153 118 154 ---STRING service 119 155 Service … … 148 184 ---STRINGEND 149 185 186 ---STRING updated %s 187 updated %s 188 ---STRINGEND 189 150 190 ---STRING updated products 151 191 Updated products 152 192 ---STRINGEND 153 193 194 ---STRING whether to enable adding subcomponents to products 195 Whether to enable adding subcomponents to products 196 ---STRINGEND 197 154 198 ---STRING year 155 199 year 156 200 ---STRINGEND 157 201 158 ---STRING updated %s 159 updated %s 160 ---STRINGEND 161 202 ---STRING you can import csv files here 203 You can import csv files here 204 ---STRINGEND 205 206 ---STRING search index order 207 Search index order 208 ---STRINGEND branches/MidCOM_2_8/org.openpsa.products/locale/default.fi.txt
r5551 r11689 148 148 ---STRINGEND 149 149 150 ---STRING updated %s 151 pÀivitetty %s 152 ---STRINGEND 153 150 154 ---STRING updated products 151 155 PÀivitetyt tuotteet … … 156 160 ---STRINGEND 157 161 158 ---STRING updated %s 159 pÀivitetty %s 160 ---STRINGEND 161 162 ---STRING business area schema database 163 Bisnesalueen tietokantakuvaus 164 ---STRINGEND 165 166 ---STRING fields available for matching are defined in schema 167 KÀytettÀvissÀ olevat kentÀt on mÀÀritelty tietokantakuvauksessa 168 ---STRINGEND 169 170 ---STRING file to import 171 Tuotava tiedosto 172 ---STRINGEND 173 174 ---STRING first row is headers 175 EnsimmÀinen rivi on otsikkotiedoille 176 ---STRINGEND 177 178 ---STRING import 179 Tuo 180 ---STRINGEND 181 182 ---STRING iso-latin-1 encoding 183 ISO-Latin1 -merkistö 184 ---STRINGEND 185 186 ---STRING list group products 187 Listaa tuoteryhmÀt 188 ---STRINGEND 189 190 ---STRING number of items in feed 191 Syötteen kohteiden lukumÀÀrÀ 192 ---STRINGEND 193 194 ---STRING search all items on default 195 Etsi kaikista kohteista oletuksena 196 ---STRINGEND 197 198 ---STRING whether to enable adding subcomponents to products 199 Sallitaanko komponenttien lisÀÀminen tuotteisiin 200 ---STRINGEND 201 202 ---STRING you can import csv files here 203 Voit tuoda CSV-tiedostot tÀÀltÀ 204 ---STRINGEND 205 206 ---STRING search index order 207 Haun tulosten jÀrjestely 208 ---STRINGEND
