5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * http://fusionforge.org/
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 require_once('../env.inc.php');
26 require_once $gfcommon.'include/pre.php';
27 require_once $gfcommon.'survey/SurveyFactory.class.php';
28 require_once $gfwww.'survey/include/SurveyHTML.class.php';
30 $group_id = getIntFromRequest('group_id');
31 $survey_id = getIntFromRequest('survey_id');
33 /* We need a group_id */
38 $g = group_get_object($group_id);
39 if (!$g || !is_object($g) || $g->isError()) {
43 $user_id = user_getid();
46 $title = sprintf(_('Surveys for %1$s'), $g->getPublicName());
47 $sh = new SurveyHtml();
48 $sh->header(array('title'=>$title));
50 plugin_hook ("blocks", "survey index");
52 /* Show list of Servey */
53 $sf = new SurveyFactory($g);
54 $ss = & $sf->getSurveys();
56 echo '<p class="warning_msg">' . (_('No Survey is found')) . '</p>';
58 echo '<p>' . _('Select a survey to vote') . '</p>';
59 echo($sh->showSurveys($ss, 0, 0, 1, 1, 1, 0));