PluginProbe
Booking Calendar / 11.8.3
Booking Calendar v11.8.3
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
← All changes | includes/page-availability/availability__page.php +52 -37 10.1111.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
@@ -20,42 +20,42 @@
20 20 */
21 21 class WPBC_Page_AJX_Availability extends WPBC_Page_Structure {
22 22
23 23
24 - public function __construct() {
24 + public function __construct() {
25 25
26 - parent::__construct();
26 + parent::__construct();
27 27
28 28 add_action( 'wpbc_toolbar_top_tabs_insert', array( $this, 'wpbc_toolbar_toolbar_tabs' ) );
29 - }
29 + }
30 30
31 31
32 - public function in_page() {
33 - return 'wpbc-availability';
34 - }
32 + public function in_page() {
33 + return 'wpbc-availability';
34 + }
35 35
36 36
37 37 public function tabs() {
38 -
39 -
40 - $tabs = array();
41 - $tabs[ 'availability' ] = array(
42 - 'title' => __( 'Days Availability', 'booking' ) // Title of TAB //FixIn: 9.8.15.2.2
43 - , 'hint' => __( 'Define available and unavailable days for your calendar(s).', 'booking' ) // Hint
44 - , 'page_title' => __( 'Days Availability', 'booking' ) // Title of Page
45 - , 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link
46 - , 'position' => '' // 'left' || 'right' || ''
47 - , 'css_classes' => '' // CSS class(es)
48 - , 'icon' => '' // Icon - link to the real PNG img
49 - , 'font_icon' => 'wpbc-bi-calendar2-check'//'wpbc_icn_free_cancellation' // CSS definition of forn Icon
50 - , 'font_icon_right' => 'wpbc-bi-question-circle'
51 - , 'default' => true // Is this tab activated by default or not: true || false.
52 - , 'disabled' => false // Is this tab disbaled: true || false.
53 - , 'hided' => false // Is this tab hided: true || false.
54 - , 'subtabs' => array()
55 - );
56 - // $subtabs = array();
57 - // $tabs[ 'items' ][ 'subtabs' ] = $subtabs;
38 + $tabs = array();
39 + $tabs['availability'] = array(
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 + 'hint' => __( 'Define available and unavailable days for your calendar(s).', 'booking' ), // Hint.
44 + 'page_title' => __( 'Block Dates', 'booking' ), // Title of Page.
45 + 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
46 + 'position' => '', // 'left' / 'right' / ''.
47 + 'css_classes' => '', // CSS c l a s s(es).
48 + 'icon' => '', // Icon - link to the real PNG img.
49 + 'font_icon' => 'wpbc-bi-calendar2-check', // 'wpbc_icn_free_cancellation' // CSS definition of forn Icon.
50 + 'font_icon_right' => 'wpbc-bi-question-circle',
51 + 'default' => true, // Is this tab activated by default or not: true || false.
52 + 'disabled' => false, // Is this tab disbaled: true || false.
53 + 'hided' => false, // Is this tab hided: true || false.
54 + 'subtabs' => array(),
55 + 'folder_style' => 'order:91;',
56 + 'is_show_top_navigation' => true,
57 + );
58 58 return $tabs;
59 59 }
60 60
61 61
@@ -165,9 +165,18 @@
165 165 $request_prefix = false;
166 166 $escaped_request_params_arr = $user_request->get_sanitized__in_request__value_or_default( $request_prefix ); // Direct: $_REQUEST['resource_id']
167 167 }
168 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 + }
169 177
178 +
170 179 //MU
171 180 if ( class_exists( 'wpdev_bk_multiuser' ) ) {
172 181
173 182 // Check if this MU user activated or superadmin, otherwise show warning
@@ -284,12 +293,13 @@
284 293 } );
285 294 </script>
286 295 <?php
287 296 // FixIn: 10.0.0.5.
297 +/*
288 298 if ( 0 ) {
289 299 $resource_id = 220;
290 - // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
291 - ?><style type="text/css" rel="stylesheet"> .hasDatepick .datepick-inline .datepick-title-row th, .hasDatepick .datepick-inline .datepick-days-cell { height: 50px; } </style><?php
300 + // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet // FixIn: 10.12.4.2.
301 + ?><style type="text/css" rel="stylesheet"> .hasDatepick .datepick-inline .datepick-title-row th, .hasDatepick .datepick-inline .datepick-days-cell { max-height: 50px; } </style><?php
292 302
293 303 ?>
294 304 <div class="wpbc_calendar_wraper wpbc_change_over_triangle">
295 305 <div class="bk_calendar_frame months_num_in_row_4 cal_month_num_4" style="width:100%;max-width:100%;">
@@ -330,11 +340,11 @@
330 340 _wpbc.calendar__set_param_value( 220, 'dynamic__days_specific', [] );
331 341 _wpbc.calendar__set_param_value( 220, 'dynamic__week_days__start', [-1] );
332 342 _wpbc.calendar__set_param_value( 220, 'booking_date_format', 'j M Y' );
333 343 _wpbc.calendar__set_param_value( 220, 'booking_time_format', 'g:i A' );
334 - _wpbc.set_message( 'message_dates_times_unavailable', 'These dates and times in this calendar are already booked or unavailable.' );
335 - _wpbc.set_message( 'message_choose_alternative_dates', 'Please choose alternative date(s), times, or adjust the number of slots booked.' );
336 - _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' ) ); ?> );
337 347 _wpbc.calendar__set_param_value( 220, 'is_parent_resource', 0 );
338 348 _wpbc.calendar__set_param_value( 220, 'booking_capacity_field', 'visitors' );
339 349 _wpbc.calendar__set_param_value( 220, 'booking_is_dissbale_booking_for_different_sub_resources', 'Off' );
340 350 _wpbc.calendar__set_param_value( 220, 'booking_recurrent_time', 'Off' );
@@ -364,10 +374,10 @@
364 374 </script>
365 375 <?php
366 376 }
367 377 }
378 +*/
368 379
369 -
370 380 }
371 381
372 382 /**
373 383 * Hide first "Availability tab", because we have only one tab hhere, and need to show only tabs for toolbar
@@ -397,8 +407,12 @@
397 407
398 408
399 409 public function in_page() {
400 410
411 + if ( class_exists( 'WPBC_Page_Availability_General_Dedicated' ) ) {
412 + return (string) wp_rand( 100000, 1000000 );
413 + }
414 +
401 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
402 416 return (string) wp_rand( 100000, 1000000 ); // If this User not "super admin", then do not load this page at all
403 417 }
404 418
@@ -423,14 +437,14 @@
423 437 'default' => false, // Is this sub tab activated by default or not: true || false.
424 438 );
425 439
426 440 $tabs = array();
427 - $tabs[ 'general_availability' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:200;' ) );
441 + // FixIn: 10.12.4.7. $tabs[ 'general_availability' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:200;' ) );
428 442 $tabs[ 'general_availability' ] = array(
429 - '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
430 444 , 'hint' => __( 'Define unavailable weekdays for all calendar(s) and unavailable dates depend from today date', 'booking' ) // Hint
431 - , 'page_title' => __( 'General Availability', 'booking' ) // Title of Page
432 - , '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
433 447 , 'position' => '' // 'left' || 'right' || ''
434 448 , 'css_classes' => 'wpbc_top_tab__general_availability' // CSS class(es)
435 449 , 'icon' => '' // Icon - link to the real PNG img
436 450 , 'font_icon' => 'wpbc-bi-calendar2-day 0wpbc-bi-calendar2-check'//'wpbc_icn_free_cancellation' // CSS definition of forn Icon
@@ -438,9 +452,10 @@
438 452 , 'default' => false // Is this tab activated by default or not: true || false.
439 453 , 'disabled' => false // Is this tab disbaled: true || false.
440 454 , 'hided' => false // Is this tab hided: true || false.
441 455 , 'subtabs' => array()
442 - , 'folder_style' => 'order:200;',
456 + // , 'folder_style' => 'order:200;',
457 + , 'folder_style' => 'order:93;',
443 458 );
444 459 // $subtabs = array();
445 460 // $tabs[ 'items' ][ 'subtabs' ] = $subtabs;
446 461 return $tabs;