Restaurant Reservations - Version 1.7.3

Version Description

Download this release

Release Info

Developer NateWr
Plugin Icon 128x128 Restaurant Reservations
Version 1.7.3
Comparing to
See all releases

Code changes from version 1.7.2 to 1.7.3

assets/js/booking-form.js CHANGED
@@ -44,8 +44,14 @@ jQuery(document).ready(function ($) {
44
container: 'body',
45
firstDay: rtb_pickadate.first_day,
46
47
- // Select the value when loaded if a value has been set
48
onStart: function() {
49
if ( $date_input.val() !== '' ) {
50
var date = new Date( $date_input.val() );
51
if ( Object.prototype.toString.call( date ) === "[object Date]" ) {
@@ -112,13 +118,15 @@ jQuery(document).ready(function ($) {
112
rtb_booking_form.datepicker.set( 'disable', disable_dates );
113
}
114
115
- if ( typeof rtb_pickadate.late_bookings === 'string' && rtb_pickadate.late_bookings == 'same_day' ) {
116
- rtb_booking_form.datepicker.set( 'min', 1 );
117
- } else if ( typeof rtb_pickadate.late_bookings === 'number' && rtb_pickadate.late_bookings % 1 === 0 ) {
118
- rtb_pickadate.late_bookings = parseInt( rtb_pickadate.late_bookings, 10 );
119
- if ( rtb_pickadate.late_bookings >= 1440 ) {
120
- var min = Math.floor( rtb_pickadate.late_bookings / 1440 );
121
- rtb_booking_form.datepicker.set( 'min', min );
122
}
123
}
124
@@ -178,7 +186,7 @@ jQuery(document).ready(function ($) {
178
var valid_times = [ rtb_booking_form.get_outer_time_range() ];
179
180
// Check if this date is an exception to the rules
181
- if ( typeof rtb_pickadate.schedule_closed != 'undefined' ) {
182
183
var excp_date = [];
184
var excp_start_date = [];
44
container: 'body',
45
firstDay: rtb_pickadate.first_day,
46
47
onStart: function() {
48
+
49
+ // Block dates beyond early bookings window
50
+ if ( rtb_pickadate.early_bookings !== '' ) {
51
+ this.set( 'max', parseInt( rtb_pickadate.early_bookings, 10 ) );
52
+ }
53
+
54
+ // Select the value when loaded if a value has been set
55
if ( $date_input.val() !== '' ) {
56
var date = new Date( $date_input.val() );
57
if ( Object.prototype.toString.call( date ) === "[object Date]" ) {
118
rtb_booking_form.datepicker.set( 'disable', disable_dates );
119
}
120
121
+ if ( typeof rtb_pickadate.late_bookings === 'string' ) {
122
+ if ( rtb_pickadate.late_bookings == 'same_day' ) {
123
+ rtb_booking_form.datepicker.set( 'min', 1 );
124
+ } else if ( rtb_pickadate.late_bookings !== '' ) {
125
+ rtb_pickadate.late_bookings = parseInt( rtb_pickadate.late_bookings, 10 );
126
+ if ( rtb_pickadate.late_bookings % 1 === 0 && rtb_pickadate.late_bookings >= 1440 ) {
127
+ var min = Math.floor( rtb_pickadate.late_bookings / 1440 );
128
+ rtb_booking_form.datepicker.set( 'min', min );
129
+ }
130
}
131
}
132
186
var valid_times = [ rtb_booking_form.get_outer_time_range() ];
187
188
// Check if this date is an exception to the rules
189
+ if ( typeof rtb_pickadate.schedule_closed !== 'undefined' ) {
190
191
var excp_date = [];
192
var excp_start_date = [];
includes/MultipleLocations.class.php CHANGED
@@ -185,7 +185,7 @@ if ( ! class_exists( 'rtbMultipleLocations', false ) ) {
185
}
186
187
if ( !empty( $_POST['rtb_admin_email_address'] ) ) {
188
- $email = sanitize_email( $_POST['rtb_admin_email_address'] );
189
update_term_meta( $term_id, 'rtb_admin_email_address', $email );
190
} else {
191
delete_term_meta( $term_id, 'rtb_admin_email_address' );
185
}
186
187
if ( !empty( $_POST['rtb_admin_email_address'] ) ) {
188
+ $email = sanitize_text_field( $_POST['rtb_admin_email_address'] );
189
update_term_meta( $term_id, 'rtb_admin_email_address', $email );
190
} else {
191
delete_term_meta( $term_id, 'rtb_admin_email_address' );
includes/integrations/business-profile.php CHANGED
@@ -97,7 +97,7 @@ function rtb_bp_print_booking_link( $location = false ) {
97
if ( bpfwp_get_display( 'show_booking_link' ) ) :
98
?>
99
<div class="bp-booking">
100
- <a href="<?php echo esc_url( get_permalink( $booking_page ) ); ?>"<?php if ( rtb_bp_is_schema_type_compatible( $schema_type ) ) : ?> itemprop="acceptsReservations"<?php endif; ?>><?php _e( 'Book a table', 'business-profile' ); ?></a>
101
</div>
102
<?php
103
endif;
@@ -123,10 +123,10 @@ function rtb_bp_add_booking_link_widget_option( $toggles ) {
123
if ( ! empty( $pos ) ) {
124
$a = array_slice( $toggles, 0, $pos );
125
$b = array_slice( $toggles, $pos );
126
- $toggles = array_merge( $a, array( 'show_booking_link' => __( 'Show book a table link', 'business-profile' ) ) , $b );
127
} else {
128
// If no short links are being displayed, just add it to the bottom.
129
- $toggles['show_booking_link'] = __( 'Show book a table link', 'business-profile' );
130
}
131
132
return $toggles;
97
if ( bpfwp_get_display( 'show_booking_link' ) ) :
98
?>
99
<div class="bp-booking">
100
+ <a href="<?php echo esc_url( get_permalink( $booking_page ) ); ?>"<?php if ( rtb_bp_is_schema_type_compatible( $schema_type ) ) : ?> itemprop="acceptsReservations"<?php endif; ?>><?php _e( 'Book a table', 'restaurant-reservations' ); ?></a>
101
</div>
102
<?php
103
endif;
123
if ( ! empty( $pos ) ) {
124
$a = array_slice( $toggles, 0, $pos );
125
$b = array_slice( $toggles, $pos );
126
+ $toggles = array_merge( $a, array( 'show_booking_link' => __( 'Show book a table link', 'restaurant-reservations' ) ) , $b );
127
} else {
128
// If no short links are being displayed, just add it to the bottom.
129
+ $toggles['show_booking_link'] = __( 'Show book a table link', 'restaurant-reservations' );
130
}
131
132
return $toggles;
languages/restaurant-reservations.pot CHANGED
@@ -2,9 +2,9 @@
2
# This file is distributed under the GNU General Public License v2.0 or later.
3
msgid ""
4
msgstr ""
5
- "Project-Id-Version: Restaurant Reservations 1.7.2\n"
6
"Report-Msgid-Bugs-To: https://themeofthecrop.com\n"
7
- "POT-Creation-Date: 2017-01-12 19:56:22+00:00\n"
8
"MIME-Version: 1.0\n"
9
"Content-Type: text/plain; charset=utf-8\n"
10
"Content-Transfer-Encoding: 8bit\n"
2
# This file is distributed under the GNU General Public License v2.0 or later.
3
msgid ""
4
msgstr ""
5
+ "Project-Id-Version: Restaurant Reservations 1.7.3\n"
6
"Report-Msgid-Bugs-To: https://themeofthecrop.com\n"
7
+ "POT-Creation-Date: 2017-03-02 09:22:55+00:00\n"
8
"MIME-Version: 1.0\n"
9
"Content-Type: text/plain; charset=utf-8\n"
10
"Content-Transfer-Encoding: 8bit\n"
package.json CHANGED
@@ -1,7 +1,7 @@
1
{
2
"name": "restaurant-reservations",
3
"description": "Accept restaurant reservations and bookings online.",
4
- "version": "1.7.2",
5
"author": {
6
"name": "Theme of the Crop",
7
"url": "https://themeofthecrop.com"
1
{
2
"name": "restaurant-reservations",
3
"description": "Accept restaurant reservations and bookings online.",
4
+ "version": "1.7.3",
5
"author": {
6
"name": "Theme of the Crop",
7
"url": "https://themeofthecrop.com"
readme.md CHANGED
@@ -1,20 +1,12 @@
1
# Restaurant Reservations
2
- Contributors: NateWr
3
- <br/>
4
- Author URI: https://github.com/NateWr
5
- <br/>
6
- Plugin URL: https://themeofthecrop.com
7
- <br/>
8
- Requires at Least: 4.4
9
- <br/>
10
- Tested Up To: 4.7
11
- <br/>
12
- Tags: restaurant, reservations, bookings, table bookings, restaurant reservation, table reservation
13
- <br/>
14
- Stable tag: 1.7.2
15
- <br/>
16
- License: GPLv2 or later
17
- <br/>
18
Donate link: https://themeofthecrop.com
19
20
Accept restaurant reservations and table bookings online. Quickly confirm or reject bookings, send email notifications, set booking times and more.
@@ -42,11 +34,13 @@ Accept restaurant reservations and table bookings online. Quickly confirm or rej
42
Read the [User Guide](http://doc.themeofthecrop.com/plugins/restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) for quick tips on how to get started taking reservations.
43
44
### Addons
45
- [Custom Fields for Restaurant Reservations](https://themeofthecrop.com/plugins/custom-fields-restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Add custom fields and edit your booking form with ease.
46
47
- [Export Bookings for Restaurant Reservations](https://themeofthecrop.com/plugins/export-bookings-for-restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Export your restaurant reservations to PDF and Excel/CSV files.
48
49
- [MailChimp for Restaurant Reservations](https://themeofthecrop.com/plugins/mailchimp-restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Subscribe emails from new restaurant reservations to your MailChimp mailing list.
50
51
### Developers
52
@@ -125,6 +119,12 @@ Find answers to even more questions in the [FAQ](http://doc.themeofthecrop.com/p
125
126
## Changelog
127
128
#### 1.7.2 (2017-01-12)
129
* Fix: acceptsReservations schema property sometimes didn't appear in Business Profile integration
130
* Update: improve early bookings options language. Changed "Up to X days in advance" to "From X days in advance".
@@ -332,6 +332,9 @@ Find answers to even more questions in the [FAQ](http://doc.themeofthecrop.com/p
332
333
## Upgrade Notice
334
335
#### 1.7.2
336
This minor maintenance update fixes a bug with the integration with the Business Profile plugin. It also adds the new Email Templates addon to the list of available addons.
337
1
# Restaurant Reservations
2
+ Contributors: NateWr
3
+ Author URI: https://github.com/NateWr
4
+ Plugin URL: https://themeofthecrop.com
5
+ Requires at Least: 4.4
6
+ Tested Up To: 4.7.3
7
+ Tags: restaurant, reservations, bookings, table bookings, restaurant reservation, table reservation
8
+ Stable tag: 1.7.3
9
+ License: GPLv2 or later
10
Donate link: https://themeofthecrop.com
11
12
Accept restaurant reservations and table bookings online. Quickly confirm or reject bookings, send email notifications, set booking times and more.
34
Read the [User Guide](http://doc.themeofthecrop.com/plugins/restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) for quick tips on how to get started taking reservations.
35
36
### Addons
37
+ [Custom Fields for Restaurant Reservations](https://themeofthecrop.com/plugins/restaurant-reservations/custom-fields/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Add custom fields and edit your booking form with ease.
38
39
+ [Email Templates for Restaurant Reservations](https://themeofthecrop.com/plugins/restaurant-reservations/email-templates/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Subscribe emails from new restaurant reservations to your MailChimp mailing list.
40
41
+ [Export Bookings for Restaurant Reservations](https://themeofthecrop.com/plugins/restaurant-reservations/export-bookings/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Export your restaurant reservations to PDF and Excel/CSV files.
42
+
43
+ [MailChimp for Restaurant Reservations](https://themeofthecrop.com/plugins/restaurant-reservations/mailchimp/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations) - Subscribe emails from new restaurant reservations to your MailChimp mailing list.
44
45
### Developers
46
119
120
## Changelog
121
122
+ #### 1.7.3 (2017-03-02)
123
+ * Fix: Apply late bookings restrictions more than 1 day to date picker
124
+ * Fix: Allow multiple email addresses for location-specific admin notifications
125
+ * Fix: Translation textdomain used for Business Profile integration
126
+ * Add: Apply early bookings restrictions to the date picker
127
+
128
#### 1.7.2 (2017-01-12)
129
* Fix: acceptsReservations schema property sometimes didn't appear in Business Profile integration
130
* Update: improve early bookings options language. Changed "Up to X days in advance" to "From X days in advance".
332
333
## Upgrade Notice
334
335
+ #### 1.7.3
336
+ This minor maintenance update ensures scheduling restrictions are reflected in the date and time pickers. It also allows multiple email addresses to be used in location-specific admin notifications.
337
+
338
#### 1.7.2
339
This minor maintenance update fixes a bug with the integration with the Business Profile plugin. It also adds the new Email Templates addon to the list of available addons.
340
restaurant-reservations.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: Restaurant Reservations
4
* Plugin URI: http://themeofthecrop.com
5
* Description: Accept restaurant reservations and bookings online.
6
- * Version: 1.7.2
7
* Author: Theme of the Crop
8
* Author URI: http://themeofthecrop.com
9
* License: GNU General Public License v2.0 or later
@@ -47,7 +47,7 @@ class rtbInit {
47
public function __construct() {
48
49
// Common strings
50
- define( 'RTB_VERSION', '1.7.2' );
51
define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
52
define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
53
define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
3
* Plugin Name: Restaurant Reservations
4
* Plugin URI: http://themeofthecrop.com
5
* Description: Accept restaurant reservations and bookings online.
6
+ * Version: 1.7.3
7
* Author: Theme of the Crop
8
* Author URI: http://themeofthecrop.com
9
* License: GNU General Public License v2.0 or later
47
public function __construct() {
48
49
// Common strings
50
+ define( 'RTB_VERSION', '1.7.3' );
51
define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
52
define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
53
define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );