Commit 4f99223c authored by Kevin Stover's avatar Kevin Stover

Updating to version 3.0.20. See Changelog for details.

parents 2edf8716 8fd029c9
......@@ -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
Stable tag: 3.0.18
Stable tag: 3.0.20
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.
......
jQuery(document).ready(function($) {
$( '.trash a' ).click( function( e ) {
e.preventDefault();
var answer = confirm( nfi18n.confirm_delete );
if ( answer ) {
window.location.href = e.currentTarget.href;
}
} );
} );
\ No newline at end of file
......@@ -41,7 +41,7 @@ define( ['models/app/optionRepeaterModel', 'models/app/optionRepeaterCollection'
* @param backbone.model dataModel
* @return void
*/
changeOption: function( e, model, dataModel, settingModel ) {
changeOption: function( e, model, dataModel, settingModel, optionView ) {
var name = jQuery( e.target ).data( 'id' );
if ( 'selected' == name ) {
if ( jQuery( e.target ).attr( 'checked' ) ) {
......@@ -74,9 +74,9 @@ define( ['models/app/optionRepeaterModel', 'models/app/optionRepeaterCollection'
};
nfRadio.channel( 'changes' ).request( 'register:change', 'changeSetting', model, changes, label );
nfRadio.channel( 'option-repeater' ).trigger( 'update:option', model, dataModel, settingModel );
nfRadio.channel( 'option-repeater-option-' + name ).trigger( 'update:option', e, model, dataModel, settingModel );
nfRadio.channel( 'option-repeater-' + settingModel.get( 'name' ) ).trigger( 'update:option', model, dataModel, settingModel );
nfRadio.channel( 'option-repeater' ).trigger( 'update:option', model, dataModel, settingModel, optionView );
nfRadio.channel( 'option-repeater-option-' + name ).trigger( 'update:option', e, model, dataModel, settingModel, optionView );
nfRadio.channel( 'option-repeater-' + settingModel.get( 'name' ) ).trigger( 'update:option', model, dataModel, settingModel, optionView );
},
/**
......@@ -193,11 +193,10 @@ define( ['models/app/optionRepeaterModel', 'models/app/optionRepeaterCollection'
*
* @since 3.0
* @param Object sortable jQuery UI element
* @param backbone.model setting Setting model
* @param backbone.view setting Setting view
* @return void
*/
updateOptionSortable: function( ui, sortable, setting ) {
var newOrder = jQuery( sortable ).sortable( 'toArray' );
var dragModel = setting.collection.get( { cid: jQuery( ui.item ).prop( 'id' ) } );
var data = {
......@@ -231,7 +230,7 @@ define( ['models/app/optionRepeaterModel', 'models/app/optionRepeaterCollection'
nfRadio.channel( 'changes' ).request( 'register:change', 'sortListOptions', dragModel, null, label, data );
this.triggerDataModel( dragModel, setting.dataModel );
nfRadio.channel( 'option-repeater' ).trigger( 'sort:option', dragModel, setting );
nfRadio.channel( 'option-repeater-' + setting.get( 'name' ) ).trigger( 'sort:option', dragModel, setting );
nfRadio.channel( 'option-repeater-' + setting.model.get( 'name' ) ).trigger( 'sort:option', dragModel, setting );
},
/**
......
......@@ -18,9 +18,9 @@ define( [ 'models/app/optionRepeaterCollection' ], function( ListOptionCollectio
this.listenTo( nfRadio.channel( 'fields-list' ), 'init:fieldModel', this.convertOptions );
},
updateOptionLabel: function( e, model, dataModel, settingModel ) {
updateOptionLabel: function( e, model, dataModel, settingModel, optionView ) {
if( 'list' != fieldTypeData[ dataModel.get( 'type' ) ].parentType ) return;
if( 'list' != _.findWhere( fieldTypeData, { id: dataModel.get( 'type' ) } ).parentType ) return;
if( model.get( 'manual_value' ) ) return;
......@@ -29,15 +29,18 @@ define( [ 'models/app/optionRepeaterCollection' ], function( ListOptionCollectio
model.set( 'value', value );
model.trigger( 'change', model );
// TODO: Set focus on value input
// jQuery( e.target ).closest( 'nf-table-row' ).find( '*[data-id="value"] ).focus();
// Set focus on value input
jQuery( optionView.el ).find( '[data-id="value"]' ).focus().select();
},
updateOptionValue: function( e, model, dataModel, settingModel ) {
updateOptionValue: function( e, model, dataModel, settingModel, optionView ) {
if( 'list' != fieldTypeData[ dataModel.get( 'type' ) ].parentType ) return;
if( 'list' != _.findWhere( fieldTypeData, { id: dataModel.get( 'type' ) } ).parentType ) return;
model.set( 'manual_value', true );
// Set focus on calc input
jQuery( optionView.el ).find( '[data-id="calc"]' ).focus().select();
},
convertOptions: function( fieldModel ) {
......
......@@ -21,7 +21,7 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
this.collection = optionCollection;
this.dataModel = data.dataModel;
this.childViewOptions = { settingModel: this.model, collection: this.collection, dataModel: data.dataModel, columns: this.model.get( 'columns' ) };
this.childViewOptions = { parentView: this, settingModel: this.model, collection: this.collection, dataModel: data.dataModel, columns: this.model.get( 'columns' ) };
var deps = this.model.get( 'deps' );
if ( deps ) {
......@@ -154,6 +154,7 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
clickAddOption: function( e ) {
nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel );
jQuery( this.children.findByIndex(this.children.length - 1).el ).find( '[data-id="label"]' ).focus();
}
} );
......
......@@ -16,6 +16,7 @@ define( ['views/app/drawer/optionRepeaterError'], function( ErrorView ) {
this.dataModel = data.dataModel;
this.collection = data.collection;
this.columns = data.columns;
this.parentView = data.parentView;
this.model.on( 'change:errors', this.renderErrors, this );
this.model.on( 'change', this.render, this );
......@@ -71,23 +72,23 @@ define( ['views/app/drawer/optionRepeaterError'], function( ErrorView ) {
},
changeOption: function( e ) {
nfRadio.channel( 'option-repeater' ).trigger( 'change:option', e, this.model, this.dataModel, this.settingModel );
nfRadio.channel( 'option-repeater' ).trigger( 'change:option', e, this.model, this.dataModel, this.settingModel, this );
},
deleteOption: function( e ) {
nfRadio.channel( 'option-repeater' ).trigger( 'click:deleteOption', this.model, this.collection, this.dataModel );
nfRadio.channel( 'option-repeater' ).trigger( 'click:deleteOption', this.model, this.collection, this.dataModel, this );
},
keyupOption: function( e ) {
this.maybeAddOption( e );
nfRadio.channel( 'option-repeater' ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel )
nfRadio.channel( 'option-repeater-' + this.settingModel.get( 'name' ) ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel )
nfRadio.channel( 'option-repeater' ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel, this )
nfRadio.channel( 'option-repeater-' + this.settingModel.get( 'name' ) ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel, this )
},
maybeAddOption: function( e ) {
if ( 13 == e.keyCode ) {
nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel );
nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel, this );
jQuery( this.parentView.children.findByIndex(this.parentView.children.length - 1).el ).find( '[data-id="label"]' ).focus();
}
},
......
......@@ -32,7 +32,7 @@ define(['controllers/submitButton'], function( submitButton ) {
maybeDisable: function( fieldModel ) {
if( fieldModel.get( 'formID' ) != this.get( 'formID' ) ) return;
if( 'undefined' != typeof fieldModel && fieldModel.get( 'formID' ) != this.get( 'formID' ) ) return;
this.set( 'disabled', true );
this.trigger( 'reRender' );
......
......@@ -245,6 +245,10 @@ define( [], function() {
nfRadio.channel( 'field-' + this.model.get( 'id' ) ).trigger( 'blur:field', el, this.model );
nfRadio.channel( this.model.get( 'type' ) ).trigger( 'blur:field', el, this.model );
nfRadio.channel( 'fields' ).trigger( 'blur:field', el, this.model );
},
onAttach: function() {
nfRadio.channel( this.model.get( 'type' ) ).trigger( 'attach:view', this );
}
});
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
File mode changed from 100644 to 100755
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.
......@@ -43,7 +43,7 @@ class NF_Extension_Updater
}
$this->version = $version;
$this->file = $file;
$this->file = str_replace( '/deprecated', '', $file );
$this->author = $author;
$this->add_license_fields();
......
......@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.19' );
define( 'NF_PLUGIN_VERSION', '3.0.20' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -91,7 +91,7 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
$this->_data[ 'form_id' ] = $this->_form_data[ 'form_id' ] = $this->_form_id;
$this->_data[ 'settings' ] = $form_settings;
$this->_data[ 'settings' ][ 'is_preview' ];
$this->_data[ 'settings' ][ 'is_preview' ] = $this->is_preview();
$this->_data[ 'extra' ] = $this->_form_data[ 'extra' ];
/*
......
......@@ -135,7 +135,12 @@ final class NF_Actions_Email extends NF_Abstracts_Action
if( ! $email ) continue;
$headers[] = $this->_format_recipient($type, $email);
$matches = array();
if (preg_match('/^"?(?<name>[^<"]+)"? <(?<email>[^>]+)>$/', $email, $matches)) {
$headers[] = $this->_format_recipient($type, $matches['email'], $matches['name']);
} else {
$headers[] = $this->_format_recipient($type, $email);
}
}
}
......
......@@ -34,6 +34,12 @@ class NF_Admin_AllFormsTable extends WP_List_Table
*/
public function prepare_items()
{
wp_enqueue_script( 'nf-all-forms', Ninja_Forms::$url . 'assets/js/all-forms.js' );
wp_localize_script( 'nf-all-forms', 'nfi18n', array(
'confirm_delete' => __( 'Really Delete This Form? This will remove all fields and submission data. Recovery is not possible.', 'ninja-forms' ),
) );
$columns = $this->get_columns();
$hidden = $this->get_hidden_columns();
$sortable = $this->get_sortable_columns();
......
......@@ -139,9 +139,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('<option>').val('export').text('<?php _e('Export')?>').appendTo("select[name='action']");
jQuery('<option>').val('export').text('<?php _e('Export')?>').appendTo("select[name='action2']");
<?php
<?php
if ( ( isset ( $_POST['action'] ) && $_POST['action'] == 'export' ) || ( isset ( $_POST['action2'] ) && $_POST['action2'] == 'export' ) ) {
?>
setInterval(function(){
......
......@@ -19,7 +19,7 @@ class NF_Admin_CPT_Submission
add_action( 'admin_print_styles', array( $this, 'enqueue_scripts' ) );
// Filter Post Row Actions
add_filter( 'post_row_actions', array( $this, 'post_row_actions' ) );
add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
// Change our submission columns.
add_filter( 'manage_nf_sub_posts_columns', array( $this, 'change_columns' ) );
......@@ -30,7 +30,7 @@ class NF_Admin_CPT_Submission
// Save our metabox values
add_action( 'save_post', array( $this, 'save_nf_sub' ), 10, 2 );
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 10, 2 );
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 10, 1 );
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ) );
// Filter our submission capabilities
......@@ -113,12 +113,16 @@ class NF_Admin_CPT_Submission
wp_localize_script( 'subs-cpt', 'nf_sub', array( 'form_id' => $form_id ) );
}
public function post_row_actions( $actions )
public function post_row_actions( $actions, $sub )
{
if( $this->cpt_slug == get_post_type() ){
unset( $actions[ 'view' ] );
unset( $actions[ 'inline hide-if-no-js' ] );
}
$export_url = add_query_arg( array( 'action' => 'export', 'post[]' => $sub->ID ) );
$actions[ 'export' ] = sprintf( '<a href="%s">%s</a>', $export_url, __( 'Export', 'ninja-forms' ) );
return $actions;
}
......@@ -218,7 +222,7 @@ class NF_Admin_CPT_Submission
/**
* Meta Boxes
*/
public function add_meta_boxes( $post_type, $post )
public function add_meta_boxes( $post_type )
{
add_meta_box(
'nf_sub_fields',
......
......@@ -15,8 +15,8 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
parent::__construct();
if( ! defined( 'DOING_AJAX' ) ) {
add_action('admin_init', array($this, 'admin_init'));
add_action( 'admin_init', array( 'NF_Admin_AllFormsTable', 'process_bulk_action' ) );
add_action('current_screen', array($this, 'admin_init'));
add_action( 'current_screen', array( 'NF_Admin_AllFormsTable', 'process_bulk_action' ) );
}
}
......@@ -146,7 +146,6 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
wp_enqueue_script( 'jquery-ui-touch-punch', Ninja_Forms::$url . 'assets/js/lib/jquery.ui.touch-punch.min.js', array( 'jquery' ) );
wp_enqueue_script( 'jquery-classy-wiggle', Ninja_Forms::$url . 'assets/js/lib/jquery.classywiggle.min.js', array( 'jquery' ) );
wp_enqueue_script( 'moment-with-locale', Ninja_Forms::$url . 'assets/js/lib/moment-with-locales.min.js', array( 'jquery' ) );
wp_enqueue_script( 'modernizr', Ninja_Forms::$url . 'assets/js/lib/modernizr.min.js', array( 'jquery' ) );
wp_enqueue_script( 'pikaday', Ninja_Forms::$url . 'assets/js/lib/pikaday.min.js', array( 'moment-with-locale' ) );
wp_enqueue_script( 'pikaday-responsive', Ninja_Forms::$url . 'assets/js/lib/pikaday-responsive.min.js', array( 'pikaday', 'modernizr' ) );
......
......@@ -90,8 +90,12 @@ final class NF_Admin_Menus_Submissions extends NF_Abstracts_Submenu
if( in_array( $field->get_setting( 'type' ), $hidden_field_types ) ) continue;
// TODO: Add support for 'Admin Labels'
$cols[ 'field_' . $field->get_id() ] = $field->get_setting( 'label' );
if ( $field->get_setting( 'admin_label' ) ) {
$cols[ 'field_' . $field->get_id() ] = $field->get_setting( 'admin_label' );
} else {
$cols[ 'field_' . $field->get_id() ] = $field->get_setting( 'label' );
}
}
$cols[ 'sub_date' ] = __( 'Date', 'ninja-forms' );
......
This diff is collapsed.
......@@ -298,15 +298,19 @@ final class NF_Database_Models_Submission
$fields = Ninja_Forms()->form( $form_id )->get_fields();
usort( $fields, array( self, sort_fields ) );
usort( $fields, array( 'NF_Database_Models_Submission', 'sort_fields' ) );
$hidden_field_types = apply_filters( 'nf_sub_hidden_field_types', array() );
foreach( $fields as $field ){
if( in_array( $field->get_setting( 'type' ), $hidden_field_types ) ) continue;
$field_labels[ $field->get_id() ] = $field->get_setting( 'label' );
if ( $field->get_setting( 'admin_label' ) ) {
$field_labels[ $field->get_id() ] = $field->get_setting( 'admin_label' );
} else {
$field_labels[ $field->get_id() ] = $field->get_setting( 'label' );
}
}
......
......@@ -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.19
Version: 3.0.20
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -51,7 +51,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/**
* @since 3.0
*/
const VERSION = '3.0.19';
const VERSION = '3.0.20';
/**
* @var Ninja_Forms
......
......@@ -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
Stable tag: 3.0.19
Stable tag: 3.0.20
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,15 +102,44 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 3.0.19 (07 December 2016) =
= 3.0.20 (21 December 2016) =
*Changes:*
* Added a prompt before deleting forms on the all-forms table.
* Added the ability to use: {field:name} <{field:email}> to get Name - Address formatting in email actions CC, BCC, Reply-To Field.
* Updated the third-party EDD library.
* Removed references to the modernizer library from the builder.
* Added Twilio and Videomail to the list of available actions.
*Bugs:*
* Product, Shipping, and Total fields should now work in all locales.
* Fixed a major bug preventing forms with date fields from showing in some instances.
* Fixed a bug that caused fields to be out of order when exporting or editing submissions.
* Product fields should now respect locale-specific number formating.
* Fixed a bug with restarting form submit. This caused issues with PayPal Express and other add-ons.
* When adding new list options, the 'value' should auto-populate from 'label' setting.
* The tab order for list options should now work properly.
== Changelog ==
= 3.0.20 (21 December 2016) =
*Changes:*
* Added a prompt before deleting forms on the all-forms table.
* Added the ability to use: {field:name} <{field:email}> to get Name - Address formatting in email actions CC, BCC, Reply-To Field.
* Updated the third-party EDD library.
* Removed references to the modernizer library from the builder.
* Added Twilio and Videomail to the list of available actions.
*Bugs:*
* Fixed a bug that caused fields to be out of order when exporting or editing submissions.
* Product fields should now respect locale-specific number formating.
* Fixed a bug with restarting form submit. This caused issues with PayPal Express and other add-ons.
* When adding new list options, the 'value' should auto-populate from 'label' setting.
* The tab order for list options should now work properly.
= 3.0.19 (07 December 2016) =
*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