5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2004 (c) Guillaume Smet / Open Wide
7 * http://fusionforge.org
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 require_once '../env.inc.php';
26 require_once $gfcommon.'include/pre.php';
27 require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
28 require_once $gfwww.'search/include/SearchManager.class.php';
30 $group_id = getIntFromRequest('group_id');
31 $atid = getIntFromRequest('atid');
32 $forum_id = getIntFromRequest('forum_id');
33 $group_project_id = getIntFromRequest('group_project_id');
35 $words = getStringFromRequest('words');
36 $type_of_search = getStringFromRequest('type_of_search');
37 $exact = getIntFromRequest('exact', 1);
39 // Support for short aliases
42 $words = getStringFromRequest('q');
45 if (!$type_of_search) {
46 $type_of_search = getStringFromRequest('type');
48 if (!$type_of_search) {
49 $type_of_search = getStringFromRequest('t');
51 if (!$type_of_search) {
52 $type_of_search = SEARCH__TYPE_IS_SOFTWARE;
54 $words=htmlspecialchars($words);
56 $offset = getIntFromGet('offset');
58 $searchManager =& getSearchManager();
61 SEARCH__PARAMETER_GROUP_ID => $group_id,
62 SEARCH__PARAMETER_ARTIFACT_ID => $atid,
63 SEARCH__PARAMETER_FORUM_ID => $forum_id,
64 SEARCH__PARAMETER_GROUP_PROJECT_ID => $group_project_id
67 $searchManager->setParametersValues($parameters);
69 if (getStringFromRequest('rss')) {
70 $outputFormat = SEARCH__OUTPUT_RSS;
72 $outputFormat = SEARCH__OUTPUT_HTML;
75 $renderer = $searchManager->getSearchRenderer($type_of_search, $words, $offset, $exact, $outputFormat);
80 exit_error(_('Error: Invalid search'));