Commit 97377f16 authored by Kevin Stover's avatar Kevin Stover

Updating to version 3.0.31.

parents e0e2d7e6 129c42f8
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration, Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5 Requires at least: 4.5
Tested up to: 4.7.2 Tested up to: 4.7.2
Stable tag: 3.0.30 Stable tag: 3.0.31
License: GPLv2 or later License: GPLv2 or later
With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site. With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site.
......
...@@ -715,17 +715,18 @@ All styles used within the drawer ...@@ -715,17 +715,18 @@ All styles used within the drawer
display: block; display: block;
margin-bottom: 20px; } margin-bottom: 20px; }
.ninja-forms-app label::after { .ninja-forms-app label {
clear: both; position: relative; }
content: ""; .ninja-forms-app label::after {
display: block; } clear: both;
content: "";
display: block; }
.ninja-forms-app legend { .ninja-forms-app legend {
margin: 0 3px 10px; margin: 0 3px 10px;
padding: 0 10px; } padding: 0 10px; }
.ninja-forms-app .nf-setting-label, .ninja-forms-app label, .ninja-forms-app legend { .ninja-forms-app .nf-setting-label, .ninja-forms-app label, .ninja-forms-app legend {
position: relative;
color: #424242; color: #424242;
display: block; display: block;
font-size: 13px; font-size: 13px;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,53 +9,33 @@ ...@@ -9,53 +9,33 @@
define( [], function() { define( [], function() {
var controller = Marionette.Object.extend( { var controller = Marionette.Object.extend( {
initialize: function() { initialize: function() {
this.listenTo( nfRadio.channel( 'fields' ), 'drop:fieldType', this.dropField ); this.listenTo( nfRadio.channel( 'fields' ), 'after:addField', this.addField );
this.listenTo( nfRadio.channel( 'fields' ), 'add:stagedField', this.stageField );
}, },
dropField: function( type, tmpID ) { addField: function( model ) {
if( 'password' == type ) { if( 'password' == model.get( 'type' ) ) {
var model = nfRadio.channel( 'fields').request( 'get:field', tmpID );
var order = model.get( 'order' ); var order = model.get( 'order' );
nfRadio.channel( 'fields' ).request( 'delete', model ); var confirm = this.insertField( 'passwordconfirm', order + 1 );
_.each( [ 'password', 'passwordconfirm' ], function( type ) {
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
var newField = { confirm.set( 'confirm_field', model.get( 'key' ) );
id: nfRadio.channel( 'fields' ).request( 'get:tmpID' ),
type: type,
label: fieldType.get( 'nicename' ),
order: order
};
nfRadio.channel('fields').request('add', newField );
});
} }
}, },
stageField: function( model ) { insertField: function( type, order ) {
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
var field_slug = model.get( 'slug' ); var newField = {
id: nfRadio.channel( 'fields' ).request( 'get:tmpID' ),
type: type,
label: fieldType.get( 'nicename' ),
order: order
};
if( 'password' == field_slug ) { return nfRadio.channel('fields').request('add', newField );
nfRadio.channel( 'fields' ).request( 'remove:stagedField', '', model );
_.each( [ 'password', 'passwordconfirm' ], function( type ) {
var silent = ( type == field_slug );
nfRadio.channel('fields').request('add:stagedField', type, silent );
});
}
} }
}); });
return controller; return controller;
......
...@@ -27,7 +27,7 @@ define( [], function() { ...@@ -27,7 +27,7 @@ define( [], function() {
return { return {
renderTitle: function(){ renderTitle: function(){
var formData = nfRadio.channel( 'app' ).request( 'get:formModel' ); var formData = nfRadio.channel( 'app' ).request( 'get:formModel' );
return formData.get( 'settings' ).get( 'title' ); return _.escape( formData.get( 'settings' ).get( 'title' ) );
}, },
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
margin-bottom: 20px; margin-bottom: 20px;
} }
label { label {
position: relative;
&::after { &::after {
clear: both; clear: both;
content: ""; content: "";
...@@ -70,7 +71,6 @@ ...@@ -70,7 +71,6 @@
padding: 0 10px; padding: 0 10px;
} }
.nf-setting-label, label, legend { .nf-setting-label, label, legend {
position: relative;
color: #424242; color: #424242;
display: block; display: block;
font-size: 13px; font-size: 13px;
......
...@@ -265,7 +265,7 @@ class Ninja_Forms { ...@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version // Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) ) if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.30' ); define( 'NF_PLUGIN_VERSION', '3.0.31' );
// Plugin Folder Path // Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) ) if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
...@@ -157,12 +157,14 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller ...@@ -157,12 +157,14 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
$field = array_merge( $field, $field[ 'settings' ] ); $field = array_merge( $field, $field[ 'settings' ] );
/** Validate the Field */ /** Validate the Field */
if( $validate_fields ){ if( $validate_fields && ! isset( $this->_data[ 'resume' ] ) ){
$this->validate_field( $field ); $this->validate_field( $field );
} }
/** Process the Field */ /** Process the Field */
$this->process_field( $field ); if( ! isset( $this->_data[ 'resume' ] ) ) {
$this->process_field($field);
}
$field = array_merge( $field, $this->_form_data[ 'fields' ][ $field_id ] ); $field = array_merge( $field, $this->_form_data[ 'fields' ][ $field_id ] );
/** Populate Field Merge Tag */ /** Populate Field Merge Tag */
......
...@@ -76,6 +76,10 @@ final class NF_Actions_Email extends NF_Abstracts_Action ...@@ -76,6 +76,10 @@ final class NF_Actions_Email extends NF_Abstracts_Action
if( $errors ){ if( $errors ){
$data[ 'errors' ][ 'form' ] = $errors; $data[ 'errors' ][ 'form' ] = $errors;
} }
if ( ! empty( $attachments ) ) {
$this->_drop_csv();
}
return $data; return $data;
} }
...@@ -197,6 +201,8 @@ final class NF_Actions_Email extends NF_Abstracts_Action ...@@ -197,6 +201,8 @@ final class NF_Actions_Email extends NF_Abstracts_Action
foreach( $fields as $field ){ foreach( $fields as $field ){
if( ! isset( $field[ 'label' ] ) ) continue; if( ! isset( $field[ 'label' ] ) ) continue;
if( 'hr' == $field['type'] ) continue;
if( 'submit' == $field['type'] ) continue;
$csv_array[ 0 ][] = $field[ 'label' ]; $csv_array[ 0 ][] = $field[ 'label' ];
$csv_array[ 1 ][] = WPN_Helper::stripslashes( $field[ 'value' ] ); $csv_array[ 1 ][] = WPN_Helper::stripslashes( $field[ 'value' ] );
...@@ -236,6 +242,23 @@ final class NF_Actions_Email extends NF_Abstracts_Action ...@@ -236,6 +242,23 @@ final class NF_Actions_Email extends NF_Abstracts_Action
rename( $dir.'/'.$basename, $dir.'/'.$new_name.'.csv' ); rename( $dir.'/'.$basename, $dir.'/'.$new_name.'.csv' );
return $dir.'/'.$new_name.'.csv'; return $dir.'/'.$new_name.'.csv';
} }
/**
* Function to delete csv file from temp directory after Email Action has completed.
*/
private function _drop_csv()
{
$upload_dir = wp_upload_dir();
$path = trailingslashit( $upload_dir['path'] );
// create name for file
$new_name = apply_filters( 'ninja_forms_submission_csv_name', 'ninja-forms-submission' );
// remove a file if it already exists
if( file_exists( $path.'/'.$new_name.'.csv' ) ) {
unlink( $path.'/'.$new_name.'.csv' );
}
}
/* /*
* Backwards Compatibility * Backwards Compatibility
......
...@@ -100,7 +100,13 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu ...@@ -100,7 +100,13 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
{ {
$template = sanitize_title( $_GET['form_id'] ); $template = sanitize_title( $_GET['form_id'] );
$form = Ninja_Forms::template( $template . '.nff', array(), TRUE ); $templates = Ninja_Forms::config( 'NewFormTemplates' );
if( isset( $templates[ $template ] ) && ! empty( $templates[ $template ][ 'form' ] ) ) {
$form = $templates[ $template ][ 'form' ];
} else {
$form = Ninja_Forms::template( $template . '.nff', array(), TRUE );
}
if( ! $form ) die( 'Template not found' ); if( ! $form ) die( 'Template not found' );
......
...@@ -800,7 +800,7 @@ return apply_filters( 'ninja_forms_field_settings', array( ...@@ -800,7 +800,7 @@ return apply_filters( 'ninja_forms_field_settings', array(
'type' => 'field-select', 'type' => 'field-select',
'label' => __( 'Confirm', 'ninja-forms' ), 'label' => __( 'Confirm', 'ninja-forms' ),
'width' => 'full', 'width' => 'full',
'group' => 'advanced' 'group' => 'primary'
), ),
/* /*
......
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/**
'slug_name' => array(
//Same as slug name/
'id' => 'slug_name',
'title' => 'nicename',
'template-desc' => '',
),
*/
return apply_filters( 'ninja_forms_new_form_templates', array(
'formtemplate-contactform' => array(
'id' => 'formtemplate-contactform',
'title' => __( 'Contact Us', 'ninja-forms' ),
'template-desc' => __( 'Allow your users to contact you with this simple contact form. You can add and remove fields as needed.', 'ninja-forms' ),
),
'formtemplate-quoterequest' => array(
'id' => 'formtemplate-quoterequest',
'title' => __( 'Quote Request', 'ninja-forms' ),
'template-desc' => __( 'Manage quote requests from your website easily with this template. You can add and remove fields as needed.', 'ninja-forms' ),
),
'formtemplate-eventregistration' => array(
'id' => 'formtemplate-eventregistration',
'title' => __( 'Event Registration', 'ninja-forms' ),
'template-desc' => __( 'Allow user to register for your next event this easy to complete form. You can add and remove fields as needed.', 'ninja-forms' ),
),
));
\ No newline at end of file
...@@ -53,7 +53,6 @@ final class NF_Database_FieldsController ...@@ -53,7 +53,6 @@ final class NF_Database_FieldsController
'label' => $field_data[ 'settings' ][ 'label' ], 'label' => $field_data[ 'settings' ][ 'label' ],
'type' => $field_data[ 'settings' ][ 'type' ] 'type' => $field_data[ 'settings' ][ 'type' ]
); );
if( ! is_numeric( $field_id ) ) { if( ! is_numeric( $field_id ) ) {
$this->insert_field( $settings ); // New Field. $this->insert_field( $settings ); // New Field.
} else { } else {
...@@ -213,6 +212,7 @@ final class NF_Database_FieldsController ...@@ -213,6 +212,7 @@ final class NF_Database_FieldsController
$this->db->escape_by_ref( $value ); $this->db->escape_by_ref( $value );
if( ! $this->update_field_meta[ $this->update_field_meta_chunk ] ) $this->update_field_meta[ $this->update_field_meta_chunk ] = ''; if( ! $this->update_field_meta[ $this->update_field_meta_chunk ] ) $this->update_field_meta[ $this->update_field_meta_chunk ] = '';
$this->update_field_meta[ $this->update_field_meta_chunk ] .= " WHEN `parent_id` = '{$field_id}' AND `key` = '{$key}' THEN '{$value}'"; $this->update_field_meta[ $this->update_field_meta_chunk ] .= " WHEN `parent_id` = '{$field_id}' AND `key` = '{$key}' THEN '{$value}'";
$counter++; $counter++;
if( 0 == $counter % 5000 ) $this->update_field_meta_chunk++; if( 0 == $counter % 5000 ) $this->update_field_meta_chunk++;
} }
......
...@@ -78,7 +78,7 @@ final class NF_Display_Render ...@@ -78,7 +78,7 @@ final class NF_Display_Render
$form->update_settings( $settings ); $form->update_settings( $settings );
if( $form->get_setting( 'logged_in' ) && ! is_user_logged_in() ){ if( $form->get_setting( 'logged_in' ) && ! is_user_logged_in() ){
echo $form->get_setting( 'not_logged_in_msg' ); echo do_shortcode( $form->get_setting( 'not_logged_in_msg' ));
return; return;
} }
...@@ -94,7 +94,7 @@ final class NF_Display_Render ...@@ -94,7 +94,7 @@ final class NF_Display_Render
} }
if( $count >= $form->get_setting( 'sub_limit_number' ) ) { if( $count >= $form->get_setting( 'sub_limit_number' ) ) {
echo apply_filters( 'nf_sub_limit_reached_msg', $form->get_setting( 'sub_limit_msg' ), $form_id ); echo do_shortcode( apply_filters( 'nf_sub_limit_reached_msg', $form->get_setting( 'sub_limit_msg' ), $form_id ));
return; return;
} }
} }
...@@ -359,7 +359,7 @@ final class NF_Display_Render ...@@ -359,7 +359,7 @@ final class NF_Display_Render
} }
if( isset( $form[ 'settings' ][ 'logged_in' ] ) && $form[ 'settings' ][ 'logged_in' ] && ! is_user_logged_in() ){ if( isset( $form[ 'settings' ][ 'logged_in' ] ) && $form[ 'settings' ][ 'logged_in' ] && ! is_user_logged_in() ){
echo $form[ 'settings' ][ 'not_logged_in_msg' ]; echo do_shortcode( $form[ 'settings' ][ 'not_logged_in_msg' ]);
return; return;
} }
......
<?php if ( ! defined( 'ABSPATH' ) ) exit;
$templates = Ninja_Forms::config( 'NewFormTemplates' );
foreach( $templates as $template ) {
?>
<a href="?page=ninja-forms&form_id=<?php echo $template[ 'id' ]; ?>" class="nf-one-third template-box">
<div class="template-box-inside">
<h4><?php echo $template[ 'title' ]; ?></h4>
<p class="template-desc"><?php echo $template[ 'template-desc' ]; ?></p>
</div>
</a>
<?php
}
\ No newline at end of file
...@@ -127,31 +127,8 @@ ...@@ -127,31 +127,8 @@
<h3><?php _e( 'Add form fields', 'ninja-forms' ); ?></h3> <h3><?php _e( 'Add form fields', 'ninja-forms' ); ?></h3>
<p><?php _e( 'Get started by adding your first form field.', 'ninja-forms' ); ?> <a class="nf-open-drawer" title="<?php _e( 'Add New Field', 'ninja-forms' ); ?>" href="#" data-drawerid="addField"><?php _e( 'Just click here and select the fields you want.', 'ninja-forms' ); ?> </a><?php _e( "It's that easy. Or...", 'ninja-forms' ); ?> <p><?php _e( 'Get started by adding your first form field.', 'ninja-forms' ); ?> <a class="nf-open-drawer" title="<?php _e( 'Add New Field', 'ninja-forms' ); ?>" href="#" data-drawerid="addField"><?php _e( 'Just click here and select the fields you want.', 'ninja-forms' ); ?> </a><?php _e( "It's that easy. Or...", 'ninja-forms' ); ?>
<h3><?php _e( 'Start from a template', 'ninja-forms' ); ?></h3> <h3><?php _e( 'Start from a template', 'ninja-forms' ); ?></h3>
<a href="?page=ninja-forms&form_id=formtemplate-contactform" class="nf-one-third template-box"> <?php Ninja_Forms::template( 'NewFormTemplates.html.php' ); ?>
<div class="template-box-inside">
<h4><?php _e( 'Contact Us', 'ninja-forms' ); ?></h4>
<p class="template-desc"><?php _e( 'Allow your users to contact you with this simple contact form. You can add and remove fields as needed.', 'ninja-forms' ); ?></p>
</div>
</a>
<a href="?page=ninja-forms&form_id=formtemplate-quoterequest" class="nf-one-third template-box">
<div class="template-box-inside">
<h4><?php _e( 'Quote Request', 'ninja-forms' ); ?></h4>
<p class="template-desc"><?php _e( 'Manage quote requests from your website easily with this template. You can add and remove fields as needed.', 'ninja-forms' ); ?></p>
</div>
</a>
<a href="?page=ninja-forms&form_id=formtemplate-eventregistration" class="nf-one-third template-box">
<div class="template-box-inside">
<h4><?php _e( 'Event Registration', 'ninja-forms' ); ?></h4>
<p class="template-desc"><?php _e( 'Allow user to register for your next event this easy to complete form. You can add and remove fields as needed.', 'ninja-forms' ); ?></p>
</div>
</a>
<!--<a href="#" class="nf-one-third template-box">
<div class="template-box-inside">
<h4><?php _e( 'Newsletter Sign Up Form', 'ninja-forms' ); ?></h4>
<p class="template-desc"><?php _e( 'Add subscribers and grow your email list with this newsletter signup form. You can add and remove fields as needed.', 'ninja-forms' ); ?></p>
</div>
</a> -->
</div> </div>
</script> </script>
...@@ -165,7 +142,7 @@ ...@@ -165,7 +142,7 @@
</script> </script>
<script id="tmpl-nf-main-content-field" type="text/template"> <script id="tmpl-nf-main-content-field" type="text/template">
<div id="{{{ data.getFieldID() }}}" class="{{{ data.renderClasses() }}}" data-id="{{{ data.id }}}">{{{ data.renderIcon() }}}<span class="nf-field-label">{{{ data.label }}} {{{ data.renderRequired() }}}</span> <div id="{{{ data.getFieldID() }}}" class="{{{ data.renderClasses() }}}" data-id="{{{ data.id }}}">{{{ data.renderIcon() }}}<span class="nf-field-label">{{{ _.escape( data.label ) }}} {{{ data.renderRequired() }}}</span>
<div class="nf-item-controls"></div> <div class="nf-item-controls"></div>
</div> </div>
</script> </script>
...@@ -411,7 +388,7 @@ ...@@ -411,7 +388,7 @@
</script> </script>
<script id="tmpl-nf-merge-tags-item" type="text/template"> <script id="tmpl-nf-merge-tags-item" type="text/template">
<a href="#" title="{{{ data.label }}}" tabindex="1" class="{{{ data.renderClasses() }}}">{{{ data.label }}}</a> <a href="#" title="{{{ data.label }}}" tabindex="1" class="{{{ data.renderClasses() }}}">{{{ _.escape( data.label ) }}}</a>
</script> </script>
<!-- Field Settings Templates --> <!-- Field Settings Templates -->
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/ Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features. Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 3.0.30 Version: 3.0.31
Author: The WP Ninjas Author: The WP Ninjas
Author URI: http://ninjaforms.com Author URI: http://ninjaforms.com
Text Domain: ninja-forms Text Domain: ninja-forms
...@@ -52,7 +52,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf ...@@ -52,7 +52,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/** /**
* @since 3.0 * @since 3.0
*/ */
const VERSION = '3.0.30'; const VERSION = '3.0.31';
/** /**
* @var Ninja_Forms * @var Ninja_Forms
...@@ -294,8 +294,10 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf ...@@ -294,8 +294,10 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/* /*
* JS Exception Handler * JS Exception Handler
*
* TODO: Review PR#2492 for improvements.
*/ */
self::$instance->exception_handler_js = new NF_ExceptionHandlerJS(); // self::$instance->exception_handler_js = new NF_ExceptionHandlerJS();
/* /*
* Activation Hook * Activation Hook
......
...@@ -3,7 +3,7 @@ Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, wpnzach, ...@@ -3,7 +3,7 @@ Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, wpnzach,
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration, Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5 Requires at least: 4.5
Tested up to: 4.7.2 Tested up to: 4.7.2
Stable tag: 3.0.30 Stable tag: 3.0.31
License: GPLv2 or later License: GPLv2 or later
Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more! Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more!
...@@ -102,20 +102,34 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati ...@@ -102,20 +102,34 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice == == Upgrade Notice ==
= 3.0.30 (28 February 2017) = = 3.0.31 (07 March 2017) =
*Bugs:* *Bugs:*
* Publishing a form should now populate the backup database properly in all environments. * Confirmed password fields should work properly.
* Editing submissions that have selects or other lists should now work properly. * Fixed a bug with List Fields that caused the Import button to overlap the Add New button.
* Closed a possible security vulnerability by escaping HTML in the builder.
* CSV files should now be deleted from the server after they are emailed when attached to an email action.
*Changes:* *Changes:*
* Added Trello to the available actions list. * Added a filter so that add-ons and custom code can add forms to the templates section of the New Form builder.
* Added a JS exception catcher to help debug when forms don't display because of JS errors.
== Changelog == == Changelog ==
= 3.0.31 (07 March 2017) =
*Bugs:*
* Confirmed password fields should work properly.
* Fixed a bug with List Fields that caused the Import button to overlap the Add New button.
* Closed a possible security vulnerability by escaping HTML in the builder.
* CSV files should now be deleted from the server after they are emailed when attached to an email action.
*Changes:*
* Added a filter so that add-ons and custom code can add forms to the templates section of the New Form builder.
= 3.0.30 (28 February 2017) = = 3.0.30 (28 February 2017) =
*Bugs:* *Bugs:*
......
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