6 * Portions Copyright 1999-2001 (c) VA Linux Systems
7 * The rest Copyright 2004 (c) Guillaume Smet / Open Wide
14 require_once('../env.inc.php');
15 require_once $gfcommon.'include/pre.php';
16 require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
17 require_once $gfwww.'search/include/SearchManager.class.php';
19 $group_id = getIntFromRequest('group_id');
20 $atid = getIntFromRequest('atid');
21 $forum_id = getIntFromRequest('forum_id');
22 $group_project_id = getIntFromRequest('group_project_id');
24 $words = getStringFromRequest('words');
25 $type_of_search = getStringFromRequest('type_of_search');
26 $exact = getStringFromRequest('exact', 1);
28 // Support for short aliases
31 $words = getStringFromRequest('q');
34 if (!$type_of_search) {
35 $type_of_search = getStringFromRequest('type');
37 if (!$type_of_search) {
38 $type_of_search = getStringFromRequest('t');
40 if (!$type_of_search) {
41 $type_of_search = SEARCH__TYPE_IS_SOFTWARE;
43 $words=htmlspecialchars($words);
45 $offset = getIntFromGet('offset');
47 $searchManager =& getSearchManager();
50 SEARCH__PARAMETER_GROUP_ID => $group_id,
51 SEARCH__PARAMETER_ARTIFACT_ID => $atid,
52 SEARCH__PARAMETER_FORUM_ID => $forum_id,
53 SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
56 $searchManager->setParametersValues($parameters);
58 if (getStringFromRequest('rss')) {
59 $outputFormat = SEARCH__OUTPUT_RSS;
61 $outputFormat = SEARCH__OUTPUT_HTML;
64 $renderer = $searchManager->getSearchRenderer($type_of_search, $words, $offset, $exact, $outputFormat);
69 $HTML->header(array('title'=>_('Search')));
70 echo '<div class="error">'._('Error - Invalid search').'</div>';
72 $HTML->footer(array());