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

Updating to version 3.0.31.

parents e0e2d7e6 129c42f8
......@@ -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,
Requires at least: 4.5
Tested up to: 4.7.2
Stable tag: 3.0.30
Stable tag: 3.0.31
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.
......
......@@ -715,7 +715,9 @@ All styles used within the drawer
display: block;
margin-bottom: 20px; }
.ninja-forms-app label::after {
.ninja-forms-app label {
position: relative; }
.ninja-forms-app label::after {
clear: both;
content: "";
display: block; }
......@@ -725,7 +727,6 @@ All styles used within the drawer
padding: 0 10px; }
.ninja-forms-app .nf-setting-label, .ninja-forms-app label, .ninja-forms-app legend {
position: relative;
color: #424242;
display: block;
font-size: 13px;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,22 +9,22 @@
define( [], function() {
var controller = Marionette.Object.extend( {
initialize: function() {
this.listenTo( nfRadio.channel( 'fields' ), 'drop:fieldType', this.dropField );
this.listenTo( nfRadio.channel( 'fields' ), 'add:stagedField', this.stageField );
this.listenTo( nfRadio.channel( 'fields' ), 'after:addField', this.addField );
},
dropField: function( type, tmpID ) {
addField: function( model ) {
if( 'password' == type ) {
var model = nfRadio.channel( 'fields').request( 'get:field', tmpID );
if( 'password' == model.get( 'type' ) ) {
var order = model.get( 'order' );
nfRadio.channel( 'fields' ).request( 'delete', model );
var confirm = this.insertField( 'passwordconfirm', order + 1 );
_.each( [ 'password', 'passwordconfirm' ], function( type ) {
confirm.set( 'confirm_field', model.get( 'key' ) );
}
},
insertField: function( type, order ) {
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
var newField = {
......@@ -34,28 +34,8 @@ define( [], function() {
order: order
};
nfRadio.channel('fields').request('add', newField );
});
}
},
stageField: function( model ) {
var field_slug = model.get( 'slug' );
if( 'password' == field_slug ) {
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 nfRadio.channel('fields').request('add', newField );
}
}
});
return controller;
......
......@@ -27,7 +27,7 @@ define( [], function() {
return {
renderTitle: function(){
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 @@
margin-bottom: 20px;
}
label {
position: relative;
&::after {
clear: both;
content: "";
......@@ -70,7 +71,6 @@
padding: 0 10px;
}
.nf-setting-label, label, legend {
position: relative;
color: #424242;
display: block;
font-size: 13px;
......
......@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.30' );
define( 'NF_PLUGIN_VERSION', '3.0.31' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -157,12 +157,14 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
$field = array_merge( $field, $field[ 'settings' ] );
/** Validate the Field */
if( $validate_fields ){
if( $validate_fields && ! isset( $this->_data[ 'resume' ] ) ){
$this->validate_field( $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 ] );
/** Populate Field Merge Tag */
......
......@@ -77,6 +77,10 @@ final class NF_Actions_Email extends NF_Abstracts_Action
$data[ 'errors' ][ 'form' ] = $errors;
}
if ( ! empty( $attachments ) ) {
$this->_drop_csv();
}
return $data;
}
......@@ -197,6 +201,8 @@ final class NF_Actions_Email extends NF_Abstracts_Action
foreach( $fields as $field ){
if( ! isset( $field[ 'label' ] ) ) continue;
if( 'hr' == $field['type'] ) continue;
if( 'submit' == $field['type'] ) continue;
$csv_array[ 0 ][] = $field[ 'label' ];
$csv_array[ 1 ][] = WPN_Helper::stripslashes( $field[ 'value' ] );
......@@ -237,6 +243,23 @@ final class NF_Actions_Email extends NF_Abstracts_Action
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
*/
......
......@@ -100,7 +100,13 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
{
$template = sanitize_title( $_GET['form_id'] );
$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' );
......
......@@ -800,7 +800,7 @@ return apply_filters( 'ninja_forms_field_settings', array(
'type' => 'field-select',
'label' => __( 'Confirm', 'ninja-forms' ),
'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
'label' => $field_data[ 'settings' ][ 'label' ],
'type' => $field_data[ 'settings' ][ 'type' ]
);
if( ! is_numeric( $field_id ) ) {
$this->insert_field( $settings ); // New Field.
} else {
......@@ -213,6 +212,7 @@ final class NF_Database_FieldsController
$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 ] = '';
$this->update_field_meta[ $this->update_field_meta_chunk ] .= " WHEN `parent_id` = '{$field_id}' AND `key` = '{$key}' THEN '{$value}'";
$counter++;
if( 0 == $counter % 5000 ) $this->update_field_meta_chunk++;
}
......
......@@ -78,7 +78,7 @@ final class NF_Display_Render
$form->update_settings( $settings );
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;
}
......@@ -94,7 +94,7 @@ final class NF_Display_Render
}
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;
}
}
......@@ -359,7 +359,7 @@ final class NF_Display_Render
}
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;
}
......
<?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 @@
<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' ); ?>
<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">
<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>
<?php Ninja_Forms::template( 'NewFormTemplates.html.php' ); ?>
<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>
</script>
......@@ -165,7 +142,7 @@
</script>
<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>
</script>
......@@ -411,7 +388,7 @@
</script>
<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>
<!-- Field Settings Templates -->
......
......@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/
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 URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -52,7 +52,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/**
* @since 3.0
*/
const VERSION = '3.0.30';
const VERSION = '3.0.31';
/**
* @var Ninja_Forms
......@@ -294,8 +294,10 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/*
* 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
......
......@@ -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,
Requires at least: 4.5
Tested up to: 4.7.2
Stable tag: 3.0.30
Stable tag: 3.0.31
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!
......@@ -102,20 +102,34 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 3.0.30 (28 February 2017) =
= 3.0.31 (07 March 2017) =
*Bugs:*
* Publishing a form should now populate the backup database properly in all environments.
* Editing submissions that have selects or other lists should now work properly.
* 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 Trello to the available actions list.
* Added a JS exception catcher to help debug when forms don't display because of JS errors.
* Added a filter so that add-ons and custom code can add forms to the templates section of the New Form builder.
== 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) =
*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