--CRM-16187, added warning text in API explorer
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 28 May 2015 20:11:59 +0000 (01:41 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Sat, 25 Jul 2015 05:19:56 +0000 (10:49 +0530)
templates/CRM/Admin/Page/APIExplorer.js

index 9f744229044127745584678767f6392f015ca41e..eb79dd6e677585a68b328f6d3fe764bdf5ec60f4 100644 (file)
           $('#api-params').html('<tr><td colspan="4" class="crm-loading-element"></td></tr>');
           $('#api-params-table thead').show();
           getFields(this);
-          buildParams();
+         if ($.inArray(entity, ['EntityFinancialTrxn', 'FinancialTrxn']) > -1 
+            && $.inArray(action, ['delete', 'setvalue', 'replace', 'create']) > -1
+          ) {
+           var msg = ts('Given the importance of auditability, extension developers are strongly discouraged from writing code to add, update or delete entries in the civicrm_financial_item, civicrm_entity_financial_trxn, and civicrm_financial_trxn tables. Before publishing an extension on civicrm.org that does any of this, please ask for a special bookkeeping code review for the extension.');
+           CRM.alert(msg, 'warning');
+         }
         } else {
           $('#api-params, #api-generated pre').empty();
           $('#api-param-buttons, #api-params-table thead').hide();