-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#527 Add in abiity to set translated text for Submit and Canc… #13185
Conversation
(Standard links)
|
Hmm - we are really moving toward using shared code for this sort of stuff - ie. per the entity settings form & the related Tpl |
@eileenmcnaughton sure understand that but given this is an additional file that is bundled in (its an accordion on the profile setting page) i'm not sure how it would work on the entity setting form. |
@seamuslee001 so you can replace a part of a tpl with the standard field/s template like this - it permits some fields to be transitioned across without having to do the whole form. The key part is that all the metadata is in $fieldSpec before the {include file="CRM/Core/Form/Field.tpl"} is called
|
Obviously you need to assign metadata to the tpl in some array - but that's kinda the point - the more we mature our metadata the better prepared we are to NOT be on QF anymore |
c1ab558
to
f09769f
Compare
@eileenmcnaughton ok i think i have it now it was a little tricky to ensure the fields didn't get displayed in the main part of the form |
@@ -64,7 +64,9 @@ protected function setEntityFields() { | |||
'title' => ['name' => 'title'], | |||
'frontend_title' => ['name' => 'frontend_title'], | |||
'description' => ['name' => 'description', 'help' => ['id' => 'id-description', 'file' => 'CRM/UF/Form/Group.hlp']], | |||
'uf_group_type' => ['name' => 'uf_group_type', 'not-auto-addable' => TRUE, 'help' => ['id' => 'id-used_for', 'file' => 'CRM/UF/Form/Group.hlp'], 'post_html_text' => ' ' . $this->getOtherModuleString()] | |||
'uf_group_type' => ['name' => 'uf_group_type', 'not-auto-addable' => TRUE, 'help' => ['id' => 'id-used_for', 'file' => 'CRM/UF/Form/Group.hlp'], 'post_html_text' => ' ' . $this->getOtherModuleString()], | |||
'cancel_button_text' => ['name' => 'cancel_button_text', 'help' => ['id' => 'id-cancel_button_text', 'file' => 'CRM/UF/Form/Group.hlp'], 'class' => 'cancel_button_section'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton note the class here is because of some javascript that hides all cancel button sections if the show cancel button field is not checked
<tr class="crm-{$entityInClassFormat}-form-block-{$fieldName}"> | ||
{include file="CRM/Core/Form/Field.tpl"} | ||
</tr> | ||
{if not in_array($fieldSpec.name, $advancedFieldsConverted)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures that the new fields don't show on the main part of the form as well as on the advanced settings section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not hugely important but I think !in_array would be more consistent with elsewhere than 'not'
…el button text Convert to using entity fields style adding to form
f09769f
to
5e59ce4
Compare
Jenkins re test this please |
I just tested this & it works well. Code looks good. Merge on pass |
thanks @eileenmcnaughton |
Merging as per the tag |
…el button text
Overview
This adds in the ability for Users to set different text per language for these fields when editing the settings
Before
Could not enter different text per language
After
Can enter text per language
ping @eileenmcnaughton @samuelsov