Changeset 3397414
- Timestamp:
- 11/17/2025 04:58:55 PM (5 months ago)
- Location:
- restaurant-reservations
- Files:
-
- 16 edited
- 1 copied
-
tags/2.7.6 (copied) (copied from restaurant-reservations/trunk)
-
tags/2.7.6/assets/js/booking-form.js (modified) (4 diffs)
-
tags/2.7.6/includes/Booking.class.php (modified) (3 diffs)
-
tags/2.7.6/includes/Notification.class.php (modified) (1 diff)
-
tags/2.7.6/includes/Notifications.class.php (modified) (1 diff)
-
tags/2.7.6/includes/Settings.class.php (modified) (1 diff)
-
tags/2.7.6/includes/template-functions.php (modified) (1 diff)
-
tags/2.7.6/readme.txt (modified) (2 diffs)
-
tags/2.7.6/restaurant-reservations.php (modified) (5 diffs)
-
trunk/assets/js/booking-form.js (modified) (4 diffs)
-
trunk/includes/Booking.class.php (modified) (3 diffs)
-
trunk/includes/Notification.class.php (modified) (1 diff)
-
trunk/includes/Notifications.class.php (modified) (1 diff)
-
trunk/includes/Settings.class.php (modified) (1 diff)
-
trunk/includes/template-functions.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/restaurant-reservations.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
restaurant-reservations/tags/2.7.6/assets/js/booking-form.js
r3336820 r3397414 9 9 */ 10 10 rtb_booking_form.init = function() { 11 12 rtb_pickadate.init_complete = false;13 11 14 12 // Scroll to the first error message on the booking form … … 56 54 // Enable datepickers on load 57 55 if ( typeof rtb_pickadate !== 'undefined' ) { 56 57 rtb_pickadate.init_complete = false; 58 58 59 59 // Declare datepicker … … 251 251 rtb_booking_form.update_disabled_dates = function() { 252 252 253 if ( rtb_booking_form_js_localize.admin_ignore_schedule && rtb_booking_form_js_localize.is_admin ) { 254 rtb_booking_form.datepicker.set( 'enable', true ); 255 return; 256 } 257 253 258 // Pass conditional configuration parameters 254 259 if ( rtb_pickadate.disable_dates.length ) { … … 283 288 rtb_booking_form.timepicker.set( 'enable', false ); 284 289 rtb_booking_form.timepicker.set( 'disable', false ); 290 291 if ( rtb_booking_form_js_localize.admin_ignore_schedule && rtb_booking_form_js_localize.is_admin ) { 292 rtb_booking_form.timepicker.set( 'enable', true ); 293 return; 294 } 285 295 286 296 if ( rtb_booking_form.datepicker.get() === '' ) { -
restaurant-reservations/tags/2.7.6/includes/Booking.class.php
r3351461 r3397414 508 508 empty( $this->validation_errors ) 509 509 && !empty( $exception_rules ) 510 && !current_user_can( 'manage_bookings')510 && ( ! empty( $rtb_controller->settings->get_setting( 'admin-ignore-schedule' ) ) && ! current_user_can( 'manage_bookings' ) ) 511 511 ) { 512 512 … … 603 603 empty( $this->validation_errors ) 604 604 && !empty( $rules ) 605 && !current_user_can( 'manage_bookings')605 && ( ! empty( $rtb_controller->settings->get_setting( 'admin-ignore-schedule' ) ) && ! current_user_can( 'manage_bookings' ) ) 606 606 && !$exception_is_active 607 607 ) { … … 673 673 674 674 // Name 675 $this->name = empty( $_POST['rtb-name'] ) ? '' : wp_strip_all_tags( sanitize_text_field( $_POST['rtb-name'] ), true ); // @todo should I limit length?675 $this->name = empty( $_POST['rtb-name'] ) ? '' : wp_strip_all_tags( sanitize_text_field( $_POST['rtb-name'] ), true ); 676 676 if ( empty( $this->name ) ) { 677 677 $this->validation_errors[] = array( -
restaurant-reservations/tags/2.7.6/includes/Notification.class.php
r3119660 r3397414 113 113 $template_tags = array( 114 114 '{booking_id}' => $this->booking->ID, 115 '{user_email}' => $this->booking->email,116 '{user_name}' => $this->booking->name,115 '{user_email}' => esc_html( $this->booking->email ), 116 '{user_name}' => esc_html( $this->booking->name ), 117 117 '{party}' => $this->booking->party, 118 118 '{table}' => implode(',', $this->booking->table ), 119 119 '{date}' => $this->booking->format_date( $this->booking->date ), 120 '{phone}' => $this->booking->phone,121 '{message}' => $this->booking->message,120 '{phone}' => esc_html( $this->booking->phone ), 121 '{message}' => esc_html( $this->booking->message ), 122 122 '{booking_url}' => $booking_page_url, 123 123 '{cancellation_url}' => $cancellation_url, -
restaurant-reservations/tags/2.7.6/includes/Notifications.class.php
r3336820 r3397414 323 323 <?php if ( $multiple_locations ) { $term = get_term( $booking_object->location ); echo ( ! is_wp_error( $term ) ? "<td>{$term->name}</td>" : '<td></td>' ); } ?> 324 324 <td><?php echo ( new DateTime( $booking_object->date ) )->format( 'H:i:s' ); ?></td> 325 <td><?php echo $booking_object->party; ?></td>326 <td><?php echo $booking_object->name; ?></td>327 <td><?php echo $booking_object->email; ?></td>328 <td><?php echo $booking_object->phone; ?></td>325 <td><?php echo esc_html( $booking_object->party ); ?></td> 326 <td><?php echo esc_html( $booking_object->name ); ?></td> 327 <td><?php echo esc_html( $booking_object->email ); ?></td> 328 <td><?php echo esc_html( $booking_object->phone ); ?></td> 329 329 <?php if ( $display_table ) { $table = implode(', ', $booking_object->table ); echo "<td>{$table}</td>"; } ?> 330 330 <td><?php echo $rtb_controller->cpts->booking_statuses[$booking_object->post_status]['label'] ?></td> -
restaurant-reservations/tags/2.7.6/includes/Settings.class.php
r3336820 r3397414 1302 1302 ); 1303 1303 1304 $sap->add_setting( 1305 'rtb-settings', 1306 'rtb-schedule', 1307 'toggle', 1308 array( 1309 'id' => 'admin-ignore-schedule', 1310 'title' => __( 'Admin Ignore Schedule', 'restaurant-reservations' ), 1311 'description' => __( 'Allows bookings to be made at any time at all via the admin, ignoring all scheduling rules.', 'restaurant-reservations' ) 1312 ) 1313 ); 1314 1304 1315 $sap->add_section( 1305 1316 'rtb-settings', -
restaurant-reservations/tags/2.7.6/includes/template-functions.php
r3381412 r3397414 575 575 wp_enqueue_script( 'rtb-columns', RTB_PLUGIN_URL . '/assets/js/columns.js', array( 'jquery' ), '', true ); 576 576 } 577 578 // Pass date and time format settings to the pickadate controls579 wp_localize_script(580 'rtb-booking-form',581 'rtb_pickadate',582 apply_filters(583 'rtb_pickadate_args',584 array(585 'date_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'date-format' ) ),586 'time_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'time-format' ) ),587 'disable_dates' => rtb_get_datepicker_rules(),588 'schedule_open' => $rtb_controller->settings->get_setting( 'schedule-open' ),589 'schedule_closed' => $rtb_controller->settings->get_setting( 'schedule-closed' ),590 'multiple_locations_enabled' => $rtb_controller->locations->do_locations_exist(),591 'early_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'early-bookings' ),592 'late_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'late-bookings' ),593 'enable_max_reservations' => is_admin() && current_user_can( 'manage_bookings' ) ? false : $rtb_controller->settings->get_setting( 'rtb-enable-max-tables' ),594 'max_people' => is_admin() && current_user_can( 'manage_bookings' ) ? 100 : $rtb_controller->settings->get_setting( 'rtb-max-people-count' ),595 'enable_tables' => $rtb_controller->settings->get_setting( 'enable-tables' ),596 'date_onload' => $rtb_controller->settings->get_setting( 'date-onload' ),597 'time_interval' => $rtb_controller->settings->get_setting( 'time-interval' ),598 'first_day' => $rtb_controller->settings->get_setting( 'week-start' ),599 'allow_past' => is_admin() && current_user_can( 'manage_bookings' ),600 'date_today_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-today' ) ),601 'date_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-clear' ) ),602 'date_close_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-close' ) ),603 'time_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-time-clear' ) ),604 )605 )606 );607 608 577 } 609 578 } // endif; -
restaurant-reservations/tags/2.7.6/readme.txt
r3381412 r3397414 3 3 Tested Up To: 6.8 4 4 Tags: reservation, reservations, restaurant reservations, reservation form, restaurant, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations 5 Stable tag: 2.7. 55 Stable tag: 2.7.6 6 6 License: GPLv3 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 303 303 == Changelog == 304 304 305 = 2.7.6 (2025-11-17) = 306 - Added a new "Admin Ignore Schedule" option, so admins can create bookings outside their created scheduling rules and exceptions. 307 - Fixed an issue with the booking widget not working correctly with Elementor. 308 305 309 = 2.7.5 (2025-10-20) = 306 310 - Fixed an issue causing an error to sometimes display when clicking the "proceed to deposit" button in the booking form when using the Stripe gateway. -
restaurant-reservations/tags/2.7.6/restaurant-reservations.php
r3381412 r3397414 4 4 * Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/ 5 5 * Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more. 6 * Version: 2.7. 56 * Version: 2.7.6 7 7 * Author: Five Star Plugins 8 8 * Author URI: https://www.fivestarplugins.com/ … … 59 59 60 60 // Common strings 61 define( 'RTB_VERSION', '2.7. 5' );61 define( 'RTB_VERSION', '2.7.6' ); 62 62 define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); 63 63 define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) ); … … 229 229 add_action( 'admin_init', array( $this, 'maybe_delete_older_reservations' ) ); 230 230 add_filter( 'sanitize_option_rtb-settings', array( $this, 'maybe_delete_older_reservations' ), 100 ); 231 232 // Localize settings data if booking form is loaded 233 add_action( 'wp_footer', array( $this, 'assets_footer' ), 2 ); 234 add_action( 'admin_footer', array( $this, 'assets_footer' ), 2 ); 231 235 232 236 // Handle the helper notice … … 630 634 'is_admin' => is_admin(), 631 635 'cancellation_cutoff' => $rtb_controller->settings->get_setting( 'late-cancellations' ), 636 'admin_ignore_schedule' => $rtb_controller->settings->get_setting( 'admin-ignore-schedule' ), 632 637 'admin_ignore_maximums' => $rtb_controller->settings->get_setting( 'rtb-admin-ignore-maximums' ), 633 638 'want_to_modify' => esc_html( $rtb_controller->settings->get_setting( 'label-modify-reservation' ) ), … … 743 748 } 744 749 750 /** 751 * Print out any PHP data needed for our JS to work correctly 752 * @since 2.7.6 753 */ 754 public function assets_footer() { 755 global $rtb_controller; 756 757 $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; 758 759 if ( 760 empty( $rtb_controller->display_bookings_form_rendered ) and 761 empty( $rtb_controller->form_rendered ) and 762 ( ! empty( $screen) and $screen->base != 'toplevel_page_rtb-bookings' ) 763 ) { 764 return; 765 } 766 767 $rtb_pickadate = apply_filters( 768 'rtb_pickadate_args', 769 array( 770 'date_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'date-format' ) ), 771 'time_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'time-format' ) ), 772 'disable_dates' => rtb_get_datepicker_rules(), 773 'schedule_open' => $rtb_controller->settings->get_setting( 'schedule-open' ), 774 'schedule_closed' => $rtb_controller->settings->get_setting( 'schedule-closed' ), 775 'multiple_locations_enabled' => $rtb_controller->locations->do_locations_exist(), 776 'early_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'early-bookings' ), 777 'late_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'late-bookings' ), 778 'enable_max_reservations' => is_admin() && current_user_can( 'manage_bookings' ) ? false : $rtb_controller->settings->get_setting( 'rtb-enable-max-tables' ), 779 'max_people' => is_admin() && current_user_can( 'manage_bookings' ) ? 100 : $rtb_controller->settings->get_setting( 'rtb-max-people-count' ), 780 'enable_tables' => $rtb_controller->settings->get_setting( 'enable-tables' ), 781 'date_onload' => $rtb_controller->settings->get_setting( 'date-onload' ), 782 'time_interval' => $rtb_controller->settings->get_setting( 'time-interval' ), 783 'first_day' => $rtb_controller->settings->get_setting( 'week-start' ), 784 'allow_past' => is_admin() && current_user_can( 'manage_bookings' ), 785 'date_today_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-today' ) ), 786 'date_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-clear' ) ), 787 'date_close_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-close' ) ), 788 'time_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-time-clear' ) ), 789 ) 790 ); 791 792 echo "<script type='text/javascript'>\n"; 793 echo "/* <![CDATA[ */\n"; 794 echo 'var rtb_pickadate = ' . wp_json_encode( $rtb_pickadate ) . "\n"; 795 echo "/* ]]> */\n"; 796 echo "</script>\n"; 797 798 } 799 745 800 public function maybe_display_helper_notice() { 746 801 global $rtb_controller; -
restaurant-reservations/trunk/assets/js/booking-form.js
r3336820 r3397414 9 9 */ 10 10 rtb_booking_form.init = function() { 11 12 rtb_pickadate.init_complete = false;13 11 14 12 // Scroll to the first error message on the booking form … … 56 54 // Enable datepickers on load 57 55 if ( typeof rtb_pickadate !== 'undefined' ) { 56 57 rtb_pickadate.init_complete = false; 58 58 59 59 // Declare datepicker … … 251 251 rtb_booking_form.update_disabled_dates = function() { 252 252 253 if ( rtb_booking_form_js_localize.admin_ignore_schedule && rtb_booking_form_js_localize.is_admin ) { 254 rtb_booking_form.datepicker.set( 'enable', true ); 255 return; 256 } 257 253 258 // Pass conditional configuration parameters 254 259 if ( rtb_pickadate.disable_dates.length ) { … … 283 288 rtb_booking_form.timepicker.set( 'enable', false ); 284 289 rtb_booking_form.timepicker.set( 'disable', false ); 290 291 if ( rtb_booking_form_js_localize.admin_ignore_schedule && rtb_booking_form_js_localize.is_admin ) { 292 rtb_booking_form.timepicker.set( 'enable', true ); 293 return; 294 } 285 295 286 296 if ( rtb_booking_form.datepicker.get() === '' ) { -
restaurant-reservations/trunk/includes/Booking.class.php
r3351461 r3397414 508 508 empty( $this->validation_errors ) 509 509 && !empty( $exception_rules ) 510 && !current_user_can( 'manage_bookings')510 && ( ! empty( $rtb_controller->settings->get_setting( 'admin-ignore-schedule' ) ) && ! current_user_can( 'manage_bookings' ) ) 511 511 ) { 512 512 … … 603 603 empty( $this->validation_errors ) 604 604 && !empty( $rules ) 605 && !current_user_can( 'manage_bookings')605 && ( ! empty( $rtb_controller->settings->get_setting( 'admin-ignore-schedule' ) ) && ! current_user_can( 'manage_bookings' ) ) 606 606 && !$exception_is_active 607 607 ) { … … 673 673 674 674 // Name 675 $this->name = empty( $_POST['rtb-name'] ) ? '' : wp_strip_all_tags( sanitize_text_field( $_POST['rtb-name'] ), true ); // @todo should I limit length?675 $this->name = empty( $_POST['rtb-name'] ) ? '' : wp_strip_all_tags( sanitize_text_field( $_POST['rtb-name'] ), true ); 676 676 if ( empty( $this->name ) ) { 677 677 $this->validation_errors[] = array( -
restaurant-reservations/trunk/includes/Notification.class.php
r3119660 r3397414 113 113 $template_tags = array( 114 114 '{booking_id}' => $this->booking->ID, 115 '{user_email}' => $this->booking->email,116 '{user_name}' => $this->booking->name,115 '{user_email}' => esc_html( $this->booking->email ), 116 '{user_name}' => esc_html( $this->booking->name ), 117 117 '{party}' => $this->booking->party, 118 118 '{table}' => implode(',', $this->booking->table ), 119 119 '{date}' => $this->booking->format_date( $this->booking->date ), 120 '{phone}' => $this->booking->phone,121 '{message}' => $this->booking->message,120 '{phone}' => esc_html( $this->booking->phone ), 121 '{message}' => esc_html( $this->booking->message ), 122 122 '{booking_url}' => $booking_page_url, 123 123 '{cancellation_url}' => $cancellation_url, -
restaurant-reservations/trunk/includes/Notifications.class.php
r3336820 r3397414 323 323 <?php if ( $multiple_locations ) { $term = get_term( $booking_object->location ); echo ( ! is_wp_error( $term ) ? "<td>{$term->name}</td>" : '<td></td>' ); } ?> 324 324 <td><?php echo ( new DateTime( $booking_object->date ) )->format( 'H:i:s' ); ?></td> 325 <td><?php echo $booking_object->party; ?></td>326 <td><?php echo $booking_object->name; ?></td>327 <td><?php echo $booking_object->email; ?></td>328 <td><?php echo $booking_object->phone; ?></td>325 <td><?php echo esc_html( $booking_object->party ); ?></td> 326 <td><?php echo esc_html( $booking_object->name ); ?></td> 327 <td><?php echo esc_html( $booking_object->email ); ?></td> 328 <td><?php echo esc_html( $booking_object->phone ); ?></td> 329 329 <?php if ( $display_table ) { $table = implode(', ', $booking_object->table ); echo "<td>{$table}</td>"; } ?> 330 330 <td><?php echo $rtb_controller->cpts->booking_statuses[$booking_object->post_status]['label'] ?></td> -
restaurant-reservations/trunk/includes/Settings.class.php
r3336820 r3397414 1302 1302 ); 1303 1303 1304 $sap->add_setting( 1305 'rtb-settings', 1306 'rtb-schedule', 1307 'toggle', 1308 array( 1309 'id' => 'admin-ignore-schedule', 1310 'title' => __( 'Admin Ignore Schedule', 'restaurant-reservations' ), 1311 'description' => __( 'Allows bookings to be made at any time at all via the admin, ignoring all scheduling rules.', 'restaurant-reservations' ) 1312 ) 1313 ); 1314 1304 1315 $sap->add_section( 1305 1316 'rtb-settings', -
restaurant-reservations/trunk/includes/template-functions.php
r3381412 r3397414 575 575 wp_enqueue_script( 'rtb-columns', RTB_PLUGIN_URL . '/assets/js/columns.js', array( 'jquery' ), '', true ); 576 576 } 577 578 // Pass date and time format settings to the pickadate controls579 wp_localize_script(580 'rtb-booking-form',581 'rtb_pickadate',582 apply_filters(583 'rtb_pickadate_args',584 array(585 'date_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'date-format' ) ),586 'time_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'time-format' ) ),587 'disable_dates' => rtb_get_datepicker_rules(),588 'schedule_open' => $rtb_controller->settings->get_setting( 'schedule-open' ),589 'schedule_closed' => $rtb_controller->settings->get_setting( 'schedule-closed' ),590 'multiple_locations_enabled' => $rtb_controller->locations->do_locations_exist(),591 'early_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'early-bookings' ),592 'late_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'late-bookings' ),593 'enable_max_reservations' => is_admin() && current_user_can( 'manage_bookings' ) ? false : $rtb_controller->settings->get_setting( 'rtb-enable-max-tables' ),594 'max_people' => is_admin() && current_user_can( 'manage_bookings' ) ? 100 : $rtb_controller->settings->get_setting( 'rtb-max-people-count' ),595 'enable_tables' => $rtb_controller->settings->get_setting( 'enable-tables' ),596 'date_onload' => $rtb_controller->settings->get_setting( 'date-onload' ),597 'time_interval' => $rtb_controller->settings->get_setting( 'time-interval' ),598 'first_day' => $rtb_controller->settings->get_setting( 'week-start' ),599 'allow_past' => is_admin() && current_user_can( 'manage_bookings' ),600 'date_today_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-today' ) ),601 'date_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-clear' ) ),602 'date_close_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-close' ) ),603 'time_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-time-clear' ) ),604 )605 )606 );607 608 577 } 609 578 } // endif; -
restaurant-reservations/trunk/readme.txt
r3381412 r3397414 3 3 Tested Up To: 6.8 4 4 Tags: reservation, reservations, restaurant reservations, reservation form, restaurant, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations 5 Stable tag: 2.7. 55 Stable tag: 2.7.6 6 6 License: GPLv3 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 303 303 == Changelog == 304 304 305 = 2.7.6 (2025-11-17) = 306 - Added a new "Admin Ignore Schedule" option, so admins can create bookings outside their created scheduling rules and exceptions. 307 - Fixed an issue with the booking widget not working correctly with Elementor. 308 305 309 = 2.7.5 (2025-10-20) = 306 310 - Fixed an issue causing an error to sometimes display when clicking the "proceed to deposit" button in the booking form when using the Stripe gateway. -
restaurant-reservations/trunk/restaurant-reservations.php
r3381412 r3397414 4 4 * Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/ 5 5 * Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more. 6 * Version: 2.7. 56 * Version: 2.7.6 7 7 * Author: Five Star Plugins 8 8 * Author URI: https://www.fivestarplugins.com/ … … 59 59 60 60 // Common strings 61 define( 'RTB_VERSION', '2.7. 5' );61 define( 'RTB_VERSION', '2.7.6' ); 62 62 define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); 63 63 define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) ); … … 229 229 add_action( 'admin_init', array( $this, 'maybe_delete_older_reservations' ) ); 230 230 add_filter( 'sanitize_option_rtb-settings', array( $this, 'maybe_delete_older_reservations' ), 100 ); 231 232 // Localize settings data if booking form is loaded 233 add_action( 'wp_footer', array( $this, 'assets_footer' ), 2 ); 234 add_action( 'admin_footer', array( $this, 'assets_footer' ), 2 ); 231 235 232 236 // Handle the helper notice … … 630 634 'is_admin' => is_admin(), 631 635 'cancellation_cutoff' => $rtb_controller->settings->get_setting( 'late-cancellations' ), 636 'admin_ignore_schedule' => $rtb_controller->settings->get_setting( 'admin-ignore-schedule' ), 632 637 'admin_ignore_maximums' => $rtb_controller->settings->get_setting( 'rtb-admin-ignore-maximums' ), 633 638 'want_to_modify' => esc_html( $rtb_controller->settings->get_setting( 'label-modify-reservation' ) ), … … 743 748 } 744 749 750 /** 751 * Print out any PHP data needed for our JS to work correctly 752 * @since 2.7.6 753 */ 754 public function assets_footer() { 755 global $rtb_controller; 756 757 $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; 758 759 if ( 760 empty( $rtb_controller->display_bookings_form_rendered ) and 761 empty( $rtb_controller->form_rendered ) and 762 ( ! empty( $screen) and $screen->base != 'toplevel_page_rtb-bookings' ) 763 ) { 764 return; 765 } 766 767 $rtb_pickadate = apply_filters( 768 'rtb_pickadate_args', 769 array( 770 'date_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'date-format' ) ), 771 'time_format' => rtb_esc_js( $rtb_controller->settings->get_setting( 'time-format' ) ), 772 'disable_dates' => rtb_get_datepicker_rules(), 773 'schedule_open' => $rtb_controller->settings->get_setting( 'schedule-open' ), 774 'schedule_closed' => $rtb_controller->settings->get_setting( 'schedule-closed' ), 775 'multiple_locations_enabled' => $rtb_controller->locations->do_locations_exist(), 776 'early_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'early-bookings' ), 777 'late_bookings' => is_admin() && current_user_can( 'manage_bookings' ) ? '' : $rtb_controller->settings->get_setting( 'late-bookings' ), 778 'enable_max_reservations' => is_admin() && current_user_can( 'manage_bookings' ) ? false : $rtb_controller->settings->get_setting( 'rtb-enable-max-tables' ), 779 'max_people' => is_admin() && current_user_can( 'manage_bookings' ) ? 100 : $rtb_controller->settings->get_setting( 'rtb-max-people-count' ), 780 'enable_tables' => $rtb_controller->settings->get_setting( 'enable-tables' ), 781 'date_onload' => $rtb_controller->settings->get_setting( 'date-onload' ), 782 'time_interval' => $rtb_controller->settings->get_setting( 'time-interval' ), 783 'first_day' => $rtb_controller->settings->get_setting( 'week-start' ), 784 'allow_past' => is_admin() && current_user_can( 'manage_bookings' ), 785 'date_today_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-today' ) ), 786 'date_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-clear' ) ), 787 'date_close_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-date-close' ) ), 788 'time_clear_label' => rtb_esc_js( $rtb_controller->settings->get_setting( 'label-time-clear' ) ), 789 ) 790 ); 791 792 echo "<script type='text/javascript'>\n"; 793 echo "/* <![CDATA[ */\n"; 794 echo 'var rtb_pickadate = ' . wp_json_encode( $rtb_pickadate ) . "\n"; 795 echo "/* ]]> */\n"; 796 echo "</script>\n"; 797 798 } 799 745 800 public function maybe_display_helper_notice() { 746 801 global $rtb_controller;
Note: See TracChangeset
for help on using the changeset viewer.