$form->add('text', 'tf_thankyou_title', ts('Thank-you Title'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'thankyou_title'), TRUE);
$form->addWysiwyg('tf_thankyou_text', ts('Thank-you Message'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'thankyou_text'), TRUE);
+
+ if ($form->_friendId) {
+ // CRM-14200 the i18n dialogs need this for translation
+ $form->assign('friendId', $form->_friendId);
+ }
}
/**
*
* @var int
*/
- private $_friendId;
+ public $_friendId;
public function preProcess() {
parent::preProcess();
* @access public
*/
public function buildQuickForm() {
+ if (isset($this->_id)) {
+ $defaults['entity_table'] = 'civicrm_contribution_page';
+ $defaults['entity_id'] = $this->_id;
+ CRM_Friend_BAO_Friend::getValues($defaults);
+ $this->_friendId = CRM_Utils_Array::value('id', $defaults);
+ }
+
CRM_Friend_BAO_Friend::buildFriendForm($this);
parent::buildQuickForm();
}
*
* @var int
*/
- private $_friendId;
+ public $_friendId;
public function preProcess() {
parent::preProcess();
* @access public
*/
public function buildQuickForm() {
+ if (isset($this->_id)) {
+ $defaults['entity_table'] = 'civicrm_event';
+ $defaults['entity_id'] = $this->_id;
+ CRM_Friend_BAO_Friend::getValues($defaults);
+ $this->_friendId = CRM_Utils_Array::value('id', $defaults);
+ }
+
CRM_Friend_BAO_Friend::buildFriendForm($this);
parent::buildQuickForm();
}
<tr class="crm-friend-manage-form-block-tf_title">
<td class="label">{$form.tf_title.label}
{if $action == 2}
- {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='title' id=$id}
+ {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='title' id=$friendId}
{/if}
</td>
<td>{$form.tf_title.html}
<tr class="crm-friend-manage-form-block-intro">
<td class="label">{$form.intro.label}
{if $action == 2}
- {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='intro' id=$id}
+ {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='intro' id=$friendId}
{/if}
</td>
<td>{$form.intro.html}<br />
<tr class="crm-friend-manage-form-block-suggested_message">
<td class="label">{$form.suggested_message.label}
{if $action == 2}
- {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='suggested_message' id=$id}
+ {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='suggested_message' id=$friendId}
{/if}
</td>
<td>{$form.suggested_message.html}<br />
<tr class="crm-friend-manage-form-block-thankyou_title">
<td class="label">{$form.tf_thankyou_title.label}
{if $action == 2}
- {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='tf_thankyou_title' id=$id}{/if}</td>
+ {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='tf_thankyou_title' id=$friendId}{/if}</td>
<td>{$form.tf_thankyou_title.html}</td>
</tr>
<tr class="crm-friend-manage-form-block-thankyou_text">
<td class="label">{$form.tf_thankyou_text.label}
{if $action == 2}
- {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='tf_thankyou_text' id=$id}
+ {include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_tell_friend' field='tf_thankyou_text' id=$friendId}
{/if}
</td>
<td>{$form.tf_thankyou_text.html}<br />