Skip to content

Commit

Permalink
Merge branch 'formTemplates'
Browse files Browse the repository at this point in the history
[#100] Fix form template issues (help texts, undefined template variables, etc.)
  • Loading branch information
jensschuppe committed Sep 24, 2024
2 parents f6cd361 + 4ae20a1 commit 2834f80
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 36 deletions.
40 changes: 20 additions & 20 deletions CRM/Twingle/Form/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ class CRM_Twingle_Form_Settings extends CRM_Core_Form {
* List of all settings options.
*/
public static $SETTINGS_LIST = [
'twingle_prefix',
'twingle_use_sepa',
'twingle_dont_use_reference',
'twingle_protect_recurring',
'twingle_protect_recurring_activity_type',
'twingle_protect_recurring_activity_subject',
'twingle_protect_recurring_activity_status',
'twingle_protect_recurring_activity_assignee',
'twingle_use_shop',
'twingle_access_key',
'twingle_prefix',
'twingle_use_sepa',
'twingle_dont_use_reference',
'twingle_protect_recurring',
'twingle_protect_recurring_activity_type',
'twingle_protect_recurring_activity_subject',
'twingle_protect_recurring_activity_status',
'twingle_protect_recurring_activity_assignee',
'twingle_use_shop',
'twingle_access_key',
];

/**
Expand Down Expand Up @@ -110,22 +110,22 @@ public function buildQuickForm(): void {
$this->add(
'checkbox',
'twingle_use_shop',
E::ts("Use Twingle Shop Integration")
E::ts('Use Twingle Shop Integration')
);

$this->add(
'text',
'twingle_access_key',
E::ts("Twingle Access Key")
E::ts('Twingle Access Key')
);

$this->addButtons(array(
array (
'type' => 'submit',
'name' => E::ts('Save'),
'isDefault' => TRUE,
)
));
$this->addButtons([
[
'type' => 'submit',
'name' => E::ts('Save'),
'isDefault' => TRUE,
],
]);

// set defaults
foreach (self::$SETTINGS_LIST as $setting) {
Expand Down Expand Up @@ -164,7 +164,7 @@ public function validate() {
CRM_Utils_Array::value('twingle_use_shop', $this->_submitValues) &&
!CRM_Utils_Array::value('twingle_access_key', $this->_submitValues, FALSE)
) {
$this->_errors['twingle_access_key'] = E::ts("An Access Key is required to enable Twingle Shop Integration");
$this->_errors['twingle_access_key'] = E::ts('An Access Key is required to enable Twingle Shop Integration');
}

return (0 == count($this->_errors));
Expand Down
4 changes: 2 additions & 2 deletions templates/CRM/Twingle/Form/Profile.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{/htxt}

{htxt id='id-shop_map_products'}
<p>{ts domain="de.systopia.twingle"}If this option is enabled, all Twingle Shop products corresponding to the specified project IDs will be retrieved from Twingle and mapped as price sets and price fields. Each Twingle Shop is mapped as a price set with its products as price fields.</p>
<p>This allows you to manually create contributions with the same line items for phone orders, for example, as would be the case for orders placed through the Twingle Shop.</p>
<p>{ts domain="de.systopia.twingle"}If this option is enabled, all Twingle Shop products corresponding to the specified project IDs will be retrieved from Twingle and mapped as price sets and price fields. Each Twingle Shop is mapped as a price set with its products as price fields.{/ts}</p>
<p>{ts domain="de.systopia.twingle"}This allows you to manually create contributions with the same line items for phone orders, for example, as would be the case for orders placed through the Twingle Shop.{/ts}</p>
{/htxt}
{/crmScope}
4 changes: 4 additions & 0 deletions templates/CRM/Twingle/Form/Settings.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
{htxt id='id-twingle_use_shop'}
{ts domain="de.systopia.twingle"}If you enable Twingle Shop integration, you can configure Twingle API profiles to include products ordered through Twingle Shop as line items in the created contribution.{/ts}
{/htxt}

{htxt id='id-twingle_access_key'}
{ts domain="de.systopia.twingle"}Enter your twingle API access key.{/ts}
{/htxt}
20 changes: 6 additions & 14 deletions templates/CRM/Twingle/Form/Settings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,16 @@

<table class="form-layout-compressed">
<tr class="crm-twingle-form-block-use-shop">
<td class="label">{$form.twingle_use_shop.label}&nbsp;&nbsp;<a onclick='CRM.help("{$form.twingle_use_shop.label}", {literal}{"id":"id-{/literal}{$form.twingle_use_shop.name}{literal}","file":"CRM\/Twingle\/Form\/Settings"}{/literal}); return false;' href="#" title="{ts domain="de.systopia.twingle"}Help{/ts}" class="helpicon"></a></td>
<td>
{$form.twingle_use_shop.html}
<br />
<span class="description">
{$formElements.twingle_use_shop.description}
</span>
<td class="label">{$form.twingle_use_shop.label}
{help id="id-twingle_use_shop" title=$form.twingle_use_shop.label}
</td>
<td>{$form.twingle_use_shop.html}</td>
</tr>
<tr class="crm-twingle-form-block-access-key twingle-shop-element">
<td class="label">{$form.twingle_access_key.label}&nbsp;&nbsp;<a onclick='CRM.help("{$form.twingle_access_key.label}", {literal}{"id":"id-{/literal}{$form.twingle_access_key.name}{literal}","file":"CRM\/Twingle\/Form\/Settings"}{/literal}); return false;' href="#" title="{ts domain="de.systopia.twingle"}Help{/ts}" class="helpicon"></a></td>
<td>
{$form.twingle_access_key.html}
<br />
<span class="description">
{$formElements.twingle_access_key.description}
</span>
<td class="label">{$form.twingle_access_key.label}
{help id="id-twingle_access_key" title=$form.twingle_access_key.label}
</td>
<td>{$form.twingle_access_key.html}</td>
</tr>
</table>

Expand Down

0 comments on commit 2834f80

Please sign in to comment.