Skip to content

Commit

Permalink
Fixed issue #15656: Quick translation: Basic and detailed admin notif…
Browse files Browse the repository at this point in the history
…ication emails can't be translated (#1566)

Added new tab and fields
  • Loading branch information
gabrieljenik committed Sep 6, 2020
1 parent 31bd77b commit a31c917
Showing 1 changed file with 79 additions and 6 deletions.
85 changes: 79 additions & 6 deletions application/controllers/admin/translate.php
Expand Up @@ -73,7 +73,8 @@ public function index($surveyid)
$aViewUrls['translateheader_view'][] = $aData;

$tab_names = array("title", "welcome", "group", "question", "subquestion", "answer",
"emailinvite", "emailreminder", "emailconfirmation", "emailregistration");
"emailinvite", "emailreminder", "emailconfirmation", "emailregistration",
"emailbasicadminnotification", "emaildetailedadminnotification");

if (!empty($tolang)) {
// Only save if the administration user has the correct permission
Expand Down Expand Up @@ -592,7 +593,7 @@ private function setupTranslateFields($type)
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Invitation email subject"),
'description' => gT("Invitation email"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "Popup",
'associated' => "emailinvitebody"
Expand Down Expand Up @@ -622,7 +623,7 @@ private function setupTranslateFields($type)
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Reminder email subject"),
'description' => gT("Reminder email"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => "emailreminderbody"
Expand Down Expand Up @@ -652,7 +653,7 @@ private function setupTranslateFields($type)
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Confirmation email subject"),
'description' => gT("Confirmation email"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => "emailconfirmationbody"
Expand Down Expand Up @@ -682,7 +683,7 @@ private function setupTranslateFields($type)
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Registration email subject"),
'description' => gT("Registration email"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => "emailregistrationbody"
Expand Down Expand Up @@ -712,7 +713,7 @@ private function setupTranslateFields($type)
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Confirmation email subject"),
'description' => gT("Confirmation email"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => "email_confirmbody"
Expand All @@ -733,6 +734,66 @@ private function setupTranslateFields($type)
'associated' => ""
);
break;

case 'emailbasicadminnotification':
$aData = array(
'type' => 1,
'dbColumn' => 'email_admin_notification_subj',
'id1' => '',
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Basic admin notification"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => "emailbasicadminnotificationbody"
);
break;

case 'emailbasicadminnotificationbody':
$aData = array(
'type' => 1,
'dbColumn' => 'email_admin_notification',
'id1' => '',
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Basic admin notification"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => ""
);
break;

case 'emaildetailedadminnotification':
$aData = array(
'type' => 1,
'dbColumn' => 'email_admin_responses_subj',
'id1' => '',
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Detailed admin notification"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => "emaildetailedadminnotificationbody"
);
break;

case 'emaildetailedadminnotificationbody':
$aData = array(
'type' => 1,
'dbColumn' => 'email_admin_responses',
'id1' => '',
'id2' => '',
'gid' => false,
'qid' => false,
'description' => gT("Detailed admin notification"),
'HTMLeditorType' => "email",
'HTMLeditorDisplay' => "",
'associated' => ""
);
break;
}
return $aData;
}
Expand Down Expand Up @@ -763,6 +824,10 @@ private function query($type, $action, $iSurveyID, $tolang, $baselang, $id1 = ""
case 'emailregistrationbody':
case 'email_confirm':
case 'email_confirmbody':
case 'emailbasicadminnotification':
case 'emailbasicadminnotificationbody':
case 'emaildetailedadminnotification':
case 'emaildetailedadminnotificationbody':
return SurveyLanguageSetting::model()->resetScope()->findAllByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$baselang));
case 'group':
case 'group_desc':
Expand Down Expand Up @@ -809,6 +874,14 @@ private function query($type, $action, $iSurveyID, $tolang, $baselang, $id1 = ""
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('surveyls_email_register_subj'=>$new));
case 'emailregistrationbody':
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('surveyls_email_register'=>$new));
case 'emailbasicadminnotification':
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('email_admin_notification_subj'=>$new));
case 'emailbasicadminnotificationbody':
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('email_admin_notification'=>$new));
case 'emaildetailedadminnotification':
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('email_admin_responses_subj'=>$new));
case 'emaildetailedadminnotificationbody':
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('email_admin_responses'=>$new));
case 'email_confirm':
return SurveyLanguageSetting::model()->updateByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$tolang), array('surveyls_email_confirm_subject'=>$new));
case 'email_confirmbody':
Expand Down

0 comments on commit a31c917

Please sign in to comment.