function civicrm_api3_contribution_recur_cancel($params) {
civicrm_api3_verify_one_mandatory($params, NULL, array('id'));
- return call_user_func_array(array(_civicrm_api3_get_BAO(__FUNCTION__), 'cancelRecurContribution'), array($params['id'], CRM_Core_DAO::$_nullObject));
+ return CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($params['id'], CRM_Core_DAO::$_nullObject) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while cancelling recurring contribution'));
}
/**
$row = this.first().closest('.crm-entity');
ret.entity = $row.data('entity') || $row[0].id.split('-')[0];
ret.id = $row.data('id') || $row[0].id.split('-')[1];
- ret.action = $row.data('entity-action') || $row[0].id.split('-')[2] || 'setvalue';
+ ret.action = $row.attr('data-entity-action') || 'setvalue';
if (!ret.entity || !ret.id) {
return false;
{foreach from=$recurRows item=row}
{assign var=id value=$row.id}
- <tr id="contribution_recur-{$row.id}-cancel" class="crm-entity {cycle values="even-row,odd-row"}{if NOT $row.is_active} disabled{/if}">
+ <tr id="contribution_recur-{$row.id}" data-entity-action="cancel" class="crm-entity {cycle values="even-row,odd-row"}{if NOT $row.is_active} disabled{/if}">
<td>{$row.amount|crmMoney}{if $row.is_test} ({ts}test{/ts}){/if}</td>
<td>{ts}Every{/ts} {$row.frequency_interval} {$row.frequency_unit} </td>
<td>{$row.start_date|crmDate}</td>