| @@ -265,9 +265,9 @@ | ||
| 265 | 265 | case 'make_reset': |
| 266 | 266 | |
| 267 | 267 | $is_reseted = $user_request->user_request_params__db_delete(); // Delete from DB |
| 268 | 268 | |
| 269 | - wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 269 | + wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 270 | 270 | |
| 271 | 271 | $cleaned_request_params['do_action'] = $is_reseted ? 'reset_done' : 'reset_error'; |
| 272 | 272 | |
| 273 | 273 | $cleaned_request_params = wpbc_setup_wizard_page__get__request_values__default(); |
| @@ -331,34 +331,36 @@ | ||
| 331 | 331 | |
| 332 | 332 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing |
| 333 | 333 | if ( isset( $_POST['all_ajx_params']['step_data'] ) && ( ! empty( $_POST['all_ajx_params']['step_data'] ) ) ) { |
| 334 | 334 | $cleaned_data = wpbc_template__bookings_types__action_validate_data( $_POST['all_ajx_params']['step_data'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 335 | - | |
| 336 | - // Legacy update booking form and dates selection, as some other options (recurrent time).... | |
| 337 | - wpbc_setup__update__bookings_types( $cleaned_data ); | |
| 338 | - $booking_wizard_data_arr['save_and_continue__bookings_types'] = $cleaned_data; | |
| 339 | - update_bk_option( 'booking_wizard_data', $booking_wizard_data_arr ); | |
| 340 | - | |
| 341 | - /** | |
| 342 | - * Fires after the validated Booking Type configuration is applied and saved. | |
| 343 | - * | |
| 344 | - * Optional modules can synchronize presentation state from the selected | |
| 345 | - * workflow without entering the Setup Wizard validation or mutation engine. | |
| 346 | - * | |
| 347 | - * @param array $cleaned_data Validated Setup Wizard booking-type data. | |
| 348 | - */ | |
| 349 | - do_action( 'wpbc_setup_wizard_booking_type_saved', $cleaned_data ); | |
| 350 | - $setup_steps = new WPBC_SETUP_WIZARD_STEPS(); | |
| 351 | - | |
| 352 | - // FixIn: 10.7.1.3. // FixIn: 10.15.1.1. | |
| 353 | - $cleaned_data_booking_feedback_arr = get_bk_option( 'booking_feedback__send_email' ); | |
| 354 | - if (! empty($cleaned_data_booking_feedback_arr)){ | |
| 335 | + | |
| 336 | + // Legacy update booking form and dates selection, as some other options (recurrent time).... | |
| 337 | + wpbc_setup__update__bookings_types( $cleaned_data ); | |
| 338 | + $booking_wizard_data_arr['save_and_continue__bookings_types'] = $cleaned_data; | |
| 339 | + update_bk_option( 'booking_wizard_data', $booking_wizard_data_arr ); | |
| 340 | + | |
| 341 | + /** | |
| 342 | + * Fires after the validated Booking Type configuration is applied and saved. | |
| 343 | + * | |
| 344 | + * Optional modules can synchronize presentation state from the selected | |
| 345 | + * workflow without entering the Setup Wizard validation or mutation engine. | |
| 346 | + * | |
| 347 | + * @param array $cleaned_data Validated Setup Wizard booking-type data. | |
| 348 | + */ | |
| 349 | + do_action( 'wpbc_setup_wizard_booking_type_saved', $cleaned_data ); | |
| 350 | + $setup_steps = new WPBC_SETUP_WIZARD_STEPS(); | |
| 351 | + | |
| 352 | + // FixIn: 10.7.1.3. // FixIn: 10.15.1.1. | |
| 353 | + $cleaned_data_booking_feedback_arr = get_bk_option( 'booking_feedback__send_email' ); | |
| 354 | + if (! empty($cleaned_data_booking_feedback_arr)){ | |
| 355 | 355 | if ( 'On' === $cleaned_data_booking_feedback_arr['wpbc_swp_accept_send'] ) { |
| 356 | 356 | $cleaned_data_booking_feedback_arr = array_merge( $cleaned_data_booking_feedback_arr , array( 'type' => 'Type: ' . $cleaned_data ['wpbc_swp_booking_types'] ) ); |
| 357 | 357 | if ( 'time_slots_appointments' === $cleaned_data ['wpbc_swp_booking_types'] ) { |
| 358 | 358 | $cleaned_data_booking_feedback_arr = array_merge( $cleaned_data_booking_feedback_arr, array( 'appointments_type' => 'Appointment: ' . $cleaned_data ['wpbc_swp_booking_appointments_type'] ) ); |
| 359 | 359 | } |
| 360 | - wpbc_setup_feedback__send_email( $cleaned_data_booking_feedback_arr ); | |
| 360 | + if ( ! WPBC_IS_PLAYGROUND ) { | |
| 361 | + wpbc_setup_feedback__send_email( $cleaned_data_booking_feedback_arr ); | |
| 362 | + } | |
| 361 | 363 | update_bk_option( 'booking_feedback__after_send', $cleaned_data_booking_feedback_arr ); |
| 362 | 364 | delete_bk_option( 'booking_feedback__send_email' ); |
| 363 | 365 | } |
| 364 | 366 | } |
| @@ -364,21 +366,29 @@ | ||
| 364 | 366 | } |
| 365 | 367 | |
| 366 | 368 | } |
| 367 | 369 | |
| 368 | - $setup_steps->db__set_step_as_completed( 'bookings_types' ); | |
| 369 | - if ( ! empty( $cleaned_data ) ) { | |
| 370 | - wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 371 | - $data_arr['current_step'] = wpbc_setup_wizard__get_first_profile_step(); | |
| 372 | - $current_steps_arr = $setup_steps->get_steps_arr(); | |
| 373 | - $setup_steps->db__reset_steps_from( $data_arr['current_step'] ); | |
| 374 | - if ( | |
| 375 | - isset( $current_steps_arr[ $data_arr['current_step'] ] ) | |
| 376 | - && 'manual_save_required' === $setup_steps->get_step_save_behavior( $data_arr['current_step'] ) | |
| 377 | - ) { | |
| 378 | - $setup_steps->db__set_step_as_saved( $data_arr['current_step'], false ); | |
| 379 | - } | |
| 380 | - $data_arr['redirect_url'] = $setup_steps->get_step_target_url( $data_arr['current_step'] ); | |
| 370 | + $setup_steps->db__set_step_as_completed( 'bookings_types' ); | |
| 371 | + if ( ! empty( $cleaned_data ) ) { | |
| 372 | + $data_arr['current_step'] = wpbc_setup_wizard__get_first_profile_step(); | |
| 373 | + $current_steps_arr = $setup_steps->get_steps_arr(); | |
| 374 | + $is_form_builder_handoff = array( 'form_structure' ) === wpbc_setup_wizard__get_profile_route(); | |
| 375 | + | |
| 376 | + if ( $is_form_builder_handoff ) { | |
| 377 | + // Form Builder is the fifth and final temporary Setup step. | |
| 378 | + $setup_steps->db__set_step_as_completed( 'form_structure' ); | |
| 379 | + wpbc_setup_wizard__set_full_screen_mode_for_current_user( false ); | |
| 380 | + } else { | |
| 381 | + wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 382 | + $setup_steps->db__reset_steps_from( $data_arr['current_step'] ); | |
| 383 | + if ( | |
| 384 | + isset( $current_steps_arr[ $data_arr['current_step'] ] ) | |
| 385 | + && 'manual_save_required' === $setup_steps->get_step_save_behavior( $data_arr['current_step'] ) | |
| 386 | + ) { | |
| 387 | + $setup_steps->db__set_step_as_saved( $data_arr['current_step'], false ); | |
| 388 | + } | |
| 389 | + } | |
| 390 | + $data_arr['redirect_url'] = $setup_steps->get_step_target_url( $data_arr['current_step'] ); | |
| 381 | 391 | $data_arr['steps'] = $current_steps_arr; |
| 382 | 392 | $cleaned_request_params['do_action'] = 'redirect_to_setup_step'; |
| 383 | 393 | } |
| 384 | 394 | break; |