| @@ -914,16 +914,30 @@ | ||
| 914 | 914 | $field_options = array( |
| 915 | 915 | 'vm_booking_listing' => __('Bookings Listing' ,'booking') // FixIn: 9.6.3.5. |
| 916 | 916 | , 'vm_calendar' => __('Timeline View' ,'booking') |
| 917 | 917 | ); |
| 918 | - $this->fields['booking_listing_default_view_mode'] = array( | |
| 919 | - 'type' => 'select' | |
| 918 | + $this->fields['booking_listing_default_view_mode'] = array( | |
| 919 | + 'type' => 'select' | |
| 920 | 920 | , 'default' => $default_options_values['booking_listing_default_view_mode'] //'vm_calendar' |
| 921 | 921 | , 'title' => __('Default booking admin page', 'booking') |
| 922 | 922 | , 'description' => __('Select your default view mode of bookings at the booking listing page' ,'booking') |
| 923 | 923 | , 'options' => $field_options |
| 924 | - , 'group' => 'booking_listing' | |
| 925 | - ); | |
| 924 | + , 'group' => 'booking_listing' | |
| 925 | + ); | |
| 926 | + | |
| 927 | + if ( class_exists( 'wpdev_bk_personal' ) ) { | |
| 928 | + $this->fields['booking_admin_edit_booking_mode'] = array( | |
| 929 | + 'type' => 'select', | |
| 930 | + 'default' => $default_options_values['booking_admin_edit_booking_mode'], | |
| 931 | + 'title' => __( 'Edit booking in', 'booking' ), | |
| 932 | + 'description' => __( 'Choose whether Edit booking opens in a popup or on the dedicated Add Booking page.', 'booking' ), | |
| 933 | + 'options' => array( | |
| 934 | + 'popup' => __( 'Popup window (default)', 'booking' ), | |
| 935 | + 'add_booking_page' => __( 'Add Booking page', 'booking' ), | |
| 936 | + ), | |
| 937 | + 'group' => 'booking_listing', | |
| 938 | + ); | |
| 939 | + } | |
| 926 | 940 | |
| 927 | 941 | // Default booking resources. |
| 928 | 942 | $this->fields = apply_filters( 'wpbc_settings_booking_listing_br_default_count', $this->fields, $default_options_values ); |
| 929 | 943 | |
| @@ -1178,9 +1192,9 @@ | ||
| 1178 | 1192 | // <editor-fold defaultstate="collapsed" desc=" Advanced " > |
| 1179 | 1193 | |
| 1180 | 1194 | if ( wpbc_is_11_6_features_enabled() && wpbc_booking_resources_catalog_can_manage_settings() ) { |
| 1181 | 1195 | $is_pro_compatible = wpbc_booking_resources_catalog_is_pro_compatible(); |
| 1182 | - $description = __( 'Legacy catalog pages are deprecated and scheduled for removal in Booking Calendar 11.7. This setting applies to all administration catalogs upgraded in Booking Calendar 11.6.', 'booking' ); | |
| 1196 | + $description = __( 'Choose the new or legacy pages for upgraded administration catalogs, including Seasonal Availability and Searchable Resources when their new catalogs are enabled. Legacy pages remain available for compatibility.', 'booking' ); | |
| 1183 | 1197 | |
| 1184 | 1198 | if ( ! $is_pro_compatible ) { |
| 1185 | 1199 | $pro_version = wpbc_booking_resources_catalog_get_pro_version(); |
| 1186 | 1200 | if ( '' === $pro_version ) { |
| @@ -1187,9 +1201,9 @@ | ||
| 1187 | 1201 | $pro_version = __( 'Unknown', 'booking' ); |
| 1188 | 1202 | } |
| 1189 | 1203 | |
| 1190 | 1204 | /* translators: 1: Detected Booking Calendar Pro version, 2: Minimum compatible Pro version. */ |
| 1191 | - $description = sprintf( __( 'Legacy catalog mode is required because Booking Calendar Pro %1$s is active. Update Pro to %2$s or newer to use the new catalogs. Legacy catalog pages are deprecated and scheduled for removal in Booking Calendar 11.7.', 'booking' ), esc_html( $pro_version ), esc_html( wpbc_booking_resources_catalog_get_minimum_pro_version() ) ); | |
| 1205 | + $description = sprintf( __( 'Legacy catalog mode is required because Booking Calendar Pro %1$s is active. Update Pro to %2$s or newer to use the new catalogs. Legacy pages remain available for compatibility.', 'booking' ), esc_html( $pro_version ), esc_html( wpbc_booking_resources_catalog_get_minimum_pro_version() ) ); | |
| 1192 | 1206 | } |
| 1193 | 1207 | |
| 1194 | 1208 | $this->fields['booking_resources_catalog_renderer'] = array( |
| 1195 | 1209 | 'type' => 'select', |
| @@ -1530,9 +1544,9 @@ | ||
| 1530 | 1544 | ?> |
| 1531 | 1545 | <div class="wpdvlp-sub-tabs wpbc_redirection_message" |
| 1532 | 1546 | style="margin: 20px 0;padding: 1em;font-size: 14px;"> |
| 1533 | 1547 | <a href="<?php |
| 1534 | - echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span | |
| 1548 | + echo esc_url( wpbc_get_settings_url() ); ?>">Redirect</a> after <span | |
| 1535 | 1549 | class="wpbc_countdown">1</span> second... |
| 1536 | 1550 | </div> |
| 1537 | 1551 | <?php |
| 1538 | 1552 | |
| @@ -1561,22 +1575,13 @@ | ||
| 1561 | 1575 | . 'Reset custom forms' |
| 1562 | 1576 | . '</a>'; |
| 1563 | 1577 | |
| 1564 | 1578 | |
| 1565 | - $my_system_buttons .= ' <a class="button button-secondary" style="background:#fff9e6;" href="' | |
| 1566 | - . esc_url( wpbc_get_settings_url() | |
| 1567 | - . '&wpbc_setup_wizard=reset&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) ) .'">' | |
| 1568 | - . 'Reset Setup Wizard' | |
| 1569 | - . '</a>'; | |
| 1570 | -// if ( ( isset( $_GET['wpbc_setup_wizard'] ) ) && ( 'reset' === $_GET['wpbc_setup_wizard'] ) ) { | |
| 1571 | -// $my_system_buttons .= '<script type="text/javascript"> window.location.href = "' . esc_url( wpbc_get_setup_wizard_page_url() ) . '"; </script>'; | |
| 1572 | -// } | |
| 1573 | - $my_system_buttons .= ' <a class="button button-secondary" style="background:#fff9e6;" href="' | |
| 1574 | - . esc_url( wpbc_get_settings_url() | |
| 1575 | - . '&wpbc_setup_wizard=completed&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) ) .'">' | |
| 1576 | - . 'Set Setup Wizard as Completed' | |
| 1577 | - . '</a>'; | |
| 1578 | - } | |
| 1579 | + $my_system_buttons .= ' <a class="button button-secondary" style="background:#fff9e6;" href="' | |
| 1580 | + . esc_url( wpbc_get_setup_wizard_page_url() ) . '">' | |
| 1581 | + . 'Open Setup Wizard' | |
| 1582 | + . '</a>'; | |
| 1583 | + } | |
| 1579 | 1584 | |
| 1580 | 1585 | $this->fields['tools_section_buttons']['value'][] = |
| 1581 | 1586 | '<div class="wpbc_booking_system_info_buttons_align">' |
| 1582 | 1587 | . $my_system_buttons |
| @@ -2032,8 +2037,30 @@ | ||
| 2032 | 2037 | return $stored_renderer; |
| 2033 | 2038 | } |
| 2034 | 2039 | |
| 2035 | 2040 | return $submitted_renderer; |
| 2041 | + } | |
| 2042 | + | |
| 2043 | + /** | |
| 2044 | + * Validate the administrator edit-booking destination. | |
| 2045 | + * | |
| 2046 | + * The General Settings page owns nonce and capability checks. This method | |
| 2047 | + * adds an explicit allow list and preserves the current normalized setting | |
| 2048 | + * when a malformed value is submitted. | |
| 2049 | + * | |
| 2050 | + * @param string $post_key Full Settings API POST key. | |
| 2051 | + * | |
| 2052 | + * @return string Allow-listed edit destination. | |
| 2053 | + */ | |
| 2054 | + public function validate_booking_admin_edit_booking_mode_post( $post_key ) { | |
| 2055 | + $stored_mode = wpbc_get_booking_admin_edit_mode(); | |
| 2056 | + $submitted_mode = self::validate_select_post_static( $post_key ); | |
| 2057 | + | |
| 2058 | + if ( ! is_string( $submitted_mode ) || ! in_array( $submitted_mode, array( 'popup', 'add_booking_page' ), true ) ) { | |
| 2059 | + return $stored_mode; | |
| 2060 | + } | |
| 2061 | + | |
| 2062 | + return $submitted_mode; | |
| 2036 | 2063 | } |
| 2037 | 2064 | |
| 2038 | 2065 | } |
| 2039 | 2066 | |