Browse Source

** Booking Activities 1.7.5 **

* Fix - JS fatal error when trying to validate a dialog in calendar editor
* Fix - Infinite loading when creating a calendar (must refresh page)
develop 1.7.5
Yoan Cutillas 3 years ago
parent
commit
c7baa8ba3e
  1. 4
      booking-activities.php
  2. 15
      js/form-editor-dialogs.js
  3. 2
      js/form-editor-dialogs.min.js
  4. 11
      js/settings.js
  5. 2
      js/settings.min.js
  6. 52
      js/templates-dialogs.js
  7. 2
      js/templates-dialogs.min.js
  8. 10
      js/templates-functions.js
  9. 2
      js/templates-functions.min.js
  10. 6
      readme.txt

4
booking-activities.php

@ -3,7 +3,7 @@
* Plugin Name: Booking Activities
* Plugin URI: https://booking-activities.fr/en/?utm_source=plugin&utm_medium=plugin&utm_content=header
* Description: Booking system specialized in activities (sports, cultural, leisure, events...). Works great with WooCommerce.
* Version: 1.7.4
* Version: 1.7.5
* Author: Booking Activities Team
* Author URI: https://booking-activities.fr/en/?utm_source=plugin&utm_medium=plugin&utm_content=header
* Text Domain: booking-activities
@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
// GLOBALS AND CONSTANTS
if( ! defined( 'BOOKACTI_VERSION' ) ) { define( 'BOOKACTI_VERSION', '1.7.4' ); }
if( ! defined( 'BOOKACTI_VERSION' ) ) { define( 'BOOKACTI_VERSION', '1.7.5' ); }
if( ! defined( 'BOOKACTI_PLUGIN_NAME' ) ) { define( 'BOOKACTI_PLUGIN_NAME', 'booking-activities' ); }

15
js/form-editor-dialogs.js

@ -47,7 +47,7 @@ function bookacti_init_form_editor_actions() {
/**
* Update Form Meta
* @since 1.5.0
* @version 1.7.3
* @version 1.7.5
*/
function bookacti_dialog_update_form_meta() {
@ -80,7 +80,9 @@ function bookacti_dialog_update_form_meta() {
'click': function() {
// Save tineMCE editors content
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var data = $j( 'form#bookacti-update-form-meta-form' ).serializeObject();
@ -291,6 +293,7 @@ function bookacti_dialog_remove_form_field( field_id, field_name ) {
/**
* Update Form Field
* @since 1.5.0
* @version 1.7.5
* @param {int} field_id
* @param {string} field_name
*/
@ -342,7 +345,9 @@ function bookacti_dialog_update_form_field( field_id, field_name ) {
$j( '#bookacti-form-field-dialog-' + field_name ).find( '.bookacti-loading-alt,.bookacti-notices' ).remove();
// Save tineMCE editors content
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
// Prepare the fields
$j( 'form#bookacti-form-field-form-' + field_name + ' select[multiple].bookacti-items-select-box option' ).prop( 'selected', true );
@ -412,7 +417,9 @@ function bookacti_dialog_update_form_field( field_id, field_name ) {
'click': function() {
// Save tineMCE editors content
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
$j( 'form#bookacti-form-field-form-' + field_name + ' input[name="action"]' ).val( 'bookactiResetFormField' );
var data = $j( 'form#bookacti-form-field-form-' + field_name ).serializeObject();

2
js/form-editor-dialogs.min.js vendored

File diff suppressed because one or more lines are too long

11
js/settings.js

@ -1,14 +1,19 @@
$j( document ).ready( function() {
// Intercept settings form submission
/**
* Intercept settings form submission
* @version 1.7.5
*/
$j( 'form#bookacti-settings.bookacti_save_settings_with_ajax' ).on( 'submit', function( e ) {
// Prevent submission
e.preventDefault();
// Save tineMCE editor content
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var form = $j( this );
var form_data = form.serializeObject(); // Need to use the homemade serializeObject to support multidimentionnal array

2
js/settings.min.js vendored

File diff suppressed because one or more lines are too long

52
js/templates-dialogs.js

@ -143,7 +143,7 @@ function bookacti_init_template_dialogs() {
/**
* Dialog Create Template
* @version 1.7.4
* @version 1.7.5
*/
function bookacti_dialog_add_new_template() {
// Set the dialog title
@ -208,7 +208,9 @@ function bookacti_dialog_add_new_template() {
var start = moment( $j( '#bookacti-template-opening' ).val(), [ 'MM-DD-YYYY', 'DD-MM-YYYY', 'YYYY-MM-DD' ] ).format( 'YYYY-MM-DD' );
var end = moment( $j( '#bookacti-template-closing' ).val(), [ 'MM-DD-YYYY', 'DD-MM-YYYY', 'YYYY-MM-DD' ] ).format( 'YYYY-MM-DD' );
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var isFormValid = bookacti_validate_template_form();
@ -301,7 +303,7 @@ function bookacti_dialog_add_new_template() {
/**
* Dialog Update Template
* @version 1.7.4
* @version 1.7.5
* @param {int} template_id
*/
function bookacti_dialog_update_template( template_id ) {
@ -356,8 +358,10 @@ function bookacti_dialog_update_template( template_id ) {
$j( '#bookacti-template-data-form-action' ).val( 'bookactiUpdateTemplate' );
$j( '#bookacti-template-data-form select[multiple].bookacti-items-select-box option' ).prop( 'selected', true );
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var isFormValid = bookacti_validate_template_form();
if( isFormValid ) {
@ -533,7 +537,7 @@ function bookacti_dialog_deactivate_template( template_id ) {
/**
* Dialog Update Event
* @version 1.7.4
* @version 1.7.5
* @param {object} event
*/
function bookacti_dialog_update_event( event ) {
@ -630,7 +634,9 @@ function bookacti_dialog_update_event( event ) {
// Store new exceptions list
var new_exceptions = $j( '#bookacti-event-exceptions-selectbox' ).val() ? $j( '#bookacti-event-exceptions-selectbox' ).val() : [];
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var isFormValid = bookacti_validate_event_form( event );
@ -1150,7 +1156,7 @@ function bookacti_dialog_import_activity() {
/**
* Dialog Create Activity
* @version 1.7.4
* @version 1.7.5
* @returns {false}
*/
function bookacti_dialog_create_activity() {
@ -1190,7 +1196,9 @@ function bookacti_dialog_create_activity() {
$j( '#bookacti-activity-duration' ).val( duration );
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var is_form_valid = bookacti_validate_activity_form();
@ -1263,7 +1271,7 @@ function bookacti_dialog_create_activity() {
/**
* Open a dialog to update an activity
* @version 1.7.4
* @version 1.7.5
* @param {int} activity_id
*/
function bookacti_dialog_update_activity( activity_id ) {
@ -1345,15 +1353,15 @@ function bookacti_dialog_update_activity( activity_id ) {
$j( '#bookacti-activity-duration' ).val( duration );
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var is_form_valid = bookacti_validate_activity_form();
if( is_form_valid ) {
var data = $j( '#bookacti-activity-data-form' ).serialize();
console.log( $j( '#bookacti-activity-data-form' ).serializeObject() );
bookacti_start_template_loading();
// Save updated values in database
@ -1531,7 +1539,7 @@ function bookacti_dialog_delete_activity( activity_id ) {
/**
* Create a group of events
* @version 1.7.4
* @version 1.7.5
* @param {int} category_id
*/
function bookacti_dialog_create_group_of_events( category_id ) {
@ -1590,7 +1598,9 @@ function bookacti_dialog_create_group_of_events( category_id ) {
var selected_category_id = $j( '#bookacti-group-of-events-category-selectbox' ).val();
bookacti.selected_category = selected_category_id;
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var is_form_valid = bookacti_validate_group_of_events_form();
@ -1665,7 +1675,7 @@ function bookacti_dialog_create_group_of_events( category_id ) {
/**
* Update a group of events with selected events
* @version 1.7.4
* @version 1.7.5
* @param {int} group_id
*/
function bookacti_dialog_update_group_of_events( group_id ) {
@ -1734,7 +1744,9 @@ function bookacti_dialog_update_group_of_events( group_id ) {
var selected_category_id = $j( '#bookacti-group-of-events-category-selectbox' ).val();
bookacti.selected_category = selected_category_id;
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var is_form_valid = bookacti_validate_group_of_events_form();
@ -1912,7 +1924,7 @@ function bookacti_dialog_delete_group_of_events( group_id ) {
/**
* Update a group category
* @version 1.7.4
* @version 1.7.5
* @param {int} category_id
*/
function bookacti_dialog_update_group_category( category_id ) {
@ -1949,7 +1961,9 @@ function bookacti_dialog_update_group_category( category_id ) {
$j( '#bookacti-group-category-action' ).val( 'bookactiUpdateGroupCategory' );
$j( '#bookacti-group-category-form select[multiple].bookacti-items-select-box option' ).prop( 'selected', true );
if( tinyMCE ) { tinyMCE.triggerSave(); }
if( typeof tinyMCE !== 'undefined' ) {
if( tinyMCE ) { tinyMCE.triggerSave(); }
}
var is_form_valid = bookacti_validate_group_category_form();

2
js/templates-dialogs.min.js vendored

File diff suppressed because one or more lines are too long

10
js/templates-functions.js

@ -2,7 +2,7 @@
/**
* Change default template on change in the select box
* @version 1.7.4
* @version 1.7.5
* @param {int} selected_template_id
*/
function bookacti_switch_template( selected_template_id ) {
@ -27,12 +27,20 @@ function bookacti_switch_template( selected_template_id ) {
if( response.status === 'success' ) {
// Change the global var
var is_first_template = bookacti.selected_template ? false : true;
var loading_number_temp = bookacti.booking_system[ 'bookacti-template-calendar' ][ 'loading_number' ];
bookacti.selected_template = parseInt( selected_template_id );
bookacti.hidden_activities = [];
// Update data array
bookacti.booking_system[ 'bookacti-template-calendar' ] = response.booking_system_data;
bookacti.booking_system[ 'bookacti-template-calendar' ][ 'selected_events' ] = [];
bookacti.booking_system[ 'bookacti-template-calendar' ][ 'picked_events' ] = [];
bookacti.booking_system[ 'bookacti-template-calendar' ][ 'loading_number' ] = loading_number_temp;
bookacti.booking_system[ 'bookacti-template-calendar' ][ 'method' ] = 'calendar';
bookacti.booking_system[ 'bookacti-template-calendar' ][ 'past_events' ] = true;
bookacti.booking_system[ 'bookacti-template-calendar' ][ 'past_events_bookable' ] = true;
// Unlock dialogs triggering after first template is created and selected
if( is_first_template ) {
bookacti_bind_template_dialogs();

2
js/templates-functions.min.js vendored

File diff suppressed because one or more lines are too long

6
readme.txt

@ -5,7 +5,7 @@ Tags: booking activities, booking sport, booking form, event reservation, reserv
Requires at least: 3.6
Tested up to: 5.2
Requires PHP: 5.3
Stable tag: 1.7.4
Stable tag: 1.7.5
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -319,6 +319,10 @@ If you don't receive a reply within 48h by email, a technical problem has probab
== Changelog ==
= 1.7.5 - 2019/06/07 =
* Fix - JS fatal error when trying to validate a dialog in calendar editor
* Fix - Infinite loading when creating a calendar (must refresh page)
= 1.7.4 - 2019/06/06 =
* Tweak - You can choose the columns to display in the customer booking list ([bookingactivities_list columns="..."], [see the docs](https://booking-activities.fr/en/docs/user-documentation/get-started-with-booking-activities/display-customers-bookings-list-on-the-frontend/))
* Tweak - You can display other's bookings in the customer booking list ([bookingactivities_list user_id="all"], [see the docs](https://booking-activities.fr/en/docs/user-documentation/get-started-with-booking-activities/display-customers-bookings-list-on-the-frontend/))

Loading…
Cancel
Save