diff --git a/entityform.rules.inc b/entityform.rules.inc new file mode 100644 index 0000000..5de2791 --- /dev/null +++ b/entityform.rules.inc @@ -0,0 +1,44 @@ + t('Remove draft status from a submission'), + 'group' => t('Entityforms'), + 'parameter' => array( + 'entityform' => array( + 'label' => t('The entityform submission to save'), + 'type' => 'entityform', + ), + ), + 'callbacks' => array( + 'execute' => 'entityform_rules_remove_draft_status', + ), + ); + return $actions; +} + +/** + * Callback to mark an entityform submission as permanent. + */ +function entityform_rules_remove_draft_status($submission) { + $submission->draft = FALSE; + $submission->save(); + + watchdog('entityform', 'Remove draft status from @type submission @submission', array('@type' => $submission->type, '@submission' => $submission->entityform_id), WATCHDOG_INFO, l(t('View submission'), 'entityform/' . $submission->entityform_id)); +} + +/** + * @} + */