}
return $content;
}
+
+/**
+ * Implements hook_civicrm_searchKitTasks().
+ *
+ * @param array[] $tasks
+ * @param bool $checkPermissions
+ * @param int|null $userID
+ */
+function afform_civicrm_searchKitTasks(array &$tasks, bool $checkPermissions, ?int $userID) {
+ $tasks['AfformSubmission']['process'] = [
+ 'module' => 'afSearchTasks',
+ 'title' => E::ts('Process Submissions'),
+ 'icon' => 'fa-check-square-o',
+ 'uiDialog' => ['templateUrl' => '~/afSearchTasks/afformSubmissionProcessTask.html'],
+ ];
+}
--- /dev/null
+<?php
+// This file declares an Angular module which can be autoloaded
+return [
+ 'js' => [
+ 'ang/afSearchTasks.module.js',
+ 'ang/afSearchTasks/*.js',
+ 'ang/afSearchTasks/*/*.js',
+ ],
+ 'partials' => [
+ 'ang/afSearchTasks',
+ ],
+ 'css' => [],
+ 'settings' => [],
+ 'requires' => [],
+];
--- /dev/null
+(function(angular, $, _) {
+ "use strict";
+
+ // Declare module
+ angular.module('afSearchTasks', CRM.angRequires('afSearchTasks'));
+
+})(angular, CRM.$, CRM._);
(function(angular, $, _) {
"use strict";
- angular.module('crmSearchTasks').controller('crmSearchTaskProcess', function ($scope, $timeout, crmApi4, searchTaskBaseTrait) {
- var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
+ angular.module('afSearchTasks').controller('afformSubmissionProcessTask', function ($scope, $timeout, crmApi4, searchTaskBaseTrait) {
+ var ts = $scope.ts = CRM.ts('org.civicrm.afform'),
// Combine this controller with model properties (ids, entity, entityInfo) and searchTaskBaseTrait
ctrl = angular.extend(this, $scope.model, searchTaskBaseTrait);
<div id="bootstrap-theme" crm-dialog="crmSearchTask">
- <form name="crmSearchTaskProcessForm" ng-controller="crmSearchTaskProcess as $ctrl">
+ <form name="afformSubmissionProcessTaskForm" ng-controller="afformSubmissionProcessTask as $ctrl">
<p><strong>{{:: ts('Process the %1 selected %2 submission(s):', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</strong></p>
<crm-dialog-button text="ts('Cancel')" icons="{primary: 'fa-times'}" on-click="$ctrl.cancel()" disabled="$ctrl.run" ></crm-dialog-button>
- <crm-dialog-button text="ts('Process submission(s)')" icons="{primary: $ctrl.run ? 'fa-spin fa-spinner' : 'fa-check'}" on-click="$ctrl.save()" disabled="$ctrl.run || !crmSearchTaskProcessForm.$valid" ></crm-dialog-button>
+ <crm-dialog-button text="ts('Process submission(s)')" icons="{primary: $ctrl.run ? 'fa-spin fa-spinner' : 'fa-check'}" on-click="$ctrl.save()" disabled="$ctrl.run || !afformSubmissionProcessTaskForm.$valid" ></crm-dialog-button>
</form>
</div>
'number' => '>= 0',
];
- $tasks[$entity['name']]['process'] = [
- 'module' => 'crmSearchTasks',
- 'title' => E::ts('Process Submissions'),
- 'icon' => 'fa-check-square-o',
- 'uiDialog' => ['templateUrl' => '~/crmSearchTasks/crmSearchTaskProcess.html'],
- ];
-
if (array_key_exists('update', $entity['actions'])) {
$tasks[$entity['name']]['update'] = [
'module' => 'crmSearchTasks',