PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 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 All 205 releases
← All changes | includes/page-add-booking/add_booking__modal.php +35 -6 11.2 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * Add Booking modal for Booking Listing and Timeline.
4 4 *
@@ -86,12 +86,13 @@
86 86 <div id="wpbc_modal__add_booking__body" class="wpbc_modal__add_booking__body">
87 87 <?php self::print_loading_spinner(); ?>
88 88 </div>
89 89 </div>
90 - <div class="modal-footer">
91 - <div class="wpbc_modal__add_booking__footer_time_override" data-wpbc-add-booking-time-override-footer="1"></div>
92 - <?php self::print_modal_send_emails_toggle(); ?>
93 - <a href="javascript:void(0)" id="wpbc_modal__add_booking__button_send" class="button button-primary" onclick="wpbc_boo_listing__submit__add_booking_modal();">
90 + <div class="modal-footer">
91 + <div class="wpbc_modal__add_booking__footer_time_override" data-wpbc-add-booking-time-override-footer="1"></div>
92 + <?php self::print_modal_send_emails_toggle(); ?>
93 + <?php self::print_add_appointment_entry(); ?>
94 + <a href="javascript:void(0)" id="wpbc_modal__add_booking__button_send" class="button button-primary" onclick="wpbc_boo_listing__submit__add_booking_modal();">
94 95 <?php esc_html_e( 'Add booking', 'booking' ); ?>
95 96 </a>
96 97 <a href="javascript:void(0)" class="button button-secondary" data-dismiss="modal">
97 98 <?php esc_html_e( 'Close', 'booking' ); ?>
@@ -101,9 +102,37 @@
101 102 </div><!-- /.modal-dialog -->
102 103 </div><!-- /.modal -->
103 104 </span>
104 105 <?php
105 - }
106 + }
107 +
108 +
109 + /**
110 + * Print the released route to the Service-first administrator workflow.
111 + *
112 + * The standard Add Booking form remains the popup's primary action. This
113 + * secondary route is hidden by the modal client whenever an existing booking
114 + * is being edited.
115 + *
116 + * @return void
117 + */
118 + private static function print_add_appointment_entry() {
119 + if (
120 + ! function_exists( 'wpbc_add_appointment_page_get_url' )
121 + || ! WPBC_Add_Booking_Component::current_user_can_add_booking()
122 + ) {
123 + return;
124 + }
125 + ?>
126 + <a href="<?php echo esc_url( wpbc_add_appointment_page_get_url() ); ?>"
127 + class="button button-secondary wpbc_modal__add_booking__appointment_entry"
128 + data-wpbc-add-appointment-entry="1"
129 + title="<?php esc_attr_e( 'Choose a Service and Provider before creating the booking', 'booking' ); ?>">
130 + <i class="menu_icon icon-1x wpbc-bi-calendar-plus" aria-hidden="true"></i>
131 + <?php esc_html_e( 'Add Appointment', 'booking' ); ?>
132 + </a>
133 + <?php
134 + }
106 135
107 136
108 137 /**
109 138 * Print modal-scoped email notification toggle.
@@ -250,9 +279,9 @@
250 279 * @return void
251 280 */
252 281 private static function print_modal_booking_form_edit_link() {
253 282
254 - if ( ! defined( 'WPBC_NEW_FORM_BUILDER' ) || ! WPBC_NEW_FORM_BUILDER || ! function_exists( 'wpbc_get_settings_url' ) ) {
283 + if ( ! function_exists( 'wpbc_get_settings_url' ) ) {
255 284 return;
256 285 }
257 286
258 287 $base_url = add_query_arg(