diff --git a/CRM/CivirulesActions/Contribution/ThankYouDate.mgd.php b/CRM/CivirulesActions/Contribution/ThankYouDate.mgd.php new file mode 100644 index 0000000000000000000000000000000000000000..87549c445654907358c3ad276a2250ac0d6a25a6 --- /dev/null +++ b/CRM/CivirulesActions/Contribution/ThankYouDate.mgd.php @@ -0,0 +1,17 @@ +<?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 diff --git a/CRM/CivirulesActions/Contribution/ThankYouDate.php b/CRM/CivirulesActions/Contribution/ThankYouDate.php new file mode 100644 index 0000000000000000000000000000000000000000..b315f24b874f83e860cac23982b92b46c248c216 --- /dev/null +++ b/CRM/CivirulesActions/Contribution/ThankYouDate.php @@ -0,0 +1,34 @@ +<?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 diff --git a/templates/CRM/CivirulesActions/Contribution/Form/ThankYouDate.tpl b/templates/CRM/CivirulesActions/Contribution/Form/ThankYouDate.tpl new file mode 100644 index 0000000000000000000000000000000000000000..b4e20f6ce117ebde35ef914e5291a3e35fe21b21 --- /dev/null +++ b/templates/CRM/CivirulesActions/Contribution/Form/ThankYouDate.tpl @@ -0,0 +1,43 @@ +<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 diff --git a/xml/Menu/civirules.xml b/xml/Menu/civirules.xml index 29c792a62836bfdbe17b6635690183053cea6944..4594ee67683997b52ec5c53938e28a91509c4b7e 100755 --- a/xml/Menu/civirules.xml +++ b/xml/Menu/civirules.xml @@ -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>