Skip to content

Commit

Permalink
Added convert function to convert the old mechanism to the new group_…
Browse files Browse the repository at this point in the history
…order and question_order fields.

Updated german language file.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@1968 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Aug 18, 2006
1 parent 5ae4448 commit dcbfdd2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
41 changes: 40 additions & 1 deletion admin/install/upgrade-mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,11 @@ function mysqlcheckfields()
}
}
}


convertquestionorder();
convertgrouporder();
modify_database('','insert '.$dbprefix.'settings_global values("DBVersion","108")');

echo "</font></font></font></td></tr>\n";
echo "<tr><td align='center' bgcolor='#CCCCCC'>\n";
echo "<input type='submit' value='"._("Main Admin Screen")."' onClick=\"window.open('admin.php', '_top')\">\n";
Expand All @@ -248,6 +251,42 @@ function mysqlcheckfields()
echo getAdminFooter("$langdir/instructions.html", "Using PHPSurveyors Admin Script");
}


function convertgrouporder() //Function rewrites the grouporder for complete db
{
global $dbprefix, $connect;
$tabsurvey = db_execute_assoc("SELECT sid from ".$dbprefix."surveys");
while ($surveyrow=$tabsurvey->FetchRow())
{
$tabgroups = db_execute_assoc("SELECT * from ".$dbprefix."groups where sid=".$surveyrow['sid']." order by group_name");
$icount=0;
while ($grouprow=$tabgroups->FetchRow())
{
$cd2query="UPDATE ".db_table_name('groups')." SET group_order=? WHERE gid=?";
$cd2result=$connect->Execute($cd2query, Array($icount, $grouprow['gid'])) or die ("Couldn't update group_order<br />$cd2query<br />".htmlspecialchars($connect->ErrorMsg()));
$icount++;
}
}
}


function convertquestionorder() //Function rewrites the question_order for complete db
{
global $dbprefix, $connect;
$tabsurvey = db_execute_assoc("SELECT gid from ".$dbprefix."groups");
while ($surveyrow=$tabsurvey->FetchRow())
{
$tabgroups = db_execute_assoc("SELECT qid from ".$dbprefix."questions where gid=".$surveyrow['gid']." order by title");
$icount=0;
while ($grouprow=$tabgroups->FetchRow())
{
$cd2query="UPDATE ".db_table_name('questions')." SET question_order=? WHERE qid=?";
$cd2result=$connect->Execute($cd2query, Array($icount, $grouprow['qid'])) or die ("Couldn't update group_order<br />$cd2query<br />".htmlspecialchars($connect->ErrorMsg()));
$icount++;
}
}
}

function checktable($tablename)
{
global $databasename, $allfields, $connect;
Expand Down
Binary file modified locale/de/LC_MESSAGES/de.mo
Binary file not shown.
8 changes: 6 additions & 2 deletions locale/de/LC_MESSAGES/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PHPSurveyor German language file\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2006-08-18 19:31+0100\n"
"PO-Revision-Date: 2006-08-18 22:29+0100\n"
"Last-Translator: Carsten Schmitz <c_schmitz@users.sourceforge.net>\n"
"Language-Team: PHPSurveyor <c_schmitz@users.sourceforge.net>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -60,7 +60,7 @@ msgid "Please Choose..."
msgstr "Bitte auswählen.."

msgid "None"
msgstr "Nein"
msgstr "Keine"

msgid "5 Point Choice"
msgstr "5 Punkte Auswahl"
Expand Down Expand Up @@ -902,6 +902,10 @@ msgstr "Konnte Datenbank nicht erstellen"
msgid "Group could not be added. It is missing the mandatory group name"
msgstr "Gruppe konnte nicht hinzugefügt werden. Der Gruppenname wurde nicht angegeben."

# D:\xampp\xampp\htdocs\phpsurveyor/admin/database.php:101
msgid "Error: The database reported the following error:"
msgstr "Fehler: Die Datenbank meldet folgenden Fehler:"

msgid "Group could not be updated"
msgstr "Gruppe konnte nicht aktualisiert werden."

Expand Down

0 comments on commit dcbfdd2

Please sign in to comment.