Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surveys: Fix I18n translation support and WYSIWYG support #26135

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CRM/Campaign/DAO/Survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Campaign/Survey.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:4b2846e419f4a7d5dcc44b80df895caf)
* (GenCodeChecksum:79c05054f18c94059ec35314ea6bbef6)
*/

/**
Expand Down Expand Up @@ -417,7 +417,7 @@ public static function &fields() {
'bao' => 'CRM_Campaign_BAO_Survey',
'localizable' => 1,
'html' => [
'type' => 'TextArea',
'type' => 'RichTextEditor',
],
'add' => '3.3',
],
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/I18n/SchemaStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public static function &widgets() {
'required' => "true",
],
'instructions' => [
'type' => "TextArea",
'type' => "RichTextEditor",
'rows' => "20",
'cols' => "80",
],
Expand Down
2 changes: 2 additions & 0 deletions CRM/Utils/API/HTMLInputCoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public function getSkipFields() {
'settings',
// SearchSegment items
'items',
// Survey entity
'instructions',
];
$custom = CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_custom_field WHERE html_type = "RichTextEditor"');
while ($custom->fetch()) {
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Campaign/Form/Petition.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td>{$form.title.html}
</tr>
<tr class="crm-campaign-survey-form-block-instructions">
<td class="label">{$form.instructions.label}</td>
<td class="label">{$form.instructions.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_survey' field='instructions' id=$surveyId}{/if}</td>
<td class="view-value">{$form.instructions.html}
</tr>
<tr class="crm-campaign-survey-form-block-campaign_id">
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Campaign/Form/Survey/Main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="description">{ts}Select the Activity Type.{/ts}</div></td>
</tr>
<tr class="crm-campaign-survey-main-form-block-instructions">
<td class="label">{$form.instructions.label}</td>
<td class="label">{$form.instructions.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_survey' field='instructions' id=$surveyId}{/if}</td>
<td class="view-value">{$form.instructions.html}
</tr>
<tr class="crm-campaign-survey-main-form-block-default_number_of_contacts">
Expand Down
2 changes: 1 addition & 1 deletion xml/schema/Campaign/Survey.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<localizable>true</localizable>
<comment>Script instructions for volunteers to use for the survey.</comment>
<html>
<type>TextArea</type>
<type>RichTextEditor</type>
<rows>20</rows>
<cols>80</cols>
</html>
Expand Down