Skip to content

Commit

Permalink
Adds new "allowprev" field in surveys - turn off the capacity for use…
Browse files Browse the repository at this point in the history
…rs to move backwards through surveys. This modification requires a new field in the survey table so "checkfields.php" should be run before use.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1256 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Nov 5, 2004
1 parent dafbd54 commit f312a16
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions admin/checkfields.php
Expand Up @@ -134,6 +134,7 @@
$allfields[]=array("{$dbprefix}surveys", "allowsave","allowsave char(1) default 'Y'");
$allfields[]=array("{$dbprefix}surveys", "autonumber_start", "autonumber_start bigint(11) default 0");
$allfields[]=array("{$dbprefix}surveys", "autoredirect", "autoredirect char(1) default 'N'");
$allfields[]=array("{$dbprefix}surveys", "allowprev","allowprev char(1) default 'Y'");

$allfields[]=array("{$dbprefix}saved", "saved_id", "saved_id int(11) NOT NULL auto_increment");
$allfields[]=array("{$dbprefix}saved", "scid", "scid int(11) NOT NULL");
Expand Down
6 changes: 3 additions & 3 deletions admin/database.php
Expand Up @@ -580,7 +580,7 @@
. "(sid, short_title, description, admin, active, welcome, expires, "
. "adminemail, private, faxto, format, template, url, urldescrip, "
. "language, datestamp, usecookie, notification, allowregister, attribute1, attribute2, "
. "email_invite, email_remind, email_register, email_confirm, allowsave, autoredirect)\n"
. "email_invite, email_remind, email_register, email_confirm, allowsave, autoredirect, allowprev)\n"
. "VALUES ('', '{$_POST['short_title']}', '{$_POST['description']}',\n"
. "'{$_POST['admin']}', 'N', '".str_replace("\n", "<br />", $_POST['welcome'])."',\n"
. "'{$_POST['expires']}', '{$_POST['adminemail']}', '{$_POST['private']}',\n"
Expand All @@ -589,7 +589,7 @@
. "'{$_POST['usecookie']}', '{$_POST['notification']}', '{$_POST['allowregister']}',\n"
. "'{$_POST['attribute1']}', '{$_POST['attribute2']}', '{$_POST['email_invite']}', \n"
. "'{$_POST['email_remind']}', '{$_POST['email_register']}', '{$_POST['email_confirm']}', \n"
. "'{$_POST['allowsave']}', '{$_POST['autoredirect']}')";
. "'{$_POST['allowsave']}', '{$_POST['autoredirect']}', '{$_POST['allowprev']}')";
$isresult = mysql_query ($isquery);
if ($isresult)
{
Expand Down Expand Up @@ -635,7 +635,7 @@
. "attribute2='{$_POST['attribute2']}', email_invite='{$_POST['email_invite']}',\n"
. "email_remind='{$_POST['email_remind']}', email_register='{$_POST['email_register']}',\n"
. "email_confirm='{$_POST['email_confirm']}', allowsave='{$_POST['allowsave']}',\n"
. "autoredirect='{$_POST['autoredirect']}'\n"
. "autoredirect='{$_POST['autoredirect']}', allowprev='{$_POST['allowprev']}'\n"
. "WHERE sid={$_POST['sid']}";
$usresult = mysql_query($usquery) or die("Error updating<br />$usquery<br /><br /><b>".mysql_error());
if ($usresult)
Expand Down
25 changes: 23 additions & 2 deletions admin/html.php
Expand Up @@ -1480,7 +1480,17 @@
$editsurvey .= ">"._AD_NO."</option>\n"
. "\t\t</select></td>\n"
. "\t</tr>\n";

//ALLOW PREV
$editsurvey .= "\t<tr><td align='right'>$setfont<b>"._SL_ALLOWPREV."</b></font></td>\n"
. "\t\t<td><select $slstyle name='allowprev'>\n"
. "\t\t\t<option value='Y'";
if (!isset($esrow['allowprev']) || !$esrow['allowprev'] || $esrow['allowprev'] == "Y") {$editsurvey .= " selected";}
$editsurvey .= ">"._AD_YES."</option>\n"
. "\t\t<option value='N'";
if (isset($esrow['allowprev']) && $esrow['allowprev'] == "N") {$editsurvey .= " selected";}
$editsurvey .= ">"._AD_NO."</option>\n"
. "\t\t</select></td>\n"
. "\t</tr>\n";
//NOTIFICATION
$editsurvey .= "\t<tr><td align='right'>$setfont<b>"._SL_NOTIFICATION."</b></font></td>\n"
. "\t\t<td><select $slstyle name='notification'>\n"
Expand Down Expand Up @@ -1661,8 +1671,19 @@
. "\t\t\t<option value='Y'";
if (!isset($esrow['allowsave']) || !$esrow['allowsave'] || $esrow['allowsave'] == "Y") {$newsurvey .= " selected";}
$newsurvey .= ">"._AD_YES."</option>\n"
. "\t\t\<option value='N'";
. "\t\t<option value='N'";
if (isset($esrow['allowsave']) && $esrow['allowsave'] == "N") {$newsurvey .= " selected";}
$newsurvey .= ">"._AD_NO."</option>\n"
. "\t\t</select></td>\n"
. "\t</tr>\n";
//ALLOW PREV
$newsurvey .= "\t<tr><td align='right'>$setfont<b>"._SL_ALLOWPREV."</b></font></td>\n"
. "\t\t<td><select $slstyle name='allowprev'>\n"
. "\t\t\t<option value='Y'";
if (!isset($esrow['allowprev']) || !$esrow['allowprev'] || $esrow['allowprev'] == "Y") {$newsurvey .= " selected";}
$newsurvey .= ">"._AD_YES."</option>\n"
. "\t\t<option value='N'";
if (isset($esrow['allowprev']) && $esrow['allowprev'] == "N") {$newsurvey .= " selected";}
$newsurvey .= ">"._AD_NO."</option>\n"
. "\t\t</select></td>\n"
. "\t</tr>\n";
Expand Down

0 comments on commit f312a16

Please sign in to comment.