Commit a8475168 authored by Eric Windham's avatar Eric Windham

lots of changes for GDPR updates

parent 48c86adc
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
......@@ -302,6 +302,61 @@ define( ['views/app/drawer/mergeTagsContent', 'views/app/drawer/settingError'],
return helpTextWrapper.innerHTML;
},
/*
* Render a select element with only the email fields on the
* form
*/
renderEmailFieldOptions: function() {
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
initialOption = document.createElement( 'option' );
initialOption.value = '';
initialOption.label = '--';
initialOption.innerHTML = '--';
var select_value = '';
var select = document.createElement( 'select' );
select.classList.add( 'setting' );
select.setAttribute( 'data-id', 'my_seledt' );
select.appendChild( initialOption );
var index = 0;
var that = this;
fields.each( function( field ) {
// Check for the field type in our lookup array and...
if( 'email' != field.get( 'type' ) ) {
// Return if the type is in our lookup array.
return '';
}
var option = document.createElement( 'option' );
option.value = field.get( 'key' );
option.innerHTML = field.get( 'label' );
option.label = field.get( 'label' );
if( that.value === field.get( 'key' ) ) {
option.setAttribute( 'selected', 'selected' );
} else if( 0 === index ) {
option.setAttribute( 'selected', 'selected' );
}
select.appendChild( option );
index = index + 1;
});
label = document.createElement( 'label' );
label.classList.add( 'nf-select' );
label.appendChild( select );
// Select Lists need an empty '<div></div>' for styling purposes.
emptyContainer = document.createElement( 'div' );
label.appendChild( emptyContainer );
// The template requires a string.
return label.innerHTML;
},
renderMergeTags: function() {
if ( this.use_merge_tags && ! this.hide_merge_tags ) {
return '<span class="dashicons dashicons-list-view merge-tags"></span>';
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
File mode changed from 100755 to 100644
File mode changed from 100644 to 100755
......@@ -29,6 +29,7 @@ abstract class NF_Abstracts_UserInfo extends NF_Fields_Textbox
'help',
'description',
'custom_name_attribute',
'personally_identifiable',
'disable_browser_autocomplete' )
);
......
......@@ -84,8 +84,8 @@ final class NF_Actions_DeleteDataRequest extends NF_Abstracts_Action
// to anonymize or not to anonymize, that is the question
add_post_meta( $request_id,
'anonymize_data',
$action_settings[ 'anonymize_data' ] );
'nf_anonymize_data',
$action_settings[ 'anonymize' ] );
wp_send_user_request( $request_id );
}
......
This diff is collapsed.
......@@ -5,6 +5,15 @@ return apply_filters( 'ninja_forms_action_email_settings', array(
/*
* To
*/
'submitter_email' => array(
'name' => 'submitter_email',
'type' => 'email-select',
'options' => array(),
'group' => 'primary',
'label' => __( 'Designated Submitter\'s Email Address', 'ninja-forms' ),
'value' => '',
'help' => __( 'This field helps you with privacy regulations.', 'ninja-forms' ),
),
'fields_save_toggle' => array(
'name' => 'fields-save-toggle',
......
......@@ -654,11 +654,13 @@ return apply_filters( 'ninja_forms_field_settings', array(
),
'personally_identifiable' => array(
'name' => 'anonymize',
'name' => 'personally_identifiable',
'type' => 'toggle',
'group' => 'advanced',
'label' => __( 'Anonymize Data', 'ninja-forms' ),
'label' => __( 'This Field Is Personally Identifiable Data', 'ninja-forms' ),
'width' => 'full',
'value' => '',
'help' => __( 'This option helps with privacy regulation compliance', 'ninja-forms' ),
),
/*
......
......@@ -25,5 +25,6 @@ class NF_Fields_Address extends NF_Fields_Textbox
$this->_nicename = __( 'Address', 'ninja-forms' );
$this->_settings[ 'custom_name_attribute' ][ 'value' ] = 'address';
$this->_settings[ 'personally_identifiable' ][ 'value' ] = '1';
}
}
......@@ -23,5 +23,6 @@ class NF_Fields_Address2 extends NF_Fields_Textbox
$this->_nicename = __( 'Address 2', 'ninja-forms' );
$this->_settings[ 'custom_name_attribute' ][ 'value' ] = 'address';
$this->_settings[ 'personally_identifiable' ][ 'value' ] = '1';
}
}
......@@ -19,7 +19,7 @@ class NF_Fields_Email extends NF_Abstracts_UserInfo
protected $_test_value = 'foo@bar.dev';
protected $_settings_all_fields = array( 'custom_name_attribute' );
protected $_settings_all_fields = array( 'custom_name_attribute', 'personally_identifiable' );
public function __construct()
{
......@@ -28,6 +28,7 @@ class NF_Fields_Email extends NF_Abstracts_UserInfo
$this->_nicename = __( 'Email', 'ninja-forms' );
$this->_settings[ 'custom_name_attribute' ][ 'value' ] = 'email';
$this->_settings[ 'personally_identifiable' ][ 'value' ] = '1';
}
......
......@@ -24,5 +24,6 @@ class NF_Fields_Phone extends NF_Fields_Textbox
$this->_nicename = __( 'Phone', 'ninja-forms' );
$this->_settings[ 'custom_name_attribute' ][ 'value' ] = 'phone';
$this->_settings[ 'personally_identifiable' ][ 'value' ] = '1';
}
}
......@@ -19,7 +19,13 @@ class NF_Fields_Textbox extends NF_Abstracts_Input
protected $_test_value = 'Lorem ipsum';
protected $_settings = array( 'disable_browser_autocomplete', 'mask', 'custom_mask', 'custom_name_attribute' );
protected $_settings = array(
'disable_browser_autocomplete',
'mask',
'custom_mask',
'custom_name_attribute',
'personally_identifiable'
);
public function __construct()
{
......
......@@ -501,6 +501,13 @@ Label Three, value-three, 3
</label>
</script>
<script id="tmpl-nf-edit-setting-email-select" type="text/template">
<label for="{{{ data.name }}}" class="nf-select">{{{ data.label }}} {{{ data.renderTooltip() }}}
{{{ data.renderEmailFieldOptions() }}}
<div></div>
</label>
</script>
<script id="tmpl-nf-edit-setting-field-select" type="text/template">
<label for="{{{ data.name }}}" class="nf-select">{{{ data.label }}} {{{ data.renderTooltip() }}}
<select id="{{{ data.name }}}" class="setting">
......
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