| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php /** |
| 2 | 2 | * @version 1.0 |
| 3 | 3 | * @description Ajax and Requests Structure for WPBC_AJX__Setup__Ajax_Request |
| 4 | 4 | * @category Setup Class |
| @@ -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( false ); | |
| 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(); |
| @@ -336,8 +336,18 @@ | ||
| 336 | 336 | // Legacy update booking form and dates selection, as some other options (recurrent time).... |
| 337 | 337 | wpbc_setup__update__bookings_types( $cleaned_data ); |
| 338 | 338 | $booking_wizard_data_arr['save_and_continue__bookings_types'] = $cleaned_data; |
| 339 | 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 ); | |
| 340 | 350 | $setup_steps = new WPBC_SETUP_WIZARD_STEPS(); |
| 341 | 351 | |
| 342 | 352 | // FixIn: 10.7.1.3. // FixIn: 10.15.1.1. |
| 343 | 353 | $cleaned_data_booking_feedback_arr = get_bk_option( 'booking_feedback__send_email' ); |
| @@ -346,9 +356,11 @@ | ||
| 346 | 356 | $cleaned_data_booking_feedback_arr = array_merge( $cleaned_data_booking_feedback_arr , array( 'type' => 'Type: ' . $cleaned_data ['wpbc_swp_booking_types'] ) ); |
| 347 | 357 | if ( 'time_slots_appointments' === $cleaned_data ['wpbc_swp_booking_types'] ) { |
| 348 | 358 | $cleaned_data_booking_feedback_arr = array_merge( $cleaned_data_booking_feedback_arr, array( 'appointments_type' => 'Appointment: ' . $cleaned_data ['wpbc_swp_booking_appointments_type'] ) ); |
| 349 | 359 | } |
| 350 | - 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 | + } | |
| 351 | 363 | update_bk_option( 'booking_feedback__after_send', $cleaned_data_booking_feedback_arr ); |
| 352 | 364 | delete_bk_option( 'booking_feedback__send_email' ); |
| 353 | 365 | } |
| 354 | 366 | } |
| @@ -354,21 +366,29 @@ | ||
| 354 | 366 | } |
| 355 | 367 | |
| 356 | 368 | } |
| 357 | 369 | |
| 358 | - $setup_steps->db__set_step_as_completed( 'bookings_types' ); | |
| 359 | - if ( ! empty( $cleaned_data ) ) { | |
| 360 | - wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 361 | - $data_arr['current_step'] = wpbc_setup_wizard__get_first_profile_step(); | |
| 362 | - $current_steps_arr = $setup_steps->get_steps_arr(); | |
| 363 | - $setup_steps->db__reset_steps_from( $data_arr['current_step'] ); | |
| 364 | - if ( | |
| 365 | - isset( $current_steps_arr[ $data_arr['current_step'] ] ) | |
| 366 | - && 'manual_save_required' === $setup_steps->get_step_save_behavior( $data_arr['current_step'] ) | |
| 367 | - ) { | |
| 368 | - $setup_steps->db__set_step_as_saved( $data_arr['current_step'], false ); | |
| 369 | - } | |
| 370 | - $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'] ); | |
| 371 | 391 | $data_arr['steps'] = $current_steps_arr; |
| 372 | 392 | $cleaned_request_params['do_action'] = 'redirect_to_setup_step'; |
| 373 | 393 | } |
| 374 | 394 | break; |