Commit 1ce12ad8 authored by Rich's avatar Rich

add formprocessor instances lis

parent 87274153
......@@ -92,23 +92,30 @@
/>
</div>
<div crm-ui-field="{name: 'editLinkForm.form_processor_name', title: ts('Form Processor')}">
<select
crm-ui-id="editLinkForm.form_processor_name"
ng-model="editData.form_processor_name"
name="form_processor_name"
class="crm-form-select"
>
</select>
</div>
<div ng-if="formProcessorInstalled" >
<div crm-ui-field="{name: 'editLinkForm.form_processor_name', title: ts('Form Processor')}">
<select
crm-ui-id="editLinkForm.form_processor_name"
ng-model="editData.form_processor_name"
name="form_processor_name"
class="crm-form-select"
>
<option value="" >({{ts('None')}})</option>
<option ng-repeat="n in formProcessorInstances" value="{{n.name}}" >{{n.title + (n.is_active == '1' ? '' : '(Inactive)')}}</option>
</select>
</div>
<div crm-ui-field="{name: 'myForm.form_processor_params', title: ts('Form Processor params')}">
<textarea
crm-ui-id="myForm.form_processor_params"
name="form_processor_params"
ng-model="editData.form_processor_params"
class="crm-form-textarea"
></textarea>
<div crm-ui-field="{name: 'myForm.form_processor_params', title: ts('Form Processor params')}">
<textarea
crm-ui-id="myForm.form_processor_params"
name="form_processor_params"
ng-model="editData.form_processor_params"
class="crm-form-textarea"
></textarea>
</div>
</div>
<div ng-if="!formProcessorInstalled" >
{{ts('You do not have the Form Processor extension installed. That extension lets you process the data however you need to, e.g. recording an activity or adding contacts to a group.')}}
</div>
<div crm-ui-field="{name: 'editLinkForm.use_limit', title: ts('Max uses')}">
......@@ -120,11 +127,13 @@
ng-model="editData.use_limit"
class="crm-form-text"
/>
<span>{{editData.use_count || 0}} used so far</span>
</div>
<div crm-ui-field="{name: 'editLinkForm.use_by', title: ts('When to stop allowing access')}">
<!-- @todo date time -->
<input
crm-ui-datepicker="{time: true}"
type="text"
crm-ui-id="editLinkForm.use_by"
name="use_by"
......@@ -133,14 +142,6 @@
/>
</div>
<div crm-ui-field="{name: 'myForm.contact_required', title: ts('Active')}">
<input type="checkbox"
crm-ui-id="myForm.contact_required"
name="contact_required"
ng-model="editData.contact_required"
class="crm-form-radio"
>
</div>
</div>
</div>
<div class="crm-block">
......
......@@ -15,7 +15,7 @@
// The controller uses *injection*. This default injects a few things:
// $scope -- This is the set of variables shared between JS and HTML.
// crmApi, crmStatus, crmUiHelp -- These are services provided by civicrm-core.
angular.module('actionlinksext').controller('ActionLinksExtAdmin', function($scope, crmApi4, crmStatus, crmUiHelp) {
angular.module('actionlinksext').controller('ActionLinksExtAdmin', function($scope, crmApi, crmApi4, crmStatus, crmUiHelp) {
// The ts() and hs() functions help load strings for this module.
var ts = $scope.ts = CRM.ts('actionlinks');
//var hs = $scope.hs = crmUiHelp({file: 'CRM/actionlinksext/ActionLinksExtAdmin'}); // See: templates/CRM/actionlinksext/ActionLinksExtAdmin.hlp
......@@ -24,6 +24,8 @@
$scope.error = '';
$scope.view = 'list';
$scope.actionLinks = [];
$scope.formProcessorInstances = [];
$scope.formProcessorInstalled = false;
// We have myContact available in JS. We also want to reference it in HTML.
function resetEditData() {
......@@ -54,6 +56,18 @@
}, function(failure) {
console.error(failure);
});
crmApi('FormProcessorInstance', 'get', {
return: ["is_active","name","title"],
options: {limit: 0}
}).then(function(r) {
console.log("OK ", r);
$scope.formProcessorInstances = r.values;
$scope.formProcessorInstalled = true;
})
.catch(function(e) {
$scope.formProcessorInstalled = false;
});
}
$scope.editRow = function editRow(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment