crmEditable - consistent treatment of action params
authorColeman Watts <coleman@civicrm.org>
Sat, 9 Aug 2014 12:03:57 +0000 (13:03 +0100)
committerColeman Watts <coleman@civicrm.org>
Sat, 9 Aug 2014 12:03:57 +0000 (13:03 +0100)
js/jquery/jquery.crmeditable.js
templates/CRM/Contribute/Page/ContributionRecur.tpl

index 80735b9dd6a52181bc10c052ec434b1d743c4d3a..bb86b2f65a5e6deb7f5bf68349ede18d74a78d80 100644 (file)
@@ -12,7 +12,7 @@
       $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.attr('data-entity-action') || 'setvalue';
+      ret.action = $row.data('action') || 'setvalue';
 
     if (!ret.entity || !ret.id) {
       return false;
@@ -43,7 +43,7 @@
           field: info.field,
           value: checked ? 1 : 0
         };
-        CRM.api(info.entity, 'setvalue', params, {
+        CRM.api(info.entity, info.action, params, {
           context: this,
           error: function(data) {
             editableSettings.error.call(this, info.entity, info.field, checked, data);
         var
           info = $i.crmEditableEntity(),
           params = {},
-          action = $i.data('action') || 'setvalue';
+          action = $i.data('action') || info.action;
         if (!info.field) {
           return false;
         }
index 38f26e01fff0821eddc7eca9757b070cd8263e8b..4521d91e0186e84fd1e8320987bb66aec6f587cb 100644 (file)
@@ -69,7 +69,7 @@
 
         {foreach from=$recurRows item=row}
             {assign var=id value=$row.id}
-            <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}">
+            <tr id="contribution_recur-{$row.id}" data-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>