[WIP] twingleDonation.Submit API action and general profile functionality

This commit is contained in:
Jens Schuppe 2018-10-05 15:25:31 +02:00
parent 061972706c
commit e141f2951a
14 changed files with 1048 additions and 16 deletions

View file

@ -0,0 +1,106 @@
{*------------------------------------------------------------+
| SYSTOPIA Twingle Integration |
| Copyright (C) 2018 SYSTOPIA |
| Author: J. Schuppe (schuppe@systopia.de) |
+-------------------------------------------------------------+
| This program is released as free software under the |
| Affero GPL license. You can redistribute it and/or |
| modify it under the terms of this license which you |
| can read by viewing the included agpl.txt or online |
| at www.gnu.org/licenses/agpl.html. Removal of this |
| copyright header is strictly prohibited without |
| written permission from the original author(s). |
+-------------------------------------------------------------*}
<div class="crm-block crm-form-block">
{if $op == 'create' or $op == 'edit'}
<fieldset>
<legend>{ts domain="de.systopia.twingle"}General settings{/ts}</legend>
<table class="form-layout-compressed">
<tr class="crm-section">
<td class="label">{$form.name.label}</td>
<td class="content">{$form.name.html}</td>
</tr>
<tr class="crm-section">
<td class="label">{$form.selector.label}</td>
<td class="content">{$form.selector.html}</td>
</tr>
<tr class="crm-section">
<td class="label">{$form.location_type_id.label}</td>
<td class="content">{$form.location_type_id.html}</td>
</tr>
<tr class="crm-section">
<td class="label">{$form.financial_type_id.label}</td>
<td class="content">{$form.financial_type_id.html}</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>{ts domain="de.systopia.twingle"}Payment methods{/ts}</legend>
<table class="form-layout-compressed">
{foreach key=pi_name item=pi_label from=$payment_instruments}
<tr class="crm-section {cycle values="odd,even"}">
<td class="label">{$form.$pi_name.label}</td>
<td class="content">{$form.$pi_name.html}</td>
</tr>
{/foreach}
</table>
</fieldset>
<fieldset>
<legend>{ts domain="de.systopia.twingle"}Groups{/ts}</legend>
<table class="form-layout-compressed">
<tr class="crm-section">
<td class="label">{$form.newsletter_groups.label}</td>
<td class="content">{$form.newsletter_groups.html}</td>
</tr>
<tr class="crm-section">
<td class="label">{$form.postinfo_groups.label}</td>
<td class="content">{$form.postinfo_groups.html}</td>
</tr>
<tr class="crm-section">
<td class="label">{$form.donation_receipts_groups.label}</td>
<td class="content">{$form.donation_receipts_groups.html}</td>
</tr>
</table>
</fieldset>
{elseif $op == 'delete'}
{if $profile_name}
{if $profile_name == 'default'}
<div class="status">{ts domain="de.systopia.twingle" 1=$profile_name}Are you sure you want to reset the default profile?{/ts}</div>
{else}
<div class="status">{ts domain="de.systopia.twingle" 1=$profile_name}Are you sure you want to delete the profile <em>%1</em>?{/ts}</div>
{/if}
{else}
<div class="crm-error">{ts domain="de.systopia.twingle"}Profile name not given or invalid.{/ts}</div>
{/if}
{/if}
{* FOOTER *}
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
</div>

View file

@ -0,0 +1,17 @@
{*------------------------------------------------------------+
| SYSTOPIA Twingle Integration |
| Copyright (C) 2018 SYSTOPIA |
| Author: J. Schuppe (schuppe@systopia.de) |
+-------------------------------------------------------------+
| This program is released as free software under the |
| Affero GPL license. You can redistribute it and/or |
| modify it under the terms of this license which you |
| can read by viewing the included agpl.txt or online |
| at www.gnu.org/licenses/agpl.html. Removal of this |
| copyright header is strictly prohibited without |
| written permission from the original author(s). |
+-------------------------------------------------------------*}
{htxt id='id-twingle_use_sepa'}
{ts domain="de.systopia.twingle"}When the <a href="https://github.com/project60/org.project60.sepa" target="_blank" title="Extension page">CiviSEPA (<kbd>org.project60.sepa</kbd>) extension</a> is enabled and one of its payment instruments is assigned to a Twingle payment method (practically the <em>debit_manual</em> payment method), submitting a Twingle donation through the API will create a SEPA mandate with the given data.{/ts}
{/htxt}

View file

@ -0,0 +1,42 @@
{*------------------------------------------------------------+
| SYSTOPIA Twingle Integration |
| Copyright (C) 2018 SYSTOPIA |
| Author: J. Schuppe (schuppe@systopia.de) |
+-------------------------------------------------------------+
| This program is released as free software under the |
| Affero GPL license. You can redistribute it and/or |
| modify it under the terms of this license which you |
| can read by viewing the included agpl.txt or online |
| at www.gnu.org/licenses/agpl.html. Removal of this |
| copyright header is strictly prohibited without |
| written permission from the original author(s). |
+-------------------------------------------------------------*}
<div class="crm-block crm-form-block crm-twingle-form-block">
{* HEADER *}
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="top"}
</div>
<table class="form-layout-compressed">
{foreach from=$elementNames item=elementName}
<tr class="crm-twingle-form-block-{$form.$elementName.name}">
<td class="label">{$form.$elementName.label} &nbsp;<a onclick='CRM.help("{$form.$elementName.label}", {literal}{"id":"id-{/literal}{$form.$elementName.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.$elementName.html}
<br />
<span class="description">
{$formElements.$elementName.description}
</span>
</td>
</tr>
{/foreach}
</table>
{* FOOTER *}
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
</div>