Example #1
0
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfcommon . 'survey/Survey.class.php';
require_once $gfcommon . 'survey/SurveyResponse.class.php';
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
$g =& group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
    exit_no_group();
}
$sh = new SurveyHtml();
$sh->header(array('title' => _('Survey Complete')));
if (!$survey_id) {
    /*
    	Quit if params are not provided
    */
    echo "<h1>" . _('Error - For some reason group_id and/or survey_id did not make it he') . "</h1>";
    $sh->footer(array());
    exit;
}
if (!session_loggedin()) {
    /*
    	Tell them they need to be logged in
    */
    echo "<h1>" . _('You need to be logged in') . "</h1>";
    echo "<p>" . _('Unfortunately, you have to be logged in to participate in surveys.') . "</p>";
Example #2
0
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfcommon . 'survey/SurveyFactory.class.php';
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
/* We need a group_id */
if (!$group_id) {
    exit_no_group();
}
$g =& group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
    exit_no_group();
}
$user_id = user_getid();
/* Show header */
$sh = new SurveyHtml();
$sh->header(array('title' => _('Survey')));
/* Show list of Servey */
$sf = new SurveyFactory($g);
$ss =& $sf->getSurveys();
if (!$ss) {
    echo '<h2>' . _('No Survey is found') . '</h2>';
} else {
    echo $sh->showSurveys($ss, 0, 0, 1, 1, 1, 0);
}
$sh->footer(array());
Example #3
0
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once '../../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$is_admin_page = 'y';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
$sh = new SurveyHtml();
$sh->header(array('title' => _('Survey Administration')));
if (!session_loggedin() || !user_ismember($group_id, 'A')) {
    echo '<h1>' . _('Permission denied') . '</h1>';
    $sh->footer(array());
    exit;
}
?>

<?php 
printf(_('<p>It\'s simple to create a survey.<ol><li>Create questions and comments using the forms above.</li><li>Create a survey, listing the questions in order (choose from <strong>your</strong> list of questions).</li><li>Link to the survey using this format: %1$s where XX is the survey number'), '<p><strong>' . util_make_url('/survey/survey.php?group_id=' . $group_id . '&survey_id=XX') . '</strong>');
?>

<p><?php 
printf(_('You can now activate/deactivate surveys on the %1$s Edit Existing Surveys %2$s page'), '<a href="' . util_make_url('/survey/admin/survey.php?group_id=' . $group_id) . '">', '</a>');
?>
Example #4
0
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfcommon . 'survey/Survey.class.php';
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
/* We need a group_id */
if (!$group_id) {
    exit_no_group();
}
$g =& group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
    exit_no_group();
}
// Check to make sure they're logged in.
if (!session_loggedin()) {
    exit_not_logged_in();
}
$sh = new SurveyHtml();
$s = new Survey($g, $survey_id);
$sh->header(array('title' => _('Survey')));
if (!$survey_id) {
    echo "<h1>" . _('For some reason, the Group ID or Survey ID did not make it to this page') . "</h1>";
} else {
    echo $sh->ShowSurveyForm($s);
}
$sh->footer(array());
Example #5
0
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
$question_id = getIntFromRequest('question_id');
$question = getStringFromRequest('question');
$question_type = getStringFromRequest('question_type');
/* We need a group_id */
if (!$group_id) {
    exit_no_group();
}
$g =& group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
    exit_no_group();
}
$is_admin_page = 'y';
$sh = new SurveyHtml();
$sh->header(array('title' => _('Add A Question')));
if (!session_loggedin() || !user_ismember($group_id, 'A')) {
    echo "<h1>" . _('You don\'t have a permission to access this page') . "</h1>";
    $sh->footer(array());
    exit;
}
/* Create a Survey Question for general purpose */
$sq = new SurveyQuestion($g, $question_id);
if (!$sq || !is_object($sq)) {
    echo "<h3>" . _('Error') . ' Can not get Survey Question' . "</h3>";
} else {
    if ($sq->isError()) {
        echo "<h3>" . _('Error') . $sq->getErrorMessage() . "</h3>";
    }
}
Example #6
0
require_once $gfcommon . 'survey/SurveyFactory.class.php';
require_once $gfcommon . 'survey/SurveyQuestion.class.php';
require_once $gfcommon . 'survey/SurveyQuestionFactory.class.php';
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
/* We need a group_id */
if (!$group_id) {
    exit_no_group();
}
$g =& group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
    exit_no_group();
}
$is_admin_page = 'y';
$sh = new SurveyHtml();
$s = new Survey($g, $survey_id);
$sh->header(array('title' => _('Add A Survey')));
if (!session_loggedin() || !user_ismember($group_id, 'A')) {
    echo "<h1>" . _('Permission denied') . "</h1>";
    $sh->footer(array());
    exit;
}
if (getStringFromRequest('post') == "Y") {
    if (!form_key_is_valid(getStringFromRequest('form_key'))) {
        exit_form_double_submit();
    }
    $survey_title = getStringFromRequest('survey_title');
    $to_add = getStringFromRequest('to_add');
    $to_del = getStringFromRequest('to_del');
    $is_active = getStringFromRequest('is_active');
Example #7
0
require_once $gfcommon . 'survey/SurveyResponseFactory.class.php';
require_once $gfwww . 'survey/include/SurveyHTML.class.php';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
$graph = getStringFromRequest('graph');
$show_comment = getStringFromRequest('show_comment');
/* We need a group_id */
if (!$group_id) {
    exit_no_group();
}
$g =& group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
    exit_no_group();
}
$is_admin_page = 'y';
$sh = new SurveyHtml();
$is_admin_page = 'y';
$sh->header(array('title' => _('Survey Results')));
if (!session_loggedin() || !user_ismember($group_id, 'A')) {
    echo "<h1>" . _('Permission denied') . "</h1>";
    $sh->footer(array());
    exit;
}
/* Show detailed results of a survey */
if ($survey_id) {
    $s = new Survey($g, $survey_id);
    if (!$s || !is_object($s)) {
        echo "<h3>" . _('Error') . ' Can not get Survey' . "</h3>";
        $sh->footer(array());
        exit;
    } else {