Version Description
(2020-02-10) = - Fixing error with PDF export not rendering/downloading correctly
Download this release
Release Info
Developer | Rustaurius |
Plugin | Restaurant Reservations |
Version | 2.0.12 |
Comparing to | |
See all releases |
Code changes from version 2.0.11 to 2.0.12
- includes/Export.PDF.class.php +1 -1
- readme.txt +614 -608
- restaurant-reservations.php +443 -443
includes/Export.PDF.class.php
CHANGED
@@ -129,7 +129,7 @@ class ebfrtbExportPDF extends ebfrtbExport {
|
|
129 |
ob_get_clean();
|
130 |
|
131 |
if ( $this->lib === 'tcpdf' || $this->lib === 'mpdf' ) {
|
132 |
-
$this->export->Output( $filename, 'I');
|
133 |
|
134 |
} else {
|
135 |
do_action( 'ebcfrtb_pdf_deliver_' . $this->lib, $this );
|
129 |
ob_get_clean();
|
130 |
|
131 |
if ( $this->lib === 'tcpdf' || $this->lib === 'mpdf' ) {
|
132 |
+
$this->export->Output( $filename, 'I'); exit();
|
133 |
|
134 |
} else {
|
135 |
do_action( 'ebcfrtb_pdf_deliver_' . $this->lib, $this );
|
readme.txt
CHANGED
@@ -1,608 +1,614 @@
|
|
1 |
-
=== Five Star Restaurant Reservations ===
|
2 |
-
Contributors: FiveStarPlugins
|
3 |
-
Requires at Least: 4.4
|
4 |
-
Tested Up To: 5.3
|
5 |
-
Tags: reservation, reservations, restaurant reservations, reservation form, 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
|
6 |
-
License: GPLv3
|
7 |
-
License URI:http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
-
Donate Link: https://www.etoilewebdesign.com/plugin-donations/
|
9 |
-
|
10 |
-
Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
|
11 |
-
|
12 |
-
== Description ==
|
13 |
-
|
14 |
-
Restaurant reservations made easy. Accept reservations and table bookings online. Quickly confirm or reject restaurant reservations, send out custom email notifications, restrict booking times and more.
|
15 |
-
|
16 |
-
<strong>Includes Gutenberg restaurant block for displaying your reservation form!</strong> You can also use the handy restaurant reservation shortcode or set the reservation page directly in the plugin settings.
|
17 |
-
|
18 |
-
= Key Features =
|
19 |
-
|
20 |
-
* Create a customized restaurant reservation form
|
21 |
-
* Responsive booking form layout that looks great for mobile reservations and on all devices
|
22 |
-
* Add your reservation form to any page via the included Gutenberg restaurant booking block or shortcode, or just choose your reservation page in the settings
|
23 |
-
* Quickly [confirm or reject](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/manage/confirm-reject-bookings) a booking
|
24 |
-
* Notify a customer by email when their request is confirmed or rejected
|
25 |
-
* Receive an [email notification](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/config/email-notifications) when a booking request is made
|
26 |
-
|
27 |
-
[youtube https://www.youtube.com/watch?v=b6x0QkgHBKI]
|
28 |
-
|
29 |
-
Create a five star restaurant reservation experience by tailoring your form to yours and your customers' specific needs. With options to set minimum and maximum party sizes, to require a phone number, to change the date and time format and to write a custom message after a successful online restaurant booking, you can create a familiar and comfortable atmosphere and make the reservation process as easy and effortless as possible.
|
30 |
-
|
31 |
-
= Additional Restaurant Reservation Features =
|
32 |
-
|
33 |
-
Our customizable restaurant reservations plugin comes with several additional features that will help ensure you're able to set it up not only easily, but with all the options you need. It will also allow you to deliver the best and easiest online restaurant booking system for your visitors. These features include:
|
34 |
-
|
35 |
-
* Add and edit bookings directly from the plugin admin panel
|
36 |
-
* Set up a specific restaurant schedule by defining the times and dates available for reservation
|
37 |
-
*
|
38 |
-
*
|
39 |
-
*
|
40 |
-
*
|
41 |
-
*
|
42 |
-
* [
|
43 |
-
*
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
*
|
57 |
-
*
|
58 |
-
*
|
59 |
-
*
|
60 |
-
*
|
61 |
-
*
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
*
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
2
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
*
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
= I
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
-
|
207 |
-
|
208 |
-
= 2.0.
|
209 |
-
- Corrects
|
210 |
-
|
211 |
-
= 2.0.
|
212 |
-
-
|
213 |
-
|
214 |
-
= 2.0.
|
215 |
-
-
|
216 |
-
|
217 |
-
= 2.0.
|
218 |
-
- Fixing
|
219 |
-
|
220 |
-
= 2.0.
|
221 |
-
-
|
222 |
-
|
223 |
-
|
224 |
-
-
|
225 |
-
|
226 |
-
|
227 |
-
-
|
228 |
-
-
|
229 |
-
- Added in
|
230 |
-
- Added in a
|
231 |
-
- Added in
|
232 |
-
-
|
233 |
-
-
|
234 |
-
-
|
235 |
-
-
|
236 |
-
-
|
237 |
-
-
|
238 |
-
-
|
239 |
-
|
240 |
-
|
241 |
-
-
|
242 |
-
|
243 |
-
|
244 |
-
-
|
245 |
-
|
246 |
-
= 1.
|
247 |
-
-
|
248 |
-
|
249 |
-
= 1.8 (
|
250 |
-
-
|
251 |
-
|
252 |
-
= 1.
|
253 |
-
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
*
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
*
|
270 |
-
*
|
271 |
-
|
272 |
-
= 1.7.
|
273 |
-
*
|
274 |
-
* Add:
|
275 |
-
* Add:
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
* Fix:
|
280 |
-
*
|
281 |
-
* Add:
|
282 |
-
|
283 |
-
= 1.7.
|
284 |
-
* Fix:
|
285 |
-
*
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
* Fix:
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
*
|
295 |
-
*
|
296 |
-
*
|
297 |
-
|
298 |
-
|
299 |
-
*
|
300 |
-
*
|
301 |
-
*
|
302 |
-
|
303 |
-
|
304 |
-
* Fix:
|
305 |
-
*
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
*
|
312 |
-
|
313 |
-
|
314 |
-
*
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
* Fix:
|
320 |
-
*
|
321 |
-
* Add:
|
322 |
-
*
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
* Fix:
|
327 |
-
* Add:
|
328 |
-
* Add:
|
329 |
-
*
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
*
|
335 |
-
|
336 |
-
|
337 |
-
*
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
*
|
344 |
-
*
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
* Fix:
|
349 |
-
*
|
350 |
-
*
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
*
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
* Fix:
|
360 |
-
*
|
361 |
-
|
362 |
-
|
363 |
-
*
|
364 |
-
|
365 |
-
|
366 |
-
*
|
367 |
-
*
|
368 |
-
*
|
369 |
-
*
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
*
|
375 |
-
*
|
376 |
-
*
|
377 |
-
*
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
* Fix:
|
383 |
-
*
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
* Add:
|
390 |
-
|
391 |
-
|
392 |
-
* Fix:
|
393 |
-
|
394 |
-
|
395 |
-
*
|
396 |
-
|
397 |
-
|
398 |
-
* Fix:
|
399 |
-
|
400 |
-
|
401 |
-
*
|
402 |
-
|
403 |
-
|
404 |
-
*
|
405 |
-
|
406 |
-
|
407 |
-
*
|
408 |
-
|
409 |
-
|
410 |
-
* Add:
|
411 |
-
* Add:
|
412 |
-
*
|
413 |
-
* Fix:
|
414 |
-
|
415 |
-
= 1.
|
416 |
-
* Add
|
417 |
-
*
|
418 |
-
* Add
|
419 |
-
*
|
420 |
-
|
421 |
-
|
422 |
-
*
|
423 |
-
*
|
424 |
-
*
|
425 |
-
*
|
426 |
-
*
|
427 |
-
*
|
428 |
-
*
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
*
|
433 |
-
*
|
434 |
-
*
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
*
|
439 |
-
|
440 |
-
|
441 |
-
*
|
442 |
-
*
|
443 |
-
*
|
444 |
-
*
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
*
|
449 |
-
*
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
*
|
455 |
-
* Fix
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
* Add
|
460 |
-
*
|
461 |
-
* Fix
|
462 |
-
*
|
463 |
-
|
464 |
-
= 1.1.
|
465 |
-
*
|
466 |
-
|
467 |
-
|
468 |
-
*
|
469 |
-
|
470 |
-
= 1.1.
|
471 |
-
*
|
472 |
-
|
473 |
-
= 1.1 (2014-05-
|
474 |
-
*
|
475 |
-
|
476 |
-
|
477 |
-
*
|
478 |
-
|
479 |
-
= 1.
|
480 |
-
*
|
481 |
-
|
482 |
-
|
483 |
-
*
|
484 |
-
|
485 |
-
= 1.0 (2014-05-
|
486 |
-
*
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
= 1.8 =
|
497 |
-
This update
|
498 |
-
|
499 |
-
= 1.
|
500 |
-
This update fixes a bug
|
501 |
-
|
502 |
-
= 1.
|
503 |
-
This update adds
|
504 |
-
|
505 |
-
= 1.7.
|
506 |
-
This update
|
507 |
-
|
508 |
-
= 1.7.
|
509 |
-
This update
|
510 |
-
|
511 |
-
= 1.7.
|
512 |
-
This
|
513 |
-
|
514 |
-
= 1.7.
|
515 |
-
This
|
516 |
-
|
517 |
-
= 1.7.
|
518 |
-
This update
|
519 |
-
|
520 |
-
= 1.7 =
|
521 |
-
This
|
522 |
-
|
523 |
-
= 1.
|
524 |
-
This update fixes a critical
|
525 |
-
|
526 |
-
= 1.
|
527 |
-
This
|
528 |
-
|
529 |
-
= 1.6 =
|
530 |
-
This
|
531 |
-
|
532 |
-
= 1.
|
533 |
-
This update
|
534 |
-
|
535 |
-
= 1.
|
536 |
-
This update
|
537 |
-
|
538 |
-
= 1.5.
|
539 |
-
This update
|
540 |
-
|
541 |
-
= 1.5 =
|
542 |
-
This update
|
543 |
-
|
544 |
-
= 1.
|
545 |
-
This update
|
546 |
-
|
547 |
-
= 1.
|
548 |
-
This update
|
549 |
-
|
550 |
-
= 1.4.
|
551 |
-
This update
|
552 |
-
|
553 |
-
= 1.4.
|
554 |
-
This update fixes a bug that
|
555 |
-
|
556 |
-
= 1.4.
|
557 |
-
This update
|
558 |
-
|
559 |
-
= 1.4.
|
560 |
-
This update fixes a
|
561 |
-
|
562 |
-
= 1.4.
|
563 |
-
This update
|
564 |
-
|
565 |
-
= 1.4.
|
566 |
-
This update
|
567 |
-
|
568 |
-
= 1.4.
|
569 |
-
This update
|
570 |
-
|
571 |
-
= 1.4.
|
572 |
-
This update
|
573 |
-
|
574 |
-
= 1.4 =
|
575 |
-
|
576 |
-
|
577 |
-
= 1.
|
578 |
-
This update
|
579 |
-
|
580 |
-
= 1.
|
581 |
-
|
582 |
-
|
583 |
-
= 1.
|
584 |
-
This update adds support for
|
585 |
-
|
586 |
-
= 1.2.
|
587 |
-
This
|
588 |
-
|
589 |
-
= 1.2 =
|
590 |
-
This update adds new
|
591 |
-
|
592 |
-
= 1.1
|
593 |
-
This
|
594 |
-
|
595 |
-
= 1.
|
596 |
-
This update
|
597 |
-
|
598 |
-
= 1.1.
|
599 |
-
This
|
600 |
-
|
601 |
-
= 1.1.
|
602 |
-
This update fixes
|
603 |
-
|
604 |
-
= 1.1 =
|
605 |
-
This update
|
606 |
-
|
607 |
-
= 1.
|
608 |
-
This update
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Five Star Restaurant Reservations ===
|
2 |
+
Contributors: FiveStarPlugins
|
3 |
+
Requires at Least: 4.4
|
4 |
+
Tested Up To: 5.3
|
5 |
+
Tags: reservation, reservations, restaurant reservations, reservation form, 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
|
6 |
+
License: GPLv3
|
7 |
+
License URI:http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
+
Donate Link: https://www.etoilewebdesign.com/plugin-donations/
|
9 |
+
|
10 |
+
Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
Restaurant reservations made easy. Accept reservations and table bookings online. Quickly confirm or reject restaurant reservations, send out custom email notifications, restrict booking times and more.
|
15 |
+
|
16 |
+
<strong>Includes Gutenberg restaurant block for displaying your reservation form!</strong> You can also use the handy restaurant reservation shortcode or set the reservation page directly in the plugin settings.
|
17 |
+
|
18 |
+
= Key Features =
|
19 |
+
|
20 |
+
* Create a customized restaurant reservation form
|
21 |
+
* Responsive booking form layout that looks great for mobile reservations and on all devices
|
22 |
+
* Add your reservation form to any page via the included Gutenberg restaurant booking block or shortcode, or just choose your reservation page in the settings
|
23 |
+
* Quickly [confirm or reject](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/manage/confirm-reject-bookings) a booking
|
24 |
+
* Notify a customer by email when their request is confirmed or rejected
|
25 |
+
* Receive an [email notification](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/config/email-notifications) when a booking request is made
|
26 |
+
|
27 |
+
[youtube https://www.youtube.com/watch?v=b6x0QkgHBKI]
|
28 |
+
|
29 |
+
Create a five star restaurant reservation experience by tailoring your form to yours and your customers' specific needs. With options to set minimum and maximum party sizes, to require a phone number, to change the date and time format and to write a custom message after a successful online restaurant booking, you can create a familiar and comfortable atmosphere and make the reservation process as easy and effortless as possible.
|
30 |
+
|
31 |
+
= Additional Restaurant Reservation Features =
|
32 |
+
|
33 |
+
Our customizable restaurant reservations plugin comes with several additional features that will help ensure you're able to set it up not only easily, but with all the options you need. It will also allow you to deliver the best and easiest online restaurant booking system for your visitors. These features include:
|
34 |
+
|
35 |
+
* Add and edit bookings directly from the plugin admin panel
|
36 |
+
* Set up a specific restaurant schedule by defining the times and dates available for reservation
|
37 |
+
* Add exceptions to your schedule (e.g. for holidays and special events)
|
38 |
+
* Support for multiple booking locations when using [Five Star Business Profile](https://wordpress.org/plugins/business-profile/)
|
39 |
+
* Send customers [an email](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/manage/send-emails) about their booking from the admin panel
|
40 |
+
* Option to automatically confirm reservations below a certain party size.
|
41 |
+
* Customize all [notification messages](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/config/email-notifications#understanding-the-template-tags) as well as date and time formats
|
42 |
+
* Automatically [block bookings](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/config/schedule#scheduling-exceptions) when you're closed, including holidays and one-off openings
|
43 |
+
* [Ban abusive customers](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/manage/ban-customers) to save money on no-shows
|
44 |
+
* Change the language of the datepicker feature
|
45 |
+
|
46 |
+
With our reservation system, you can set up the booking schedule for you restaurant. Our settings allow you to be as broad or specific as you want with this, with options for setting the open times, the interval between booking slots, booking in advance, and even the ability to add exceptions to these options.
|
47 |
+
|
48 |
+
You know your customers best. With features like the ability to enable automatic confirmation and to customize your notifications, you can tailor your restaurant booking form to meet the specific requirements of your restaurant and business.
|
49 |
+
|
50 |
+
[youtube https://www.youtube.com/watch?v=1OsaLLpEevc]
|
51 |
+
|
52 |
+
= Premium Restaurant Reservations =
|
53 |
+
|
54 |
+
With the premium version of our restaurant reservations plugin, you can extend the functionality of your booking form to offer your customers the best possible experience. Premium features include:
|
55 |
+
|
56 |
+
* Stylish New Layout Options: Choose from multiple modern restaurant form layouts to find the one that best suits your site.
|
57 |
+
* Custom Fields: Plan your dinner service better by asking for special seating requests, dietary needs and more when customers book online. Similar to open table, this allows you to customize the reservation system to have any field you want, allowing you to gather all the info you need to offer the best experience to your customers. This feature also allows you to modify the existing default fields.
|
58 |
+
* Email Templates and Designer: Send beautiful email notifications with your own logo and brand colors when your customers make a reservation.
|
59 |
+
* Export Bookings: Easily print your restaurant bookings via PDF or export them to an Excel/CSV file so you can analyze patterns, gather customer data and import bookings into other services.
|
60 |
+
* MailChimp Integration: Subscribe new reservation requests to your MailChimp mailing list and watch your subscription rates grow effortlessly.
|
61 |
+
* Reservation Restrictions: Easily set the desired dining block length as well as a maximum number of reservations.
|
62 |
+
* View Bookings Page: Create a page on the front end of your site that displays upcoming bookings and allows you to check in guests who have arrived.
|
63 |
+
* Automatic Reservation Confirmation: Enable automatic confirmation of a reservation request if that date/time is currently below the maximum reservation or seat number.
|
64 |
+
* Styling Options: Many styling options are included that let you set the color, font-size, borders, etc. for the different elements of the form.
|
65 |
+
|
66 |
+
For further information and purchasing options, please visit our <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/" target="_blank">WordPress restaurant reservations</a> homepage.
|
67 |
+
|
68 |
+
[youtube https://www.youtube.com/watch?v=0DigZnw_3Qw]
|
69 |
+
|
70 |
+
This easy restaurant booking system is one part of our suite of plugins designed to give you the best WordPress restaurant experience. Check out the powerful [Restaurant Menu](https://wordpress.org/plugins/food-and-drink-menu/) plugin and let your customers view your full menu directly on your site. With its intuitive and easy-to-use interface, you'll be sure to not lose out on business to your competitors.
|
71 |
+
|
72 |
+
= For help and support, please see: =
|
73 |
+
|
74 |
+
* Our FAQ page, here: https://wordpress.org/plugins/restaurant-reservations/faq/
|
75 |
+
* Our installation guide, here: https://wordpress.org/plugins/restaurant-reservations/installation/
|
76 |
+
* Our documentation and user guide, here: http://doc.fivestarplugins.com/plugins/restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations
|
77 |
+
* The Restaurant Menu support forum, here: https://wordpress.org/support/plugin/restaurant-reservations/
|
78 |
+
|
79 |
+
This plugin also comes with hooks that developers can use to extend and customize it. Take a look at the [Developer Documentation](http://doc.fivestarplugins.com/plugins/restaurant-reservations/developer/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations).
|
80 |
+
|
81 |
+
== Installation ==
|
82 |
+
|
83 |
+
1. Upload the 'restaurant-reservations' folder to the '/wp-content/plugins/' directory
|
84 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
85 |
+
|
86 |
+
or
|
87 |
+
|
88 |
+
1. Go to the 'Plugins' menu in WordPress and click 'Add New'
|
89 |
+
2. Search for 'Five Star Restaurant Reservations' and select 'Install Now'
|
90 |
+
3. Activate the plugin when prompted
|
91 |
+
|
92 |
+
= Getting Started =
|
93 |
+
|
94 |
+
1. To place your restaurant booking form on a page:
|
95 |
+
* Option 1: Go to the 'General' tab in the plugin settings and use the Booking Page dropdown to select the page on which you want your reservation form to appear.
|
96 |
+
* Option 2: Place the included reservations Gutenberg block on the page on which you want your reservation form to appear.
|
97 |
+
* Option 3: Place the [booking-form] shortcode on the page on which you want your reservation form to appear.
|
98 |
+
|
99 |
+
2. To customize the form:
|
100 |
+
* Go to the Settings area of the plugin admin and click the 'General' tab. There you'll be able to set the min and max party size, the successful booking message, the date and time format and make use of our security and privacy features.
|
101 |
+
* Also in the Settings area, go to the 'Booking Schedule' tab. There you'll be able to set your restaurant's schedule, the interval between booking slots, earliest and latest bookings and also create exceptions for the schedule.
|
102 |
+
|
103 |
+
3. To set up notifications.
|
104 |
+
* Go to the 'Notifications' tab in the settings.
|
105 |
+
* Use the Subject and Email fields there to craft your message for each different circumstance
|
106 |
+
* There is also a list of template tags there that you can include in your messages to display reservation-specific messages about the table reserved.
|
107 |
+
|
108 |
+
4. To view and manage your bookings:
|
109 |
+
* Go to the 'Bookings' area of the plugin admin.
|
110 |
+
* There you'll be able to view and modify any bookings that have been placed on your site.
|
111 |
+
* You'll also be able to manually create a new restaurant reservation (e.g. a reservation you took over the phone).
|
112 |
+
|
113 |
+
For a list of specific features, see the Restaurant Menu description page here: https://wordpress.org/plugins/restaurant-reservations/.
|
114 |
+
|
115 |
+
For help and support, please see:
|
116 |
+
|
117 |
+
* Our FAQ page, here: https://wordpress.org/plugins/restaurant-reservations/faq/
|
118 |
+
* Our documentation and user guide, here: http://doc.fivestarplugins.com/plugins/restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations
|
119 |
+
* The Restaurant Menu support forum, here: https://wordpress.org/support/plugin/restaurant-reservations/
|
120 |
+
|
121 |
+
== Frequently Asked Questions ==
|
122 |
+
|
123 |
+
= Is there a shortcode to print the booking form? =
|
124 |
+
|
125 |
+
Yes, use the `[booking-form]` shortcode.
|
126 |
+
|
127 |
+
= Can I change the format of the date or time? =
|
128 |
+
|
129 |
+
Yes, set the format for the datepicker in *Bookings > Settings*. The format used in the backend will depend on the date and time formats in your WordPress settings.
|
130 |
+
|
131 |
+
= The datepicker or timepicker is not working. =
|
132 |
+
|
133 |
+
If you load up the form and no date or time picker is popping up when you select those fields, this is likely caused by a Javascript error from another plugin or theme. You can find the problematic plugin by deactivating other plugins you're using one-by-one. Test after each deactivation to see if the date and time pickers work.
|
134 |
+
|
135 |
+
If you have deactivated all other plugins and still have a problem, try switching to a default theme (one of the TwentySomething themes).
|
136 |
+
|
137 |
+
= I'm not receiving notification emails for new bookings. =
|
138 |
+
|
139 |
+
This is almost always the result of issues with your server and can be caused by a number of things. Before posting a support request, please run through the following checklist:
|
140 |
+
|
141 |
+
1. Double-check that the notification email in *Bookings > Settings > Notifications* is correct.
|
142 |
+
2. Make sure that WordPress is able to send emails. The admin email address in the WordPress settings page should receive notifications of new users.
|
143 |
+
3. If you're not able to receive regular WordPress emails, contact your web host and ask them for help sorting it out.
|
144 |
+
4. If you're able to receive regular WordPress emails but not booking notifications, check your spam filters or junk mail folders.
|
145 |
+
5. If you still haven't found the emails, contact your web host and let them know the date, time and email address where you expected to receive a booking. They should be able to check their logs to see what is happening to the email.
|
146 |
+
|
147 |
+
= Can I make the phone number required? =
|
148 |
+
|
149 |
+
This is a common request so I have written a small addon to do this for you. [Learn more](https://fivestarplugins.com/2015/01/08/simple-phone-validation-restaurant-reservations/).
|
150 |
+
|
151 |
+
= Can I translate the booking form? =
|
152 |
+
|
153 |
+
Yes, everything in this plugin can be translated using the standard translation process and software like PoEdit. If you're not familiar with that process, I'd recommend you take a look at the [Loco Translate](https://wordpress.org/plugins/loco-translate/) plugin, which provides a simple interface in your WordPress admin area for translating themes and plugins.
|
154 |
+
|
155 |
+
= I set Early or Late Bookings restrictions, but I scan still book during that time =
|
156 |
+
Users with the Administrator and Booking Manager roles are exempt from these restrictions. This is so that they can make last-minute changes to bookings as needed. If you want to test the Early or Late Bookings restrictions, try logging out and testing.
|
157 |
+
|
158 |
+
= I want to add a field to the form. Can I do that? =
|
159 |
+
|
160 |
+
The premium version does indeed come with a custom fields feature that lets you add new fields and modify existing ones.
|
161 |
+
|
162 |
+
= More questions and answers =
|
163 |
+
|
164 |
+
Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/faq?utm_source=Plugin&utm_medium=Plugin%20Description&utm_campaign=Restaurant%20Reservations).
|
165 |
+
|
166 |
+
== Screenshots ==
|
167 |
+
|
168 |
+
1. Booking form with the Contemporary layout.
|
169 |
+
2. Booking form with the Columns layout.
|
170 |
+
3. Booking form with the default layout.
|
171 |
+
4. Great, mobile-friendly date picker to make it easy for your customers.
|
172 |
+
5. Great, mobile-friendly time picker to make it easy for your customers.
|
173 |
+
6. Easily manage bookings. View today's bookings or upcoming bookings at-a-glance. Confirm or reject bookings quickly.
|
174 |
+
7. The Booking Schedule area of the Settings page.
|
175 |
+
8. The Basic area of the Settings page.
|
176 |
+
9. The Notifications area of the Settings page.
|
177 |
+
10. The Premium area of the Settings page.
|
178 |
+
11. The Styling area of the Settings page.
|
179 |
+
12. The custom fields editor.
|
180 |
+
13. Add and edit bookings from an admin panel.
|
181 |
+
14. Quickly find bookings before or after a date. You can also filter by status or view just Today's bookings.
|
182 |
+
15. It also integrates with the Business Profile plugin to support booking for multiple locations.
|
183 |
+
16. Access a short guide from your Plugins list to help you get started quickly.
|
184 |
+
|
185 |
+
== Changelog ==
|
186 |
+
|
187 |
+
= 2.0.12 (2020-02-10) =
|
188 |
+
- Fixing error with PDF export not rendering/downloading correctly
|
189 |
+
|
190 |
+
= 2.0.11 (2019-12-03) =
|
191 |
+
- Moving screenshots out of main plugin folder and into assets.
|
192 |
+
- Updating plugin icon and banner.
|
193 |
+
|
194 |
+
= 2.0.10 (2019-11-26) =
|
195 |
+
- Fixes issue that was causing an error and/or incorrect display of the plugin dashboard for certain languages
|
196 |
+
|
197 |
+
= 2.0.9 (2019-11-04) =
|
198 |
+
- Fixes the issue with exceptions when max reservations wasn't enabled
|
199 |
+
- Fixes the ajaxurl JS error
|
200 |
+
|
201 |
+
= 2.0.8 (2019-11-01) =
|
202 |
+
- Corrects issue that was causing the array_key_exists null given error
|
203 |
+
|
204 |
+
= 2.0.7 (2019-10-31) =
|
205 |
+
- Updating version number of enqueued admin files to help with incorrect styling after update
|
206 |
+
- Correcting issue with premium license transfer
|
207 |
+
|
208 |
+
= 2.0.6 (2019-10-31) =
|
209 |
+
- Corrects a missing function issue for exporting custom fields
|
210 |
+
|
211 |
+
= 2.0.5 (2019-10-30) =
|
212 |
+
- Corrects an error with the max reservations feature when using the booking form while logged in.
|
213 |
+
|
214 |
+
= 2.0.4 (2019-10-29) =
|
215 |
+
- Corrects an error that was coming up on submission when there was a custom field in the form.
|
216 |
+
|
217 |
+
= 2.0.3 (2019-10-28) =
|
218 |
+
- Fixing a class conflict with the email designer
|
219 |
+
|
220 |
+
= 2.0.2 (2019-10-28) =
|
221 |
+
- Additional fix related to the email templates conflict
|
222 |
+
|
223 |
+
= 2.0.1 (2019-10-28) =
|
224 |
+
- Fixing an error being thrown if you tried to update while also having the email templates add-on activated
|
225 |
+
|
226 |
+
= 2.0.0 (2019-10-28) =
|
227 |
+
- <strong>This is a big update with many new features, corrections, revised admin styling, etc., so please take caution and test before updating on a live site (or wait a few days before updating in case some minor corrective updates need to be put out)</strong>
|
228 |
+
- The Options pages have a brand new and easy-to-use design, to go hand in hand with the many, many new options!
|
229 |
+
- Added in two brand new responsive reservation form layouts
|
230 |
+
- Added in a new styling options section that lets you customize the colors, fonts, borders etc. of all elements of your restaurant booking form
|
231 |
+
- Added in a new "view bookings" shortcode and page
|
232 |
+
- Added in the ability to automatically confirm reservations when less than X reservations or seats are taken during a time block
|
233 |
+
- Added in the ability to specify a dining block length
|
234 |
+
- Added in a "Max Reservations" number for a particular timeslot, so that it's not possible to book within a timeslot once that number has been reached
|
235 |
+
- Added in an option for guests to be checked in as they arrive
|
236 |
+
- Added in a walkthrough on installation to help you get going as quickly as possible
|
237 |
+
- Added in defaults for several options
|
238 |
+
- Updated the styling of certain default features to be consistent with new features
|
239 |
+
- Other styling and ease-of-use changes
|
240 |
+
- Updated the order, layout and descriptions of several options
|
241 |
+
- Updated the upgrade-to-premium process to be much quicker and easier
|
242 |
+
- Corrected issue causing the email template designer to not load properly in the customizer
|
243 |
+
- Corrected internal settings version numbering that was causing an issue with the Business Profile plugin settings
|
244 |
+
- Removed files from the plugin that were not being used/not needed
|
245 |
+
|
246 |
+
= 1.9.0 =
|
247 |
+
- Name change and new banner and icon
|
248 |
+
|
249 |
+
= 1.8.2 (2019-03-18) =
|
250 |
+
- Fix: Date and time picker in latest Chromium version
|
251 |
+
|
252 |
+
= 1.8.1 (2018-12-12) =
|
253 |
+
- Fix: Booking form block loads without correct location in editor
|
254 |
+
|
255 |
+
= 1.8 (2018-12-11) =
|
256 |
+
- Add: Gutenberg block for the booking form
|
257 |
+
|
258 |
+
= 1.7.8 (2018-09-13) =
|
259 |
+
- Add: #126 Setting to override the FROM header's email address
|
260 |
+
- Fix: #136 Preserve consent acquired state when booking is edited
|
261 |
+
- Update: German, French and Dutch translations
|
262 |
+
|
263 |
+
= 1.7.7 (2018-04-27) =
|
264 |
+
* Add: #135 Option to collect consent to store data (GDPR)
|
265 |
+
* Add: #135 Ability to delete all bookings related to an email address (GDPR)
|
266 |
+
* Fix: Some data not updated in confirm/reject emails when changed
|
267 |
+
|
268 |
+
= 1.7.6 (2017-05-15) =
|
269 |
+
* Fix: Prevent IP address from being modified after initial submission
|
270 |
+
* Fix: Schema type for Bakery used when integrating with Business Profile
|
271 |
+
|
272 |
+
= 1.7.5 (2017-03-31) =
|
273 |
+
* Add: #104 Show count of upcoming pending bookings in admin nav menu
|
274 |
+
* Add: #44 Reject invalid email addresses in booking requests
|
275 |
+
* Add: Setting to require a phone number
|
276 |
+
* Add: Recommended themes with booking form styles listed in the Addons page
|
277 |
+
|
278 |
+
= 1.7.4 (2017-03-21) =
|
279 |
+
* Fix: Wrong time restrictions for day one month in advance. See #102
|
280 |
+
* Add: Disable button when submitted to prevent duplicate submissions
|
281 |
+
* Add: Polish translation. h/t Wojciech Sadowski
|
282 |
+
|
283 |
+
= 1.7.3 (2017-03-02) =
|
284 |
+
* Fix: Apply late bookings restrictions more than 1 day to date picker
|
285 |
+
* Fix: Allow multiple email addresses for location-specific admin notifications
|
286 |
+
* Fix: Translation textdomain used for Business Profile integration
|
287 |
+
* Add: Apply early bookings restrictions to the date picker
|
288 |
+
|
289 |
+
= 1.7.2 (2017-01-12) =
|
290 |
+
* Fix: acceptsReservations schema property sometimes didn't appear in Business Profile integration
|
291 |
+
* Update: improve early bookings options language. Changed "Up to X days in advance" to "From X days in advance".
|
292 |
+
|
293 |
+
= 1.7.1 (2016-12-14) =
|
294 |
+
* Fix: Submitted by date and time in the bookings list
|
295 |
+
* Fix: Fatal error when creating a new location with the Business Profile plugin
|
296 |
+
* Fix: Remove or archive unexpected "Auto Draft" that was created in some circumstances
|
297 |
+
|
298 |
+
= 1.7 (2016-12-05) =
|
299 |
+
* Add: Allow customer banning by email and IP address
|
300 |
+
* Add: HTML5 required and aria-required attributes where appropriate
|
301 |
+
* Add: Disable times in the time picker blocked by late bookings restrictions
|
302 |
+
* Add: Option to block same-day bookings
|
303 |
+
* Add: Option for minimum party size
|
304 |
+
* Fix: Location printed twice in booking details
|
305 |
+
* Fix: Allow Bookings Managers to edit bookings in the past
|
306 |
+
* Update: Deprecated RTB_LOAD_FRONTEND_ASSETS moved `rtb-load-frontend-assets` filter
|
307 |
+
* Update: Sort bookings by latest date first when viewing All bookings
|
308 |
+
|
309 |
+
= 1.6.3 (2016-10-31) =
|
310 |
+
* Fix: Exporting bookings by location (addon). Location query args are now support for rtbQuery objects.
|
311 |
+
* Add: Option to select start of the week for the datepicker
|
312 |
+
|
313 |
+
= 1.6.2 (2016-08-20) =
|
314 |
+
* Fix: Broken time picker introduced in 1.6.1
|
315 |
+
|
316 |
+
= 1.6.1 (2016-08-19) =
|
317 |
+
* Fix: Support location post ids in booking form shortcode
|
318 |
+
* Fix: JavaScript error if the time field is hidden
|
319 |
+
* Fix: Fix booking detail popup issue when used with custom fields addon
|
320 |
+
* Add: Notification template tag for location: {location}
|
321 |
+
* Add: Russian language translation. h/t Alexandra Kuksa
|
322 |
+
* Update: Spanish language translation. h/t Matias Rodriguez
|
323 |
+
|
324 |
+
= 1.6 (2016-06-20) =
|
325 |
+
* Fix: Currently visible notice in bookings list on mobile devices
|
326 |
+
* Fix: Conflict with WooCommerce that prevented booking managers from viewing bookings
|
327 |
+
* Add: Support multi-location bookings
|
328 |
+
* Add: Add reservation schema.org markup when Business Profile used
|
329 |
+
* Add: Allow custom first day of the week for date picker
|
330 |
+
|
331 |
+
= 1.5.3 (2016-03-25) =
|
332 |
+
* Fix: no bookings found when searching by start and end dates that are the same
|
333 |
+
* Add: clarify that early/late bookings restrictions don't apply to admins
|
334 |
+
* Add: Brazilian and Norwegian translations
|
335 |
+
* Update: Dutch translation
|
336 |
+
* Update: link to new online documentation
|
337 |
+
* Other: Tested for compatibility with WP 4.5
|
338 |
+
|
339 |
+
= 1.5.2 (2016-02-29) =
|
340 |
+
* Fix: booking managers can not confirm/reject bookings
|
341 |
+
|
342 |
+
= 1.5.1 (2016-02-19) =
|
343 |
+
* Fix: increase security of the quicklink feature for confirming/rejecting bookings
|
344 |
+
* Fix: Improve wp-cli compatibility
|
345 |
+
|
346 |
+
= 1.5 (2015-12-17) =
|
347 |
+
* Fix: pickadate iOS bug
|
348 |
+
* Fix: Bookings table's Today view didn't respect WordPress timezone setting
|
349 |
+
* Add: Allow bookings table columns to be toggled on/off
|
350 |
+
* Update: Convert message column/row drop-down to a details modal for all hidden columns
|
351 |
+
* Update: Put focus into message field when expanded in booking form
|
352 |
+
|
353 |
+
= 1.4.10 (2015-10-29) =
|
354 |
+
* Fix: Allow settings page required capability to be filtered later
|
355 |
+
* Fix: Compatibility issue with old versions of jQuery
|
356 |
+
* Add: Spanish translation from Rafa dMC
|
357 |
+
|
358 |
+
= 1.4.9 (2015-10-06) =
|
359 |
+
* Fix: iOS 8 bug with date and time pickers
|
360 |
+
* Add: newsletter signup prompt to addons page
|
361 |
+
|
362 |
+
= 1.4.8 (2015-08-20) =
|
363 |
+
* Add: WPML config file for improved multi-lingual compatibility
|
364 |
+
* Add: Danish translation by Yusef Mubeen
|
365 |
+
* Fix: Allow bookings managers to bypass early/late bookings restrictions
|
366 |
+
* Fix: No times available when latest time falls between last interval and midnight
|
367 |
+
* Updated: Improve bookings message view on small screens (adapt to 4.3 style)
|
368 |
+
* Updated: Simple Admin Pages lib to v2.0.a.10
|
369 |
+
* Updated: Dutch translation h/t Roy van den Houten and Clements Tolboom
|
370 |
+
|
371 |
+
= 1.4.7 (2015-07-02) =
|
372 |
+
* Add: Spanish translation from Joaqin Sanz Boixader
|
373 |
+
* Fix: Sorting of bookings by date and name in list table broken
|
374 |
+
* Fix: Custom late bookings values more than one day aren't reflected in date picker
|
375 |
+
* Fix: Norwegian doesn't include time picker translation for some strings
|
376 |
+
* Updated: German translation from Roland Stumpp
|
377 |
+
* Updated: pickadate.js language translations
|
378 |
+
|
379 |
+
= 1.4.6 (2015-06-20) =
|
380 |
+
* Add: Remove old schedule exceptions and sort exceptions by date
|
381 |
+
* Add: CSS class indicating type of booking form field
|
382 |
+
* Fix: Extended Latin can cause Reply-To email headers to fail in some clients
|
383 |
+
* Fix: PHP Warning when performing bulk or quick action in bookings panel
|
384 |
+
* Fix: Message row lingers after booking trashed in admin panel
|
385 |
+
* Updated .pot file
|
386 |
+
|
387 |
+
= 1.4.5 (2015-04-23) =
|
388 |
+
* Fix: Loading spinner not visible due to 4.2 changes
|
389 |
+
* Add: new addon Export Bookings released
|
390 |
+
|
391 |
+
= 1.4.4 (2015-04-20) =
|
392 |
+
* Fix: low-risk XSS security vulnerability with escaped URLs on admin bookings page
|
393 |
+
|
394 |
+
= 1.4.3 (2015-04-20) =
|
395 |
+
* Add: Datepickers for start/end date filters in admin bookings list
|
396 |
+
* Fix: Disabled weekdays get offset when editing bookings
|
397 |
+
* Fix: Start/end date filters in admin bookings list
|
398 |
+
* Fix: Booking form shouldn't appear on password-protected posts
|
399 |
+
* Fix: Dutch translation
|
400 |
+
* Updated: Dutch and German translations
|
401 |
+
* Updated: pickadate.js lib now at v3.5.6
|
402 |
+
|
403 |
+
= 1.4.2 (2015-03-31) =
|
404 |
+
* Fix: Speed issue if licensed addon active
|
405 |
+
|
406 |
+
= 1.4.1 (2015-03-31) =
|
407 |
+
* Add: rtbQuery class for fetching bookings
|
408 |
+
* Add: Centralized system for handling extension licenses
|
409 |
+
* Add: Several filters for the bookings admin list table
|
410 |
+
* Add: French translation h/t I-Visio
|
411 |
+
* Add: Italian translation h/t Pierfilippo Trevisan
|
412 |
+
* Updated: German translation h/t Roland Stumpp
|
413 |
+
* Fix: Button label in send email modal
|
414 |
+
|
415 |
+
= 1.4 (2015-02-24) =
|
416 |
+
* Add: Send a custom email from the bookings list
|
417 |
+
* Add: Hebrew translation. h/t Ahrale
|
418 |
+
* Add: Default template functions for checkbox, radio and confirmation fields
|
419 |
+
* Fix: Replace dialect with more common German in translation file. h/t Roland Stumpp
|
420 |
+
|
421 |
+
= 1.3 (2015-02-03) =
|
422 |
+
* Add and edit bookings from the admin area
|
423 |
+
* Fix: date and time pickers broken on iOS 8 devices
|
424 |
+
* Add complete German translation from scolast34
|
425 |
+
* Add partial Dutch and Chilean translations
|
426 |
+
* Change Party text field to a dropdown selection
|
427 |
+
* Bookings admin panel shows upcoming bookings by default
|
428 |
+
* Use new HTML5 input types for email and phone
|
429 |
+
* Change textdomain to comply with upcoming translation standards
|
430 |
+
* Improve WPML compatibility
|
431 |
+
* New support for assigning custom classes to fields, fieldsets and legends. h/t Primoz Cigler
|
432 |
+
* New filters for email notifications
|
433 |
+
* Fix: some bookings menu pages don't load when screen names are translated
|
434 |
+
* Fix: addons list won't load if allow_url_fopen is disabled
|
435 |
+
|
436 |
+
|
437 |
+
= 1.2.3 (2014-11-04) =
|
438 |
+
* Add a {user_email} notification template tag
|
439 |
+
* Add filter to notification template tag descriptions for extensions
|
440 |
+
* Add Reply-To mail headers and use a more reliable From header
|
441 |
+
* Add filter to the datepicker rules for disabled dates
|
442 |
+
* Fix: missing "Clear" button translation in time picker for many languages
|
443 |
+
* Fix: open time picker in body container to mitigate rare positioning bugs
|
444 |
+
* Fix: don't auto-select today's date if it's not a valid date or errors are attached to the date field
|
445 |
+
|
446 |
+
= 1.2.2 (2014-08-24) =
|
447 |
+
* Fix: custom date formats can break date validation for new bookings
|
448 |
+
* Add new booking form generation hooks for easier customization
|
449 |
+
* Add support for upcoming MailChimp addon
|
450 |
+
* Add new addons page
|
451 |
+
* Update Simple Admin Pages library to v2.0.a.7
|
452 |
+
|
453 |
+
= 1.2.1 (2014-08-01) =
|
454 |
+
* Fix: bulk actions below the bookings table don't work
|
455 |
+
* Fix: PHP Notice generated during validation
|
456 |
+
|
457 |
+
= 1.2 (2014-07-17) =
|
458 |
+
* Add notification template tags for phone number and message
|
459 |
+
* Add automatic selection of date when page is loaded (option to disable this feature)
|
460 |
+
* Add option to set time interval of time picker
|
461 |
+
* Fix auto-detection of pickadate language from WordPress site language
|
462 |
+
* Fix duplicate entry in .pot file that caused PoEdit error
|
463 |
+
|
464 |
+
= 1.1.4 (2014-07-03) =
|
465 |
+
* Add a .pot file for easier translations
|
466 |
+
* Fix notifications that showed MySQL date format instead of user-selected format
|
467 |
+
* Fix Arabic translation of pickadate component
|
468 |
+
* Add support for the correct start of the week depending on language
|
469 |
+
|
470 |
+
= 1.1.3 (2014-05-22) =
|
471 |
+
* Fix an error where the wrong date would be selected when a form was reloaded with validation errors
|
472 |
+
|
473 |
+
= 1.1.2 (2014-05-14) =
|
474 |
+
* Update Simple Admin Pages library to fix an uncommon error when saving Textarea components
|
475 |
+
|
476 |
+
= 1.1.1 (2014-05-14) =
|
477 |
+
* Update Simple Admin Pages library to fix broken Scheduler in Firefox
|
478 |
+
|
479 |
+
= 1.1 (2014-05-12) =
|
480 |
+
* Attempt to load the correct language for the datepicker from the WordPress settings
|
481 |
+
* Add support for choosing a language for the datepicker if different from WordPress settings
|
482 |
+
* Allow late bookings to be blocked 4 hours and 1 day in advance
|
483 |
+
* Fix: don't show settings under WordPress's core General settings page
|
484 |
+
|
485 |
+
= 1.0.2 (2014-05-08) =
|
486 |
+
* Remove development tool from codebase
|
487 |
+
|
488 |
+
= 1.0.1 (2014-05-08) =
|
489 |
+
* Replace dashicons caret with CSS-only caret in booking form
|
490 |
+
|
491 |
+
= 1.0 (2014-05-07) =
|
492 |
+
* Initial release
|
493 |
+
|
494 |
+
== Upgrade Notice ==
|
495 |
+
|
496 |
+
= 1.8.2 =
|
497 |
+
This update fixes an issue with the date and time pickers that occurs with the latest version of the Chrome browser.
|
498 |
+
|
499 |
+
= 1.8.1 =
|
500 |
+
This update fixes a bug in the booking form block where the location would not be reloaded correctly after saving.
|
501 |
+
|
502 |
+
= 1.8 =
|
503 |
+
This update adds a block to the new Gutenberg editor for the booking form.
|
504 |
+
|
505 |
+
= 1.7.8 =
|
506 |
+
This update fixes a bug which removed the GDPR consent status for a booking when the booking was edited. It also adds an option to modify the FROM email header address and updates some translations.
|
507 |
+
|
508 |
+
= 1.7.7 =
|
509 |
+
This update adds two features to help you comply with GDPR privacy regulations in Europe: a confirmation field can be added to the booking form to collect a customer's consent to store their data. And you can delete all bookings related to an email address.
|
510 |
+
|
511 |
+
= 1.7.5 =
|
512 |
+
This update adds an option to require a phone, email address validation and a notification bubble showing the number of upcoming pending bookings in the admin area.
|
513 |
+
|
514 |
+
= 1.7.4 =
|
515 |
+
This update fixes an issue with time restrictions when applied to the same day one month in advance. It also adds a technique to attempt to prevent duplicate submissions. Adds Polish translation.
|
516 |
+
|
517 |
+
= 1.7.3 =
|
518 |
+
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.
|
519 |
+
|
520 |
+
= 1.7.2 =
|
521 |
+
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.
|
522 |
+
|
523 |
+
= 1.7.1 =
|
524 |
+
This update fixes a critical bug introduced in v1.7 if you use bookings with the multi-location features of Business Profile. You are encouraged to update as soon as possible.
|
525 |
+
|
526 |
+
= 1.7 =
|
527 |
+
This update adds new features for banning bookings from no-shows and preventing blocked times from appearing in the time picker. New options for min party size and same-day bookings have been added. Bookings Managers can now edit bookings in the past.
|
528 |
+
|
529 |
+
= 1.6.2 =
|
530 |
+
This update fixes a critical error introduced in v1.6.1 which broke the time picker.
|
531 |
+
|
532 |
+
= 1.6.1 =
|
533 |
+
This maintenance update adds a {location} tag for notifications, improves the location argument in the booking form shortcode and fixes a few minor bugs.
|
534 |
+
|
535 |
+
= 1.6 =
|
536 |
+
This is a major update that adds support for accepting bookings at multiple locations. View the online documentation for further details.
|
537 |
+
|
538 |
+
= 1.5.3 =
|
539 |
+
This update fixes a minor bug when searching for bookings by date, updates compatibilty for WP v4.5, and adds links to the new online documentation.
|
540 |
+
|
541 |
+
= 1.5.2 =
|
542 |
+
This update fixes a bug introduced in the last version which prevented Booking Managers from approving/rejecting reservations.
|
543 |
+
|
544 |
+
= 1.5.1 =
|
545 |
+
This update increases security for the quick link feature to confirm/reject bookings from the admin notification email.
|
546 |
+
|
547 |
+
= 1.5 =
|
548 |
+
This update adds the ability to configure which columns are visible in the bookings table. It works with the Custom Fields addon. If you have added fields using custom code, please read the release notification at themeofthecrop.com before updating.
|
549 |
+
|
550 |
+
= 1.4.10 =
|
551 |
+
This update includes a new Spanish translation and a few minor fixes. Updating isn't necessary for most people.
|
552 |
+
|
553 |
+
= 1.4.9 =
|
554 |
+
This update fixes a bug that made it difficult for iOS 8 users to select a date and time in their bookings. I strongly recommend you update.
|
555 |
+
|
556 |
+
= 1.4.8 =
|
557 |
+
This update fixes a bug that prevented bookings managers from editing bookings within the early/late schedule restrictions. It also fixed a bug with late opening times, added a WPML config file for better multi-lingual compatibility, updated translations, and improved the mobile view of the bookings list.
|
558 |
+
|
559 |
+
= 1.4.7 =
|
560 |
+
This update fixes a bug that prevented bookings from being sorted by date or name in the admin panel. It also updates some translations and improves support for custom late bookings values.
|
561 |
+
|
562 |
+
= 1.4.6 =
|
563 |
+
This update improves compatibility with an upcoming Custom Fields addon. It also fixes some minor bugs with extended Latin characters in emails and the admin list table, and removes expired schedule exceptions.
|
564 |
+
|
565 |
+
= 1.4.5 =
|
566 |
+
This update fixes a non-critical issue with the display of the loading spinner in the upcoming 4.2 version of WordPress.
|
567 |
+
|
568 |
+
= 1.4.4 =
|
569 |
+
This update fixes a low-risk XSS security vulnerability. It is low-risk because in order to exploit this vulnerability a user would need to have access to the bookings management panel in the admin area, which only trusted users should have.
|
570 |
+
|
571 |
+
= 1.4.3 =
|
572 |
+
This update adds datepickers to the start/end date filters in the admin bookings list and fixes a small error with the filters. It also fixes an issue with disabled weekdays when editing bookings. Dutch and German translation updates.
|
573 |
+
|
574 |
+
= 1.4.2 =
|
575 |
+
This update is a maintenance release that fixes a couple minor issues, adds French and Italian translations, and includes some under-the-hood changes to support upcoming extensions. 1.4.1-1.4.2 fixes a rare but vital performance issue in the admin.
|
576 |
+
|
577 |
+
= 1.4.1 =
|
578 |
+
This update is a maintenance release that fixes a couple minor issues, adds French and Italian translations, and includes some under-the-hood changes to support upcoming extensions.
|
579 |
+
|
580 |
+
= 1.4 =
|
581 |
+
Thanks to sponsorship from Gemini Design, the plugin now supports sending an email directly to customers from the list of bookings, so you can request more details or suggest an alternative booking time. This update also improves the German translation and adds a Hebrew translation. Read the full changelog for details.
|
582 |
+
|
583 |
+
= 1.3 =
|
584 |
+
This update adds support for adding and editing bookings from the admin panel. The bookings panel now shows upcoming bookings by default. The Party field in the booking form is now a dropdown selection. Plus a bunch of new features and fixes. Read the full changelog for details.
|
585 |
+
|
586 |
+
= 1.2.3 =
|
587 |
+
This update adds a {user_email} notification template tag and improves the mail headers on notifications to mitigate spam risk. It also adds the missing translation for the Clear button in the time picker for many languages. More minor bug fixes listed in the changelog.
|
588 |
+
|
589 |
+
= 1.2.2 =
|
590 |
+
This update adds support for a new MailChimp addon that will be released soon. An addons page is now available under the Bookings menu. A bug in which custom date/time formats could cause validation errors has been fixed. New hooks are now in place so that it's easier to customize the form output.
|
591 |
+
|
592 |
+
= 1.2.1 =
|
593 |
+
This is a minor maintenance update which fixes a couple of small bugs.
|
594 |
+
|
595 |
+
= 1.2 =
|
596 |
+
This update adds new template tags for notification emails, a new option to customize the time interval and more. A new .pot file has been generated, so update your translations. Consult the changelog for further details.
|
597 |
+
|
598 |
+
= 1.1.4 =
|
599 |
+
This updated fixes an error with the format of the date in notification emails. Now it will show you the date formatted however you have chosen for it to be formatted in your WordPress installation. It also now displays the correct start of the week depending on the language selected for the datepicker. A .pot file is now included for easier translations.
|
600 |
+
|
601 |
+
= 1.1.3 =
|
602 |
+
This update fixes an error when the form had validation errors (missing fields or wrong date/time selected). Instead of loading the selected date it would load today's date. This update ensures the selected date is reloaded properly.
|
603 |
+
|
604 |
+
= 1.1.2 =
|
605 |
+
This update fixes an error some people may experience when trying to save settings. This is the second update today, so if you missed the other one please read the changelog for the 1.1.1 update as well.
|
606 |
+
|
607 |
+
= 1.1.1 =
|
608 |
+
This update fixes problems some users reported when using the Firefox browser to modify the booking schedule. This required an update to a library that is shared with another plugin, Food and Drink Menu. If you are using that plugin, please update that one as well or you may get some odd behavior. (Thanks to sangwh and bforsoft for reporting the issue.)
|
609 |
+
|
610 |
+
= 1.1 =
|
611 |
+
This update improves internationalization (i8n) by attempting to determine the appropriate language for the booking form datepicker from your WordPress settings. It also adds a setting to pick a language manually from a list of supported languages. This update also adds options to block late bookings at least 4 hours or 1 day in advance. Thanks to Remco and Roland for their early feedback.
|
612 |
+
|
613 |
+
= 1.0.2 =
|
614 |
+
This update removes a bit of code that was used for development purposes. Please update as this code could be run by any user on the frontend.
|
restaurant-reservations.php
CHANGED
@@ -1,443 +1,443 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
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.
|
7 |
-
* Author: FiveStarPlugins
|
8 |
-
* Author URI: https://profiles.wordpress.org/fivestarplugins/
|
9 |
-
* Text Domain: restaurant-reservations
|
10 |
-
*/
|
11 |
-
if ( ! defined( 'ABSPATH' ) )
|
12 |
-
exit;
|
13 |
-
|
14 |
-
if ( !class_exists( 'rtbInit' ) ) {
|
15 |
-
class rtbInit {
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Set a flag which tracks whether the form has already been rendered on
|
19 |
-
* the page. Only one form per page for now.
|
20 |
-
* @todo support multiple forms per page
|
21 |
-
*/
|
22 |
-
public $form_rendered = false;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Set a flag which tracks whether the view bookings form has already been
|
26 |
-
* rendered on the page. Only one form per page for now.
|
27 |
-
*/
|
28 |
-
public $display_bookings_form_rendered = false;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* An object which stores a booking request, or an empty object if
|
32 |
-
* no request has been processed.
|
33 |
-
*/
|
34 |
-
public $request;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Initialize the plugin and register hooks
|
38 |
-
*/
|
39 |
-
public function __construct() {
|
40 |
-
|
41 |
-
// Common strings
|
42 |
-
define( 'RTB_VERSION', '2.0.7' );
|
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__ ) );
|
46 |
-
define( 'RTB_BOOKING_POST_TYPE', 'rtb-booking' );
|
47 |
-
define( 'RTB_BOOKING_POST_TYPE_SLUG', 'booking' );
|
48 |
-
|
49 |
-
// Initialize the plugin
|
50 |
-
add_action( 'init', array( $this, 'load_textdomain' ) );
|
51 |
-
|
52 |
-
// Set up empty request object
|
53 |
-
$this->request = new stdClass();
|
54 |
-
$this->request->request_processed = false;
|
55 |
-
$this->request->request_inserted = false;
|
56 |
-
|
57 |
-
// Load query class
|
58 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Query.class.php' );
|
59 |
-
|
60 |
-
// Add custom roles and capabilities
|
61 |
-
add_action( 'init', array( $this, 'add_roles' ) );
|
62 |
-
|
63 |
-
// Load the plugin permissions
|
64 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Permissions.class.php' );
|
65 |
-
$this->permissions = new rtbPermissions();
|
66 |
-
$this->handle_combination();
|
67 |
-
|
68 |
-
// Load custom post types
|
69 |
-
require_once( RTB_PLUGIN_DIR . '/includes/CustomPostTypes.class.php' );
|
70 |
-
$this->cpts = new rtbCustomPostTypes();
|
71 |
-
|
72 |
-
// Load multiple location support
|
73 |
-
require_once( RTB_PLUGIN_DIR . '/includes/MultipleLocations.class.php' );
|
74 |
-
$this->locations = new rtbMultipleLocations();
|
75 |
-
|
76 |
-
// Flush the rewrite rules for the custom post types
|
77 |
-
register_activation_hook( __FILE__, array( $this, 'rewrite_flush' ) );
|
78 |
-
|
79 |
-
// Load the template functions which print the booking form, etc
|
80 |
-
require_once( RTB_PLUGIN_DIR . '/includes/template-functions.php' );
|
81 |
-
|
82 |
-
// Load the admin bookings page
|
83 |
-
require_once( RTB_PLUGIN_DIR . '/includes/AdminBookings.class.php' );
|
84 |
-
$this->bookings = new rtbAdminBookings();
|
85 |
-
|
86 |
-
// Load assets
|
87 |
-
add_action( 'admin_notices', array($this, 'display_header_area'));
|
88 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
|
89 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
|
90 |
-
|
91 |
-
// Handle notifications
|
92 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Notifications.class.php' );
|
93 |
-
$this->notifications = new rtbNotifications();
|
94 |
-
|
95 |
-
// Load settings
|
96 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Settings.class.php' );
|
97 |
-
$this->settings = new rtbSettings();
|
98 |
-
|
99 |
-
// Load plugin dashboard
|
100 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Dashboard.class.php' );
|
101 |
-
new rtbDashboard();
|
102 |
-
|
103 |
-
// Load walk-through
|
104 |
-
require_once( RTB_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
|
105 |
-
new rtbInstallationWalkthrough();
|
106 |
-
register_activation_hook( __FILE__, array( $this, 'run_walkthrough' ) );
|
107 |
-
|
108 |
-
// Create cron jobs for reminders and late arrivals
|
109 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Cron.class.php' );
|
110 |
-
$this->cron = new rtbCron();
|
111 |
-
register_activation_hook( __FILE__, array( $this, 'cron_schedule_events' ) );
|
112 |
-
register_deactivation_hook( __FILE__, array( $this, 'cron_unschedule_events' ) );
|
113 |
-
|
114 |
-
// Handle AJAX actions
|
115 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Ajax.class.php' );
|
116 |
-
$this->ajax = new rtbAJAX();
|
117 |
-
|
118 |
-
// Handle setting up exports
|
119 |
-
require_once( RTB_PLUGIN_DIR . '/includes/ExportHandler.class.php' );
|
120 |
-
$this->exports = new rtbExportHandler();
|
121 |
-
|
122 |
-
// Handle setting up exports
|
123 |
-
require_once( RTB_PLUGIN_DIR . '/includes/EmailTemplates.class.php' );
|
124 |
-
$this->email_templates = new rtbEmailTemplates();
|
125 |
-
|
126 |
-
// Load the custom fields
|
127 |
-
require_once( RTB_PLUGIN_DIR . '/includes/CustomFields.class.php' );
|
128 |
-
$this->custom_fields = new rtbCustomFields();
|
129 |
-
|
130 |
-
// Load in the custom fields controller
|
131 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Field.Controller.class.php' );
|
132 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Field.class.php' );
|
133 |
-
$this->fields = new rtbFieldController();
|
134 |
-
|
135 |
-
// Load the custom fields editor page
|
136 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Editor.class.php' );
|
137 |
-
$this->editor = new cffrtbEditor();
|
138 |
-
|
139 |
-
// Load MailChimp integration
|
140 |
-
require_once( RTB_PLUGIN_DIR . '/includes/MailChimp.class.php' );
|
141 |
-
$this->mailchimp = new mcfrtbInit();
|
142 |
-
|
143 |
-
// Append booking form to a post's $content variable
|
144 |
-
add_filter( 'the_content', array( $this, 'append_to_content' ) );
|
145 |
-
|
146 |
-
// Register the widget
|
147 |
-
add_action( 'widgets_init', array( $this, 'register_widgets' ) );
|
148 |
-
|
149 |
-
// Add links to plugin listing
|
150 |
-
add_filter('plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
|
151 |
-
|
152 |
-
// Load integrations with other plugins
|
153 |
-
require_once( RTB_PLUGIN_DIR . '/includes/integrations/business-profile.php' );
|
154 |
-
require_once( RTB_PLUGIN_DIR . '/includes/integrations/woocommerce.php' );
|
155 |
-
|
156 |
-
// Load gutenberg blocks
|
157 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Blocks.class.php' );
|
158 |
-
new rtbBlocks();
|
159 |
-
|
160 |
-
// Load backwards compatibility functions
|
161 |
-
require_once( RTB_PLUGIN_DIR . '/includes/Compatibility.class.php' );
|
162 |
-
new rtbCompatibility();
|
163 |
-
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Flush the rewrite rules when this plugin is activated to update with
|
168 |
-
* custom post types
|
169 |
-
* @since 0.0.1
|
170 |
-
*/
|
171 |
-
public function rewrite_flush() {
|
172 |
-
$this->cpts->load_cpts();
|
173 |
-
flush_rewrite_rules();
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Load the plugin textdomain for localistion
|
178 |
-
* @since 0.0.1
|
179 |
-
*/
|
180 |
-
public function load_textdomain() {
|
181 |
-
load_plugin_textdomain( 'restaurant-reservations', false, plugin_basename( dirname( __FILE__ ) ) . "/languages/" );
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Set a transient so that the walk-through gets run
|
186 |
-
* @since 2.0
|
187 |
-
*/
|
188 |
-
public function run_walkthrough() {
|
189 |
-
set_transient('rtb-getting-started', true, 30);
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Add a role to manage the bookings and add the capability to Editors,
|
194 |
-
* Administrators and Super Admins
|
195 |
-
* @since 0.0.1
|
196 |
-
*/
|
197 |
-
public function add_roles() {
|
198 |
-
|
199 |
-
// The booking manager should be able to access the bookings list and
|
200 |
-
// update booking statuses, but shouldn't be able to touch anything else
|
201 |
-
// in the account.
|
202 |
-
$booking_manager = add_role(
|
203 |
-
'rtb_booking_manager',
|
204 |
-
__( 'Booking Manager', 'restaurant-reservations' ),
|
205 |
-
array(
|
206 |
-
'read' => true,
|
207 |
-
'manage_bookings' => true,
|
208 |
-
)
|
209 |
-
);
|
210 |
-
|
211 |
-
$manage_bookings_roles = apply_filters(
|
212 |
-
'rtb_manage_bookings_roles',
|
213 |
-
array(
|
214 |
-
'administrator',
|
215 |
-
'editor',
|
216 |
-
)
|
217 |
-
);
|
218 |
-
|
219 |
-
global $wp_roles;
|
220 |
-
foreach ( $manage_bookings_roles as $role ) {
|
221 |
-
$wp_roles->add_cap( $role, 'manage_bookings' );
|
222 |
-
}
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Append booking form to a post's $content variable
|
227 |
-
* @since 0.0.1
|
228 |
-
*/
|
229 |
-
function append_to_content( $content ) {
|
230 |
-
global $post;
|
231 |
-
|
232 |
-
if ( !is_main_query() || !in_the_loop() || post_password_required() ) {
|
233 |
-
return $content;
|
234 |
-
}
|
235 |
-
|
236 |
-
if ( $post->ID == $this->settings->get_setting( 'booking-page' ) ) {
|
237 |
-
return $content . rtb_print_booking_form();
|
238 |
-
}
|
239 |
-
|
240 |
-
if ( $post->ID == $this->settings->get_setting( 'view-bookings-page' ) ) {
|
241 |
-
|
242 |
-
if ( $this->settings->get_setting( 'view-bookings-private' ) and ! is_user_logged_in() ) { return $content; }
|
243 |
-
|
244 |
-
$args = array();
|
245 |
-
if ( isset($_GET['date']) ) { $args['date'] = $_GET['date']; }
|
246 |
-
|
247 |
-
return $content . rtb_print_view_bookings_form( $args );
|
248 |
-
}
|
249 |
-
$view_bookings_page = $this->settings->get_setting( 'view-bookings-page' );
|
250 |
-
|
251 |
-
return $content;
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Adds in a menu bar for the plugin
|
256 |
-
* @since 2.0
|
257 |
-
*/
|
258 |
-
public function display_header_area() {
|
259 |
-
global $rtb_controller, $admin_page_hooks, $post;
|
260 |
-
|
261 |
-
$screen = get_current_screen();
|
262 |
-
$screenID = $screen->id;
|
263 |
-
|
264 |
-
if ( $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-settings' && $screenID != 'toplevel_page_rtb-bookings' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-dashboard' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_cffrtb-editor' ) {return;}
|
265 |
-
|
266 |
-
if ( ! $rtb_controller->permissions->check_permission( 'styling' ) || get_option("RTB_Trial_Happening") == "Yes" ) {
|
267 |
-
echo "<a href='https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1' class='rtb-temp-upgrade-banner' target='_blank'>Upgrade to the Premium Version!</a>";
|
268 |
-
}
|
269 |
-
|
270 |
-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
271 |
-
if ( get_option( 'rtb-pro-was-active' ) > time() - 7*24*3600 ) {
|
272 |
-
echo "<div class='rtb-deactivate-pro'>";
|
273 |
-
echo "<p>We've combined the code base for the free and pro versions into one plugin file for easier management.</p>";
|
274 |
-
echo "<p>You still have access to the premium features you purchased, and you can read more about why we've combined them <a href='http://www.fivestarplugins.com/2019/10/21/five-star-restaurant-reservations-new-features-more-options/'>on our blog</a></p>";
|
275 |
-
echo "</div>";
|
276 |
-
}
|
277 |
-
|
278 |
-
?>
|
279 |
-
<div class="rtb-admin-header-menu">
|
280 |
-
<h2 class="nav-tab-wrapper">
|
281 |
-
<a id="rtb-dash-mobile-menu-open" href="#" class="menu-tab nav-tab"><?php _e("MENU", 'restaurant-reservations'); ?><span id="rtb-dash-mobile-menu-down-caret"> ▼</span><span id="rtb-dash-mobile-menu-up-caret"> ▲</span></a>
|
282 |
-
<a id="dashboard-menu" href='admin.php?page=rtb-dashboard' class="menu-tab nav-tab <?php if ($screenID == 'bookings_page_rtb-dashboard') {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'restaurant-reservations'); ?></a>
|
283 |
-
<a id="bookings-menu" href='admin.php?page=rtb-bookings' class="menu-tab nav-tab <?php if ($screenID == 'toplevel_page_rtb-bookings') {echo 'nav-tab-active';}?>"><?php _e("Bookings", 'restaurant-reservations'); ?></a>
|
284 |
-
<a id="options-menu" href='admin.php?page=rtb-settings' class="menu-tab nav-tab <?php if ($screenID == 'bookings_page_rtb-settings') {echo 'nav-tab-active';}?>"><?php _e("Settings", 'restaurant-reservations'); ?></a>
|
285 |
-
<?php if ($rtb_controller->permissions->check_permission( 'custom_fields' ) ) { ?><a id="customfields-menu" href='admin.php?page=cffrtb-editor' class="menu-tab nav-tab <?php if ($screenID == 'bookings_page_cffrtb-editor') {echo 'nav-tab-active';}?>"><?php _e("Custom Fields", 'restaurant-reservations'); ?></a><?php } ?>
|
286 |
-
</h2>
|
287 |
-
</div>
|
288 |
-
<?php
|
289 |
-
}
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Enqueue the admin-only CSS and Javascript
|
293 |
-
* @since 0.0.1
|
294 |
-
*/
|
295 |
-
public function enqueue_admin_assets() {
|
296 |
-
|
297 |
-
global $rtb_controller;
|
298 |
-
|
299 |
-
// Use the page reference in $admin_page_hooks because
|
300 |
-
// it changes in SOME hooks when it is translated.
|
301 |
-
// https://core.trac.wordpress.org/ticket/18857
|
302 |
-
global $admin_page_hooks;
|
303 |
-
|
304 |
-
$screen = get_current_screen();
|
305 |
-
if ( empty( $screen ) || empty( $admin_page_hooks['rtb-bookings'] ) ) {
|
306 |
-
return;
|
307 |
-
}
|
308 |
-
|
309 |
-
if ( $screen->base == 'toplevel_page_rtb-bookings' || $screen->base == $admin_page_hooks['rtb-bookings'] . '_page_rtb-settings' || $screen->base == $admin_page_hooks['rtb-bookings'] . '_page_rtb-addons' ) {
|
310 |
-
wp_enqueue_style( 'rtb-admin-css', RTB_PLUGIN_URL . '/assets/css/admin.css', array(), RTB_VERSION );
|
311 |
-
wp_enqueue_script( 'rtb-admin-js', RTB_PLUGIN_URL . '/assets/js/admin.js', array( 'jquery' ), '', true );
|
312 |
-
wp_enqueue_style( 'rtb-spectrum-css', RTB_PLUGIN_URL . '/assets/css/spectrum.css' );
|
313 |
-
wp_enqueue_script( 'rtb-spectrum-js', RTB_PLUGIN_URL . '/assets/js/spectrum.js', array( 'jquery' ), '', true );
|
314 |
-
wp_enqueue_script( 'rtb-admin-settings-js', RTB_PLUGIN_URL . '/assets/js/admin-settings.js', array( 'jquery' ), '', true );
|
315 |
-
wp_localize_script(
|
316 |
-
'rtb-admin-js',
|
317 |
-
'rtb_admin',
|
318 |
-
array(
|
319 |
-
'nonce' => wp_create_nonce( 'rtb-admin' ),
|
320 |
-
'strings' => array(
|
321 |
-
'add_booking' => __( 'Add Booking', 'restaurant-reservations' ),
|
322 |
-
'edit_booking' => __( 'Edit Booking', 'restaurant-reservations' ),
|
323 |
-
'error_unspecified' => __( 'An unspecified error occurred. Please try again. If the problem persists, try logging out and logging back in.', 'restaurant-reservations' ),
|
324 |
-
),
|
325 |
-
'banned_emails' => preg_split( '/\r\n|\r|\n/', (string) $rtb_controller->settings->get_setting( 'ban-emails' ) ),
|
326 |
-
'banned_ips' => preg_split( '/\r\n|\r|\n/', (string) $rtb_controller->settings->get_setting( 'ban-ips' ) ),
|
327 |
-
'export_url' => admin_url( '?action=ebfrtb-export' )
|
328 |
-
)
|
329 |
-
);
|
330 |
-
}
|
331 |
-
|
332 |
-
// Enqueue frontend assets to add/edit bookins on the bookings page
|
333 |
-
if ( $screen->base == 'toplevel_page_rtb-bookings' ) {
|
334 |
-
$this->register_assets();
|
335 |
-
rtb_enqueue_assets();
|
336 |
-
}
|
337 |
-
}
|
338 |
-
|
339 |
-
/**
|
340 |
-
* Register the front-end CSS and Javascript for the booking form
|
341 |
-
* @since 0.0.1
|
342 |
-
*/
|
343 |
-
function register_assets() {
|
344 |
-
|
345 |
-
if ( !apply_filters( 'rtb-load-frontend-assets', true ) ) {
|
346 |
-
return;
|
347 |
-
}
|
348 |
-
|
349 |
-
wp_register_style( 'pickadate-default', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/default.css' );
|
350 |
-
wp_register_style( 'pickadate-date', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/default.date.css' );
|
351 |
-
wp_register_style( 'pickadate-time', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/default.time.css' );
|
352 |
-
wp_register_script( 'pickadate', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/picker.js', array( 'jquery' ), '', true );
|
353 |
-
wp_register_script( 'pickadate-date', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/picker.date.js', array( 'jquery' ), '', true );
|
354 |
-
wp_register_script( 'pickadate-time', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/picker.time.js', array( 'jquery' ), '', true );
|
355 |
-
wp_register_script( 'pickadate-legacy', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/legacy.js', array( 'jquery' ), '', true );
|
356 |
-
|
357 |
-
$i8n = $this->settings->get_setting( 'i8n' );
|
358 |
-
if ( !empty( $i8n ) ) {
|
359 |
-
wp_register_script( 'pickadate-i8n', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/translations/' . esc_attr( $i8n ) . '.js', array( 'jquery' ), '', true );
|
360 |
-
|
361 |
-
// Arabic and Hebrew are right-to-left languages
|
362 |
-
if ( $i8n == 'ar' || $i8n == 'he_IL' ) {
|
363 |
-
wp_register_style( 'pickadate-rtl', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/rtl.css' );
|
364 |
-
}
|
365 |
-
}
|
366 |
-
|
367 |
-
wp_register_style( 'rtb-booking-form', RTB_PLUGIN_URL . '/assets/css/booking-form.css' );
|
368 |
-
wp_register_script( 'rtb-booking-form', RTB_PLUGIN_URL . '/assets/js/booking-form.js', array( 'jquery' ) );
|
369 |
-
}
|
370 |
-
|
371 |
-
/**
|
372 |
-
* Register the widgets
|
373 |
-
* @since 0.0.1
|
374 |
-
*/
|
375 |
-
public function register_widgets() {
|
376 |
-
require_once( RTB_PLUGIN_DIR . '/includes/WP_Widget.BookingFormWidget.class.php' );
|
377 |
-
register_widget( 'rtbBookingFormWidget' );
|
378 |
-
}
|
379 |
-
|
380 |
-
/**
|
381 |
-
* Add links to the plugin listing on the installed plugins page
|
382 |
-
* @since 0.0.1
|
383 |
-
*/
|
384 |
-
public function plugin_action_links( $links, $plugin ) {
|
385 |
-
|
386 |
-
if ( $plugin == RTB_PLUGIN_FNAME ) {
|
387 |
-
|
388 |
-
$links['help'] = '<a href="http://doc.fivestarplugins.com/plugins/restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%Help&utm_campaign=Restaurant%20Reservations" title="' . __( 'View the help documentation for Restaurant Reservations', 'restaurant-reservations' ) . '">' . __( 'Help', 'restaurant-reservations' ) . '</a>';
|
389 |
-
}
|
390 |
-
|
391 |
-
return $links;
|
392 |
-
|
393 |
-
}
|
394 |
-
|
395 |
-
/**
|
396 |
-
* Register the cron hook that the plugin uses
|
397 |
-
* @since 2.0
|
398 |
-
*/
|
399 |
-
public function cron_schedule_events() {
|
400 |
-
$this->cron->schedule_events();
|
401 |
-
}
|
402 |
-
|
403 |
-
/**
|
404 |
-
* Unregister the cron hook that the plugin uses
|
405 |
-
* @since 2.0
|
406 |
-
*/
|
407 |
-
public function cron_unschedule_events() {
|
408 |
-
$this->cron->unschedule_events();
|
409 |
-
}
|
410 |
-
|
411 |
-
/**
|
412 |
-
* Handle the codebase combination
|
413 |
-
* @since 2.0
|
414 |
-
*/
|
415 |
-
public function handle_combination() {
|
416 |
-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
417 |
-
|
418 |
-
if ( is_plugin_active( "custom-fields-for-rtb/custom-fields-for-rtb.php" ) ) {
|
419 |
-
update_option('rtb-pro-was-active', time());
|
420 |
-
deactivate_plugins("custom-fields-for-rtb/custom-fields-for-rtb.php");
|
421 |
-
}
|
422 |
-
|
423 |
-
if ( is_plugin_active( "email-templates-for-rtb/email-templates-for-rtb.php" ) ) {
|
424 |
-
update_option('rtb-pro-was-active', time());
|
425 |
-
deactivate_plugins("email-templates-for-rtb/email-templates-for-rtb.php");
|
426 |
-
}
|
427 |
-
|
428 |
-
if ( is_plugin_active( "export-bookings-for-rtb/export-bookings-for-rtb.php" ) ) {
|
429 |
-
update_option('rtb-pro-was-active', time());
|
430 |
-
deactivate_plugins("export-bookings-for-rtb/export-bookings-for-rtb.php");
|
431 |
-
}
|
432 |
-
|
433 |
-
if ( is_plugin_active( "mailchimp-for-rtb/mailchimp-for-rtb.php" ) ) {
|
434 |
-
update_option('rtb-pro-was-active', time());
|
435 |
-
deactivate_plugins("mailchimp-for-rtb/mailchimp-for-rtb.php");
|
436 |
-
}
|
437 |
-
}
|
438 |
-
|
439 |
-
}
|
440 |
-
} // endif;
|
441 |
-
|
442 |
-
global $rtb_controller;
|
443 |
-
$rtb_controller = new rtbInit();
|
1 |
+
<?php
|
2 |
+
/**
|
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.12
|
7 |
+
* Author: FiveStarPlugins
|
8 |
+
* Author URI: https://profiles.wordpress.org/fivestarplugins/
|
9 |
+
* Text Domain: restaurant-reservations
|
10 |
+
*/
|
11 |
+
if ( ! defined( 'ABSPATH' ) )
|
12 |
+
exit;
|
13 |
+
|
14 |
+
if ( !class_exists( 'rtbInit' ) ) {
|
15 |
+
class rtbInit {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Set a flag which tracks whether the form has already been rendered on
|
19 |
+
* the page. Only one form per page for now.
|
20 |
+
* @todo support multiple forms per page
|
21 |
+
*/
|
22 |
+
public $form_rendered = false;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Set a flag which tracks whether the view bookings form has already been
|
26 |
+
* rendered on the page. Only one form per page for now.
|
27 |
+
*/
|
28 |
+
public $display_bookings_form_rendered = false;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* An object which stores a booking request, or an empty object if
|
32 |
+
* no request has been processed.
|
33 |
+
*/
|
34 |
+
public $request;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Initialize the plugin and register hooks
|
38 |
+
*/
|
39 |
+
public function __construct() {
|
40 |
+
|
41 |
+
// Common strings
|
42 |
+
define( 'RTB_VERSION', '2.0.7' );
|
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__ ) );
|
46 |
+
define( 'RTB_BOOKING_POST_TYPE', 'rtb-booking' );
|
47 |
+
define( 'RTB_BOOKING_POST_TYPE_SLUG', 'booking' );
|
48 |
+
|
49 |
+
// Initialize the plugin
|
50 |
+
add_action( 'init', array( $this, 'load_textdomain' ) );
|
51 |
+
|
52 |
+
// Set up empty request object
|
53 |
+
$this->request = new stdClass();
|
54 |
+
$this->request->request_processed = false;
|
55 |
+
$this->request->request_inserted = false;
|
56 |
+
|
57 |
+
// Load query class
|
58 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Query.class.php' );
|
59 |
+
|
60 |
+
// Add custom roles and capabilities
|
61 |
+
add_action( 'init', array( $this, 'add_roles' ) );
|
62 |
+
|
63 |
+
// Load the plugin permissions
|
64 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Permissions.class.php' );
|
65 |
+
$this->permissions = new rtbPermissions();
|
66 |
+
$this->handle_combination();
|
67 |
+
|
68 |
+
// Load custom post types
|
69 |
+
require_once( RTB_PLUGIN_DIR . '/includes/CustomPostTypes.class.php' );
|
70 |
+
$this->cpts = new rtbCustomPostTypes();
|
71 |
+
|
72 |
+
// Load multiple location support
|
73 |
+
require_once( RTB_PLUGIN_DIR . '/includes/MultipleLocations.class.php' );
|
74 |
+
$this->locations = new rtbMultipleLocations();
|
75 |
+
|
76 |
+
// Flush the rewrite rules for the custom post types
|
77 |
+
register_activation_hook( __FILE__, array( $this, 'rewrite_flush' ) );
|
78 |
+
|
79 |
+
// Load the template functions which print the booking form, etc
|
80 |
+
require_once( RTB_PLUGIN_DIR . '/includes/template-functions.php' );
|
81 |
+
|
82 |
+
// Load the admin bookings page
|
83 |
+
require_once( RTB_PLUGIN_DIR . '/includes/AdminBookings.class.php' );
|
84 |
+
$this->bookings = new rtbAdminBookings();
|
85 |
+
|
86 |
+
// Load assets
|
87 |
+
add_action( 'admin_notices', array($this, 'display_header_area'));
|
88 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
|
89 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
|
90 |
+
|
91 |
+
// Handle notifications
|
92 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Notifications.class.php' );
|
93 |
+
$this->notifications = new rtbNotifications();
|
94 |
+
|
95 |
+
// Load settings
|
96 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Settings.class.php' );
|
97 |
+
$this->settings = new rtbSettings();
|
98 |
+
|
99 |
+
// Load plugin dashboard
|
100 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Dashboard.class.php' );
|
101 |
+
new rtbDashboard();
|
102 |
+
|
103 |
+
// Load walk-through
|
104 |
+
require_once( RTB_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
|
105 |
+
new rtbInstallationWalkthrough();
|
106 |
+
register_activation_hook( __FILE__, array( $this, 'run_walkthrough' ) );
|
107 |
+
|
108 |
+
// Create cron jobs for reminders and late arrivals
|
109 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Cron.class.php' );
|
110 |
+
$this->cron = new rtbCron();
|
111 |
+
register_activation_hook( __FILE__, array( $this, 'cron_schedule_events' ) );
|
112 |
+
register_deactivation_hook( __FILE__, array( $this, 'cron_unschedule_events' ) );
|
113 |
+
|
114 |
+
// Handle AJAX actions
|
115 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Ajax.class.php' );
|
116 |
+
$this->ajax = new rtbAJAX();
|
117 |
+
|
118 |
+
// Handle setting up exports
|
119 |
+
require_once( RTB_PLUGIN_DIR . '/includes/ExportHandler.class.php' );
|
120 |
+
$this->exports = new rtbExportHandler();
|
121 |
+
|
122 |
+
// Handle setting up exports
|
123 |
+
require_once( RTB_PLUGIN_DIR . '/includes/EmailTemplates.class.php' );
|
124 |
+
$this->email_templates = new rtbEmailTemplates();
|
125 |
+
|
126 |
+
// Load the custom fields
|
127 |
+
require_once( RTB_PLUGIN_DIR . '/includes/CustomFields.class.php' );
|
128 |
+
$this->custom_fields = new rtbCustomFields();
|
129 |
+
|
130 |
+
// Load in the custom fields controller
|
131 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Field.Controller.class.php' );
|
132 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Field.class.php' );
|
133 |
+
$this->fields = new rtbFieldController();
|
134 |
+
|
135 |
+
// Load the custom fields editor page
|
136 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Editor.class.php' );
|
137 |
+
$this->editor = new cffrtbEditor();
|
138 |
+
|
139 |
+
// Load MailChimp integration
|
140 |
+
require_once( RTB_PLUGIN_DIR . '/includes/MailChimp.class.php' );
|
141 |
+
$this->mailchimp = new mcfrtbInit();
|
142 |
+
|
143 |
+
// Append booking form to a post's $content variable
|
144 |
+
add_filter( 'the_content', array( $this, 'append_to_content' ) );
|
145 |
+
|
146 |
+
// Register the widget
|
147 |
+
add_action( 'widgets_init', array( $this, 'register_widgets' ) );
|
148 |
+
|
149 |
+
// Add links to plugin listing
|
150 |
+
add_filter('plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
|
151 |
+
|
152 |
+
// Load integrations with other plugins
|
153 |
+
require_once( RTB_PLUGIN_DIR . '/includes/integrations/business-profile.php' );
|
154 |
+
require_once( RTB_PLUGIN_DIR . '/includes/integrations/woocommerce.php' );
|
155 |
+
|
156 |
+
// Load gutenberg blocks
|
157 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Blocks.class.php' );
|
158 |
+
new rtbBlocks();
|
159 |
+
|
160 |
+
// Load backwards compatibility functions
|
161 |
+
require_once( RTB_PLUGIN_DIR . '/includes/Compatibility.class.php' );
|
162 |
+
new rtbCompatibility();
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Flush the rewrite rules when this plugin is activated to update with
|
168 |
+
* custom post types
|
169 |
+
* @since 0.0.1
|
170 |
+
*/
|
171 |
+
public function rewrite_flush() {
|
172 |
+
$this->cpts->load_cpts();
|
173 |
+
flush_rewrite_rules();
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Load the plugin textdomain for localistion
|
178 |
+
* @since 0.0.1
|
179 |
+
*/
|
180 |
+
public function load_textdomain() {
|
181 |
+
load_plugin_textdomain( 'restaurant-reservations', false, plugin_basename( dirname( __FILE__ ) ) . "/languages/" );
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Set a transient so that the walk-through gets run
|
186 |
+
* @since 2.0
|
187 |
+
*/
|
188 |
+
public function run_walkthrough() {
|
189 |
+
set_transient('rtb-getting-started', true, 30);
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Add a role to manage the bookings and add the capability to Editors,
|
194 |
+
* Administrators and Super Admins
|
195 |
+
* @since 0.0.1
|
196 |
+
*/
|
197 |
+
public function add_roles() {
|
198 |
+
|
199 |
+
// The booking manager should be able to access the bookings list and
|
200 |
+
// update booking statuses, but shouldn't be able to touch anything else
|
201 |
+
// in the account.
|
202 |
+
$booking_manager = add_role(
|
203 |
+
'rtb_booking_manager',
|
204 |
+
__( 'Booking Manager', 'restaurant-reservations' ),
|
205 |
+
array(
|
206 |
+
'read' => true,
|
207 |
+
'manage_bookings' => true,
|
208 |
+
)
|
209 |
+
);
|
210 |
+
|
211 |
+
$manage_bookings_roles = apply_filters(
|
212 |
+
'rtb_manage_bookings_roles',
|
213 |
+
array(
|
214 |
+
'administrator',
|
215 |
+
'editor',
|
216 |
+
)
|
217 |
+
);
|
218 |
+
|
219 |
+
global $wp_roles;
|
220 |
+
foreach ( $manage_bookings_roles as $role ) {
|
221 |
+
$wp_roles->add_cap( $role, 'manage_bookings' );
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Append booking form to a post's $content variable
|
227 |
+
* @since 0.0.1
|
228 |
+
*/
|
229 |
+
function append_to_content( $content ) {
|
230 |
+
global $post;
|
231 |
+
|
232 |
+
if ( !is_main_query() || !in_the_loop() || post_password_required() ) {
|
233 |
+
return $content;
|
234 |
+
}
|
235 |
+
|
236 |
+
if ( $post->ID == $this->settings->get_setting( 'booking-page' ) ) {
|
237 |
+
return $content . rtb_print_booking_form();
|
238 |
+
}
|
239 |
+
|
240 |
+
if ( $post->ID == $this->settings->get_setting( 'view-bookings-page' ) ) {
|
241 |
+
|
242 |
+
if ( $this->settings->get_setting( 'view-bookings-private' ) and ! is_user_logged_in() ) { return $content; }
|
243 |
+
|
244 |
+
$args = array();
|
245 |
+
if ( isset($_GET['date']) ) { $args['date'] = $_GET['date']; }
|
246 |
+
|
247 |
+
return $content . rtb_print_view_bookings_form( $args );
|
248 |
+
}
|
249 |
+
$view_bookings_page = $this->settings->get_setting( 'view-bookings-page' );
|
250 |
+
|
251 |
+
return $content;
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Adds in a menu bar for the plugin
|
256 |
+
* @since 2.0
|
257 |
+
*/
|
258 |
+
public function display_header_area() {
|
259 |
+
global $rtb_controller, $admin_page_hooks, $post;
|
260 |
+
|
261 |
+
$screen = get_current_screen();
|
262 |
+
$screenID = $screen->id;
|
263 |
+
|
264 |
+
if ( $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-settings' && $screenID != 'toplevel_page_rtb-bookings' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-dashboard' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_cffrtb-editor' ) {return;}
|
265 |
+
|
266 |
+
if ( ! $rtb_controller->permissions->check_permission( 'styling' ) || get_option("RTB_Trial_Happening") == "Yes" ) {
|
267 |
+
echo "<a href='https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1' class='rtb-temp-upgrade-banner' target='_blank'>Upgrade to the Premium Version!</a>";
|
268 |
+
}
|
269 |
+
|
270 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
271 |
+
if ( get_option( 'rtb-pro-was-active' ) > time() - 7*24*3600 ) {
|
272 |
+
echo "<div class='rtb-deactivate-pro'>";
|
273 |
+
echo "<p>We've combined the code base for the free and pro versions into one plugin file for easier management.</p>";
|
274 |
+
echo "<p>You still have access to the premium features you purchased, and you can read more about why we've combined them <a href='http://www.fivestarplugins.com/2019/10/21/five-star-restaurant-reservations-new-features-more-options/'>on our blog</a></p>";
|
275 |
+
echo "</div>";
|
276 |
+
}
|
277 |
+
|
278 |
+
?>
|
279 |
+
<div class="rtb-admin-header-menu">
|
280 |
+
<h2 class="nav-tab-wrapper">
|
281 |
+
<a id="rtb-dash-mobile-menu-open" href="#" class="menu-tab nav-tab"><?php _e("MENU", 'restaurant-reservations'); ?><span id="rtb-dash-mobile-menu-down-caret"> ▼</span><span id="rtb-dash-mobile-menu-up-caret"> ▲</span></a>
|
282 |
+
<a id="dashboard-menu" href='admin.php?page=rtb-dashboard' class="menu-tab nav-tab <?php if ($screenID == 'bookings_page_rtb-dashboard') {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'restaurant-reservations'); ?></a>
|
283 |
+
<a id="bookings-menu" href='admin.php?page=rtb-bookings' class="menu-tab nav-tab <?php if ($screenID == 'toplevel_page_rtb-bookings') {echo 'nav-tab-active';}?>"><?php _e("Bookings", 'restaurant-reservations'); ?></a>
|
284 |
+
<a id="options-menu" href='admin.php?page=rtb-settings' class="menu-tab nav-tab <?php if ($screenID == 'bookings_page_rtb-settings') {echo 'nav-tab-active';}?>"><?php _e("Settings", 'restaurant-reservations'); ?></a>
|
285 |
+
<?php if ($rtb_controller->permissions->check_permission( 'custom_fields' ) ) { ?><a id="customfields-menu" href='admin.php?page=cffrtb-editor' class="menu-tab nav-tab <?php if ($screenID == 'bookings_page_cffrtb-editor') {echo 'nav-tab-active';}?>"><?php _e("Custom Fields", 'restaurant-reservations'); ?></a><?php } ?>
|
286 |
+
</h2>
|
287 |
+
</div>
|
288 |
+
<?php
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Enqueue the admin-only CSS and Javascript
|
293 |
+
* @since 0.0.1
|
294 |
+
*/
|
295 |
+
public function enqueue_admin_assets() {
|
296 |
+
|
297 |
+
global $rtb_controller;
|
298 |
+
|
299 |
+
// Use the page reference in $admin_page_hooks because
|
300 |
+
// it changes in SOME hooks when it is translated.
|
301 |
+
// https://core.trac.wordpress.org/ticket/18857
|
302 |
+
global $admin_page_hooks;
|
303 |
+
|
304 |
+
$screen = get_current_screen();
|
305 |
+
if ( empty( $screen ) || empty( $admin_page_hooks['rtb-bookings'] ) ) {
|
306 |
+
return;
|
307 |
+
}
|
308 |
+
|
309 |
+
if ( $screen->base == 'toplevel_page_rtb-bookings' || $screen->base == $admin_page_hooks['rtb-bookings'] . '_page_rtb-settings' || $screen->base == $admin_page_hooks['rtb-bookings'] . '_page_rtb-addons' ) {
|
310 |
+
wp_enqueue_style( 'rtb-admin-css', RTB_PLUGIN_URL . '/assets/css/admin.css', array(), RTB_VERSION );
|
311 |
+
wp_enqueue_script( 'rtb-admin-js', RTB_PLUGIN_URL . '/assets/js/admin.js', array( 'jquery' ), '', true );
|
312 |
+
wp_enqueue_style( 'rtb-spectrum-css', RTB_PLUGIN_URL . '/assets/css/spectrum.css' );
|
313 |
+
wp_enqueue_script( 'rtb-spectrum-js', RTB_PLUGIN_URL . '/assets/js/spectrum.js', array( 'jquery' ), '', true );
|
314 |
+
wp_enqueue_script( 'rtb-admin-settings-js', RTB_PLUGIN_URL . '/assets/js/admin-settings.js', array( 'jquery' ), '', true );
|
315 |
+
wp_localize_script(
|
316 |
+
'rtb-admin-js',
|
317 |
+
'rtb_admin',
|
318 |
+
array(
|
319 |
+
'nonce' => wp_create_nonce( 'rtb-admin' ),
|
320 |
+
'strings' => array(
|
321 |
+
'add_booking' => __( 'Add Booking', 'restaurant-reservations' ),
|
322 |
+
'edit_booking' => __( 'Edit Booking', 'restaurant-reservations' ),
|
323 |
+
'error_unspecified' => __( 'An unspecified error occurred. Please try again. If the problem persists, try logging out and logging back in.', 'restaurant-reservations' ),
|
324 |
+
),
|
325 |
+
'banned_emails' => preg_split( '/\r\n|\r|\n/', (string) $rtb_controller->settings->get_setting( 'ban-emails' ) ),
|
326 |
+
'banned_ips' => preg_split( '/\r\n|\r|\n/', (string) $rtb_controller->settings->get_setting( 'ban-ips' ) ),
|
327 |
+
'export_url' => admin_url( '?action=ebfrtb-export' )
|
328 |
+
)
|
329 |
+
);
|
330 |
+
}
|
331 |
+
|
332 |
+
// Enqueue frontend assets to add/edit bookins on the bookings page
|
333 |
+
if ( $screen->base == 'toplevel_page_rtb-bookings' ) {
|
334 |
+
$this->register_assets();
|
335 |
+
rtb_enqueue_assets();
|
336 |
+
}
|
337 |
+
}
|
338 |
+
|
339 |
+
/**
|
340 |
+
* Register the front-end CSS and Javascript for the booking form
|
341 |
+
* @since 0.0.1
|
342 |
+
*/
|
343 |
+
function register_assets() {
|
344 |
+
|
345 |
+
if ( !apply_filters( 'rtb-load-frontend-assets', true ) ) {
|
346 |
+
return;
|
347 |
+
}
|
348 |
+
|
349 |
+
wp_register_style( 'pickadate-default', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/default.css' );
|
350 |
+
wp_register_style( 'pickadate-date', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/default.date.css' );
|
351 |
+
wp_register_style( 'pickadate-time', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/default.time.css' );
|
352 |
+
wp_register_script( 'pickadate', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/picker.js', array( 'jquery' ), '', true );
|
353 |
+
wp_register_script( 'pickadate-date', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/picker.date.js', array( 'jquery' ), '', true );
|
354 |
+
wp_register_script( 'pickadate-time', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/picker.time.js', array( 'jquery' ), '', true );
|
355 |
+
wp_register_script( 'pickadate-legacy', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/legacy.js', array( 'jquery' ), '', true );
|
356 |
+
|
357 |
+
$i8n = $this->settings->get_setting( 'i8n' );
|
358 |
+
if ( !empty( $i8n ) ) {
|
359 |
+
wp_register_script( 'pickadate-i8n', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/translations/' . esc_attr( $i8n ) . '.js', array( 'jquery' ), '', true );
|
360 |
+
|
361 |
+
// Arabic and Hebrew are right-to-left languages
|
362 |
+
if ( $i8n == 'ar' || $i8n == 'he_IL' ) {
|
363 |
+
wp_register_style( 'pickadate-rtl', RTB_PLUGIN_URL . '/lib/simple-admin-pages/lib/pickadate/themes/rtl.css' );
|
364 |
+
}
|
365 |
+
}
|
366 |
+
|
367 |
+
wp_register_style( 'rtb-booking-form', RTB_PLUGIN_URL . '/assets/css/booking-form.css' );
|
368 |
+
wp_register_script( 'rtb-booking-form', RTB_PLUGIN_URL . '/assets/js/booking-form.js', array( 'jquery' ) );
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Register the widgets
|
373 |
+
* @since 0.0.1
|
374 |
+
*/
|
375 |
+
public function register_widgets() {
|
376 |
+
require_once( RTB_PLUGIN_DIR . '/includes/WP_Widget.BookingFormWidget.class.php' );
|
377 |
+
register_widget( 'rtbBookingFormWidget' );
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Add links to the plugin listing on the installed plugins page
|
382 |
+
* @since 0.0.1
|
383 |
+
*/
|
384 |
+
public function plugin_action_links( $links, $plugin ) {
|
385 |
+
|
386 |
+
if ( $plugin == RTB_PLUGIN_FNAME ) {
|
387 |
+
|
388 |
+
$links['help'] = '<a href="http://doc.fivestarplugins.com/plugins/restaurant-reservations/?utm_source=Plugin&utm_medium=Plugin%Help&utm_campaign=Restaurant%20Reservations" title="' . __( 'View the help documentation for Restaurant Reservations', 'restaurant-reservations' ) . '">' . __( 'Help', 'restaurant-reservations' ) . '</a>';
|
389 |
+
}
|
390 |
+
|
391 |
+
return $links;
|
392 |
+
|
393 |
+
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Register the cron hook that the plugin uses
|
397 |
+
* @since 2.0
|
398 |
+
*/
|
399 |
+
public function cron_schedule_events() {
|
400 |
+
$this->cron->schedule_events();
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Unregister the cron hook that the plugin uses
|
405 |
+
* @since 2.0
|
406 |
+
*/
|
407 |
+
public function cron_unschedule_events() {
|
408 |
+
$this->cron->unschedule_events();
|
409 |
+
}
|
410 |
+
|
411 |
+
/**
|
412 |
+
* Handle the codebase combination
|
413 |
+
* @since 2.0
|
414 |
+
*/
|
415 |
+
public function handle_combination() {
|
416 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
417 |
+
|
418 |
+
if ( is_plugin_active( "custom-fields-for-rtb/custom-fields-for-rtb.php" ) ) {
|
419 |
+
update_option('rtb-pro-was-active', time());
|
420 |
+
deactivate_plugins("custom-fields-for-rtb/custom-fields-for-rtb.php");
|
421 |
+
}
|
422 |
+
|
423 |
+
if ( is_plugin_active( "email-templates-for-rtb/email-templates-for-rtb.php" ) ) {
|
424 |
+
update_option('rtb-pro-was-active', time());
|
425 |
+
deactivate_plugins("email-templates-for-rtb/email-templates-for-rtb.php");
|
426 |
+
}
|
427 |
+
|
428 |
+
if ( is_plugin_active( "export-bookings-for-rtb/export-bookings-for-rtb.php" ) ) {
|
429 |
+
update_option('rtb-pro-was-active', time());
|
430 |
+
deactivate_plugins("export-bookings-for-rtb/export-bookings-for-rtb.php");
|
431 |
+
}
|
432 |
+
|
433 |
+
if ( is_plugin_active( "mailchimp-for-rtb/mailchimp-for-rtb.php" ) ) {
|
434 |
+
update_option('rtb-pro-was-active', time());
|
435 |
+
deactivate_plugins("mailchimp-for-rtb/mailchimp-for-rtb.php");
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
}
|
440 |
+
} // endif;
|
441 |
+
|
442 |
+
global $rtb_controller;
|
443 |
+
$rtb_controller = new rtbInit();
|