← All changes
|
includes/page-appointment-services/appointment_services__ui.php
+48
-18
11.5
→
11.9
View file →
| @@ -32,14 +32,14 @@ | ||
| 32 | 32 | $working_hours_url = add_query_arg( 'resource_id', $resource_id, $working_hours_url ); |
| 33 | 33 | $days_off_url = add_query_arg( 'resource_id', $resource_id, $days_off_url ); |
| 34 | 34 | } |
| 35 | 35 | $links[] = array( |
| 36 | - 'title' => __( 'Working Hours', 'booking' ), | |
| 36 | + 'title' => __( 'Schedule & Rules', 'booking' ), | |
| 37 | 37 | 'url' => $working_hours_url, |
| 38 | 38 | 'icon' => 'wpbc-bi-clock', |
| 39 | 39 | ); |
| 40 | 40 | $links[] = array( |
| 41 | - 'title' => __( 'Days Off', 'booking' ), | |
| 41 | + 'title' => __( 'Block Dates', 'booking' ), | |
| 42 | 42 | 'url' => $days_off_url, |
| 43 | 43 | 'icon' => 'wpbc-bi-calendar-x', |
| 44 | 44 | ); |
| 45 | 45 | } |
| @@ -102,10 +102,8 @@ | ||
| 102 | 102 | if ( |
| 103 | 103 | 'resources' !== $settings_section |
| 104 | 104 | || ! function_exists( 'wpbc_is_resources_page' ) |
| 105 | 105 | || ! wpbc_is_resources_page() |
| 106 | - || ! function_exists( 'wpbc_is_11_5_features_enabled' ) | |
| 107 | - || ! wpbc_is_11_5_features_enabled() | |
| 108 | 106 | ) { |
| 109 | 107 | return; |
| 110 | 108 | } |
| 111 | 109 | |
| @@ -114,17 +112,20 @@ | ||
| 114 | 112 | : 'classic'; |
| 115 | 113 | $guide_title = __( 'Booking Resources and availability', 'booking' ); |
| 116 | 114 | $guide_description = __( 'Configure available weekdays and dates for each Booking Resource, then use the Publish buttons below to add its booking form to a page.', 'booking' ); |
| 117 | 115 | $guide_links = array(); |
| 116 | + $guide_html_id = 'wpbc_resources_booking_resources_availability_guide'; | |
| 118 | 117 | |
| 119 | 118 | if ( 'appointment' === $selected_mode_id ) { |
| 120 | 119 | $guide_title = __( 'Provider schedules and Services', 'booking' ); |
| 121 | 120 | $guide_description = __( 'Providers use Booking Resources to manage availability. Configure their working hours and days off, then assign them to Services.', 'booking' ); |
| 122 | 121 | $guide_links = wpbc_appointment_services_get_provider_admin_links( 0, true ); |
| 122 | + $guide_html_id = 'wpbc_resources_provider_services_guide'; | |
| 123 | 123 | } else { |
| 124 | 124 | if ( 'rental' === $selected_mode_id ) { |
| 125 | 125 | $guide_title = __( 'Property availability and publishing', 'booking' ); |
| 126 | 126 | $guide_description = __( 'Properties use Booking Resources to manage availability. Configure available weekdays and dates, then publish each property\'s booking form below.', 'booking' ); |
| 127 | + $guide_html_id = 'wpbc_resources_property_availability_publishing_guide'; | |
| 127 | 128 | } |
| 128 | 129 | |
| 129 | 130 | if ( wpbc_appointment_services_can_manage_availability() ) { |
| 130 | 131 | $weekdays_availability_url = function_exists( 'wpbc_get_general_availability_url' ) |
| @@ -134,14 +135,14 @@ | ||
| 134 | 135 | ? wpbc_get_availability_url() |
| 135 | 136 | : admin_url( 'admin.php?page=wpbc-availability' ); |
| 136 | 137 | |
| 137 | 138 | $guide_links[] = array( |
| 138 | - 'title' => ( 'rental' === $selected_mode_id ) ? __( 'Weekdays Availability', 'booking' ) : __( 'General Availability', 'booking' ), | |
| 139 | + 'title' => __( 'Schedule & Rules', 'booking' ), | |
| 139 | 140 | 'url' => $weekdays_availability_url, |
| 140 | 141 | 'icon' => 'wpbc-bi-calendar-week', |
| 141 | 142 | ); |
| 142 | 143 | $guide_links[] = array( |
| 143 | - 'title' => __( 'Days Availability', 'booking' ), | |
| 144 | + 'title' => __( 'Block Dates', 'booking' ), | |
| 144 | 145 | 'url' => $days_availability_url, |
| 145 | 146 | 'icon' => 'wpbc-bi-calendar-check', |
| 146 | 147 | ); |
| 147 | 148 | } |
| @@ -146,10 +147,27 @@ | ||
| 146 | 147 | ); |
| 147 | 148 | } |
| 148 | 149 | } |
| 149 | 150 | |
| 151 | + if ( function_exists( 'wpbc_is_dismissed_panel_visible' ) && ! wpbc_is_dismissed_panel_visible( $guide_html_id ) ) { | |
| 152 | + return; | |
| 153 | + } | |
| 154 | + | |
| 150 | 155 | ?> |
| 151 | - <div class="wpbc_appointment_provider_tools"> | |
| 156 | + <div id="<?php echo esc_attr( $guide_html_id ); ?>" class="wpbc_appointment_provider_tools is-dismissible"> | |
| 157 | + <?php | |
| 158 | + if ( function_exists( 'wpbc_is_dismissed' ) ) { | |
| 159 | + wpbc_is_dismissed( | |
| 160 | + $guide_html_id, | |
| 161 | + array( | |
| 162 | + 'title' => '<span class="wpbc-bi-x-lg" aria-hidden="true"></span><span class="screen-reader-text">' . esc_html__( 'Dismiss', 'booking' ) . '</span>', | |
| 163 | + 'hint' => __( 'Dismiss', 'booking' ), | |
| 164 | + 'class' => 'wpbc_appointment_provider_tools__dismiss', | |
| 165 | + 'is_apply_in_demo' => true, | |
| 166 | + ) | |
| 167 | + ); | |
| 168 | + } | |
| 169 | + ?> | |
| 152 | 170 | <div class="wpbc_appointment_provider_tools__copy"> |
| 153 | 171 | <strong><?php echo esc_html( $guide_title ); ?></strong> |
| 154 | 172 | <span><?php echo esc_html( $guide_description ); ?></span> |
| 155 | 173 | </div> |
| @@ -259,17 +277,17 @@ | ||
| 259 | 277 | * @return void |
| 260 | 278 | */ |
| 261 | 279 | function wpbc_appointment_services_render_picture_field() { |
| 262 | 280 | ?> |
| 263 | - <div class="inspector__row wpbc_appointment_services__picture_row"> | |
| 281 | + <div class="inspector__row wpbc_ui_listing__picture_row wpbc_appointment_services__picture_row"> | |
| 264 | 282 | <label for="picture_url" class="inspector__label"><?php esc_html_e( 'Picture', 'booking' ); ?></label> |
| 265 | 283 | <div class="inspector__control"> |
| 266 | - <div class="wpbc_appointment_services__media"> | |
| 267 | - <button type="button" class="wpbc_appointment_services__media_preview wpbc_media_upload_button" data-modal_title="<?php esc_attr_e( 'Select Service Image', 'booking' ); ?>" data-btn_title="<?php esc_attr_e( 'Use this image', 'booking' ); ?>" data-url_field="picture_url" aria-label="<?php esc_attr_e( 'Select Service image', 'booking' ); ?>" disabled> | |
| 268 | - <img alt="" class="wpbc_appointment_services__media_image" hidden /> | |
| 269 | - <i class="wpbc_appointment_services__media_placeholder menu_icon icon-1x wpbc-bi-image-fill" aria-hidden="true"></i> | |
| 284 | + <div class="wpbc_ui_listing__media wpbc_appointment_services__media"> | |
| 285 | + <button type="button" class="wpbc_ui_listing__media_preview wpbc_appointment_services__media_preview wpbc_media_upload_button" data-modal_title="<?php esc_attr_e( 'Select Service Image', 'booking' ); ?>" data-btn_title="<?php esc_attr_e( 'Use this image', 'booking' ); ?>" data-url_field="picture_url" aria-label="<?php esc_attr_e( 'Select Service image', 'booking' ); ?>" disabled> | |
| 286 | + <img alt="" class="wpbc_ui_listing__media_image wpbc_appointment_services__media_image" hidden /> | |
| 287 | + <i class="wpbc_ui_listing__media_placeholder wpbc_appointment_services__media_placeholder menu_icon icon-1x wpbc-bi-image-fill" aria-hidden="true"></i> | |
| 270 | 288 | </button> |
| 271 | - <div class="wpbc_appointment_services__media_actions wpbc_ui_el__buttons_group"> | |
| 289 | + <div class="wpbc_ui_listing__media_actions wpbc_appointment_services__media_actions wpbc_ui_el__buttons_group"> | |
| 272 | 290 | <button type="button" class="button wpbc_media_upload_button wpbc_appointment_services__select_image" data-modal_title="<?php esc_attr_e( 'Select Service Image', 'booking' ); ?>" data-btn_title="<?php esc_attr_e( 'Use this image', 'booking' ); ?>" data-url_field="picture_url" disabled><?php esc_html_e( 'Select image', 'booking' ); ?></button> |
| 273 | 291 | <button type="button" class="button wpbc_appointment_services__remove_image" disabled><?php esc_html_e( 'Remove', 'booking' ); ?></button> |
| 274 | 292 | </div> |
| 275 | 293 | </div> |
| @@ -362,13 +380,13 @@ | ||
| 362 | 380 | } |
| 363 | 381 | |
| 364 | 382 | wpbc_appointment_services_render_field( 'base_cost', __( 'Base price', 'booking' ), 'number', array( |
| 365 | 383 | 'min' => 0, |
| 366 | - 'step' => '0.01', | |
| 384 | + 'step' => 1, | |
| 367 | 385 | 'slider' => true, |
| 368 | 386 | 'slider_min' => 0, |
| 369 | - 'slider_max' => 100000, | |
| 370 | - 'slider_step' => 1, //'0.01', | |
| 387 | + 'slider_max' => 1000, | |
| 388 | + 'slider_step' => 1, | |
| 371 | 389 | ) ); |
| 372 | 390 | } |
| 373 | 391 | |
| 374 | 392 | /** |
| @@ -431,9 +449,15 @@ | ||
| 431 | 449 | * |
| 432 | 450 | * @return void |
| 433 | 451 | */ |
| 434 | 452 | function wpbc_appointment_services_render_settings_panel() { |
| 435 | - WPBC_UI_Sidebar_Panels::render_inspector_header( __( 'Service Settings', 'booking' ), __( 'Select a Service or create a new one.', 'booking' ) ); | |
| 453 | + ?> | |
| 454 | + <div class="wpbc_appointment_services__operation_host" data-wpbc-appointment-services-operation-host hidden></div> | |
| 455 | + <div data-wpbc-appointment-services-native-inspector> | |
| 456 | + <div data-wpbc-appointment-service-inspector-header> | |
| 457 | + <?php WPBC_UI_Sidebar_Panels::render_inspector_header( __( 'Service Settings', 'booking' ), __( 'Select a Service or create a new one.', 'booking' ) ); ?> | |
| 458 | + </div> | |
| 459 | + <?php | |
| 436 | 460 | WPBC_UI_Sidebar_Panels::render_collapsible_group( array( |
| 437 | 461 | 'id' => 'wpbc_service_general', |
| 438 | 462 | 'group' => 'service-general', |
| 439 | 463 | 'title' => __( 'General', 'booking' ), |
| @@ -464,8 +488,9 @@ | ||
| 464 | 488 | 'id' => 'wpbc_service_advanced', |
| 465 | 489 | 'group' => 'service-advanced', |
| 466 | 490 | 'title' => __( 'Advanced', 'booking' ), |
| 467 | 491 | ), 'wpbc_appointment_services_render_advanced_fields' ); |
| 492 | + ?></div><?php | |
| 468 | 493 | } |
| 469 | 494 | |
| 470 | 495 | /** |
| 471 | 496 | * Render the Service editor action in the native right-sidebar footer. |
| @@ -489,11 +514,16 @@ | ||
| 489 | 514 | } |
| 490 | 515 | ?> |
| 491 | 516 | <div class="wpbc_ui_el__vert_right_bar__footer_section wpbc_appointment_services__right_sidebar_footer" hidden> |
| 492 | 517 | <div class="wpbc_appointment_services__top_actions wpbc_appointment_services__footer_actions wpbc_ui_el__buttons_group" hidden> |
| 518 | + <button type="button" class="button wpbc_appointment_services__cancel" data-wpbc-appointment-services-cancel hidden disabled> | |
| 519 | + <?php esc_html_e( 'Cancel', 'booking' ); ?> | |
| 520 | + </button> | |
| 493 | 521 | <button type="button" class="button button-primary wpbc_appointment_services__save" hidden disabled> |
| 494 | 522 | <?php esc_html_e( 'Save Service', 'booking' ); ?> |
| 495 | 523 | </button> |
| 524 | + <button type="button" class="button button-primary wpbc_appointment_services__operation_review" hidden disabled><?php esc_html_e( 'Review changes', 'booking' ); ?></button> | |
| 525 | + <button type="button" class="button button-primary wpbc_appointment_services__operation_apply" hidden disabled><?php esc_html_e( 'Apply changes', 'booking' ); ?></button> | |
| 496 | 526 | </div> |
| 497 | 527 | </div> |
| 498 | 528 | <?php |
| 499 | 529 | } |
| @@ -519,9 +549,9 @@ | ||
| 519 | 549 | <p><?php |
| 520 | 550 | esc_html_e( 'Providers remain Booking Calendar resources because every Provider needs an independent availability calendar.', 'booking' ); ?></p> |
| 521 | 551 | <ul> |
| 522 | 552 | <li><?php |
| 523 | - esc_html_e( 'The weekday dots are a recurring weekly summary. A weekday is available when General Availability allows it and, when Working Time is enabled, the Provider has at least one working interval that day.', 'booking' ); ?></li> | |
| 553 | + esc_html_e( 'The weekday dots are a recurring weekly summary. A weekday is available when Schedule & Rules allows it and, when Working Time is enabled, the Provider has at least one working interval that day.', 'booking' ); ?></li> | |
| 524 | 554 | <li><?php |
| 525 | 555 | esc_html_e( 'The summary does not check Seasons, date-specific days off, existing bookings, time-slot rules, Service duration, or buffers. The customer booking calendar performs those complete checks for the selected date and time.', 'booking' ); ?></li> |
| 526 | 556 | <li><?php |
| 527 | 557 | esc_html_e( 'When several Providers are assigned, a green dot means at least one of them is normally available that weekday. Point to the dot to see which Providers are included.', 'booking' ); ?></li> |