← All changes
|
includes/page-availability/availability__page.php
+27
-11
10.15.7
→
11.8.3
View file →
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* |
| 3 | 3 | * @package: AJX_Bookings Page |
| 4 | 4 | * @category: o Email Reminders |
| @@ -36,13 +36,13 @@ | ||
| 36 | 36 | |
| 37 | 37 | public function tabs() { |
| 38 | 38 | $tabs = array(); |
| 39 | 39 | $tabs['availability'] = array( |
| 40 | - 'is_show_top_path' => false, // true | false. By default value is: false. | |
| 41 | - 'left_navigation__default_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. | |
| 42 | - 'title' => __( 'Days Availability', 'booking' ), // Title of TAB //FixIn: 9.8.15.2.2. | |
| 40 | + 'is_show_top_path' => true, // true | false. By default value is: true. | |
| 41 | + 'left_navigation__default_view_mode' => '', // FixIn:11.7.1.1: 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. | |
| 42 | + 'title' => __( 'Block Dates', 'booking' ), // Title of TAB //FixIn: 9.8.15.2.2. | |
| 43 | 43 | 'hint' => __( 'Define available and unavailable days for your calendar(s).', 'booking' ), // Hint. |
| 44 | - 'page_title' => __( 'Days Availability', 'booking' ), // Title of Page. | |
| 44 | + 'page_title' => __( 'Block Dates', 'booking' ), // Title of Page. | |
| 45 | 45 | 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. |
| 46 | 46 | 'position' => '', // 'left' / 'right' / ''. |
| 47 | 47 | 'css_classes' => '', // CSS c l a s s(es). |
| 48 | 48 | 'icon' => '', // Icon - link to the real PNG img. |
| @@ -51,8 +51,10 @@ | ||
| 51 | 51 | 'default' => true, // Is this tab activated by default or not: true || false. |
| 52 | 52 | 'disabled' => false, // Is this tab disbaled: true || false. |
| 53 | 53 | 'hided' => false, // Is this tab hided: true || false. |
| 54 | 54 | 'subtabs' => array(), |
| 55 | + 'folder_style' => 'order:91;', | |
| 56 | + 'is_show_top_navigation' => true, | |
| 55 | 57 | ); |
| 56 | 58 | return $tabs; |
| 57 | 59 | } |
| 58 | 60 | |
| @@ -163,9 +165,18 @@ | ||
| 163 | 165 | $request_prefix = false; |
| 164 | 166 | $escaped_request_params_arr = $user_request->get_sanitized__in_request__value_or_default( $request_prefix ); // Direct: $_REQUEST['resource_id'] |
| 165 | 167 | } |
| 166 | 168 | |
| 169 | + // Direct links from other admin tools can intentionally open availability for a specific resource. | |
| 170 | + // In that case this URL value must override previously saved user toolbar state. | |
| 171 | + if ( false !== wpbc_get_direct_value_in_request( 'resource_id', false ) ) { | |
| 172 | + $direct_request_params_arr = $user_request->get_sanitized__in_request__value_or_default( false ); | |
| 173 | + if ( ! empty( $direct_request_params_arr['resource_id'] ) ) { | |
| 174 | + $escaped_request_params_arr['resource_id'] = $direct_request_params_arr['resource_id']; | |
| 175 | + } | |
| 176 | + } | |
| 167 | 177 | |
| 178 | + | |
| 168 | 179 | //MU |
| 169 | 180 | if ( class_exists( 'wpdev_bk_multiuser' ) ) { |
| 170 | 181 | |
| 171 | 182 | // Check if this MU user activated or superadmin, otherwise show warning |
| @@ -329,11 +340,11 @@ | ||
| 329 | 340 | _wpbc.calendar__set_param_value( 220, 'dynamic__days_specific', [] ); |
| 330 | 341 | _wpbc.calendar__set_param_value( 220, 'dynamic__week_days__start', [-1] ); |
| 331 | 342 | _wpbc.calendar__set_param_value( 220, 'booking_date_format', 'j M Y' ); |
| 332 | 343 | _wpbc.calendar__set_param_value( 220, 'booking_time_format', 'g:i A' ); |
| 333 | - _wpbc.set_message( 'message_dates_times_unavailable', 'These dates and times in this calendar are already booked or unavailable.' ); | |
| 334 | - _wpbc.set_message( 'message_choose_alternative_dates', 'Please choose alternative date(s), times, or adjust the number of slots booked.' ); | |
| 335 | - _wpbc.set_message( 'message_cannot_save_in_one_resource', 'It is not possible to store this sequence of the dates into the one same resource.' ); | |
| 344 | + _wpbc.set_message( 'message_dates_times_unavailable', <?php echo wp_json_encode( wpbc_frontend_messages__get( 'message_dates_times_unavailable' ) ); ?> ); | |
| 345 | + _wpbc.set_message( 'message_choose_alternative_dates', <?php echo wp_json_encode( wpbc_frontend_messages__get( 'message_choose_alternative_dates' ) ); ?> ); | |
| 346 | + _wpbc.set_message( 'message_cannot_save_in_one_resource', <?php echo wp_json_encode( wpbc_frontend_messages__get( 'message_cannot_save_in_one_resource' ) ); ?> ); | |
| 336 | 347 | _wpbc.calendar__set_param_value( 220, 'is_parent_resource', 0 ); |
| 337 | 348 | _wpbc.calendar__set_param_value( 220, 'booking_capacity_field', 'visitors' ); |
| 338 | 349 | _wpbc.calendar__set_param_value( 220, 'booking_is_dissbale_booking_for_different_sub_resources', 'Off' ); |
| 339 | 350 | _wpbc.calendar__set_param_value( 220, 'booking_recurrent_time', 'Off' ); |
| @@ -396,8 +407,12 @@ | ||
| 396 | 407 | |
| 397 | 408 | |
| 398 | 409 | public function in_page() { |
| 399 | 410 | |
| 411 | + if ( class_exists( 'WPBC_Page_Availability_General_Dedicated' ) ) { | |
| 412 | + return (string) wp_rand( 100000, 1000000 ); | |
| 413 | + } | |
| 414 | + | |
| 400 | 415 | if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all |
| 401 | 416 | return (string) wp_rand( 100000, 1000000 ); // If this User not "super admin", then do not load this page at all |
| 402 | 417 | } |
| 403 | 418 | |
| @@ -424,12 +439,12 @@ | ||
| 424 | 439 | |
| 425 | 440 | $tabs = array(); |
| 426 | 441 | // FixIn: 10.12.4.7. $tabs[ 'general_availability' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:200;' ) ); |
| 427 | 442 | $tabs[ 'general_availability' ] = array( |
| 428 | - 'title' => __( 'General Availability', 'booking' ) // Title of TAB //FixIn: 9.8.15.2.2 | |
| 443 | + 'title' => __( 'Schedule & Rules', 'booking' ) // Title of TAB //FixIn: 9.8.15.2.2 | |
| 429 | 444 | , 'hint' => __( 'Define unavailable weekdays for all calendar(s) and unavailable dates depend from today date', 'booking' ) // Hint |
| 430 | - , 'page_title' => __( 'General Availability', 'booking' ) // Title of Page | |
| 431 | - , 'link' => wpbc_get_settings_url( true, false ) . '&scroll_to_section=wpbc_general_settings_availability_tab' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link | |
| 445 | + , 'page_title' => __( 'Schedule & Rules', 'booking' ) // Title of Page | |
| 446 | + , 'link' => function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url( true, false ) : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ) // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link | |
| 432 | 447 | , 'position' => '' // 'left' || 'right' || '' |
| 433 | 448 | , 'css_classes' => 'wpbc_top_tab__general_availability' // CSS class(es) |
| 434 | 449 | , 'icon' => '' // Icon - link to the real PNG img |
| 435 | 450 | , 'font_icon' => 'wpbc-bi-calendar2-day 0wpbc-bi-calendar2-check'//'wpbc_icn_free_cancellation' // CSS definition of forn Icon |
| @@ -437,9 +452,10 @@ | ||
| 437 | 452 | , 'default' => false // Is this tab activated by default or not: true || false. |
| 438 | 453 | , 'disabled' => false // Is this tab disbaled: true || false. |
| 439 | 454 | , 'hided' => false // Is this tab hided: true || false. |
| 440 | 455 | , 'subtabs' => array() |
| 441 | - , 'folder_style' => 'order:200;', | |
| 456 | + // , 'folder_style' => 'order:200;', | |
| 457 | + , 'folder_style' => 'order:93;', | |
| 442 | 458 | ); |
| 443 | 459 | // $subtabs = array(); |
| 444 | 460 | // $tabs[ 'items' ][ 'subtabs' ] = $subtabs; |
| 445 | 461 | return $tabs; |