Restaurant Reservations - Version 2.0.6

Version Description

(2019-10-31) = - Corrects a missing function issue for exporting custom fields

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Restaurant Reservations
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

includes/Export.CSV.class.php CHANGED
@@ -229,6 +229,34 @@ class ebfrtbExportCSV extends ebfrtbExport {
229
  return $headers;
230
  }
231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  /**
233
  * Add custom fields to CSV data row
234
  *
229
  return $headers;
230
  }
231
 
232
+ /**
233
+ * Add custom fields to CSV headers
234
+ *
235
+ * @param array $headers Key/value of spreadsheet header rows id/label
236
+ * @since 2.0
237
+ */
238
+ public function add_custom_fields( $row, $booking ) {
239
+ global $rtb_controller;
240
+
241
+ $fields = rtb_get_custom_fields();
242
+
243
+ $cf = isset( $booking->custom_fields ) ? $booking->custom_fields : array();
244
+
245
+ foreach( $fields as $field ) {
246
+
247
+ if ( $field->type == 'fieldset' ) {
248
+ continue;
249
+ }
250
+
251
+ $val = isset( $cf[ $field->slug ] ) ? $cf[ $field->slug ] : '';
252
+ $display_val = apply_filters( 'cffrtb_display_value_csv', $rtb_controller->fields->get_display_value( $val, $field, '', false ), $val, $field, $booking );
253
+
254
+ $row[ 'cf-' . $field->slug ] = $display_val;
255
+ }
256
+
257
+ return $row;
258
+ }
259
+
260
  /**
261
  * Add custom fields to CSV data row
262
  *
readme.txt CHANGED
@@ -175,6 +175,9 @@ Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/
175
 
176
  == Changelog ==
177
 
 
 
 
178
  = 2.0.5 (2019-10-30) =
179
  - Corrects an error with the max reservations feature when using the booking form while logged in.
180
 
175
 
176
  == Changelog ==
177
 
178
+ = 2.0.6 (2019-10-31) =
179
+ - Corrects a missing function issue for exporting custom fields
180
+
181
  = 2.0.5 (2019-10-30) =
182
  - Corrects an error with the max reservations feature when using the booking form while logged in.
183
 
restaurant-reservations.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Five Star Restaurant Reservations
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.0.5
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
3
  * Plugin Name: Five Star Restaurant Reservations
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.0.6
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations