Version Description
(2021-04-21) = - Bookings that require a deposit, but which have been abandoned before the deposit was paid now show in the admin bookings table with the status Payment Pending. - Added an option to the modify/cancel booking screen on the front end to pay the deposit. This applies to bookings that have either the Payment Pending or Payment Failed status. - Added an option, for Stripe payments, to have the credit card expiry date show as one input field.
Download this release
Release Info
Developer | Rustaurius |
Plugin | Restaurant Reservations |
Version | 2.2.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.4 to 2.2.5
- assets/css/booking-form.css +30 -9
- assets/js/booking-form.js +61 -13
- assets/js/stripe-payment.js +34 -3
- includes/Ajax.class.php +17 -7
- includes/Booking.class.php +2 -2
- includes/CustomPostTypes.class.php +12 -0
- includes/Migration.class.php +174 -0
- includes/Notification.Email.class.php +20 -2
- includes/Settings.class.php +10 -0
- includes/WP_List_Table.BookingsTable.class.php +2 -2
- includes/template-functions.php +34 -27
- languages/restaurant-reservations-nl_NL.mo +0 -0
- languages/restaurant-reservations-nl_NL.po +3 -3
- readme.txt +5 -0
- restaurant-reservations.php +8 -4
assets/css/booking-form.css
CHANGED
@@ -184,7 +184,7 @@
|
|
184 |
|
185 |
|
186 |
/*CANCEL LINK*/
|
187 |
-
.rtb-
|
188 |
position: relative;
|
189 |
float: left;
|
190 |
padding: 10px 15px;
|
@@ -194,15 +194,15 @@
|
|
194 |
border-radius: 3px;
|
195 |
cursor: pointer;
|
196 |
}
|
197 |
-
label[for="rtb-
|
198 |
-
input[name="
|
199 |
float: left;
|
200 |
margin-top: 20px;
|
201 |
}
|
202 |
-
label[for="rtb-
|
203 |
margin-right: 12px;
|
204 |
}
|
205 |
-
.rtb-
|
206 |
position: relative;
|
207 |
float: left;
|
208 |
padding: 10px 15px;
|
@@ -230,14 +230,20 @@ label[for="rtb-cancellation-email"] {
|
|
230 |
color: #f24a4d;
|
231 |
background: #f24a4d47;
|
232 |
}
|
|
|
|
|
|
|
|
|
233 |
.rtb-cancel-booking {
|
234 |
-
width: 200px;
|
235 |
text-align: center;
|
236 |
padding: 10px 0;
|
237 |
background: #fe4e4e;
|
238 |
color: #fff;
|
239 |
cursor: pointer;
|
240 |
display: inline-block;
|
|
|
|
|
|
|
241 |
}
|
242 |
.rtb-cancel-booking:hover {
|
243 |
background: #ff6b6b;
|
@@ -246,10 +252,25 @@ label[for="rtb-cancellation-email"] {
|
|
246 |
.rtb-cancel-booking.cancelled {
|
247 |
background: #24b124;
|
248 |
}
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
padding: 10px 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
display: inline-block;
|
254 |
}
|
255 |
|
184 |
|
185 |
|
186 |
/*CANCEL LINK*/
|
187 |
+
.rtb-modification-toggle {
|
188 |
position: relative;
|
189 |
float: left;
|
190 |
padding: 10px 15px;
|
194 |
border-radius: 3px;
|
195 |
cursor: pointer;
|
196 |
}
|
197 |
+
label[for="rtb-modification-email"],
|
198 |
+
input[name="modification"] {
|
199 |
float: left;
|
200 |
margin-top: 20px;
|
201 |
}
|
202 |
+
label[for="rtb-modification-email"] {
|
203 |
margin-right: 12px;
|
204 |
}
|
205 |
+
.rtb-find-reservation-button {
|
206 |
position: relative;
|
207 |
float: left;
|
208 |
padding: 10px 15px;
|
230 |
color: #f24a4d;
|
231 |
background: #f24a4d47;
|
232 |
}
|
233 |
+
.rtb-cancel-booking-div *:not(:first-child) {
|
234 |
+
margin-left: -5px;
|
235 |
+
}
|
236 |
+
|
237 |
.rtb-cancel-booking {
|
|
|
238 |
text-align: center;
|
239 |
padding: 10px 0;
|
240 |
background: #fe4e4e;
|
241 |
color: #fff;
|
242 |
cursor: pointer;
|
243 |
display: inline-block;
|
244 |
+
max-width: 100px;
|
245 |
+
min-width: 100px;
|
246 |
+
width: 100%;
|
247 |
}
|
248 |
.rtb-cancel-booking:hover {
|
249 |
background: #ff6b6b;
|
252 |
.rtb-cancel-booking.cancelled {
|
253 |
background: #24b124;
|
254 |
}
|
255 |
+
|
256 |
+
.rtb-deposit-booking {
|
257 |
+
text-align: center;
|
258 |
padding: 10px 0;
|
259 |
+
background: green;
|
260 |
+
color: #fff;
|
261 |
+
cursor: pointer;
|
262 |
+
display: inline-block;
|
263 |
+
max-width: 100px;
|
264 |
+
min-width: 100px;
|
265 |
+
width: 100%;
|
266 |
+
}
|
267 |
+
.rtb-deposit-booking:hover {
|
268 |
+
background: #008000cf;
|
269 |
+
color: #fff;
|
270 |
+
}
|
271 |
+
|
272 |
+
.rtb-booking-information {
|
273 |
+
padding-left: 5px;
|
274 |
display: inline-block;
|
275 |
}
|
276 |
|
assets/js/booking-form.js
CHANGED
@@ -593,38 +593,57 @@ jQuery(document).ready(function ($) {
|
|
593 |
rtb_booking_form.init();
|
594 |
});
|
595 |
|
596 |
-
//Handle reservation
|
597 |
jQuery(document).ready(function() {
|
598 |
-
jQuery('.rtb-
|
599 |
-
jQuery('.rtb-
|
600 |
|
601 |
-
if (jQuery('.rtb-
|
602 |
-
jQuery('.rtb-
|
603 |
}
|
604 |
else {
|
605 |
-
jQuery('.rtb-
|
606 |
}
|
607 |
});
|
608 |
|
609 |
-
jQuery(
|
610 |
-
var booking_email = jQuery('input[name="
|
611 |
|
612 |
var data = 'booking_email=' + booking_email + '&action=rtb_find_reservations';
|
613 |
-
jQuery.post(ajaxurl, data, function(response) {
|
614 |
|
615 |
if (response.success) {
|
616 |
var booking_html = '';
|
|
|
|
|
617 |
|
618 |
jQuery(response.data.bookings).each(function( index, val) {
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
});
|
624 |
|
625 |
jQuery('.rtb-bookings-results').html(booking_html);
|
626 |
|
627 |
cancellationHandler();
|
|
|
628 |
}
|
629 |
else {jQuery('.rtb-bookings-results').html(response.data.msg);}
|
630 |
});
|
@@ -671,6 +690,35 @@ function cancellationHandler() {
|
|
671 |
});
|
672 |
}
|
673 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
// Functions for the 'View Bookings' shortcode
|
675 |
jQuery(document).ready(function ($) {
|
676 |
jQuery('.rtb-view-bookings-form-date-selector').on('change', function() {
|
593 |
rtb_booking_form.init();
|
594 |
});
|
595 |
|
596 |
+
//Handle reservation modification
|
597 |
jQuery(document).ready(function() {
|
598 |
+
jQuery('.rtb-modification-toggle').on('click', function() {
|
599 |
+
jQuery('.rtb-modification-form, .rtb-booking-form-form').toggleClass('rtb-hidden');
|
600 |
|
601 |
+
if (jQuery('.rtb-modification-form').hasClass('rtb-hidden')) {
|
602 |
+
jQuery('.rtb-modification-toggle').html(rtb_booking_form_js_localize.want_to_modify);
|
603 |
}
|
604 |
else {
|
605 |
+
jQuery('.rtb-modification-toggle').html(rtb_booking_form_js_localize.make);
|
606 |
}
|
607 |
});
|
608 |
|
609 |
+
jQuery(document).on('click', '.rtb-find-reservation-button', function() {
|
610 |
+
var booking_email = jQuery('input[name="rtb_modification_email"]').val();
|
611 |
|
612 |
var data = 'booking_email=' + booking_email + '&action=rtb_find_reservations';
|
613 |
+
jQuery.post(ajaxurl, data, function(response) {
|
614 |
|
615 |
if (response.success) {
|
616 |
var booking_html = '';
|
617 |
+
var guest_txt = '';
|
618 |
+
var pay_btn = '';
|
619 |
|
620 |
jQuery(response.data.bookings).each(function( index, val) {
|
621 |
+
pay_btn = '';
|
622 |
+
guest_txt = val.party > 1 ? rtb_booking_form_js_localize.guests : rtb_booking_form_js_localize.guest;
|
623 |
+
|
624 |
+
if('payment_pending' == val.status || 'payment_failed' == val.status) {
|
625 |
+
pay_btn = `
|
626 |
+
<div class="rtb-deposit-booking" data-bookingid="${val.ID}" data-bookingemail="${val.email}">
|
627 |
+
${rtb_booking_form_js_localize.deposit}
|
628 |
+
</div>
|
629 |
+
`;
|
630 |
+
}
|
631 |
+
|
632 |
+
booking_html += `
|
633 |
+
<div class="rtb-cancel-booking-div">
|
634 |
+
<div class="rtb-cancel-booking" data-bookingid="${val.ID}" data-bookingemail="${val.email}">
|
635 |
+
${rtb_booking_form_js_localize.cancel}
|
636 |
+
</div>
|
637 |
+
${pay_btn}
|
638 |
+
<div class="rtb-booking-information">${val.datetime} - ${val.party} ${guest_txt} (${val.status_lbl})</div>
|
639 |
+
</div>
|
640 |
+
`;
|
641 |
});
|
642 |
|
643 |
jQuery('.rtb-bookings-results').html(booking_html);
|
644 |
|
645 |
cancellationHandler();
|
646 |
+
delayedPaymentHandler();
|
647 |
}
|
648 |
else {jQuery('.rtb-bookings-results').html(response.data.msg);}
|
649 |
});
|
690 |
});
|
691 |
}
|
692 |
|
693 |
+
function delayedPaymentHandler() {
|
694 |
+
jQuery('.rtb-deposit-booking').off('click');
|
695 |
+
jQuery('.rtb-deposit-booking').on('click', function() {
|
696 |
+
var btn = jQuery(this);
|
697 |
+
|
698 |
+
if(btn.hasClass('processing')) {
|
699 |
+
return;
|
700 |
+
}
|
701 |
+
|
702 |
+
btn.addClass('processing');
|
703 |
+
|
704 |
+
var booking_id = btn.data('bookingid');
|
705 |
+
var booking_email = btn.data('bookingemail');
|
706 |
+
|
707 |
+
var data = {
|
708 |
+
'booking_id': booking_id,
|
709 |
+
'booking_email': booking_email,
|
710 |
+
'payment': 'rtb-delayed-deposit'
|
711 |
+
};
|
712 |
+
|
713 |
+
let current_loc = window.location;
|
714 |
+
let params = new URLSearchParams();
|
715 |
+
Object.keys( data ).map( function( param ) { params.append( param, data[ param ] ) } );
|
716 |
+
|
717 |
+
window.location = current_loc.origin + current_loc.pathname + '?' + params.toString();
|
718 |
+
|
719 |
+
});
|
720 |
+
}
|
721 |
+
|
722 |
// Functions for the 'View Bookings' shortcode
|
723 |
jQuery(document).ready(function ($) {
|
724 |
jQuery('.rtb-view-bookings-form-date-selector').on('change', function() {
|
assets/js/stripe-payment.js
CHANGED
@@ -17,17 +17,48 @@ function stripeResponseHandler(status, response) {
|
|
17 |
form$.get(0).submit();
|
18 |
}
|
19 |
}
|
|
|
20 |
jQuery(document).ready(function($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
$("#stripe-payment-form").submit(function(event) {
|
22 |
// disable the submit button to prevent repeated clicks
|
23 |
$('#stripe-submit').attr("disabled", "disabled");
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
// send the card details to Stripe
|
26 |
Stripe.createToken({
|
27 |
number: $('input[data-stripe="card_number"]').val(),
|
28 |
cvc: $('input[data-stripe="card_cvc"]').val(),
|
29 |
-
exp_month:
|
30 |
-
exp_year:
|
31 |
currency: $('input[data-stripe="currency"]').val()
|
32 |
}, stripeResponseHandler);
|
33 |
|
17 |
form$.get(0).submit();
|
18 |
}
|
19 |
}
|
20 |
+
|
21 |
jQuery(document).ready(function($) {
|
22 |
+
|
23 |
+
$('#stripe-payment-form .single-masked').on('keyup', function (ev) {
|
24 |
+
let value = $(this).val();
|
25 |
+
|
26 |
+
if ( /\//.test(value) ) {
|
27 |
+
value = value.replace( /(\/)+/, '/' );
|
28 |
+
}
|
29 |
+
|
30 |
+
if(value.length > 2 && !/\//.test(value)) {
|
31 |
+
value = value.split('');
|
32 |
+
value.splice(2, 0, '/');
|
33 |
+
value = value.join('');
|
34 |
+
}
|
35 |
+
|
36 |
+
$(this).val(value);
|
37 |
+
});
|
38 |
+
|
39 |
$("#stripe-payment-form").submit(function(event) {
|
40 |
// disable the submit button to prevent repeated clicks
|
41 |
$('#stripe-submit').attr("disabled", "disabled");
|
42 |
+
|
43 |
+
let exp_month, exp_year;
|
44 |
+
|
45 |
+
let single_field = $('#stripe-payment-form .single-masked').length;
|
46 |
+
if(single_field) {
|
47 |
+
let data = $('#stripe-payment-form .single-masked').val().split('/');
|
48 |
+
exp_month = data[0];
|
49 |
+
exp_year = data[1];
|
50 |
+
}
|
51 |
+
else {
|
52 |
+
exp_month = $('input[data-stripe="exp_month"]').val();
|
53 |
+
exp_year = $('input[data-stripe="exp_year"]').val();
|
54 |
+
}
|
55 |
+
|
56 |
// send the card details to Stripe
|
57 |
Stripe.createToken({
|
58 |
number: $('input[data-stripe="card_number"]').val(),
|
59 |
cvc: $('input[data-stripe="card_cvc"]').val(),
|
60 |
+
exp_month: exp_month,
|
61 |
+
exp_year: exp_year,
|
62 |
currency: $('input[data-stripe="currency"]').val()
|
63 |
}, stripeResponseHandler);
|
64 |
|
includes/Ajax.class.php
CHANGED
@@ -64,7 +64,7 @@ if ( !class_exists( 'rtbAJAX' ) ) {
|
|
64 |
* @since 2.1.0
|
65 |
*/
|
66 |
public function get_reservations() {
|
67 |
-
global $wpdb;
|
68 |
|
69 |
$email = isset($_POST['booking_email']) ? sanitize_email( $_POST['booking_email'] ) : '';
|
70 |
|
@@ -77,20 +77,30 @@ if ( !class_exists( 'rtbAJAX' ) ) {
|
|
77 |
);
|
78 |
}
|
79 |
|
|
|
|
|
80 |
require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
|
81 |
|
82 |
$bookings = array();
|
83 |
-
$booking_ids = $wpdb->get_results(
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
foreach ( $booking_ids as $booking_id ) {
|
85 |
$booking = new rtbBooking();
|
86 |
if ( $booking->load_post( $booking_id->post_id ) ) {
|
87 |
$booking_date = (new DateTime($booking->date, wp_timezone()))->format('U');
|
88 |
-
if ( (
|
89 |
$bookings[] = array(
|
90 |
-
'ID'
|
91 |
-
'email'
|
92 |
-
'datetime'
|
93 |
-
'party'
|
|
|
|
|
94 |
);
|
95 |
}
|
96 |
}
|
64 |
* @since 2.1.0
|
65 |
*/
|
66 |
public function get_reservations() {
|
67 |
+
global $wpdb, $rtb_controller;
|
68 |
|
69 |
$email = isset($_POST['booking_email']) ? sanitize_email( $_POST['booking_email'] ) : '';
|
70 |
|
77 |
);
|
78 |
}
|
79 |
|
80 |
+
$booking_status_lbls = $rtb_controller->cpts->booking_statuses;
|
81 |
+
|
82 |
require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
|
83 |
|
84 |
$bookings = array();
|
85 |
+
$booking_ids = $wpdb->get_results(
|
86 |
+
$wpdb->prepare("
|
87 |
+
SELECT `post_id` FROM `{$wpdb->postmeta}` WHERE `meta_key` = 'rtb' AND `meta_value` LIKE %s",
|
88 |
+
'%' . sanitize_email( $email ) . '%'
|
89 |
+
)
|
90 |
+
);
|
91 |
+
|
92 |
foreach ( $booking_ids as $booking_id ) {
|
93 |
$booking = new rtbBooking();
|
94 |
if ( $booking->load_post( $booking_id->post_id ) ) {
|
95 |
$booking_date = (new DateTime($booking->date, wp_timezone()))->format('U');
|
96 |
+
if ( in_array($booking->post_status, ['pending', 'payment_pending', 'payment_failed', 'confirmed'] ) and time() < $booking_date ) {
|
97 |
$bookings[] = array(
|
98 |
+
'ID' => $booking->ID,
|
99 |
+
'email' => $booking->email,
|
100 |
+
'datetime' => $booking->format_date( $booking->date ),
|
101 |
+
'party' => $booking->party,
|
102 |
+
'status' => $booking->post_status,
|
103 |
+
'status_lbl' => $booking_status_lbls[$booking->post_status]['label']
|
104 |
);
|
105 |
}
|
106 |
}
|
includes/Booking.class.php
CHANGED
@@ -904,7 +904,7 @@ class rtbBooking {
|
|
904 |
|
905 |
// This is an intermediate status when payment is pending
|
906 |
if ( $rtb_controller->settings->get_setting( 'require-deposit' ) ) {
|
907 |
-
$valid_status = array_merge($valid_status, ['
|
908 |
}
|
909 |
|
910 |
$args = array_merge(
|
@@ -1064,7 +1064,7 @@ class rtbBooking {
|
|
1064 |
if ( !empty( $_POST['rtb-post-status'] ) && array_key_exists( $_POST['rtb-post-status'], $rtb_controller->cpts->booking_statuses ) ) {
|
1065 |
$post_status = sanitize_text_field( stripslashes_deep( $_POST['rtb-post-status'] ) );
|
1066 |
} elseif ( $rtb_controller->settings->get_setting( 'require-deposit' ) and ! $payment_made ) {
|
1067 |
-
$post_status = '
|
1068 |
} elseif ( $this->party < $rtb_controller->settings->get_setting( 'auto-confirm-max-party-size' ) ) {
|
1069 |
$post_status = 'confirmed';
|
1070 |
} elseif ($rtb_controller->settings->get_setting( 'auto-confirm-max-reservations' ) and $this->under_max_confirm_reservations() ) {
|
904 |
|
905 |
// This is an intermediate status when payment is pending
|
906 |
if ( $rtb_controller->settings->get_setting( 'require-deposit' ) ) {
|
907 |
+
$valid_status = array_merge($valid_status, ['payment_pending']);
|
908 |
}
|
909 |
|
910 |
$args = array_merge(
|
1064 |
if ( !empty( $_POST['rtb-post-status'] ) && array_key_exists( $_POST['rtb-post-status'], $rtb_controller->cpts->booking_statuses ) ) {
|
1065 |
$post_status = sanitize_text_field( stripslashes_deep( $_POST['rtb-post-status'] ) );
|
1066 |
} elseif ( $rtb_controller->settings->get_setting( 'require-deposit' ) and ! $payment_made ) {
|
1067 |
+
$post_status = 'payment_pending';
|
1068 |
} elseif ( $this->party < $rtb_controller->settings->get_setting( 'auto-confirm-max-party-size' ) ) {
|
1069 |
$post_status = 'confirmed';
|
1070 |
} elseif ($rtb_controller->settings->get_setting( 'auto-confirm-max-reservations' ) and $this->under_max_confirm_reservations() ) {
|
includes/CustomPostTypes.class.php
CHANGED
@@ -223,6 +223,18 @@ class rtbCustomPostTypes {
|
|
223 |
'show_in_admin_status_list' => true,
|
224 |
'label_count' => _n_noop( 'Payment Failed <span class="count">(%s)</span>', 'Payment Failed <span class="count">(%s)</span>', 'restaurant-reservations' )
|
225 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
}
|
227 |
|
228 |
return $booking_statuses;
|
223 |
'show_in_admin_status_list' => true,
|
224 |
'label_count' => _n_noop( 'Payment Failed <span class="count">(%s)</span>', 'Payment Failed <span class="count">(%s)</span>', 'restaurant-reservations' )
|
225 |
);
|
226 |
+
|
227 |
+
// This is an intermediate status when payment is pending
|
228 |
+
$booking_statuses['payment_pending'] = array(
|
229 |
+
'label' => _x( 'Payment Pending', 'The guest has booked but payment is pending', 'restaurant-reservations' ),
|
230 |
+
'default' => false, // Whether or not this status is part of WP Core
|
231 |
+
'user_selectable' => false, // Whether or not a user can set a booking to this status
|
232 |
+
'public' => false,
|
233 |
+
'exclude_from_search' => true,
|
234 |
+
'show_in_admin_all_list' => true,
|
235 |
+
'show_in_admin_status_list' => true,
|
236 |
+
'label_count' => _n_noop( 'Payment Pending <span class="count">(%s)</span>', 'Payment Pending <span class="count">(%s)</span>', 'restaurant-reservations' )
|
237 |
+
);
|
238 |
}
|
239 |
|
240 |
return $booking_statuses;
|
includes/Migration.class.php
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
3 |
+
|
4 |
+
if ( !class_exists( 'rtbMigrationManager' ) ) {
|
5 |
+
/**
|
6 |
+
* Class to handle post update migrations for Restaurant Reservations
|
7 |
+
*
|
8 |
+
* @since 2.2.4
|
9 |
+
*/
|
10 |
+
class rtbMigrationManager {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Available migrations
|
14 |
+
* @since 2.2.4
|
15 |
+
*/
|
16 |
+
public $migrations;
|
17 |
+
/*
|
18 |
+
$migrations[2.2.4] => 'callback_function';
|
19 |
+
$migrations[2.2.4] => array('ClassName', 'callback_function');
|
20 |
+
$migrations[2.2.5] => array($this, 'callback_function');
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Already processed migrations, loaded from wp_options
|
25 |
+
* @since 2.2.4
|
26 |
+
*/
|
27 |
+
public $processed_migrations = array();
|
28 |
+
|
29 |
+
private $processed_migrations_key = 'rtb_processed_migrations';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* To load the current migration
|
33 |
+
* @since 2.2.4
|
34 |
+
*/
|
35 |
+
public $current_version = RTB_VERSION;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Current migration callable
|
39 |
+
* @since 2.2.4
|
40 |
+
*/
|
41 |
+
public $current_migration = null;
|
42 |
+
|
43 |
+
public function __construct()
|
44 |
+
{
|
45 |
+
|
46 |
+
$this->load_available_migrations();
|
47 |
+
|
48 |
+
$this->load_current_migration();
|
49 |
+
|
50 |
+
$this->load_processed_migrations();
|
51 |
+
|
52 |
+
$this->process_migration();
|
53 |
+
|
54 |
+
$this->save_processed_migrations();
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Add new migration with version number as key and callback function as value
|
59 |
+
* @return array
|
60 |
+
*/
|
61 |
+
public function load_available_migrations()
|
62 |
+
{
|
63 |
+
$this->migrations = array(
|
64 |
+
'2.2.5.pre-release' => array('rtbMigrationManager', 'migration_2_2_3')
|
65 |
+
);
|
66 |
+
}
|
67 |
+
|
68 |
+
public function load_current_migration()
|
69 |
+
{
|
70 |
+
if( isset( $this->migrations[$this->current_version] ) ) {
|
71 |
+
$this->current_migration = $this->migrations[$this->current_version];
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get all processed migrations from DB to prevent migration execution on every request
|
77 |
+
* @return void
|
78 |
+
*/
|
79 |
+
public function load_processed_migrations()
|
80 |
+
{
|
81 |
+
$this->processed_migrations = get_option( $this->processed_migrations_key, [] );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Run migration function here
|
86 |
+
* @return void
|
87 |
+
*/
|
88 |
+
public function process_migration()
|
89 |
+
{
|
90 |
+
if( $this->migration_exist() && ! $this->is_current_migration_processed() )
|
91 |
+
{
|
92 |
+
try
|
93 |
+
{
|
94 |
+
call_user_func($this->current_migration);
|
95 |
+
|
96 |
+
$this->mark_current_as_processed();
|
97 |
+
}
|
98 |
+
catch(Exception $ex)
|
99 |
+
{
|
100 |
+
error_log('RTB migration execution error for version: '.$this->current_version);
|
101 |
+
|
102 |
+
if(defined('WP_DEBUG') && WP_DEBUG)
|
103 |
+
{
|
104 |
+
error_log(
|
105 |
+
'RTB migration execution callback: '
|
106 |
+
.json_encode( (array) $this->current_migration )
|
107 |
+
);
|
108 |
+
|
109 |
+
error_log(
|
110 |
+
'RTB migration execution Exception: '
|
111 |
+
.json_encode( (array) $ex )
|
112 |
+
);
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
public function mark_current_as_processed()
|
119 |
+
{
|
120 |
+
$this->processed_migrations[$this->current_version] = $this->current_migration;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Save the executed mogrations in the DB for future reference
|
125 |
+
* @return void
|
126 |
+
*/
|
127 |
+
public function save_processed_migrations()
|
128 |
+
{
|
129 |
+
update_option( $this->processed_migrations_key, $this->processed_migrations, true );
|
130 |
+
}
|
131 |
+
|
132 |
+
public function migration_exist()
|
133 |
+
{
|
134 |
+
if( is_callable($this->current_migration) )
|
135 |
+
{
|
136 |
+
return true;
|
137 |
+
}
|
138 |
+
|
139 |
+
return false;
|
140 |
+
}
|
141 |
+
|
142 |
+
public function is_current_migration_processed()
|
143 |
+
{
|
144 |
+
return array_key_exists( $this->current_version, $this->processed_migrations );
|
145 |
+
}
|
146 |
+
|
147 |
+
/************************* Migration callback ahead *************************/
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Changed rtb-booking post status from draft to payment_pending while booking's been created but
|
151 |
+
* the pyment is yet to be paid. Update all existing rtb-boolking post with status draft to
|
152 |
+
* payment_pendiund This change will let admin check and process/delete the existing booking
|
153 |
+
* without payment and we can let the use pay if they have accidently move elsewhere before
|
154 |
+
* the patment completion.
|
155 |
+
* Currently users or admin can not do anything with the booking with status draft. If same
|
156 |
+
* booking needs to be made again, at least name or phone number or email needed to be cahgned
|
157 |
+
* for the asme slot otherwise validation will fail statung duplicate booking
|
158 |
+
*/
|
159 |
+
public function migration_2_2_3()
|
160 |
+
{
|
161 |
+
global $wpdb;
|
162 |
+
|
163 |
+
$wpdb->query("
|
164 |
+
UPDATE
|
165 |
+
{$wpdb->posts}
|
166 |
+
SET
|
167 |
+
`post_status` = 'payment_pending'
|
168 |
+
WHERE
|
169 |
+
`post_status` = 'draft' AND `post_type` = 'rtb-booking'
|
170 |
+
");
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
}
|
includes/Notification.Email.class.php
CHANGED
@@ -171,8 +171,26 @@ class rtbNotificationEmail extends rtbNotification {
|
|
171 |
|
172 |
$fromEmail = apply_filters( 'rtb_notification_email_header_from_email', $rtb_controller->settings->get_setting( 'from-email-address' ) );
|
173 |
|
174 |
-
$headers = "From:
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
|
177 |
|
178 |
$this->headers = apply_filters( 'rtb_notification_email_headers', $headers, $this );
|
171 |
|
172 |
$fromEmail = apply_filters( 'rtb_notification_email_header_from_email', $rtb_controller->settings->get_setting( 'from-email-address' ) );
|
173 |
|
174 |
+
$headers = "From: =?UTF-8?Q?" .
|
175 |
+
quoted_printable_encode(
|
176 |
+
html_entity_decode(
|
177 |
+
$rtb_controller->settings->get_setting( 'reply-to-name' ),
|
178 |
+
ENT_QUOTES,
|
179 |
+
'UTF-8'
|
180 |
+
)
|
181 |
+
) .
|
182 |
+
"?= <" . $fromEmail . ">\r\n";
|
183 |
+
|
184 |
+
$headers .= "Reply-To: =?UTF-8?Q?" .
|
185 |
+
quoted_printable_encode(
|
186 |
+
html_entity_decode(
|
187 |
+
$this->from_name,
|
188 |
+
ENT_QUOTES,
|
189 |
+
'UTF-8'
|
190 |
+
)
|
191 |
+
) .
|
192 |
+
"?= <" . $this->from_email . ">\r\n";
|
193 |
+
|
194 |
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
|
195 |
|
196 |
$this->headers = apply_filters( 'rtb_notification_email_headers', $headers, $this );
|
includes/Settings.class.php
CHANGED
@@ -2187,6 +2187,16 @@ If you were not the one to cancel this booking, please contact us.
|
|
2187 |
'placeholder' => $this->defaults['rtb-stripe-currency-symbol']
|
2188 |
)
|
2189 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2190 |
$sap->add_setting(
|
2191 |
'rtb-settings',
|
2192 |
'rtb-stripe-payment',
|
2187 |
'placeholder' => $this->defaults['rtb-stripe-currency-symbol']
|
2188 |
)
|
2189 |
);
|
2190 |
+
$sap->add_setting(
|
2191 |
+
'rtb-settings',
|
2192 |
+
'rtb-stripe-payment',
|
2193 |
+
'toggle',
|
2194 |
+
array(
|
2195 |
+
'id' => 'rtb-expiration-field-single',
|
2196 |
+
'title' => __( 'CC Expiration Single Field', 'restaurant-reservations' ),
|
2197 |
+
'description' => __( 'Should the field for card expiry details be a single field with a mask or two separate fields for month and year?', 'restaurant-reservations' )
|
2198 |
+
)
|
2199 |
+
);
|
2200 |
$sap->add_setting(
|
2201 |
'rtb-settings',
|
2202 |
'rtb-stripe-payment',
|
includes/WP_List_Table.BookingsTable.class.php
CHANGED
@@ -145,7 +145,7 @@ class rtbBookingsTable extends WP_List_Table {
|
|
145 |
$this->base_url = admin_url( 'admin.php?page=' . RTB_BOOKING_POST_TYPE );
|
146 |
|
147 |
// Add default items to the details column if they've been hidden
|
148 |
-
|
149 |
}
|
150 |
|
151 |
/**
|
@@ -915,7 +915,7 @@ class rtbBookingsTable extends WP_List_Table {
|
|
915 |
|
916 |
global $wpdb;
|
917 |
|
918 |
-
$where = "WHERE p.post_type = '" . RTB_BOOKING_POST_TYPE . "' AND p.post_status != '
|
919 |
|
920 |
if ( $this->filter_start_date !== null || $this->filter_end_date !== null ) {
|
921 |
|
145 |
$this->base_url = admin_url( 'admin.php?page=' . RTB_BOOKING_POST_TYPE );
|
146 |
|
147 |
// Add default items to the details column if they've been hidden
|
148 |
+
add_filter( 'rtb_bookings_table_column_details', array( $this, 'add_details_column_items' ), 10, 2 );
|
149 |
}
|
150 |
|
151 |
/**
|
915 |
|
916 |
global $wpdb;
|
917 |
|
918 |
+
$where = "WHERE p.post_type = '" . RTB_BOOKING_POST_TYPE . "' AND p.post_status != 'payment_pending'";
|
919 |
|
920 |
if ( $this->filter_start_date !== null || $this->filter_end_date !== null ) {
|
921 |
|
includes/template-functions.php
CHANGED
@@ -146,7 +146,7 @@ function rtb_print_booking_form( $args = array() ) {
|
|
146 |
rtb_process_stripe_payment();
|
147 |
|
148 |
elseif ( $rtb_controller->request->request_inserted === true or isset($_GET['payment']) ) :
|
149 |
-
if ( isset($_GET['payment']) ) { ?>
|
150 |
<div class="rtb-message">
|
151 |
<p><?php printf( __( 'Your reservation deposit payment has failed with the following message "%s" Please contact the site administrator for assistance.', 'restaurant-reservations' ), isset( $_GET['error_code'] ) ? esc_html( urldecode( $_GET['error_code'] ) ) : ' unknown error.' ); ?></p>
|
152 |
</div>
|
@@ -161,14 +161,14 @@ function rtb_print_booking_form( $args = array() ) {
|
|
161 |
<?php else : ?>
|
162 |
|
163 |
<?php if ( $rtb_controller->settings->get_setting( 'allow-cancellations' ) ) : ?>
|
164 |
-
<div class="rtb-
|
165 |
<div class="rtb-clear"></div>
|
166 |
-
<form class="rtb-
|
167 |
-
<div><?php _e( 'Use the form below to
|
168 |
-
<label for="rtb-
|
169 |
-
<input type="email" name="
|
170 |
<div class="rtb-clear"></div>
|
171 |
-
<div class="rtb-
|
172 |
<div class="rtb-clear"></div>
|
173 |
<div class="rtb-bookings-results"></div>
|
174 |
</form>
|
@@ -260,12 +260,16 @@ function rtb_print_payment_form( $args = array() ) {
|
|
260 |
$booking_page = get_permalink( $booking_page );
|
261 |
}
|
262 |
|
|
|
|
|
|
|
|
|
263 |
if ( $rtb_controller->settings->get_setting( 'rtb-payment-gateway' ) == "paypal" ) { ?>
|
264 |
<form action='https://www.paypal.com/cgi-bin/webscr' method='post' class='standard-form'>
|
265 |
<input type='hidden' name='item_name_1' value='<?php echo substr(get_bloginfo('name'), 0, 100); ?> Reservation Deposit' />
|
266 |
-
<input type='hidden' name='custom' value='booking_id=<?php echo $
|
267 |
<input type='hidden' name='quantity_1' value='1' />
|
268 |
-
<input type='hidden' name='amount_1' value='<?php echo $
|
269 |
<input type='hidden' name='cmd' value='_cart' />
|
270 |
<input type='hidden' name='upload' value='1' />
|
271 |
<input type='hidden' name='business' value='<?php echo $rtb_controller->settings->get_setting( 'rtb-paypal-email' ); ?>' />
|
@@ -288,13 +292,18 @@ function rtb_print_payment_form( $args = array() ) {
|
|
288 |
)
|
289 |
);
|
290 |
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
$
|
|
|
|
|
|
|
|
|
|
|
296 |
?>
|
297 |
-
|
298 |
<h2><?php echo __('Deposit Required: ', 'restaurant-reservations' ) . $payment_amount; ?></h2>
|
299 |
|
300 |
<div class='payment-errors'></div>
|
@@ -310,9 +319,7 @@ function rtb_print_payment_form( $args = array() ) {
|
|
310 |
</div>
|
311 |
<div class='form-row'>
|
312 |
<label><?php _e('Expiration (MM/YYYY)', 'restaurant-reservations'); ?></label>
|
313 |
-
|
314 |
-
<span> / </span>
|
315 |
-
<input type='text' size='4' data-stripe='exp_year'/>
|
316 |
</div>
|
317 |
<input type='hidden' name='action' value='rtb_stripe_booking_payment'/>
|
318 |
<input type='hidden' name='currency' value='<?php echo $rtb_controller->settings->get_setting( 'rtb-currency' ); ?>' data-stripe='currency' />
|
@@ -645,7 +652,7 @@ function rtb_print_view_bookings_form( $args = array() ) {
|
|
645 |
</div>
|
646 |
<div class='rtb-view-bookings-form-confirmation-background-div rtb-hidden'></div>
|
647 |
|
648 |
-
|
649 |
<thead>
|
650 |
<tr>
|
651 |
<?php if ( $rtb_controller->settings->get_setting( 'view-bookings-arrivals' ) ) {?> <th><?php _e('Arrived', 'restaurant-reservations'); ?></th><?php } ?>
|
@@ -1163,14 +1170,14 @@ if ( !function_exists( 'rtb_add_custom_styling' ) ) {
|
|
1163 |
if ( $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-background-hover-color') != '' ) { $styling .= '.rtb-booking-form form button:hover { background-color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-background-hover-color') . ' !important; border-color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-background-hover-color') . ' !important; }'; }
|
1164 |
if ( $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-color') != '' ) { $styling .= '.rtb-booking-form form button { color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-color') . ' !important; }'; }
|
1165 |
if ( $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-hover-color') != '' ) { $styling .= '.rtb-booking-form form button:hover { color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-hover-color') . ' !important; }'; }
|
1166 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-background-color') != '' ) { $styling .= '.rtb-
|
1167 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-background-hover-color') != '' ) { $styling .= '.rtb-
|
1168 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-text-color') != '' ) { $styling .= '.rtb-
|
1169 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-text-hover-color') != '' ) { $styling .= '.rtb-
|
1170 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-background-color') != '' ) { $styling .= '.rtb-
|
1171 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-background-hover-color') != '' ) { $styling .= '.rtb-
|
1172 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-text-color') != '' ) { $styling .= '.rtb-
|
1173 |
-
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-text-hover-color') != '' ) { $styling .= '.rtb-
|
1174 |
$styling .= '</style>';
|
1175 |
return $styling;
|
1176 |
}
|
146 |
rtb_process_stripe_payment();
|
147 |
|
148 |
elseif ( $rtb_controller->request->request_inserted === true or isset($_GET['payment']) ) :
|
149 |
+
if ( isset($_GET['payment']) && 'rtb-delayed-deposit' != $_GET['payment'] ) { ?>
|
150 |
<div class="rtb-message">
|
151 |
<p><?php printf( __( 'Your reservation deposit payment has failed with the following message "%s" Please contact the site administrator for assistance.', 'restaurant-reservations' ), isset( $_GET['error_code'] ) ? esc_html( urldecode( $_GET['error_code'] ) ) : ' unknown error.' ); ?></p>
|
152 |
</div>
|
161 |
<?php else : ?>
|
162 |
|
163 |
<?php if ( $rtb_controller->settings->get_setting( 'allow-cancellations' ) ) : ?>
|
164 |
+
<div class="rtb-modification-toggle"><?php _e( 'Want to modify your reservation?', 'restaurant-reservations' ); ?></div>
|
165 |
<div class="rtb-clear"></div>
|
166 |
+
<form class="rtb-modification-form rtb-hidden">
|
167 |
+
<div><?php _e( 'Use the form below to modify your reservation', 'restaurant-reservations' ); ?></div>
|
168 |
+
<label for="rtb-modification-email"><?php _e( 'Email:', 'restaurant-reservations' ); ?></label>
|
169 |
+
<input type="email" name="rtb_modification_email" />
|
170 |
<div class="rtb-clear"></div>
|
171 |
+
<div class="rtb-find-reservation-button"><?php _e( 'Find Reservations', 'restaurant-reservations' ); ?></div>
|
172 |
<div class="rtb-clear"></div>
|
173 |
<div class="rtb-bookings-results"></div>
|
174 |
</form>
|
260 |
$booking_page = get_permalink( $booking_page );
|
261 |
}
|
262 |
|
263 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
|
264 |
+
$booking = new rtbBooking();
|
265 |
+
$booking->load_post( isset( $_GET['booking_id'] ) ? intval( $_GET['booking_id'] ) : $rtb_controller->request->ID );
|
266 |
+
|
267 |
if ( $rtb_controller->settings->get_setting( 'rtb-payment-gateway' ) == "paypal" ) { ?>
|
268 |
<form action='https://www.paypal.com/cgi-bin/webscr' method='post' class='standard-form'>
|
269 |
<input type='hidden' name='item_name_1' value='<?php echo substr(get_bloginfo('name'), 0, 100); ?> Reservation Deposit' />
|
270 |
+
<input type='hidden' name='custom' value='booking_id=<?php echo $booking->ID; ?>' />
|
271 |
<input type='hidden' name='quantity_1' value='1' />
|
272 |
+
<input type='hidden' name='amount_1' value='<?php echo $booking->calculate_deposit(); ?>' />
|
273 |
<input type='hidden' name='cmd' value='_cart' />
|
274 |
<input type='hidden' name='upload' value='1' />
|
275 |
<input type='hidden' name='business' value='<?php echo $rtb_controller->settings->get_setting( 'rtb-paypal-email' ); ?>' />
|
292 |
)
|
293 |
);
|
294 |
|
295 |
+
$payment_amount = $rtb_controller->settings->get_setting( 'rtb-currency-symbol-location' ) == 'before'
|
296 |
+
? $rtb_controller->settings->get_setting( 'rtb-stripe-currency-symbol' ) . $booking->calculate_deposit()
|
297 |
+
: $booking->calculate_deposit() . $rtb_controller->settings->get_setting( 'rtb-stripe-currency-symbol' );
|
298 |
+
|
299 |
+
$cc_exp_single_field = null != $rtb_controller->settings->get_setting( 'rtb-expiration-field-single' )
|
300 |
+
? "<input type='text' data-stripe='exp_month_year' class='single-masked'>"
|
301 |
+
: "<input type='text' size='2' data-stripe='exp_month'>
|
302 |
+
<span> / </span>
|
303 |
+
<input type='text' size='4' data-stripe='exp_year'>";
|
304 |
+
|
305 |
?>
|
306 |
+
|
307 |
<h2><?php echo __('Deposit Required: ', 'restaurant-reservations' ) . $payment_amount; ?></h2>
|
308 |
|
309 |
<div class='payment-errors'></div>
|
319 |
</div>
|
320 |
<div class='form-row'>
|
321 |
<label><?php _e('Expiration (MM/YYYY)', 'restaurant-reservations'); ?></label>
|
322 |
+
<?php echo $cc_exp_single_field; ?>
|
|
|
|
|
323 |
</div>
|
324 |
<input type='hidden' name='action' value='rtb_stripe_booking_payment'/>
|
325 |
<input type='hidden' name='currency' value='<?php echo $rtb_controller->settings->get_setting( 'rtb-currency' ); ?>' data-stripe='currency' />
|
652 |
</div>
|
653 |
<div class='rtb-view-bookings-form-confirmation-background-div rtb-hidden'></div>
|
654 |
|
655 |
+
<table class='rtb-view-bookings-table'>
|
656 |
<thead>
|
657 |
<tr>
|
658 |
<?php if ( $rtb_controller->settings->get_setting( 'view-bookings-arrivals' ) ) {?> <th><?php _e('Arrived', 'restaurant-reservations'); ?></th><?php } ?>
|
1170 |
if ( $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-background-hover-color') != '' ) { $styling .= '.rtb-booking-form form button:hover { background-color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-background-hover-color') . ' !important; border-color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-background-hover-color') . ' !important; }'; }
|
1171 |
if ( $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-color') != '' ) { $styling .= '.rtb-booking-form form button { color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-color') . ' !important; }'; }
|
1172 |
if ( $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-hover-color') != '' ) { $styling .= '.rtb-booking-form form button:hover { color: ' . $rtb_controller->settings->get_setting('rtb-styling-request-booking-button-text-hover-color') . ' !important; }'; }
|
1173 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-background-color') != '' ) { $styling .= '.rtb-modification-toggle { background-color: ' . $rtb_controller->settings->get_setting('rtb-styling-cancel-button-background-color') . ' !important; }'; }
|
1174 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-background-hover-color') != '' ) { $styling .= '.rtb-modification-toggle:hover { background-color: ' . $rtb_controller->settings->get_setting('rtb-styling-cancel-button-background-hover-color') . ' !important; }'; }
|
1175 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-text-color') != '' ) { $styling .= '.rtb-modification-toggle { color: ' . $rtb_controller->settings->get_setting('rtb-styling-cancel-button-text-color') . ' !important; }'; }
|
1176 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-cancel-button-text-hover-color') != '' ) { $styling .= '.rtb-modification-toggle:hover { color: ' . $rtb_controller->settings->get_setting('rtb-styling-cancel-button-text-hover-color') . ' !important; }'; }
|
1177 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-background-color') != '' ) { $styling .= '.rtb-find-reservation-button { background-color: ' . $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-background-color') . ' !important; }'; }
|
1178 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-background-hover-color') != '' ) { $styling .= '.rtb-find-reservation-button:hover { background-color: ' . $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-background-hover-color') . ' !important; }'; }
|
1179 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-text-color') != '' ) { $styling .= '.rtb-find-reservation-button { color: ' . $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-text-color') . ' !important; }'; }
|
1180 |
+
if ( $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-text-hover-color') != '' ) { $styling .= '.rtb-find-reservation-button:hover { color: ' . $rtb_controller->settings->get_setting('rtb-styling-find-reservations-button-text-hover-color') . ' !important; }'; }
|
1181 |
$styling .= '</style>';
|
1182 |
return $styling;
|
1183 |
}
|
languages/restaurant-reservations-nl_NL.mo
CHANGED
Binary file
|
languages/restaurant-reservations-nl_NL.po
CHANGED
@@ -3,7 +3,7 @@ msgstr ""
|
|
3 |
"Project-Id-Version: Restaurant Reservations\n"
|
4 |
"Report-Msgid-Bugs-To: https://themeofthecrop.com\n"
|
5 |
"POT-Creation-Date: 2017-06-24 21:55+0200\n"
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Dennis Heeren <dennis.heeren+po@gmail.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: nl\n"
|
@@ -18,7 +18,7 @@ msgstr ""
|
|
18 |
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
19 |
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
20 |
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
21 |
-
"X-Generator: Poedit 2.
|
22 |
"X-Loco-Target-Locale: nl_NL\n"
|
23 |
"X-Poedit-SearchPath-0: ..\n"
|
24 |
|
@@ -1087,7 +1087,7 @@ msgstr "Aantal"
|
|
1087 |
|
1088 |
#: includes/Settings.class.php:871
|
1089 |
msgid "Contact Details"
|
1090 |
-
msgstr "
|
1091 |
|
1092 |
#: includes/Settings.class.php:874
|
1093 |
#: includes/WP_List_Table.BookingsTable.class.php:360
|
3 |
"Project-Id-Version: Restaurant Reservations\n"
|
4 |
"Report-Msgid-Bugs-To: https://themeofthecrop.com\n"
|
5 |
"POT-Creation-Date: 2017-06-24 21:55+0200\n"
|
6 |
+
"PO-Revision-Date: 2021-04-01 13:31-0400\n"
|
7 |
"Last-Translator: Dennis Heeren <dennis.heeren+po@gmail.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: nl\n"
|
18 |
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
19 |
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
20 |
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
21 |
+
"X-Generator: Poedit 2.4.1\n"
|
22 |
"X-Loco-Target-Locale: nl_NL\n"
|
23 |
"X-Poedit-SearchPath-0: ..\n"
|
24 |
|
1087 |
|
1088 |
#: includes/Settings.class.php:871
|
1089 |
msgid "Contact Details"
|
1090 |
+
msgstr "Contactgegevens"
|
1091 |
|
1092 |
#: includes/Settings.class.php:874
|
1093 |
#: includes/WP_List_Table.BookingsTable.class.php:360
|
readme.txt
CHANGED
@@ -197,6 +197,11 @@ Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/
|
|
197 |
|
198 |
== Changelog ==
|
199 |
|
|
|
|
|
|
|
|
|
|
|
200 |
= 2.2.4 (2021-03-31) =
|
201 |
- Fixed an issue in which cancelled reservations were counting when calculating the maximum restrictions.
|
202 |
|
197 |
|
198 |
== Changelog ==
|
199 |
|
200 |
+
= 2.2.5 (2021-04-21) =
|
201 |
+
- Bookings that require a deposit, but which have been abandoned before the deposit was paid now show in the admin bookings table with the status Payment Pending.
|
202 |
+
- Added an option to the modify/cancel booking screen on the front end to pay the deposit. This applies to bookings that have either the Payment Pending or Payment Failed status.
|
203 |
+
- Added an option, for Stripe payments, to have the credit card expiry date show as one input field.
|
204 |
+
|
205 |
= 2.2.4 (2021-03-31) =
|
206 |
- Fixed an issue in which cancelled reservations were counting when calculating the maximum restrictions.
|
207 |
|
restaurant-reservations.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
|
4 |
* Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
|
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.2.
|
7 |
* Author: FiveStarPlugins
|
8 |
* Author URI: https://profiles.wordpress.org/fivestarplugins/
|
9 |
* Text Domain: restaurant-reservations
|
@@ -39,7 +39,7 @@ class rtbInit {
|
|
39 |
public function __construct() {
|
40 |
|
41 |
// Common strings
|
42 |
-
define( 'RTB_VERSION', '2.
|
43 |
define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
|
44 |
define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
|
45 |
define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
@@ -169,6 +169,9 @@ class rtbInit {
|
|
169 |
require_once( RTB_PLUGIN_DIR . '/includes/Compatibility.class.php' );
|
170 |
new rtbCompatibility();
|
171 |
|
|
|
|
|
|
|
172 |
}
|
173 |
|
174 |
/**
|
@@ -392,11 +395,12 @@ class rtbInit {
|
|
392 |
'rtb-booking-form',
|
393 |
'rtb_booking_form_js_localize',
|
394 |
array(
|
395 |
-
'
|
396 |
'make' => __( 'Make a reservation', 'restaurant-reservations' ),
|
397 |
'guest' => __( 'guest', 'restaurant-reservations' ),
|
398 |
'guests' => __( 'guests', 'restaurant-reservations' ),
|
399 |
-
'cancel' => __( 'Cancel', 'restaurant-reservations' )
|
|
|
400 |
)
|
401 |
);
|
402 |
}
|
3 |
* Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
|
4 |
* Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
|
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.2.5
|
7 |
* Author: FiveStarPlugins
|
8 |
* Author URI: https://profiles.wordpress.org/fivestarplugins/
|
9 |
* Text Domain: restaurant-reservations
|
39 |
public function __construct() {
|
40 |
|
41 |
// Common strings
|
42 |
+
define( 'RTB_VERSION', '2.2.5.pre-release' );
|
43 |
define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
|
44 |
define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
|
45 |
define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
169 |
require_once( RTB_PLUGIN_DIR . '/includes/Compatibility.class.php' );
|
170 |
new rtbCompatibility();
|
171 |
|
172 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Migration.class.php' );
|
173 |
+
$this->migrationManager = new rtbMigrationManager();
|
174 |
+
|
175 |
}
|
176 |
|
177 |
/**
|
395 |
'rtb-booking-form',
|
396 |
'rtb_booking_form_js_localize',
|
397 |
array(
|
398 |
+
'want_to_modify' => __( 'Want to modify your reservation?', 'restaurant-reservations' ),
|
399 |
'make' => __( 'Make a reservation', 'restaurant-reservations' ),
|
400 |
'guest' => __( 'guest', 'restaurant-reservations' ),
|
401 |
'guests' => __( 'guests', 'restaurant-reservations' ),
|
402 |
+
'cancel' => __( 'Cancel', 'restaurant-reservations' ),
|
403 |
+
'deposit' => __( 'Deposit', 'restaurant-reservations' )
|
404 |
)
|
405 |
);
|
406 |
}
|