PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
11.8.4 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 All 204 releases
← All changes | includes/page-availability-general/availability_general__page.php +99 -77 11.611.8.4 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * General availability admin page.
4 4 *
@@ -894,13 +894,13 @@
894 894 'is_show_top_path' => true,
895 895 'right_vertical_sidebar__is_show' => true,
896 896 'right_vertical_sidebar__default_view_mode' => '',
897 897 'right_vertical_sidebar_compact__is_show' => true,
898 - 'left_navigation__default_view_mode' => 'compact',
899 - 'top_path_title' => __( 'General Availability', 'booking' ),
900 - 'title' => __( 'General Availability', 'booking' ),
898 + 'left_navigation__default_view_mode' => '', // FixIn:11.7.1.1: 'compact',
899 + 'top_path_title' => __( 'Schedule & Rules', 'booking' ),
900 + 'title' => __( 'Schedule & Rules', 'booking' ),
901 901 'hint' => __( 'Define global front-end availability rules for all calendars, including unavailable weekdays, booking buffers, and availability limits.', 'booking' ),
902 - 'page_title' => __( 'General Availability', 'booking' ),
902 + 'page_title' => __( 'Schedule & Rules', 'booking' ),
903 903 'link' => '',
904 904 'position' => '',
905 905 'css_classes' => 'wpbc_top_tab__general_availability',
906 906 'icon' => '',
@@ -966,9 +966,9 @@
966 966 'icon' => 'wpbc-bi-info-circle',
967 967 ),
968 968 ),
969 969 array(
970 - 'aria_label' => __( 'General Availability Panels', 'booking' ),
970 + 'aria_label' => __( 'Schedule & Rules Panels', 'booking' ),
971 971 'context' => 'general_availability',
972 972 'class' => 'wpbc_ag_rightbar_tabs',
973 973 )
974 974 );
@@ -1035,9 +1035,9 @@
1035 1035 $unavailable_weekdays[] = $i;
1036 1036 }
1037 1037 }
1038 1038
1039 - WPBC_UI_Sidebar_Panels::render_inspector_header( __( 'General Availability', 'booking' ), __( 'Global front-end availability rules for all calendars.', 'booking' ) );
1039 + WPBC_UI_Sidebar_Panels::render_inspector_header( __( 'Schedule & Rules', 'booking' ), __( 'Availability rules for all calendars.', 'booking' ) );
1040 1040 ?>
1041 1041 <form method="post" id="<?php echo esc_attr( $form_name ); ?>" class="wpbc_ag_settings_form" data-wpbc-ag-settings-form="1">
1042 1042 <?php wp_nonce_field( 'wpbc_settings_page_' . $form_name ); ?>
1043 1043 <input type="hidden" name="is_form_submitted_<?php echo esc_attr( $form_name ); ?>" value="1" />
@@ -1048,40 +1048,102 @@
1048 1048 'id' => 'wpbc_ag_weekdays_group',
1049 1049 'group' => 'general-availability-weekdays',
1050 1050 'title' => __( 'Unavailable Weekdays', 'booking' ),
1051 1051 'open' => ( 'working_time' !== $open_section ),
1052 - ),
1053 - function () use ( $unavailable_weekdays ) {
1054 - $days = array(
1055 - 0 => __( 'Sunday', 'booking' ),
1056 - 1 => __( 'Monday', 'booking' ),
1057 - 2 => __( 'Tuesday', 'booking' ),
1058 - 3 => __( 'Wednesday', 'booking' ),
1059 - 4 => __( 'Thursday', 'booking' ),
1060 - 5 => __( 'Friday', 'booking' ),
1061 - 6 => __( 'Saturday', 'booking' ),
1062 - );
1063 - $start_week_day = absint( get_bk_option( 'booking_start_day_weeek' ) );
1064 - if ( $start_week_day > 6 ) {
1065 - $start_week_day = 0;
1066 - }
1067 - $days_ordered = array_slice( $days, $start_week_day, null, true ) + array_slice( $days, 0, $start_week_day, true );
1068 - ?>
1069 - <div class="wpbc_ag_weekday_grid">
1070 - <?php foreach ( $days_ordered as $day_num => $day_title ) : ?>
1071 - <label class="wpbc_ag_switch">
1072 - <input type="checkbox" name="booking_unavailable_days[]" value="<?php echo esc_attr( $day_num ); ?>" <?php checked( in_array( $day_num, $unavailable_weekdays, true ) ); ?> />
1073 - <span class="wpbc_ag_switch_control" aria-hidden="true"><span class="wpbc_ag_switch_knob"></span></span>
1074 - <span class="wpbc_ag_switch_label"><?php echo esc_html( $day_title ); ?></span>
1075 - </label>
1076 - <?php endforeach; ?>
1077 - </div>
1052 + ),
1053 + function () use ( $unavailable_weekdays ) {
1054 + $days_ordered = array(
1055 + 1 => array(
1056 + 'short' => _x( 'Mo', 'Short weekday label', 'booking' ),
1057 + 'full' => __( 'Monday', 'booking' ),
1058 + ),
1059 + 2 => array(
1060 + 'short' => _x( 'Tu', 'Short weekday label', 'booking' ),
1061 + 'full' => __( 'Tuesday', 'booking' ),
1062 + ),
1063 + 3 => array(
1064 + 'short' => _x( 'We', 'Short weekday label', 'booking' ),
1065 + 'full' => __( 'Wednesday', 'booking' ),
1066 + ),
1067 + 4 => array(
1068 + 'short' => _x( 'Th', 'Short weekday label', 'booking' ),
1069 + 'full' => __( 'Thursday', 'booking' ),
1070 + ),
1071 + 5 => array(
1072 + 'short' => _x( 'Fr', 'Short weekday label', 'booking' ),
1073 + 'full' => __( 'Friday', 'booking' ),
1074 + ),
1075 + 6 => array(
1076 + 'short' => _x( 'Sa', 'Short weekday label', 'booking' ),
1077 + 'full' => __( 'Saturday', 'booking' ),
1078 + ),
1079 + 0 => array(
1080 + 'short' => _x( 'Su', 'Short weekday label', 'booking' ),
1081 + 'full' => __( 'Sunday', 'booking' ),
1082 + ),
1083 + );
1084 + ?>
1085 + <div class="wpbc_ag_weekday_grid">
1086 + <?php foreach ( $days_ordered as $day_num => $day_labels ) : ?>
1087 + <?php
1088 + $unavailable_day_aria_label = sprintf(
1089 + /* translators: %s: Full weekday name. */
1090 + __( 'Set %s as unavailable', 'booking' ),
1091 + $day_labels['full']
1092 + );
1093 + ?>
1094 + <label class="wpbc_ag_switch wpbc_ag_weekday_switch">
1095 + <input type="checkbox" name="booking_unavailable_days[]" value="<?php echo esc_attr( $day_num ); ?>" aria-label="<?php echo esc_attr( $unavailable_day_aria_label ); ?>" <?php checked( in_array( $day_num, $unavailable_weekdays, true ) ); ?> />
1096 + <span class="wpbc_ag_switch_control" aria-hidden="true"><span class="wpbc_ag_switch_knob"></span></span>
1097 + <span class="wpbc_ag_switch_label"><?php echo esc_html( $day_labels['short'] ); ?></span>
1098 + </label>
1099 + <?php endforeach; ?>
1100 + </div>
1078 1101 <p class="wpbc_ag_description"><?php esc_html_e( 'Selected weekdays will be unavailable in calendars and override other availability settings.', 'booking' ); ?></p>
1079 1102 <?php
1080 - }
1081 - );
1082 -
1083 - WPBC_UI_Sidebar_Panels::render_collapsible_group(
1103 + }
1104 + );
1105 +
1106 + WPBC_UI_Sidebar_Panels::render_collapsible_group(
1107 + array(
1108 + 'id' => 'wpbc_ag_working_time_group',
1109 + 'group' => 'general-availability-working-time',
1110 + 'title' => __( 'Working Time', 'booking' ),
1111 + 'open' => ( 'working_time' === $open_section ),
1112 + ),
1113 + function () use ( $working_time_settings, $working_time_resource_id, $working_time_resource ) {
1114 + ?>
1115 + <div class="wpbc_ag_notice wpbc_ag_working_time_notice"><?php esc_html_e( 'Working Time restricts only time-based bookings, such as rangetime, start/end time, or start/duration time fields.', 'booking' ); ?></div>
1116 + <input type="hidden" name="booking_working_time_resource_id" data-wpbc-working-time-resource-id="1" value="<?php echo esc_attr( $working_time_resource_id ); ?>" />
1117 + <label class="wpbc_ag_switch wpbc_ag_switch_card">
1118 + <input type="checkbox" name="booking_working_time_enabled" value="On" <?php checked( $working_time_settings['enabled'], 'On' ); ?> />
1119 + <span class="wpbc_ag_switch_control" aria-hidden="true"><span class="wpbc_ag_switch_knob"></span></span>
1120 + <span class="wpbc_ag_switch_label"><?php esc_html_e( 'Restrict time-based bookings to working time', 'booking' ); ?></span>
1121 + </label>
1122 +
1123 + <div class="wpbc_ag_working_time_block">
1124 + <div class="wpbc_ag_scope_title"><?php esc_html_e( 'Default working time', 'booking' ); ?></div>
1125 + <p class="wpbc_ag_description"><?php esc_html_e( 'Used by all booking resources unless a resource override is configured below.', 'booking' ); ?></p>
1126 + <?php wpbc_availability_general__render_working_time_weekdays( 'booking_working_time_default', $working_time_settings['default']['weekdays'] ); ?>
1127 + </div>
1128 +
1129 + <div class="wpbc_ag_working_time_block wpbc_ag_working_time_resource_block" data-wpbc-working-time-resource-block="1">
1130 + <div class="wpbc_ag_scope_title"><?php esc_html_e( 'Selected resource override', 'booking' ); ?></div>
1131 + <p class="wpbc_ag_description"><?php esc_html_e( 'This override follows the booking resource selected in the page toolbar.', 'booking' ); ?></p>
1132 + <div class="wpbc_ag_radio_stack wpbc_ag_working_time_mode">
1133 + <label><input type="radio" name="booking_working_time_resource_mode" value="inherit" <?php checked( $working_time_resource['mode'], 'inherit' ); ?> /> <?php esc_html_e( 'Inherit default working time', 'booking' ); ?></label>
1134 + <label><input type="radio" name="booking_working_time_resource_mode" value="custom" <?php checked( $working_time_resource['mode'], 'custom' ); ?> /> <?php esc_html_e( 'Use custom working time', 'booking' ); ?></label>
1135 + <label><input type="radio" name="booking_working_time_resource_mode" value="disabled" <?php checked( $working_time_resource['mode'], 'disabled' ); ?> /> <?php esc_html_e( 'Do not restrict this resource by working time', 'booking' ); ?></label>
1136 + </div>
1137 + <div class="wpbc_ag_working_time_custom" data-wpbc-working-time-resource-custom="1">
1138 + <?php wpbc_availability_general__render_working_time_weekdays( 'booking_working_time_resource', $working_time_resource['weekdays'] ); ?>
1139 + </div>
1140 + </div>
1141 + <?php
1142 + }
1143 + );
1144 +
1145 + WPBC_UI_Sidebar_Panels::render_collapsible_group(
1084 1146 array(
1085 1147 'id' => 'wpbc_ag_today_group',
1086 1148 'group' => 'general-availability-from-today',
1087 1149 'title' => __( 'Availability From Today', 'booking' ),
@@ -1170,49 +1232,9 @@
1170 1232 </div>
1171 1233 <?php
1172 1234 }
1173 1235 );
1174 -
1175 - WPBC_UI_Sidebar_Panels::render_collapsible_group(
1176 - array(
1177 - 'id' => 'wpbc_ag_working_time_group',
1178 - 'group' => 'general-availability-working-time',
1179 - 'title' => __( 'Working Time', 'booking' ),
1180 - 'open' => ( 'working_time' === $open_section ),
1181 - ),
1182 - function () use ( $working_time_settings, $working_time_resource_id, $working_time_resource ) {
1183 - ?>
1184 - <div class="wpbc_ag_notice wpbc_ag_working_time_notice"><?php esc_html_e( 'Working Time restricts only time-based bookings, such as rangetime, start/end time, or start/duration time fields.', 'booking' ); ?></div>
1185 - <input type="hidden" name="booking_working_time_resource_id" data-wpbc-working-time-resource-id="1" value="<?php echo esc_attr( $working_time_resource_id ); ?>" />
1186 - <label class="wpbc_ag_switch wpbc_ag_switch_card">
1187 - <input type="checkbox" name="booking_working_time_enabled" value="On" <?php checked( $working_time_settings['enabled'], 'On' ); ?> />
1188 - <span class="wpbc_ag_switch_control" aria-hidden="true"><span class="wpbc_ag_switch_knob"></span></span>
1189 - <span class="wpbc_ag_switch_label"><?php esc_html_e( 'Restrict time-based bookings to working time', 'booking' ); ?></span>
1190 - </label>
1191 -
1192 - <div class="wpbc_ag_working_time_block">
1193 - <div class="wpbc_ag_scope_title"><?php esc_html_e( 'Default working time', 'booking' ); ?></div>
1194 - <p class="wpbc_ag_description"><?php esc_html_e( 'Used by all booking resources unless a resource override is configured below.', 'booking' ); ?></p>
1195 - <?php wpbc_availability_general__render_working_time_weekdays( 'booking_working_time_default', $working_time_settings['default']['weekdays'] ); ?>
1196 - </div>
1197 -
1198 - <div class="wpbc_ag_working_time_block wpbc_ag_working_time_resource_block" data-wpbc-working-time-resource-block="1">
1199 - <div class="wpbc_ag_scope_title"><?php esc_html_e( 'Selected resource override', 'booking' ); ?></div>
1200 - <p class="wpbc_ag_description"><?php esc_html_e( 'This override follows the booking resource selected in the page toolbar.', 'booking' ); ?></p>
1201 - <div class="wpbc_ag_radio_stack wpbc_ag_working_time_mode">
1202 - <label><input type="radio" name="booking_working_time_resource_mode" value="inherit" <?php checked( $working_time_resource['mode'], 'inherit' ); ?> /> <?php esc_html_e( 'Inherit default working time', 'booking' ); ?></label>
1203 - <label><input type="radio" name="booking_working_time_resource_mode" value="custom" <?php checked( $working_time_resource['mode'], 'custom' ); ?> /> <?php esc_html_e( 'Use custom working time', 'booking' ); ?></label>
1204 - <label><input type="radio" name="booking_working_time_resource_mode" value="disabled" <?php checked( $working_time_resource['mode'], 'disabled' ); ?> /> <?php esc_html_e( 'Do not restrict this resource by working time', 'booking' ); ?></label>
1205 - </div>
1206 - <div class="wpbc_ag_working_time_custom" data-wpbc-working-time-resource-custom="1">
1207 - <?php wpbc_availability_general__render_working_time_weekdays( 'booking_working_time_resource', $working_time_resource['weekdays'] ); ?>
1208 - </div>
1209 - </div>
1210 - <?php
1211 - }
1212 - );
1213 -
1214 - ?>
1236 + ?>
1215 1237 </div>
1216 1238 </form>
1217 1239 <?php
1218 1240 }