case 'get':
case 'getsingle':
case 'getcount':
+ case 'getstat':
$metadata = _civicrm_api_get_fields($apiRequest['entity'], $unique, $apiRequest['params']);
if (empty($metadata['id'])) {
// if id is not set we will set it eg. 'id' from 'case_id', case_id will be an alias
CRM.alert(data.deprecated, entity + ' Deprecated');
}
showFields(required);
- if (action === 'get' || action === 'getsingle') {
- showReturn();
+ if (action === 'get' || action === 'getsingle' || action === 'getstat') {
+ showReturn(action === 'getstat' ? ts('Group by') : ts('Fields to return'));
}
});
}
/**
* For "get" actions show the "return" options
*/
- function showReturn() {
- $('#api-params').prepend($(returnTpl({})));
+ function showReturn(title) {
+ $('#api-params').prepend($(returnTpl({title: title})));
$('#api-return-value').crmSelect2({data: fields, multiple: true});
}
<script type="text/template" id="api-return-tpl">
<tr class="api-return-row">
<td colspan="3">
- <label for="api-return-value">{ts}Fields to return{/ts}:</label>
+ <label for="api-return-value"><%- title %>:</label>
<input type="hidden" class="api-param-name" value="return" />
<input style="width: 50%;" id="api-return-value" class="crm-form-text api-param-value api-input" placeholder="{ts}Leave blank for default{/ts}"/>
</td>