Skip to content

Commit

Permalink
dev: cosmetic changes (include prefix in table name display)
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Nov 24, 2012
1 parent 696c5e7 commit 54a8af9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions application/controllers/admin/tokens.php
Expand Up @@ -2196,12 +2196,15 @@ function kill($iSurveyId)
$date = date('YmdHis');
/* If there is not a $_POST value of 'ok', then ask if the user is sure they want to
delete the tokens table */
$oldtable = "tokens_$iSurveyId";
$newtable = "old_tokens_{$iSurveyId}_$date";
$newtableDisplay = Yii::app()->db->tablePrefix . $newtable;
if (!Yii::app()->request->getPost('ok'))
{
$this->_renderWrappedTemplate('token', array('tokenbar', 'message' => array(
'title' => $clang->gT("Delete Tokens Table"),
'message' => $clang->gT("If you delete this table tokens will no longer be required to access this survey.") . "<br />" . $clang->gT("A backup of this table will be made if you proceed. Your system administrator will be able to access this table.") . "<br />\n"
. "( \"old_tokens_{$iSurveyId}_$date\" )<br /><br />\n"
. sprintf('("%s")<br /><br />', $newtableDisplay)
. "<input type='submit' value='"
. $clang->gT("Delete Tokens") . "' onclick=\"" . convertGETtoPOST($this->getController()->createUrl("admin/tokens/kill/surveyid/$iSurveyId") . "?ok=y") . "\" />\n"
. "<input type='submit' value='"
Expand All @@ -2211,9 +2214,6 @@ function kill($iSurveyId)
else
/* The user has confirmed they want to delete the tokens table */
{
$oldtable = "tokens_$iSurveyId";
$newtable = "old_tokens_{$iSurveyId}_$date";

Yii::app()->db->createCommand()->renameTable("{{{$oldtable}}}", "{{{$newtable}}}");
Survey::model()->updateByPk($iSurveyId, array('attributedescriptions' => "a:0:{}"));

Expand All @@ -2223,7 +2223,7 @@ function kill($iSurveyId)
$this->_renderWrappedTemplate('token', array('tokenbar', 'message' => array(
'title' => $clang->gT("Delete Tokens Table"),
'message' => '<br />' . $clang->gT("The tokens table has now been removed and tokens are no longer required to access this survey.") . "<br /> " . $clang->gT("A backup of this table has been made and can be accessed by your system administrator.") . "<br />\n"
. "(\"old_tokens_{$iSurveyId}_$date\")" . "<br /><br />\n"
. sprintf('("%s")<br /><br />', $newtableDisplay)
. "<input type='submit' value='"
. $clang->gT("Main Admin Screen") . "' onclick=\"window.open('" . Yii::app()->getController()->createUrl("admin/survey/view/surveyid/".$iSurveyId) . "', '_top')\" />"
)), $aData);
Expand Down

0 comments on commit 54a8af9

Please sign in to comment.