Skip to content

Commit

Permalink
Dev: Change 'survey page' back to 'question group' again
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jan 13, 2020
1 parent e5e37b6 commit f05d9df
Show file tree
Hide file tree
Showing 34 changed files with 92 additions and 93 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/checkintegrity.php
Expand Up @@ -188,7 +188,7 @@ private function _deleteGroups(array $groups, array $aData)
if($deleted) {
$count += $deleted;
} else {
$aData['warnings'][] = sprintf(gT('Unable to delete survey page %s'), $gid);
$aData['warnings'][] = sprintf(gT('Unable to delete question group %s'), $gid);
}
}
$aData['messages'][] = sprintf(gT('Deleting groups: %u groups deleted'), $count);
Expand Down
18 changes: 9 additions & 9 deletions application/controllers/admin/questiongroups.php
Expand Up @@ -195,10 +195,10 @@ public function insert($surveyid)
$oGroupLS->language = $sLanguage;
$oGroupLS->save();
}
App()->setFlashMessage(gT("New survey page was saved."));
App()->setFlashMessage(gT("New question group was saved."));
App()->setFlashMessage(
sprintf(
gT('You can now %sadd a question%s in this page.'),
gT('You can now %sadd a question%s in this group.'),
'<a href="'
.App()->createUrl("admin/questions/sa/newquestion/surveyid/$surveyid/gid/$newGroupID")
.'">',
Expand Down Expand Up @@ -248,7 +248,7 @@ public function delete($iSurveyId = null, $iGroupId = null, $asJson = false)
}
$oQuestionGroup = QuestionGroup::model()->find("gid = :gid", array(":gid"=>$iGroupId));
if (empty($oQuestionGroup)) {
throw new CHttpException(401, gT("Invalid survey page id"));
throw new CHttpException(401, gT("Invalid question group id"));
}
/* Test the surveyid from question, not from submitted value */
$iSurveyId = $oQuestionGroup->sid;
Expand All @@ -270,7 +270,7 @@ public function delete($iSurveyId = null, $iGroupId = null, $asJson = false)
[
'success' => $success,
'deletedGroups' => $iGroupsDeleted,
'message' => ($success ?gT('The survey page was deleted.') : gT('Page could not be deleted')),
'message' => ($success ?gT('The question group was deleted.') : gT('Group could not be deleted')),
'redirect' => $this->getController()->createUrl(
'admin/survey/sa/listquestiongroups/',
['surveyid' => $iSurveyId]
Expand All @@ -282,9 +282,9 @@ public function delete($iSurveyId = null, $iGroupId = null, $asJson = false)

if ($iGroupsDeleted > 0) {
QuestionGroup::model()->updateGroupOrder($iSurveyId);
App()->setFlashMessage(gT('The survey page was deleted.'));
App()->setFlashMessage(gT('The question group was deleted.'));
} else {
App()->setFlashMessage(gT('Page could not be deleted'), 'error');
App()->setFlashMessage(gT('Group could not be deleted'), 'error');
}

LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyId);
Expand Down Expand Up @@ -364,14 +364,14 @@ public function view($surveyid, $gid, $landOnSideMenuTab = 'structure')
["surveyid" => $surveyid, 'gid' => $gid]
),
'i10N' => [
'Survey page' => gT('Survey page'),
'Page overview' => gT('Page overview'),
'Question group' => gT('Question group'),
'Group overview' => gT('Group overview'),
'Question list' => gT('Question list'),
'Create new question group' => gT('Create new question group'),
'Question group overview' => gT('Question group overview'),
'Question group editor' => gT('Question group editor'),
'General Settings' => gT("General Settings"),
'Page summary' => gT('Page summary'),
'Group summary' => gT('Group summary'),
'Random Group' => gT('Random Group'),
'Title' => gT('Title'),
'Condition' => gT('Condition'),
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -1396,7 +1396,7 @@ private function _reorderGroup($iSurveyID)
}
}
LimeExpressionManager::SetDirtyFlag(); // so refreshes syntax highlighting
Yii::app()->session['flashmessage'] = gT("The new survey page/question order was successfully saved.");
Yii::app()->session['flashmessage'] = gT("The new question group/question order was successfully saved.");
}

/**
Expand Down Expand Up @@ -1990,7 +1990,7 @@ public function insert($iSurveyID = null)
$iNewGroupID = $this->_createSampleGroup($iNewSurveyid);
$iNewQuestionID = $this->_createSampleQuestion($iNewSurveyid, $iNewGroupID);

Yii::app()->setFlashMessage($warning.gT("Your new survey was created. We also created a first survey page and an example question for you."), 'info');
Yii::app()->setFlashMessage($warning.gT("Your new survey was created. We also created a first question group and an example question for you."), 'info');
$landOnSideMenuTab = 'structure';
$redirecturl = $this->getSurveyAndSidemenueDirectionURL($iNewSurveyid, $iNewGroupID, $iNewQuestionID, $landOnSideMenuTab);
} else {
Expand Down Expand Up @@ -2300,7 +2300,7 @@ private function _createSampleGroup($iSurveyID)
$oGroup->save();
$oGroupL10ns = new QuestionGroupL10n();
$oGroupL10ns->gid = $oGroup->gid;
$oGroupL10ns->group_name = gt('My first survey page', 'html', $sLanguage);
$oGroupL10ns->group_name = gt('My first question group', 'html', $sLanguage);
$oGroupL10ns->language = $sLanguage;
$oGroupL10ns->save();
LimeExpressionManager::SetEMLanguage($sLanguage);
Expand Down
22 changes: 11 additions & 11 deletions application/core/LsDefaultDataSets.php
Expand Up @@ -22,7 +22,7 @@ public static function getSurveyMenuEntryData()
[1,null,8,'notification', gT('Notification and data management settings','unescaped'),gT('Notifications & data','unescaped'),gT('Edit settings for notification and data management','unescaped'),'feed','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_notification_panel','','surveylocale','read',null,'_tabNotificationDataManagement','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,0],
[1,null,9,'publication', gT('Publication & access control settings','unescaped'),gT('Publication & access','unescaped'),gT('Edit settings for publication and access control','unescaped'),'key','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_publication_panel','','surveylocale','read',null,'_tabPublicationAccess','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,0],
[2,null,1,'listQuestions',gT('Question list','unescaped'),gT('Question list','unescaped'),gT('List questions','unescaped'),'list','fontawesome','','admin/survey/sa/listquestions','','','','','surveycontent','read','{"render": { "link": {"data": {"surveyid": ["survey","sid"]}}}}','','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,1],
[2,null,2,'listQuestionGroups',gT('Page list','unescaped'),gT('Page list','unescaped'),gT('List survey pages','unescaped'),'th-list','fontawesome','','admin/survey/sa/listquestiongroups','','','','','surveycontent','read','{"render": { "link": {"data": {"surveyid": ["survey","sid"]}}}}','','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,1],
[2,null,2,'listQuestionGroups',gT('Group list','unescaped'),gT('Group list','unescaped'),gT('List question groups','unescaped'),'th-list','fontawesome','','admin/survey/sa/listquestiongroups','','','','','surveycontent','read','{"render": { "link": {"data": {"surveyid": ["survey","sid"]}}}}','','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,1],
[2,null,3,'responses',gT('Responses','unescaped'),gT('Responses','unescaped'),gT('Responses','unescaped'),'icon-browse','iconclass','','admin/responses/sa/browse/','','','','','responses','read','{"render": {"isActive": true, "link": {"data": {"surveyid": ["survey", "sid"]}}}}','','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,1],
[2,null,4,'participants', gT('Survey participants','unescaped'),gT('Survey participants','unescaped'),gT('Go to survey participant and token settings','unescaped'),'user','fontawesome','','admin/tokens/sa/index/','','','','','surveysettings','update','{"render": { "link": {"data": {"surveyid": ["survey","sid"]}}}}','','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,1],
[2,null,5,'statistics',gT('Statistics','unescaped'),gT('Statistics','unescaped'),gT('Statistics','unescaped'),'bar-chart','fontawesome','','admin/statistics/sa/index/','','','','','statistics','read','{"render": {"isActive": true, "link": {"data": {"surveyid": ["survey", "sid"]}}}}','','en-GB',1, date('Y-m-d H:i:s'),0,date('Y-m-d H:i:s'),0,1],
Expand Down Expand Up @@ -413,8 +413,8 @@ public static function getTutorialEntryData()
array(
'teid' => 5,
'ordering' => 5,
'title' => gT('Create a sample question and survey page'),
'content' => gT("We will be creating a survey page and a question in this tutorial. There is need to automatically create them."),
'title' => gT('Create a sample question and question group'),
'content' => gT("We will be creating a question group and a question in this tutorial. There is need to automatically create them."),
'settings' => json_encode(array(
'element' => '.bootstrap-switch-id-createsample',
'path' => ['/admin/survey/sa/newsurvey'],
Expand Down Expand Up @@ -513,7 +513,7 @@ public static function getTutorialEntryData()
'teid' => 12,
'ordering' => 12,
'title' => gT('The survey structure'),
'content' => gT('This is the structure view of your survey. Here you can see all your survey pages and questions.'),
'content' => gT('This is the structure view of your survey. Here you can see all your groups and questions.'),
'settings' => json_encode(array(
'element' => '#adminsidepanel__sidebar--selectorStructureButton',
'path' => ['/admin/survey/sa/view', ['surveyid' => '[0-9]{4,25}']],
Expand All @@ -527,9 +527,9 @@ public static function getTutorialEntryData()
array(
'teid' => 13,
'ordering' => 13,
'title' => gT("Let's add a survey page"),
'title' => gT("Let's add a question group"),
'content' => gT("What good would your survey be without questions?").'<br/>'
.gT('In LimeSurvey a survey is organized in survey pages and questions. To begin creating questions, we first need a survey page.')
.gT('In LimeSurvey a survey is organized in groups and questions. To begin creating questions, we first need a question group.')
.'<p class="alert bg-warning">'.gT("Click on the 'Add page' button").'</p>',
'settings' => json_encode(array(
'element' => '#adminsidepanel__sidebar--selectorCreateQuestionGroup',
Expand All @@ -547,8 +547,8 @@ public static function getTutorialEntryData()
array(
'teid' => 14,
'ordering' => 14,
'title' => gT('Enter a title for your first survey page'),
'content' => gT('The title of the survey page is visible to your survey participants (this setting can be changed later and it cannot be empty). survey pages are important because they allow the survey administrators to logically group the questions. By default, each survey page (including its questions) is shown on its own page (this setting can be changed later).'),
'title' => gT('Enter a title for your first question group'),
'content' => gT('The title of the question group is visible to your survey participants (this setting can be changed later and it cannot be empty). Question groups are important because they allow the survey administrators to logically group the questions. By default, each question group (including its questions) is shown on its own page (this setting can be changed later).'),
'settings' => json_encode(array(
'element' => '#group_name_en',
'delayOnElement' => "{
Expand All @@ -564,9 +564,9 @@ public static function getTutorialEntryData()
array(
'teid' => 15,
'ordering' => 15,
'title' => gT('A description for your survey page'),
'title' => gT('A description for your question group'),
'content' => gT('This description is also visible to your participants.').'<br/>'
.gT('You do not need to add a description to your survey page, but sometimes it makes sense to add a little extra information for your participants.'),
.gT('You do not need to add a description to your question group, but sometimes it makes sense to add a little extra information for your participants.'),
'settings' => json_encode(array(
'element' => 'label[for=description_en]',
'path' => ['/admin/questiongroups/sa/add', ['surveyid' => '[0-9]{4,25}']],
Expand All @@ -591,7 +591,7 @@ public static function getTutorialEntryData()
'ordering' => 17,
'title' => gT('Save and add a new question'),
'content' => gT("Now when you are finished click on 'Save and add question'.").'<br/>'
.gT('This will directly add a question to the current survey page.')
.gT('This will directly add a question to the current question group.')
.'<p class="alert bg-warning">'.gT("Now click on 'Save and add question'.").'</p>',
'settings' => json_encode(array(
'element' => '#save-and-new-question-button',
Expand Down
3 changes: 1 addition & 2 deletions application/core/Survey_Common_Action.php
Expand Up @@ -860,7 +860,6 @@ function _surveybar($aData)
}

/**
>>>>>>> parent of 00109dd9e5... Dev: Rename question group to survey page
* Show side menu for survey view
* @param array $aData all the needed data
*/
Expand Down Expand Up @@ -1130,7 +1129,7 @@ public function _surveysummary($aData)
if ($activated == "N" && $sumcount3 == 0) {
$aData['warnings'][] = gT("Survey cannot be activated yet.");
if ($sumcount2 == 0 && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'create')) {
$aData['warnings'][] = "<span class='statusentryhighlight'>[".gT("You need to add survey pages")."]</span>";
$aData['warnings'][] = "<span class='statusentryhighlight'>[".gT("You need to add question groups")."]</span>";
}
if ($sumcount3 == 0 && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'create')) {
$aData['warnings'][] = "<span class='statusentryhighlight'>".gT("You need to add questions")."</span>";
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/admin/activate_helper.php
Expand Up @@ -87,7 +87,7 @@ function checkHasGroup($postsid)
$groupresult = Yii::app()->db->createCommand($groupquery)->query()->readAll();

if (count($groupresult) == 0) {
return gT("This survey does not contain any survey pages.");
return gT("This survey does not contain any question groups.");
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Expand Up @@ -1288,7 +1288,7 @@ function breakOutAndCrash($sTemplateViewPath, $totalquestions, $iTotalGroupsWith
}

if ($iTotalGroupsWithoutQuestions > 0) {
$sMessage = gT("There are empty survey pages in this survey - please create at least one question within a survey page.");
$sMessage = gT("There are empty question groups in this survey - please create at least one question within a question group.");
}

renderError($sTitle, $sMessage, $thissurvey, $sTemplateViewPath);
Expand Down
8 changes: 4 additions & 4 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -2911,10 +2911,10 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
$oDB->createCommand()->update(
"{{surveymenu_entries}}",
[
'name' => "listSurveyPages",
'title' => gT('Page list','unescaped'),
'menu_title' => gT('Page list','unescaped'),
'menu_description' => gT('List survey pages','unescaped'),
'name' => "listSurveyGroups",
'title' => gT('Group list','unescaped'),
'menu_title' => gT('Group list','unescaped'),
'menu_description' => gT('List question group','unescaped'),
],
'name=\'listQuestionGroups\''
);
Expand Down
2 changes: 1 addition & 1 deletion application/models/QuestionBaseDataSet.php
Expand Up @@ -204,7 +204,7 @@ function ($oQuestionGroup) use (&$aGroupOptions){
'title' => gT('Question group'),
'formElementId' => 'gid',
'formElementName' => false,
'formElementHelp' => gT("If you want to change the survey page this question is in."),
'formElementHelp' => gT("If you want to change the question group this question is in."),
'inputtype' => 'questiongroup',
'formElementValue' => $this->oQuestion->gid,
'formElementOptions' => [
Expand Down
2 changes: 1 addition & 1 deletion application/models/QuestionGroup.php
Expand Up @@ -162,7 +162,7 @@ public static function deleteWithDependency($groupId, $surveyId)
// Abort if the survey is active
$surveyIsActive = Survey::model()->findByPk($surveyId)->active !== 'N';
if ($surveyIsActive) {
Yii::app()->user->setFlash('error', gt("Can't delete survey page when the survey is active"));
Yii::app()->user->setFlash('error', gt("Can't delete question group when the survey is active"));
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/assessments/assessments_edit.php
Expand Up @@ -45,7 +45,7 @@
<option value="<?=$groupId?>" ><?=flattenText($groupName)?></option>
<?php } ?>
</select>
<?php } else { echo eT("No survey page found."); } ?>
<?php } else { echo eT("No question group found."); } ?>
</div>
<div class='col-sm-2 hide-xs'></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/checkintegrity/check_view.php
Expand Up @@ -222,7 +222,7 @@
} ?>

<?php if (isset($groupOrderDuplicates) && !empty($groupOrderDuplicates)): ?>
<li><?php eT("The following surveys have an errorneous survey page order. Please go to each survey respectively, check the group order and save it."); ?>
<li><?php eT("The following surveys have an errorneous question group order. Please go to each survey respectively, check the group order and save it."); ?>
<ul>
<?php foreach ($groupOrderDuplicates as $info): ?>
<li>
Expand All @@ -231,7 +231,7 @@
<?php endforeach; ?>
</ul>
<?php else: ?>
<li><?php eT("No issues with survey page order found."); ?></li>
<li><?php eT("No issues with question group order found."); ?></li>
<?php endif; ?>

<?php
Expand Down

0 comments on commit f05d9df

Please sign in to comment.