Skip to content

Commit

Permalink
Fix salesagility#4646 - Hard coded messages in Surveys module
Browse files Browse the repository at this point in the history
  • Loading branch information
jack7anderson7 committed Oct 19, 2022
1 parent 7b6ac1b commit c03d31c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
14 changes: 14 additions & 0 deletions modules/Surveys/language/en_us.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,18 @@
'LBL_SURVEYS_SURVEYQUESTIONS_FROM_SURVEYQUESTIONS_TITLE' => 'Survey Questions',
'LBL_SURVEYS_SURVEYRESPONSES_FROM_SURVEYRESPONSES_TITLE' => 'Survey Responses',
'LBL_SHOW_RESPONSES' => 'Show responses',
'LBL_SURVEY_QUESTION' => 'Question',
'LBL_SURVEY_TEXT' => 'Text',
'LBL_SURVEY_TYPE' => 'Type',
'LBL_SURVEY_ACTIONS' => 'Actions',
'LBL_SURVEY_NEW_QUESTION' => 'New Question',
'LBL_SURVEY_RESPONSES' => 'New Question',
'LBL_SURVEYS_SENT' => 'Surveys Sent:',
'LBL_SURVEY_DISTINCT' => 'Distinct Surveys Sent:',
'LBL_DRAFT' => 'Draft',
'LBL_SUBMIT' => 'Submit',
'LBL_SATISFIED_RESPONSE' => 'Satisfied',
'LBL_NOT_SATISFIED_NOR_DISSATISFIED' => 'Neither Satisfied nor Dissatisfied',
'LBL_DISSATISFIED' => 'Dissatisfied',
'LBL_STARS' => 'Stars'
);
6 changes: 3 additions & 3 deletions modules/Surveys/tpls/detailsurveyquestions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<table id="questionTable" class="table table-bordered">
<tr>
<th>
Question
{$MOD.LBL_SURVEY_QUESTION}
</th>
<th>
Text
{$MOD.LBL_SURVEY_TEXT}
</th>
<th>
Type
{$MOD.LBL_SURVEY_TYPE}
</th>
</tr>
{foreach from=$questions item=question}
Expand Down
24 changes: 12 additions & 12 deletions modules/Surveys/tpls/editsurveyquestions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<input type="hidden" name="survey_questions_supplied" value="1">
<table id="questionTable" class="table table-bordered">
<tr>
<th>
Question
</th>
<th>
Text
</th>
<th>
Type
</th>
<th>Actions</th>
<th>
{$MOD.LBL_SURVEY_QUESTION}
</th>
<th>
{$MOD.LBL_SURVEY_TEXT}
</th>
<th>
{$MOD.LBL_SURVEY_TYPE}
</th>
<th>{$MOD.LBL_SURVEY_ACTIONS}</th>
</tr>
</table>
<button type="button" class="button" id="newQuestionButton">New Question</button>
<button type="button" class="button" id="newQuestionButton">{$MOD.LBL_SURVEY_NEW_QUESTION}</button>
</div>
{literal}
<script>
Expand Down Expand Up @@ -175,4 +175,4 @@
});

</script>
{/literal}
{/literal}
6 changes: 3 additions & 3 deletions modules/Surveys/tpls/reports.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<h1>{$survey.name}</h1>
<table>
<tr>
<th>Responses:</th>
<th>{$MOD.LBL_SURVEY_RESPONSES}</th>
<td>{$responsesCount}</td>
</tr>
<tr>
<th>Surveys Sent:</th>
<th>{$MOD.LBL_SURVEYS_SENT}</th>
<td>{$surveysSent}</td>
</tr>
<tr>
<th>Distinct Surveys Sent:</th>
<th>{$MOD.LBL_SURVEY_DISTINCT}</th>
<td>{$surveysSentDistinct}</td>
</tr>
</table>
Expand Down
10 changes: 5 additions & 5 deletions modules/Surveys/vardefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
'vname' => 'LBL_STATUS',
'type' => 'enum',
'massupdate' => 0,
'default' => 'Draft',
'default' => 'LBL_DRAFT',
'no_default' => false,
'comments' => '',
'help' => '',
Expand Down Expand Up @@ -111,31 +111,31 @@
'vname' => 'LBL_SUBMIT_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Submit',
'default' => 'LBL_SUBMIT',
),
'satisfied_text' => array(
'required' => false,
'name' => 'satisfied_text',
'vname' => 'LBL_SATISFIED_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Satisfied',
'default' => 'LBL_SATISFIED_RESPONSE',
),
'neither_text' => array(
'required' => false,
'name' => 'neither_text',
'vname' => 'LBL_NEITHER_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Neither Satisfied nor Dissatisfied',
'default' => 'LBL_NOT_SATISFIED_NOR_DISSATISFIED',
),
'dissatisfied_text' => array(
'required' => false,
'name' => 'dissatisfied_text',
'vname' => 'LBL_DISSATISFIED_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Dissatisfied',
'default' => 'LBL_DISSATISFIED',
),
"surveys_surveyquestions" => array(
'name' => 'surveys_surveyquestions',
Expand Down
6 changes: 4 additions & 2 deletions modules/Surveys/views/view.reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ private function getChoiceQuestionSkeleton($arr, $options)

private function getRatingQuestionSkeleton($arr)
{
global $mod_strings;

for ($x = 1; $x <= 5; $x++) {
$arr['chartLabels'][$x] = $x . ' Stars';
$arr['chartLabels'][$x] = $x . $mod_strings['LBL_STARS'];
$arr['chartData'][$x] = 0;
$arr['responses'][$x] = array(
'count' => 0,
'label' => $x . ' Stars',
'label' => $x . $mod_strings['LBL_STARS'],
'order' => $x
);
}
Expand Down

0 comments on commit c03d31c

Please sign in to comment.