}
};
+ this.toggleManualProcessing = function() {
+ if (editor.afform.manual_processing) {
+ editor.afform.manual_processing = null;
+ } else {
+ editor.afform.create_submission = true;
+ }
+ }
+
this.toggleEmailVerification = function() {
- if (editor.afform.require_email_confirmation) {
- editor.afform.require_email_confirmation = null;
+ if (editor.afform.allow_verification_by_email) {
+ editor.afform.allow_verification_by_email = null;
} else {
editor.afform.create_submission = true;
+ editor.afform.manual_processing = true;
}
}
// This might be set to undefined by validation
afform.server_route = afform.server_route || '';
// create submission is required if email confirmation is selected.
- if (afform.require_email_confirmation) {
+ if (afform.manual_processing || afform.allow_verification_by_email) {
afform.create_submission = true;
}
$scope.saving = true;
{{:: ts('Submissions') }}
</legend>
+<<<<<<< HEAD
<p class="form-inline">
<label class="radio">
<input class="crm-form-radio" type="radio" name="submit_enabled" ng-model="editor.afform.submit_enabled" ng-value="true">
{{:: ts('Open') }}
+=======
+ <div class="form-group" >
+ <label>
+ <input type="checkbox" ng-model="editor.afform.create_submission" ng-class="{'disabled': !!editor.afform.manual_processing}">
+ {{:: ts('Log Submissions') }}
+>>>>>>> c04192a7f4 (add manual processing option)
</label>
<label class="radio">
<input class="crm-form-radio" type="radio" name="submit_enabled" ng-model="editor.afform.submit_enabled" ng-value="false">
<div class="form-group" >
<label>
- <input type="checkbox" ng-model="editor.afform.require_email_confirmation" ng-click="editor.toggleEmailVerification()">
- {{:: ts('Verify email before processing') }}
+ <input type="checkbox" ng-model="editor.afform.manual_processing" ng-click="editor.toggleManualProcessing()" ng-class="{'disabled': !!editor.afform.allow_verification_by_email}">
+ {{:: ts('Verify submission before processing') }}
+ </label>
+ <p class="help-block">{{:: ts('The data will be processed manually using Form Sumbission action.') }}</p>
+ </div>
+
+ <div class="form-group" ng-if="!!editor.afform.manual_processing">
+ <label>
+ <input type="checkbox" ng-model="editor.afform.allow_verification_by_email" ng-click="editor.toggleEmailVerification()">
+ {{:: ts('Allow verification by email') }}
</label>
- <p class="help-block">{{:: ts('The data will be processed and stored in CiviCRM only after email verfication. Email field is required if you enable this setting.') }}</p>
+ <p class="help-block">{{:: ts('The data will be processed and stored in CiviCRM after email verfication. Email field is required if you enable this setting.') }}</p>
</div>
<div class="form-group" ng-class="{'has-error': !!config_form.redirect.$error.pattern}">
// Save submission record
if (!empty($this->_afform['create_submission'])) {
$status = 'Processed';
- if (!empty($this->_afform['require_email_confirmation'])) {
+ if (!empty($this->_afform['manual_processing'])) {
$status = 'Pending';
}
}
// let's not save the data in other CiviCRM table if email verification is needed.
- if (!empty($this->_afform['require_email_confirmation'])) {
+ if (!empty($this->_afform['manual_processing'])) {
return [];
}
'data_type' => 'Boolean',
],
[
- 'name' => 'require_email_confirmation',
+ 'name' => 'manual_processing',
'data_type' => 'Boolean',
],
+ [
+ 'name' => 'allow_verification_by_email',
+ 'data_type' => 'Boolean',
+ ],
+ [
+ 'name' => 'email_confirmation_template_id',
+ 'data_type' => 'Integer',
+ ],
[
'name' => 'navigation',
'title' => E::ts('Navigation Menu'),