[Fusionforge-commits] FusionForge branch Branch_5_3 updated. v5.3-rc4-8-gc2b97fe
Franck Villaume
nerville at fusionforge.org
Sun Mar 23 18:19:26 CET 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, Branch_5_3 has been updated
via c2b97fe2b65acc5760ec6b112d795f2934e65fb2 (commit)
from 71cab2e6a4d2d87e5bd74800757266d3c0575871 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c2b97fe2b65acc5760ec6b112d795f2934e65fb2
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date: Sun Mar 23 18:18:06 2014 +0100
indent, missing column name, drop dead code
diff --git a/src/www/survey/admin/show_questions.php b/src/www/survey/admin/show_questions.php
deleted file mode 100644
index a8be12e..0000000
--- a/src/www/survey/admin/show_questions.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/**
- * Survey Facility
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2002-2004 (c) GForge Team
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge 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 FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once '../../env.inc.php';
-require_once $gfcommon.'include/pre.php';
-
-$is_admin_page='y';
-$group_id = getIntFromRequest('group_id');
-$survey_id = getIntFromRequest('survey_id');
-survey_header(array('title'=>_('Survey Questions')));
-
-if (!session_loggedin() || !forge_check_perm('project_admin', $group_id)) {
- echo '<div class="error">'._('Permission denied.').'</div>';
- survey_footer(array());
- exit;
-}
-
-?>
-
-<p><?php echo _('You may use any of these questions on your surveys'); ?>.</p>
-
-<p><span class="important"><?php echo _('NOTE: use these question_id\'s when you create a new survey'); ?>.</span></p>
-<p> </p>
-<?php
-
-function showResultsEditQuestion($result) {
- global $group_id;
- $rows = db_numrows($result);
- $cols = db_numfields($result);
- echo "<h3>" .sprintf(ngettext('%s question found', '%s questions found', $rows), $rows)."</h3>";
-
- echo "<table>\n";
- /* Create the headers */
- echo "<tr class=\"tableheading\">\n";
- for($i=0; $i<$cols; $i++) {
- echo "<th>".db_fieldname($result,$i)."</th>\n";
- }
-
- echo( "</tr>");
- for($j = 0; $j < $rows; $j++) {
-
- echo( "<tr ". $GLOBALS['HTML']->boxGetAltRowStyle($j) .">\n");
-
- echo "<td><a href=\"edit_question.php?group_id=$group_id&question_id=".db_result($result,$j,"question_id")."\">".db_result($result,$j,"question_id")."</a></td>\n";
-
- for($i = 1; $i < $cols; $i++) {
- echo "<td>".db_result($result,$j,$i)."</td>\n";
- }
-
- echo( "</tr>");
- }
- echo "</table>"; //</td></tr></table>");
-}
-
-/*
- Select this survey from the database
-*/
-
-$result = db_query_params ('SELECT survey_questions.question_id,survey_questions.question,survey_question_types.type
-FROM survey_questions,survey_question_types
-WHERE survey_question_types.id=survey_questions.question_type AND survey_questions.group_id=$1 ORDER BY survey_questions.question_id DESC',
- array ($group_id));
-
-showResultsEditQuestion($result);
-
-survey_footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/www/survey/admin/survey.php b/src/www/survey/admin/survey.php
index e8eb23f..67747c9 100644
--- a/src/www/survey/admin/survey.php
+++ b/src/www/survey/admin/survey.php
@@ -56,36 +56,35 @@ if (!session_loggedin() || !forge_check_perm('project_admin', $group_id)) {
}
if (getStringFromRequest('post')=="Y") {
- if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+ if (!form_key_is_valid(getStringFromRequest('form_key'))) {
exit_form_double_submit('surveys');
}
$survey_title = getStringFromRequest('survey_title');
- $to_add = getStringFromRequest('to_add');
- $to_del = getStringFromRequest('to_del');
- $is_active = getStringFromRequest('is_active');
+ $to_add = getStringFromRequest('to_add');
+ $to_del = getStringFromRequest('to_del');
+ $is_active = getStringFromRequest('is_active');
- if ($survey_id) { /* Modify */
+ if ($survey_id) { /* Modify */
$s->update($survey_title, $to_add, $to_del, $is_active);
$feedback = _('Update Successful');
- } else { /* Add */
+ } else { /* Add */
$s->create($survey_title, $to_add, $is_active);
$feedback = _('Survey Added');
- }
+ }
}
/* Order changes */
if (getStringFromRequest('updown')=="Y") {
- $question_id = getIntFromRequest('question_id');
- $is_up = getStringFromRequest('is_up');
-
- $s->updateOrder($question_id, $is_up);
- $feedback = _('Update Successful');
+ $question_id = getIntFromRequest('question_id');
+ $is_up = getStringFromRequest('is_up');
+ $s->updateOrder($question_id, $is_up);
+ $feedback = _('Update Successful');
}
/* Error on previous transactions? */
if ($s->isError()) {
- $error_msg = $s->getErrorMessage();
- form_release_key(getStringFromRequest("form_key"));
+ $error_msg = $s->getErrorMessage();
+ form_release_key(getStringFromRequest("form_key"));
}
$title = $survey_id ? _('Edit a Survey') : _('Add a Survey');
diff --git a/src/www/survey/include/SurveyHTML.class.php b/src/www/survey/include/SurveyHTML.class.php
index 83ec425..4506555 100644
--- a/src/www/survey/include/SurveyHTML.class.php
+++ b/src/www/survey/include/SurveyHTML.class.php
@@ -248,7 +248,7 @@ class SurveyHTML extends Error {
/* Deletable questions */
if (count($arr_to_del) > 0) {
$ret.='<h2>'. _('Questions in this Survey').'</h2>';
- $title_arr = array(_('Question'), _('Type'), _('Order'), _('Delete from this Survey'));
+ $title_arr = array('', _('Question'), _('Type'), _('Order'), _('Delete from this Survey'));
$ret.=$GLOBALS['HTML']->listTableTop ($title_arr);
}
-----------------------------------------------------------------------
Summary of changes:
src/www/survey/admin/show_questions.php | 93 ---------------------------
src/www/survey/admin/survey.php | 27 ++++----
src/www/survey/include/SurveyHTML.class.php | 2 +-
3 files changed, 14 insertions(+), 108 deletions(-)
delete mode 100644 src/www/survey/admin/show_questions.php
hooks/post-receive
--
FusionForge
More information about the Fusionforge-commits
mailing list