<input class="collapsible-optgroups form-control" ng-model="action" ng-disabled="!entity || !actions.length" ng-class="{loading: entity && !actions.length}" crm-ui-select="{placeholder: ts('Action'), data: actions}" />
</span>
<input class="form-control api4-index" type="search" ng-model="index" ng-mouseenter="help('index', paramDoc('$index'))" ng-mouseleave="help()" placeholder="{{ ts('Index') }}" />
- <button class="btn btn-success pull-right" crm-icon="fa-bolt" ng-disabled="!entity || !action || loading" ng-click="execute()">{{ ts('Execute') }}</button>
- <button class="btn btn-primary pull-right" crm-icon="fa-save" ng-show="entity === 'Contact' && action === 'get'" ng-click="save()">{{ ts('Save...') }}</button>
+ <button class="btn btn-success pull-right" crm-icon="fa-bolt" ng-disabled="!entity || !action || loading" ng-click="execute()" ng-mouseenter="help(ts('Execute'), executeDoc())" ng-mouseleave="help()">{{ ts('Execute') }}</button>
+ <button class="btn btn-primary pull-right" crm-icon="fa-save" ng-show="entity === 'Contact' && action === 'get'" ng-click="save()" ng-mouseenter="help(ts('Save smart group'), saveDoc())" ng-mouseleave="help()">{{ ts('Save...') }}</button>
</div>
</div>
<div class="panel-body">
return docs.params[name];
};
+ $scope.executeDoc = function() {
+ var doc = {
+ description: ts('Runs API call on the CiviCRM database.'),
+ comment: ts('Results and debugging info will be displayed below.')
+ };
+ if ($scope.action === 'delete') {
+ doc.WARNING = ts('This API call will be executed on the real database. Deleting data cannot be undone.');
+ }
+ else if ($scope.action && $scope.action.slice(0, 3) !== 'get') {
+ doc.WARNING = ts('This API call will be executed on the real database. It cannot be undone.');
+ }
+ return doc;
+ };
+
+ $scope.saveDoc = function() {
+ return {
+ description: ts('Save API call as a smart group.'),
+ comment: ts('Allows you to create a SavedSearch containing the WHERE clause of this API call.'),
+ };
+ };
+
$scope.$watch('params', writeCode, true);
$scope.$watch('index', writeCode);
writeCode();