From 8b7d30ad6796b0570d76f8d542f672f6e63e2f55 Mon Sep 17 00:00:00 2001 From: Nikos Korfiatis Date: Mon, 31 Jul 2006 20:51:11 +0000 Subject: [PATCH] Fixed translation exceptions ! Previous notation is obsolete. Use gettext to display the messages. Added a listsurveys actions (experimental) git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@1848 b72ed6b6-b9f8-46b5-92b4-906544132732 --- admin/admin.php | 1 + admin/checkfields.php | 1 + admin/database.php | 4 +-- admin/html.php | 57 +++++++++++++++++++++++++++++++++++++++++++ common.php | 10 +++++--- question.php | 4 +-- 6 files changed, 70 insertions(+), 7 deletions(-) diff --git a/admin/admin.php b/admin/admin.php index 58fa1892e57..64ec8d829e0 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -163,6 +163,7 @@ exit; } +if (isset($listsurveys)) {echo $listsurveys; } if (isset($surveysummary)) {echo $surveysummary;} if (isset($cssummary)) {echo $cssummary;} if (isset($usersummary)) {echo $usersummary;} diff --git a/admin/checkfields.php b/admin/checkfields.php index 62cae09383b..e41f5ac6fb1 100644 --- a/admin/checkfields.php +++ b/admin/checkfields.php @@ -110,6 +110,7 @@ $allfields[]=array("{$dbprefix}surveys", "sid", "sid int(11) NOT NULL auto_increment"); $allfields[]=array("{$dbprefix}surveys", "short_title", "short_title varchar(200) NOT NULL default ''"); $allfields[]=array("{$dbprefix}surveys", "description", "description text"); +$allfields[]=array("{$dbprefix}surveys", "datecreated", "datecreated date"); $allfields[]=array("{$dbprefix}surveys", "admin", "admin varchar(50) default NULL"); $allfields[]=array("{$dbprefix}surveys", "active", "active char(1) NOT NULL default 'N'"); $allfields[]=array("{$dbprefix}surveys", "welcome", "welcome text"); diff --git a/admin/database.php b/admin/database.php index 6251d7ef832..264de880e92 100644 --- a/admin/database.php +++ b/admin/database.php @@ -652,7 +652,7 @@ function db_quote($str) . "language, datestamp, ipaddr, refurl, usecookie, notification, allowregister, attribute1, attribute2, " . "email_invite_subj, email_invite, email_remind_subj, email_remind, " . "email_register_subj, email_register, email_confirm_subj, email_confirm, " - . "allowsave, autoredirect, allowprev)\n" + . "allowsave, autoredirect, allowprev,datecreated)\n" . "VALUES ($surveyid, '{$_POST['short_title']}', '{$_POST['description']}',\n" . "'{$_POST['admin']}', 'N', '".str_replace("\n", "
", $_POST['welcome'])."',\n" . "'{$_POST['useexpiry']}',{$_POST['expires']}, '{$_POST['adminemail']}', '{$_POST['private']}',\n" @@ -664,7 +664,7 @@ function db_quote($str) . "'{$_POST['email_remind']}', '{$_POST['email_register_subj']}',\n" . "'{$_POST['email_register']}', '{$_POST['email_confirm_subj']}',\n" . "'{$_POST['email_confirm']}', \n" - . "'{$_POST['allowsave']}', '{$_POST['autoredirect']}', '{$_POST['allowprev']}')"; + . "'{$_POST['allowsave']}', '{$_POST['autoredirect']}', '{$_POST['allowprev']}','".date("Y-m-d")."')"; $isresult = $connect->Execute($isquery); if ($isresult) { diff --git a/admin/html.php b/admin/html.php index 7fa83ba83cc..b1875741ac8 100644 --- a/admin/html.php +++ b/admin/html.php @@ -37,6 +37,63 @@ //Ensure script is not run directly, avoid path disclosure if (!isset($dbprefix)) {die ("Cannot run this script directly");} +if ($action == "listsurveys") +{ + + $query = "SELECT * FROM {$dbprefix}surveys"; + $result = mysql_query($query) or die(mysql_error()); + + if(mysql_num_rows($result)>0) { + $listsurveys= "
+ + + + + + + " ; + + while($rows = mysql_fetch_array($result)) + { + if($rows['private']=="Y") + { + $visibility="Private" ; + } + else $visibility ="Public" ; + if($rows['active']=="Y") + { + $status= "Active" ; + } + else $status ="Non Active" ; + + $datecreated=$rows['datecreated'] ; + + $listsurveys.=" + ". + "". + "" . + "". + " + + + " ; + } + $listsurveys.=" + + + + + +
SurveyDate CreatedVisibilityStatusAction
".$rows['short_title']."".$datecreated."".$visibility."".$status."   
" . + "   

" ; + } + else $listsurveys=" No Surveys in this Installation " ; +} + + + if ($action == "checksettings" || $action == "changelang") { //GET NUMBER OF SURVEYS diff --git a/common.php b/common.php index 2bb650457ca..dc8eb439ed5 100644 --- a/common.php +++ b/common.php @@ -243,7 +243,11 @@ function showadminmenu() ."' alt='"._("Check Database")."' align='left' onClick=\"window.open('checkfields.php', '_top')\"" ."onmouseout=\"hideTooltip()\"" ."onmouseover=\"showTooltip(event,'"._("Check Database")."');return false\">\n"; - + $adminmenu .= "\t\t\t\t\t\n"; + if ($surveyid) { $adminmenu .="\t\t\t\t\t"; + $saveall = ""; } elseif (isset($_SESSION['scid']) && (isset($_POST['move']) && $_POST['move'] == " "._LAST." ")) //Already saved and on Submit Page, don't show Save So Far button { @@ -1466,7 +1470,7 @@ function templatereplace($line) } else { - $saveall=""; // Show Save So Far button + $saveall=""; // Show Save So Far button } } else diff --git a/question.php b/question.php index 71d1fa4a3b5..ed592017ffc 100644 --- a/question.php +++ b/question.php @@ -48,13 +48,13 @@ // If on SUBMIT page and select SAVE SO FAR it will return to SUBMIT page if (isset($_POST['saveprompt']) && $_POST['saveprompt'] == "Y" && $_SESSION['step'] > $_SESSION['totalsteps']) { - $_POST['move'] = " "._LAST." "; + $_POST['move'] = " "._("Last Step")." "; } // <-- END NEW FEATURE - SAVE //CHECK IF ALL MANDATORY QUESTIONS HAVE BEEN ANSWERED ############################################ //First, see if we are moving backwards or doing a Save so far, and its OK not to check: -if ($allowmandbackwards==1 && ((isset($_POST['move']) && $_POST['move'] == " << "._PREV." ") || (isset($_POST['saveall']) && $_POST['saveall'] == _SAVE_AND_RETURN))) +if ($allowmandbackwards==1 && ((isset($_POST['move']) && $_POST['move'] == " << "._("Previous")." ") || (isset($_POST['saveall']) && $_POST['saveall'] == _SAVE_AND_RETURN))) { $backok="Y"; }