Skip to content
Snippets Groups Projects
Commit 835584e4 authored by Erik Hommel's avatar Erik Hommel
Browse files

fix #33 add Thank You Date action for Contribution

parent a84aeb1f
No related branches found
No related tags found
No related merge requests found
<?php
return array (
0 =>
array (
'name' => 'Civirules:Action.ThankYouDate',
'entity' => 'CiviRuleAction',
'params' =>
array (
'version' => 3,
'name' => 'ThankYouDate',
'label' => 'Set Thank You Date for Contribution',
'class_name' => 'CRM_CivirulesActions_Contribution_ThankYouDate',
'is_active' => 1
),
),
);
\ No newline at end of file
<?php
/**
* Class for CiviRules Set Thank You Date for Contribution Action
*
* @author Erik Hommel (CiviCooP) <erik.hommel@civicoop.org>
* @license AGPL-3.0
*/
class CRM_CivirulesActions_Contribution_ThankYouDate extends CRM_Civirules_Action {
/**
* Method processAction to execute the action
*
* @param CRM_Civirules_EventData_EventData $eventData
* @access public
*
*/
public function processAction(CRM_Civirules_EventData_EventData $eventData) {
CRM_Core_Error::debug('eventData', $eventData);
exit();
$contactId = $eventData->getContactId();
}
/**
* Method to return the url for additional form processing for action
* and return false if none is needed
*
* @param int $ruleActionId
* @return bool
* @access public
*/
public function getExtraDataInputUrl($ruleActionId) {
return FALSE;
}
}
\ No newline at end of file
<h3>{$ruleActionHeader}</h3>
<div class="crm-block crm-form-block crm-civirule-rule_action-block-contact_subtype">
<div class="crm-section">
<div class="label">{$form.type.label}</div>
<div class="content">{$form.type.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section sub_type-single">
<div class="label">{$form.subtype.label}</div>
<div class="content">{$form.subtype.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section sub_type-multiple" style="display: none;">
<div class="label">{$form.subtypes.label}</div>
<div class="content">{$form.subtypes.html}</div>
<div class="clear"></div>
</div>
</div>
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
{literal}
<script type="text/javascript">
cj(function() {
cj('select#type').change(triggerTypeChange);
triggerTypeChange();
});
function triggerTypeChange() {
cj('.sub_type-multiple').css('display', 'none');
cj('.sub_type-single').css('display', 'none');
var val = cj('#type').val();
if (val == 0 ) {
cj('.sub_type-single').css('display', 'block');
} else {
cj('.sub_type-multiple').css('display', 'block');
}
}
</script>
{/literal}
\ No newline at end of file
......@@ -114,6 +114,12 @@
<title>Group contact</title>
<access_arguments>access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/civirule/form/action/thankyoudate</path>
<page_callback>CRM_CivirulesActions_Contribution_Form_ThankYouDate</page_callback>
<title>Contribution Thank You Date</title>
<access_arguments>access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/civirule/form/event/groupmembership</path>
<page_callback>CRM_CivirulesCronEvent_Form_GroupMembership</page_callback>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment