WordPress Online Booking and Scheduling Plugin – Bookly - Version 11.3

Version Description

  • Fixed issue with daylight saving time and Google Calendar
  • Fixed formatting for {next_day_agenda}
Download this release

Release Info

Developer Ladela
Plugin Icon 128x128 WordPress Online Booking and Scheduling Plugin – Bookly
Version 11.3
Comparing to
See all releases

Code changes from version 7.6.1 to 11.3

Files changed (437) hide show
  1. autoload.php +12 -12
  2. backend/AB_Backend.php +0 -111
  3. backend/Backend.php +131 -0
  4. backend/modules/appearance/AB_AppearanceController.php +0 -152
  5. backend/modules/appearance/Controller.php +202 -0
  6. backend/modules/appearance/resources/css/appearance.css +0 -42
  7. backend/modules/appearance/resources/js/appearance.js +279 -123
  8. backend/modules/appearance/templates/_1_service.php +154 -96
  9. backend/modules/appearance/templates/_2_time.php +0 -192
  10. backend/modules/appearance/templates/_3_details.php +0 -42
  11. backend/modules/appearance/templates/_3_time.php +165 -0
  12. backend/modules/appearance/templates/_4_cart.php +132 -0
  13. backend/modules/appearance/templates/_4_payment.php +0 -60
  14. backend/modules/appearance/templates/_5_details.php +63 -0
  15. backend/modules/appearance/templates/_5_done.php +0 -8
  16. backend/modules/appearance/templates/_6_payment.php +67 -0
  17. backend/modules/appearance/templates/_7_done.php +7 -0
  18. backend/modules/appearance/templates/_card_payment.php +23 -19
  19. backend/modules/appearance/templates/_codes.php +25 -16
  20. backend/modules/appearance/templates/_progress_tracker.php +35 -25
  21. backend/modules/appearance/templates/index.php +113 -77
  22. backend/modules/appointments/AB_AppointmentsController.php +0 -276
  23. backend/modules/appointments/Controller.php +246 -0
  24. backend/modules/appointments/resources/js/appointments.js +271 -0
  25. backend/modules/appointments/resources/js/ng-app.js +0 -208
  26. backend/modules/appointments/templates/_export_dialog.php +40 -0
  27. backend/modules/appointments/templates/_print_dialog.php +1 -0
  28. backend/modules/appointments/templates/index.php +106 -67
  29. backend/modules/calendar/AB_CalendarController.php +0 -488
  30. backend/modules/calendar/Components.php +62 -0
  31. backend/modules/calendar/Controller.php +584 -0
  32. backend/modules/calendar/forms/AB_AppointmentForm.php +0 -22
  33. backend/modules/calendar/forms/AB_CustomerAppointmentForm.php +0 -17
  34. backend/modules/calendar/resources/css/calendar.css +0 -215
  35. backend/modules/calendar/resources/css/fullcalendar.min.css +1 -1
  36. backend/modules/calendar/resources/js/calendar.js +58 -70
  37. backend/modules/calendar/resources/js/fullcalendar.min.js +5 -4
  38. backend/{resources/js/ng-edit_appointment_dialog.js → modules/calendar/resources/js/ng-appointment_dialog.js} +288 -131
  39. backend/modules/calendar/templates/_appointment_dialog.php +149 -0
  40. backend/modules/calendar/templates/_appointment_form.php +0 -108
  41. backend/modules/calendar/templates/_custom_fields_form.php +0 -77
  42. backend/modules/calendar/templates/_customer_details_dialog.php +98 -0
  43. backend/modules/calendar/templates/calendar.php +79 -49
  44. backend/modules/coupons/AB_CouponsController.php +0 -43
  45. backend/modules/coupons/Controller.php +64 -0
  46. backend/modules/coupons/forms/Coupon.php +19 -0
  47. backend/modules/coupons/resources/css/coupons.css +0 -20
  48. backend/modules/coupons/resources/js/coupons.js +61 -2
  49. backend/modules/coupons/templates/_list.php +0 -4
  50. backend/modules/coupons/templates/_modal.php +1 -0
  51. backend/modules/coupons/templates/index.php +40 -30
  52. backend/modules/custom_fields/AB_CustomFieldsController.php +0 -63
  53. backend/modules/custom_fields/Controller.php +88 -0
  54. backend/modules/custom_fields/resources/css/custom_fields.css +0 -86
  55. backend/modules/custom_fields/resources/js/custom_fields.js +86 -19
  56. backend/modules/custom_fields/templates/_services.php +32 -0
  57. backend/modules/custom_fields/templates/index.php +303 -129
  58. backend/modules/customer/AB_CustomerController.php +0 -254
  59. backend/modules/customer/forms/AB_CustomerForm.php +0 -28
  60. backend/modules/customer/resources/css/customers.css +0 -10
  61. backend/modules/customer/resources/js/ng-app.js +0 -356
  62. backend/modules/customer/templates/_import.php +0 -37
  63. backend/modules/customer/templates/index.php +0 -136
  64. backend/modules/customer/templates/ng-new_customer_dialog.php +0 -110
  65. backend/modules/customers/Components.php +44 -0
  66. backend/modules/customers/Controller.php +235 -0
  67. backend/modules/customers/forms/Customer.php +25 -0
  68. backend/modules/customers/resources/js/customers.js +222 -0
  69. backend/modules/customers/resources/js/ng-customer_dialog.js +122 -0
  70. backend/modules/customers/templates/_customer_dialog.php +60 -0
  71. backend/modules/customers/templates/_export.php +1 -0
  72. backend/modules/customers/templates/_import.php +36 -0
  73. backend/modules/customers/templates/index.php +89 -0
  74. backend/modules/debug/Controller.php +181 -0
  75. backend/modules/debug/resources/css/style.css +12 -0
  76. backend/modules/debug/resources/js/debug.js +3 -0
  77. backend/modules/debug/templates/index.php +71 -0
  78. backend/modules/notifications/AB_NotificationsController.php +0 -70
  79. backend/modules/notifications/Controller.php +108 -0
  80. backend/modules/notifications/forms/AB_NotificationsForm.php +0 -166
  81. backend/modules/notifications/forms/Notifications.php +213 -0
  82. backend/modules/notifications/resources/css/notifications.css +0 -29
  83. backend/modules/notifications/resources/js/ng-app.js +96 -0
  84. backend/modules/notifications/resources/js/notification.js +16 -12
  85. backend/modules/notifications/templates/_codes.php +33 -24
  86. backend/modules/notifications/templates/_codes_cart.php +16 -0
  87. backend/modules/notifications/templates/_codes_client_new_wp_user.php +15 -12
  88. backend/modules/notifications/templates/_codes_staff_agenda.php +7 -4
  89. backend/modules/notifications/templates/_test_email_notifications_modal.php +105 -0
  90. backend/modules/notifications/templates/index.php +135 -121
  91. backend/modules/payment/AB_PaymentController.php +0 -84
  92. backend/modules/payment/templates/_alert.php +0 -4
  93. backend/modules/payment/templates/index.php +0 -148
  94. backend/modules/payments/Components.php +34 -0
  95. backend/modules/payments/Controller.php +263 -0
  96. backend/modules/payments/resources/js/ng-payment_details_dialog.js +69 -0
  97. backend/modules/payments/resources/js/payments.js +184 -0
  98. backend/modules/payments/templates/_payment_details_dialog.php +21 -0
  99. backend/modules/payments/templates/details.php +132 -0
  100. backend/modules/payments/templates/index.php +89 -0
  101. backend/modules/service/AB_ServiceController.php +0 -282
  102. backend/modules/service/forms/AB_CategoryForm.php +0 -25
  103. backend/modules/service/forms/AB_ServiceForm.php +0 -47
  104. backend/modules/service/resources/css/service.css +0 -144
  105. backend/modules/service/resources/js/service.js +0 -344
  106. backend/modules/service/templates/_list.php +0 -177
  107. backend/modules/service/templates/index.php +0 -105
  108. backend/modules/services/Controller.php +288 -0
  109. backend/modules/services/forms/Category.php +22 -0
  110. backend/modules/services/forms/Service.php +52 -0
  111. backend/modules/services/resources/js/service.js +511 -0
  112. backend/modules/services/templates/_category_item.php +18 -0
  113. backend/modules/services/templates/_list.php +311 -0
  114. backend/modules/services/templates/index.php +104 -0
  115. backend/modules/settings/AB_SettingsController.php +0 -197
  116. backend/modules/settings/Controller.php +241 -0
  117. backend/modules/settings/forms/AB_BusinessHoursForm.php +0 -66
  118. backend/modules/settings/forms/AB_CompanyForm.php +0 -64
  119. backend/modules/settings/forms/BusinessHours.php +81 -0
  120. backend/modules/settings/forms/Payments.php +27 -0
  121. backend/modules/settings/resources/js/settings.js +145 -87
  122. backend/modules/settings/templates/_cartForm.php +42 -0
  123. backend/modules/settings/templates/_companyForm.php +55 -48
  124. backend/modules/settings/templates/_customers.php +28 -46
  125. backend/modules/settings/templates/_generalForm.php +107 -120
  126. backend/modules/settings/templates/_googleCalendarForm.php +51 -107
  127. backend/modules/settings/templates/_holidaysForm.php +35 -18
  128. backend/modules/settings/templates/_hoursForm.php +27 -27
  129. backend/modules/settings/templates/_paymentsForm.php +211 -59
  130. backend/modules/settings/templates/_woocommerce.php +47 -76
  131. backend/modules/settings/templates/_woocommerce_codes.php +13 -0
  132. backend/modules/settings/templates/admin_notice.php +0 -18
  133. backend/modules/settings/templates/index.php +75 -63
  134. backend/modules/sms/AB_SmsController.php +0 -46
  135. backend/modules/sms/Controller.php +336 -0
  136. backend/modules/sms/resources/css/flags.css +0 -230
  137. backend/modules/sms/resources/css/flags.png +0 -0
  138. backend/modules/sms/resources/css/sms.css +0 -53
  139. backend/modules/sms/resources/js/sms.js +532 -2
  140. backend/modules/sms/templates/_auto_recharge.php +18 -0
  141. backend/modules/sms/templates/_buttons.php +88 -0
  142. backend/modules/sms/templates/_codes.php +29 -0
  143. backend/modules/sms/templates/_codes_cart.php +16 -0
  144. backend/modules/sms/templates/_codes_client_new_wp_user.php +14 -0
  145. backend/modules/sms/templates/_codes_staff_agenda.php +7 -0
  146. backend/modules/sms/templates/_notifications.php +124 -0
  147. backend/modules/sms/templates/_price.php +13 -19
  148. backend/modules/sms/templates/_purchases.php +25 -0
  149. backend/modules/sms/templates/_sender_id.php +21 -0
  150. backend/modules/sms/templates/_sms_details.php +26 -0
  151. backend/modules/sms/templates/index.php +229 -94
  152. backend/modules/staff/AB_StaffController.php +0 -474
  153. backend/modules/staff/Controller.php +514 -0
  154. backend/modules/staff/forms/AB_StaffMemberEditForm.php +0 -59
  155. backend/modules/staff/forms/AB_StaffMemberForm.php +0 -62
  156. backend/modules/staff/forms/AB_StaffMemberNewForm.php +0 -12
  157. backend/modules/staff/forms/AB_StaffScheduleItemBreakForm.php +0 -26
  158. backend/modules/staff/forms/AB_StaffServicesForm.php +0 -125
  159. backend/modules/staff/forms/StaffMember.php +65 -0
  160. backend/modules/staff/forms/StaffMemberEdit.php +57 -0
  161. backend/modules/staff/forms/StaffMemberNew.php +15 -0
  162. backend/modules/staff/forms/{AB_StaffScheduleForm.php → StaffSchedule.php} +15 -17
  163. backend/modules/staff/forms/StaffScheduleItemBreak.php +23 -0
  164. backend/modules/staff/forms/StaffServices.php +111 -0
  165. backend/modules/staff/forms/{widget/AB_TimeChoiceWidget.php → widgets/TimeChoice.php} +24 -15
  166. backend/modules/staff/resources/css/staff.css +0 -56
  167. backend/modules/staff/resources/js/staff.js +467 -290
  168. backend/modules/staff/templates/_break.php +33 -18
  169. backend/modules/staff/templates/_breaks.php +44 -42
  170. backend/modules/staff/templates/_list_item.php +19 -0
  171. backend/modules/staff/templates/edit.php +153 -128
  172. backend/modules/staff/templates/holidays.php +38 -21
  173. backend/modules/staff/templates/index.php +33 -0
  174. backend/modules/staff/templates/list.php +0 -47
  175. backend/modules/staff/templates/list_item.php +0 -12
  176. backend/modules/staff/templates/modal-feedback.php +33 -0
  177. backend/modules/staff/templates/new.php +45 -35
  178. backend/modules/staff/templates/schedule.php +123 -78
  179. backend/modules/staff/templates/services.php +158 -83
  180. backend/modules/{tinymce/AB_TinyMCE_Plugin.php → tiny_mce/Plugin.php} +21 -19
  181. backend/modules/{tinymce → tiny_mce}/resources/images/calendar.png +0 -0
  182. backend/modules/tiny_mce/templates/appointment_list.php +139 -0
  183. backend/modules/tiny_mce/templates/popup.php +406 -0
  184. backend/modules/tinymce/templates/appointment_list.php +0 -130
  185. backend/modules/tinymce/templates/popup.php +0 -404
  186. backend/resources/bootstrap/css/bootstrap-theme.min.css +3 -0
  187. backend/resources/bootstrap/css/bootstrap.min.css +0 -5
  188. backend/resources/bootstrap/js/bootstrap.js +2371 -0
  189. backend/resources/bootstrap/js/bootstrap.min.js +4 -4
  190. backend/resources/css/ab_style.css +0 -437
  191. backend/resources/css/bookly.main-backend.css +0 -281
  192. backend/resources/css/bootstrap-select.min.css +0 -6
  193. backend/resources/css/chosen.min.css +0 -3
  194. backend/resources/css/daterangepicker.css +74 -40
  195. backend/resources/css/jCal.css +0 -167
  196. backend/resources/css/popover.css +0 -82
  197. backend/resources/images/asc.png +0 -0
  198. backend/resources/images/box-big.png +0 -0
  199. backend/resources/images/box-small.png +0 -0
  200. backend/resources/images/buy10.png +0 -0
  201. backend/resources/images/buy100.png +0 -0
  202. backend/resources/images/buy25.png +0 -0
  203. backend/resources/images/buy50.png +0 -0
  204. backend/resources/{css → images}/chosen-sprite.png +0 -0
  205. backend/resources/{css → images}/chosen-sprite@2x.png +0 -0
  206. backend/resources/images/close.png +0 -0
  207. backend/resources/images/default-avatar.png +0 -0
  208. backend/resources/images/delete_cross.png +0 -0
  209. backend/resources/images/desc.png +0 -0
  210. backend/resources/images/double-arrow-vert.gif +0 -0
  211. backend/resources/images/eeGrad.gif +0 -0
  212. backend/resources/images/eeGrad2.gif +0 -0
  213. backend/resources/images/help.png +0 -0
  214. backend/resources/images/sprite.png +0 -0
  215. backend/resources/images/sprite.psd +0 -0
  216. backend/resources/js/ab_popup.js +0 -62
  217. backend/resources/js/alert.js +43 -0
  218. backend/resources/js/angular-sanitize.min.js +0 -16
  219. backend/resources/js/angular-sanitize.min.js.map +0 -8
  220. backend/resources/js/angular-ui-utils-0.2.1.min.js +0 -7
  221. backend/resources/js/angular.min.js +289 -285
  222. backend/resources/js/angular.min.js.map +3 -3
  223. backend/resources/js/bootstrap-select.js.map +0 -1
  224. backend/resources/js/bootstrap-select.min.js +0 -8
  225. backend/resources/js/chosen.jquery.min.js +1 -1
  226. backend/resources/js/datatables.min.js +323 -0
  227. backend/resources/js/daterangepicker.js +141 -54
  228. backend/resources/js/help.js +18 -0
  229. backend/resources/js/jCal.js +113 -103
  230. backend/resources/js/moment.min.js +3 -3
  231. backend/resources/js/ng-new_customer_dialog.js +0 -126
  232. frontend/AB_Frontend.php +0 -70
  233. frontend/Frontend.php +105 -0
  234. frontend/modules/authorize_net/Controller.php +12 -0
  235. frontend/modules/booking/AB_BookingController.php +0 -634
  236. frontend/modules/booking/Controller.php +1437 -0
  237. frontend/modules/booking/lib/AB_AvailableTime.php +0 -663
  238. frontend/modules/booking/lib/AB_UserBookingData.php +0 -393
  239. frontend/modules/booking/templates/1_service.php +93 -90
  240. frontend/modules/booking/templates/2_time.php +0 -44
  241. frontend/modules/booking/templates/3_details.php +0 -91
  242. frontend/modules/booking/templates/3_time.php +46 -0
  243. frontend/modules/booking/templates/4_cart.php +93 -0
  244. frontend/modules/booking/templates/4_payment.php +0 -128
  245. frontend/modules/booking/templates/5_details.php +99 -0
  246. frontend/modules/booking/templates/6_payment.php +186 -0
  247. frontend/modules/booking/templates/7_complete.php +4 -0
  248. frontend/modules/booking/templates/_card_payment.php +19 -20
  249. frontend/modules/booking/templates/_css.php +46 -20
  250. frontend/modules/booking/templates/_login_form.php +19 -19
  251. frontend/modules/booking/templates/_progress_tracker.php +38 -29
  252. frontend/modules/booking/templates/_time_slots.php +14 -17
  253. frontend/modules/booking/templates/{cancel_appointment.php → redirection.php} +0 -0
  254. frontend/modules/booking/templates/short_code.php +14 -11
  255. frontend/modules/customer_profile/AB_CustomerProfileController.php +0 -35
  256. frontend/modules/customer_profile/Controller.php +135 -0
  257. frontend/modules/customer_profile/resources/css/customer_profile.css +22 -6
  258. frontend/modules/customer_profile/resources/js/customer_profile.js +25 -0
  259. frontend/modules/customer_profile/templates/_custom_fields.php +8 -0
  260. frontend/modules/customer_profile/templates/_row.php +76 -0
  261. frontend/modules/customer_profile/templates/short_code.php +74 -59
  262. frontend/modules/mollie/Controller.php +12 -0
  263. frontend/modules/paypal/Controller.php +12 -0
  264. frontend/modules/payson/Controller.php +12 -0
  265. frontend/modules/payu_latam/Controller.php +12 -0
  266. frontend/modules/stripe/Controller.php +12 -0
  267. frontend/modules/two_checkout/Controller.php +12 -0
  268. frontend/modules/woo_commerce/Controller.php +131 -0
  269. frontend/resources/css/ab-columnizer.css +0 -129
  270. frontend/resources/css/ab-picker.css +0 -165
  271. frontend/resources/css/ab-reset.css +0 -36
  272. frontend/resources/css/bookly-main.css +911 -390
  273. frontend/resources/css/bookly-rtl.css +155 -0
  274. frontend/resources/css/intlTelInput.css +1 -1
  275. frontend/resources/images/2Checkout.png +0 -0
  276. frontend/resources/images/authorize_net.png +0 -0
  277. frontend/resources/images/cart.png +0 -0
  278. frontend/resources/images/delete.png +0 -0
  279. frontend/resources/images/edit.png +0 -0
  280. frontend/resources/images/flags.png +0 -0
  281. frontend/resources/images/flags@2x.png +0 -0
  282. frontend/resources/images/minus.png +0 -0
  283. frontend/resources/images/mollie.png +0 -0
  284. frontend/resources/images/payson.png +0 -0
  285. frontend/resources/images/payu_latam.png +0 -0
  286. frontend/resources/images/plus.png +0 -0
  287. frontend/resources/images/refresh.png +0 -0
  288. frontend/resources/images/stripe.png +0 -0
  289. frontend/resources/js/bookly.js +1278 -632
  290. frontend/resources/js/hammer.min.js +4 -4
  291. frontend/resources/js/hammer.min.map +1 -0
  292. frontend/resources/js/intlTelInput.min.js +2 -2
  293. frontend/resources/js/intlTelInput.utils.js +235 -196
  294. includes.php +0 -70
  295. installer.php +0 -631
  296. languages/ab-cs_CZ.mo +0 -0
  297. languages/ab-cs_CZ.po +0 -2008
  298. languages/ab-de_DE.mo +0 -0
  299. languages/ab-de_DE.po +0 -2009
  300. languages/ab-en_US.mo +0 -0
  301. languages/ab-en_US.po +0 -2009
  302. languages/ab-es_ES.mo +0 -0
  303. languages/ab-es_ES.po +0 -2165
  304. languages/ab-fr_FR.mo +0 -0
  305. languages/ab-fr_FR.po +0 -2173
  306. languages/ab-it_IT.mo +0 -0
  307. languages/ab-it_IT.po +0 -2009
  308. languages/ab-nl_NL.mo +0 -0
  309. languages/ab-nl_NL.po +0 -2009
  310. languages/ab-pl_PL.mo +0 -0
  311. languages/ab-pl_PL.po +0 -2010
  312. languages/ab-pt_BR.mo +0 -0
  313. languages/ab-pt_BR.po +0 -2009
  314. languages/ab-pt_PT.mo +0 -0
  315. languages/ab-pt_PT.po +0 -2218
  316. languages/ab-ru_RU.mo +0 -0
  317. languages/ab-ru_RU.po +0 -2187
  318. languages/ab-sv_SE.mo +0 -0
  319. languages/ab-sv_SE.po +0 -2009
  320. languages/ab-tr_TR.mo +0 -0
  321. languages/ab-tr_TR.po +0 -2009
  322. languages/ab-zh_TW.mo +0 -0
  323. languages/ab-zh_TW.po +0 -2009
  324. languages/bookly-cs_CZ.mo +0 -0
  325. languages/bookly-cs_CZ.po +2278 -1200
  326. languages/bookly-de_DE.mo +0 -0
  327. languages/bookly-de_DE.po +2685 -1502
  328. languages/bookly-en_US.mo +0 -0
  329. languages/bookly-en_US.po +2273 -1199
  330. languages/bookly-es_ES.mo +0 -0
  331. languages/bookly-es_ES.po +2675 -1488
  332. languages/bookly-fr_FR.mo +0 -0
  333. languages/bookly-fr_FR.po +2670 -1485
  334. languages/bookly-it_IT.mo +0 -0
  335. languages/bookly-it_IT.po +2684 -1496
  336. languages/bookly-nl_NL.mo +0 -0
  337. languages/bookly-nl_NL.po +2986 -1737
  338. languages/bookly-pl_PL.mo +0 -0
  339. languages/bookly-pl_PL.po +2278 -1200
  340. languages/bookly-pt_BR.mo +0 -0
  341. languages/bookly-pt_BR.po +3054 -1577
  342. languages/bookly-pt_PT.mo +0 -0
  343. languages/bookly-pt_PT.po +2678 -1491
  344. languages/bookly-ru_RU.mo +0 -0
  345. languages/bookly-ru_RU.po +2676 -1480
  346. languages/bookly-sv_SE.mo +0 -0
  347. languages/bookly-sv_SE.po +2649 -1486
  348. languages/bookly-tr_TR.mo +0 -0
  349. languages/bookly-tr_TR.po +2269 -1199
  350. languages/bookly-zh_TW.mo +0 -0
  351. languages/bookly-zh_TW.po +2935 -1605
  352. lib/AB_Config.php +0 -281
  353. lib/AB_SMS.php +0 -99
  354. lib/AB_Validator.php +0 -165
  355. lib/AvailableTime.php +374 -0
  356. lib/Cart.php +357 -0
  357. lib/CartItem.php +230 -0
  358. lib/Chain.php +86 -0
  359. lib/ChainItem.php +145 -0
  360. lib/Config.php +408 -0
  361. lib/Google.php +194 -0
  362. lib/Installer.php +771 -0
  363. lib/NotificationCodes.php +263 -0
  364. lib/NotificationSender.php +316 -0
  365. lib/Plugin.php +18 -0
  366. lib/{AB_Query.php → Query.php} +55 -41
  367. lib/SMS.php +732 -0
  368. lib/Session.php +134 -0
  369. lib/Slots.php +480 -0
  370. lib/Updater.php +1260 -0
  371. lib/UserBookingData.php +412 -0
  372. lib/Validator.php +162 -0
  373. lib/{AB_Controller.php → base/Components.php} +271 -335
  374. lib/base/Controller.php +114 -0
  375. lib/{AB_Entity.php → base/Entity.php} +90 -20
  376. lib/{AB_Form.php → base/Form.php} +25 -36
  377. lib/base/Installer.php +120 -0
  378. lib/base/Plugin.php +332 -0
  379. lib/base/Updater.php +116 -0
  380. lib/captcha/Captcha.php +183 -0
  381. lib/captcha/backgrounds/45-degree-fabric.png +0 -0
  382. lib/captcha/backgrounds/cloth-alike.png +0 -0
  383. lib/captcha/backgrounds/grey-sandbag.png +0 -0
  384. lib/captcha/backgrounds/kinda-jean.png +0 -0
  385. lib/captcha/backgrounds/polyester-lite.png +0 -0
  386. lib/captcha/backgrounds/stitched-wool.png +0 -0
  387. lib/captcha/backgrounds/white-carbon.png +0 -0
  388. lib/captcha/backgrounds/white-wave.png +0 -0
  389. lib/captcha/fonts/veteran_typewriter.ttf +0 -0
  390. lib/curl/{curl.php → Curl.php} +45 -44
  391. lib/curl/{curl_response.php → CurlResponse.php} +13 -12
  392. lib/curl/curl_cookie.txt +5 -0
  393. lib/entities/AB_Appointment.php +0 -217
  394. lib/entities/AB_Category.php +0 -33
  395. lib/entities/AB_Coupon.php +0 -19
  396. lib/entities/AB_Customer.php +0 -126
  397. lib/entities/AB_CustomerAppointment.php +0 -117
  398. lib/entities/AB_Notification.php +0 -19
  399. lib/entities/AB_Payment.php +0 -19
  400. lib/entities/AB_SentNotification.php +0 -18
  401. lib/entities/AB_Service.php +0 -58
  402. lib/entities/AB_Staff.php +0 -207
  403. lib/entities/AB_StaffService.php +0 -20
  404. lib/entities/Appointment.php +260 -0
  405. lib/entities/Category.php +58 -0
  406. lib/entities/Coupon.php +59 -0
  407. lib/entities/CouponService.php +22 -0
  408. lib/entities/Customer.php +170 -0
  409. lib/entities/CustomerAppointment.php +249 -0
  410. lib/entities/{AB_Holiday.php → Holiday.php} +10 -5
  411. lib/entities/Notification.php +124 -0
  412. lib/entities/Payment.php +151 -0
  413. lib/entities/{AB_ScheduleItemBreak.php → ScheduleItemBreak.php} +17 -13
  414. lib/entities/SentNotification.php +25 -0
  415. lib/entities/Service.php +112 -0
  416. lib/entities/Staff.php +214 -0
  417. lib/entities/{AB_StaffScheduleItem.php → StaffScheduleItem.php} +15 -9
  418. lib/entities/StaffService.php +28 -0
  419. lib/payment/AuthorizeNet.php +67 -0
  420. lib/payment/Mollie.php +84 -0
  421. lib/payment/PayPal.php +59 -0
  422. lib/payment/Payson.php +112 -0
  423. lib/payment/PayuLatam.php +46 -0
  424. lib/payment/TwoCheckout.php +18 -0
  425. lib/utils/AB_Instance.php +0 -28
  426. lib/utils/AB_Utils.php +0 -284
  427. lib/utils/Common.php +524 -0
  428. lib/utils/{AB_DateTimeUtils.php → DateTime.php} +29 -18
  429. lib/utils/plugin-updates/ab-plugin-update-checker.php +0 -915
  430. lib/utils/plugin-updates/css/puc-debug-bar.css +0 -19
  431. lib/utils/plugin-updates/debug-bar-panel.php +0 -114
  432. lib/utils/plugin-updates/debug-bar-plugin.php +0 -102
  433. lib/utils/plugin-updates/js/debug-bar.js +0 -52
  434. lib/utils/send_notifications_cron.php +270 -4
  435. main.php +18 -31
  436. readme.txt +245 -22
  437. updates.php +0 -820
autoload.php CHANGED
@@ -1,19 +1,19 @@
1
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
3
/**
4
- * @param $className
5
*/
6
- function bookly_autoload( $className ) {
7
-
8
- $paths = array(
9
- '/lib/'
10
- );
11
-
12
- foreach ( $paths as $path ) {
13
- if ( file_exists( AB_PATH . $path . $className . '.php' ) ) {
14
- require_once( AB_PATH . $path . $className . '.php' );
15
}
16
}
17
}
18
-
19
- spl_autoload_register( 'bookly_autoload' );
1
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
3
/**
4
+ * Bookly Lite autoload.
5
+ * @param $class
6
*/
7
+ function bookly_lite_loader( $class )
8
+ {
9
+ if ( preg_match( '/^BooklyLite\\\\(.+)?([^\\\\]+)#x2F;U', ltrim( $class, '\\' ), $match ) ) {
10
+ $file = __DIR__ . DIRECTORY_SEPARATOR
11
+ . strtolower( str_replace( '\\', DIRECTORY_SEPARATOR, preg_replace( '/([a-z])([A-Z])/', '$1_$2', $match[1] ) ) )
12
+ . $match[2]
13
+ . '.php';
14
+ if ( is_readable( $file ) ) {
15
+ require_once $file;
16
}
17
}
18
}
19
+ spl_autoload_register( 'bookly_lite_loader', true, true );
backend/AB_Backend.php DELETED
@@ -1,111 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
-
3
- class AB_Backend {
4
-
5
- public function __construct() {
6
- add_action( 'admin_menu', array( $this, 'addAdminMenu' ) );
7
-
8
- // Backend controllers.
9
- $this->apearanceController = new AB_AppearanceController();
10
- $this->calendarController = new AB_CalendarController();
11
- $this->customerController = new AB_CustomerController();
12
- $this->notificationsController = new AB_NotificationsController();
13
- $this->paymentController = new AB_PaymentController();
14
- $this->serviceController = new AB_ServiceController();
15
- $this->smsController = new AB_SmsController();
16
- $this->settingsController = new AB_SettingsController();
17
- $this->staffController = new AB_StaffController();
18
- $this->couponsController = new AB_CouponsController();
19
- $this->customFieldsController = new AB_CustomFieldsController();
20
- $this->appointmentsController = new AB_AppointmentsController();
21
-
22
- // Frontend controllers that work via admin-ajax.php.
23
- $this->bookingController = new AB_BookingController();
24
-
25
- add_action( 'wp_loaded', array( $this, 'init' ) );
26
- add_action( 'admin_init', array( $this, 'addTinyMCEPlugin' ) );
27
- }
28
-
29
- public function addTinyMCEPlugin() {
30
- /** @var WP_User $current_user */
31
- global $current_user;
32
- new AB_TinyMCE_Plugin();
33
- }
34
-
35
- public function init() {
36
- if ( ! session_id() ) {
37
- @session_start();
38
- }
39
-
40
- if ( isset( $_POST[ 'action' ] ) ) {
41
- switch ( $_POST[ 'action' ] ) {
42
- case 'ab_update_staff':
43
- $this->staffController->updateStaff();
44
- break;
45
- }
46
- }
47
- }
48
-
49
- public function addAdminMenu() {
50
- /** @var WP_User $current_user */
51
- global $current_user;
52
-
53
- // Translated submenu pages.
54
- $calendar = __( 'Calendar', 'bookly' );
55
- $appointments = __( 'Appointments', 'bookly' );
56
- $staff_members = __( 'Staff Members', 'bookly' );
57
- $services = __( 'Services', 'bookly' );
58
- $sms = __( 'SMS Notifications', 'bookly' );
59
- $notifications = __( 'Email Notifications', 'bookly' );
60
- $customers = __( 'Customers', 'bookly' );
61
- $payments = __( 'Payments', 'bookly' );
62
- $appearance = __( 'Appearance', 'bookly' );
63
- $settings = __( 'Settings', 'bookly' );
64
- $coupons = __( 'Coupons', 'bookly' );
65
- $custom_fields = __( 'Custom Fields', 'bookly' );
66
-
67
- if ( $current_user->has_cap( 'administrator' ) || AB_Staff::query()->where( 'wp_user_id', $current_user->ID )->count() ) {
68
- if ( function_exists( 'add_options_page' ) ) {
69
- $dynamic_position = '80.0000001' . mt_rand( 1, 1000 ); // position always is under `Settings`
70
- add_menu_page( 'Bookly', 'Bookly', 'read', 'ab-system', '',
71
- plugins_url('resources/images/menu.png', __FILE__), $dynamic_position );
72
- add_submenu_page( 'ab-system', $calendar, $calendar, 'read', 'ab-calendar',
73
- array( $this->calendarController, 'index' ) );
74
- add_submenu_page( 'ab-system', $appointments, $appointments, 'manage_options', 'ab-appointments',
75
- array( $this->appointmentsController, 'index' ) );
76
- if ( $current_user->has_cap( 'administrator' ) ) {
77
- add_submenu_page( 'ab-system', $staff_members, $staff_members, 'manage_options', AB_StaffController::page_slug,
78
- array( $this->staffController, 'index' ) );
79
- } else {
80
- if ( 1 == get_option( 'ab_settings_allow_staff_members_edit_profile' ) ) {
81
- add_submenu_page( 'ab-system', __( 'Profile', 'bookly' ), __( 'Profile', 'bookly' ), 'read', AB_StaffController::page_slug,
82
- array( $this->staffController, 'index' ) );
83
- }
84
- }
85
- add_submenu_page( 'ab-system', $services, $services, 'manage_options', AB_ServiceController::page_slug,
86
- array( $this->serviceController, 'index' ) );
87
- add_submenu_page( 'ab-system', $customers, $customers, 'manage_options', AB_CustomerController::page_slug,
88
- array( $this->customerController, 'index' ) );
89
- add_submenu_page( 'ab-system', $notifications, $notifications, 'manage_options', 'ab-notifications',
90
- array( $this->notificationsController, 'index' ) );
91
- add_submenu_page( 'ab-system', $sms, $sms, 'manage_options', AB_SmsController::page_slug,
92
- array( $this->smsController, 'index' ) );
93
- add_submenu_page( 'ab-system', $payments, $payments, 'manage_options', 'ab-payments',
94
- array( $this->paymentController, 'index' ) );
95
- add_submenu_page( 'ab-system', $appearance, $appearance, 'manage_options', 'ab-appearance',
96
- array( $this->apearanceController, 'index' ) );
97
- add_submenu_page( 'ab-system', $custom_fields, $custom_fields, 'manage_options', 'ab-custom-fields',
98
- array( $this->customFieldsController, 'index' ) );
99
- add_submenu_page( 'ab-system', $coupons, $coupons, 'manage_options', 'ab-coupons',
100
- array( $this->couponsController, 'index' ) );
101
- add_submenu_page( 'ab-system', $settings, $settings, 'manage_options', AB_SettingsController::page_slug,
102
- array( $this->settingsController, 'index' ) );
103
-
104
- global $submenu;
105
- do_action( 'bookly_addons_menu', 'ab-system' );
106
- unset( $submenu[ 'ab-system' ][ 0 ] );
107
- }
108
- }
109
- }
110
-
111
- }
backend/Backend.php ADDED
@@ -0,0 +1,131 @@
1
+ <?php
2
+ namespace BooklyLite\Backend;
3
+
4
+ use BooklyLite\Backend\Modules;
5
+ use BooklyLite\Frontend;
6
+ use BooklyLite\Lib;
7
+
8
+ /**
9
+ * Class Backend
10
+ * @package BooklyLite\Backend
11
+ */
12
+ class Backend
13
+ {
14
+ public function __construct()
15
+ {
16
+ // Backend controllers.
17
+ $this->apearanceController = Modules\Appearance\Controller::getInstance();
18
+ $this->appointmentsController = Modules\Appointments\Controller::getInstance();
19
+ $this->calendarController = Modules\Calendar\Controller::getInstance();
20
+ $this->couponsController = Modules\Coupons\Controller::getInstance();
21
+ $this->customerController = Modules\Customers\Controller::getInstance();
22
+ $this->customFieldsController = Modules\CustomFields\Controller::getInstance();
23
+ $this->debugController = Modules\Debug\Controller::getInstance();
24
+ $this->notificationsController = Modules\Notifications\Controller::getInstance();
25
+ $this->paymentController = Modules\Payments\Controller::getInstance();
26
+ $this->serviceController = Modules\Services\Controller::getInstance();
27
+ $this->settingsController = Modules\Settings\Controller::getInstance();
28
+ $this->smsController = Modules\Sms\Controller::getInstance();
29
+ $this->staffController = Modules\Staff\Controller::getInstance();
30
+
31
+ // Frontend controllers that work via admin-ajax.php.
32
+ $this->bookingController = Frontend\Modules\Booking\Controller::getInstance();
33
+ $this->customerProfileController = Frontend\Modules\CustomerProfile\Controller::getInstance();
34
+ if ( ! Lib\Config::isPaymentDisabled( Lib\Entities\Payment::TYPE_AUTHORIZENET ) ) {
35
+ $this->authorizeNetController = Frontend\Modules\AuthorizeNet\Controller::getInstance();
36
+ }
37
+ if ( ! Lib\Config::isPaymentDisabled( Lib\Entities\Payment::TYPE_PAYULATAM ) ) {
38
+ $this->payulatamController = Frontend\Modules\PayuLatam\Controller::getInstance();
39
+ }
40
+ if ( ! Lib\Config::isPaymentDisabled( Lib\Entities\Payment::TYPE_STRIPE ) ) {
41
+ $this->stripeController = Frontend\Modules\Stripe\Controller::getInstance();
42
+ }
43
+ $this->wooCommerceController = Frontend\Modules\WooCommerce\Controller::getInstance();
44
+
45
+ add_action( 'admin_menu', array( $this, 'addAdminMenu' ) );
46
+ add_action( 'wp_loaded', array( $this, 'init' ) );
47
+ add_action( 'admin_init', array( $this, 'addTinyMCEPlugin' ) );
48
+ }
49
+
50
+ public function init()
51
+ {
52
+ if ( ! session_id() ) {
53
+ @session_start();
54
+ }
55
+ }
56
+
57
+ public function addTinyMCEPlugin()
58
+ {
59
+ new Modules\TinyMce\Plugin();
60
+ }
61
+
62
+ public function addAdminMenu()
63
+ {
64
+ /** @var \WP_User $current_user */
65
+ global $current_user;
66
+
67
+ // Translated submenu pages.
68
+ $calendar = __( 'Calendar', 'bookly' );
69
+ $appointments = __( 'Appointments', 'bookly' );
70
+ $staff_members = __( 'Staff Members', 'bookly' );
71
+ $services = __( 'Services', 'bookly' );
72
+ $sms = __( 'SMS Notifications', 'bookly' );
73
+ $notifications = __( 'Email Notifications', 'bookly' );
74
+ $customers = __( 'Customers', 'bookly' );
75
+ $payments = __( 'Payments', 'bookly' );
76
+ $appearance = __( 'Appearance', 'bookly' );
77
+ $settings = __( 'Settings', 'bookly' );
78
+ $coupons = __( 'Coupons', 'bookly' );
79
+ $custom_fields = __( 'Custom Fields', 'bookly' );
80
+
81
+ if ( $current_user->has_cap( 'administrator' ) || Lib\Entities\Staff::query()->where( 'wp_user_id', $current_user->ID )->count() ) {
82
+ if ( function_exists( 'add_options_page' ) ) {
83
+ $dynamic_position = '80.0000001' . mt_rand( 1, 1000 ); // position always is under `Settings`
84
+ add_menu_page( 'Bookly', 'Bookly', 'read', 'ab-system', '',
85
+ plugins_url( 'resources/images/menu.png', __FILE__ ), $dynamic_position );
86
+ add_submenu_page( 'ab-system', $calendar, $calendar, 'read', 'ab-calendar',
87
+ array( $this->calendarController, 'index' ) );
88
+ add_submenu_page( 'ab-system', $appointments, $appointments, 'manage_options', 'ab-appointments',
89
+ array( $this->appointmentsController, 'index' ) );
90
+ do_action( 'bookly_render_menu_after_appointments' );
91
+ if ( $current_user->has_cap( 'administrator' ) ) {
92
+ add_submenu_page( 'ab-system', $staff_members, $staff_members, 'manage_options', Modules\Staff\Controller::page_slug,
93
+ array( $this->staffController, 'index' ) );
94
+ } else {
95
+ if ( get_option( 'ab_settings_allow_staff_members_edit_profile' ) == 1 ) {
96
+ add_submenu_page( 'ab-system', __( 'Profile', 'bookly' ), __( 'Profile', 'bookly' ), 'read', Modules\Staff\Controller::page_slug,
97
+ array( $this->staffController, 'index' ) );
98
+ }
99
+ }
100
+ add_submenu_page( 'ab-system', $services, $services, 'manage_options', Modules\Services\Controller::page_slug,
101
+ array( $this->serviceController, 'index' ) );
102
+ add_submenu_page( 'ab-system', $customers, $customers, 'manage_options', Modules\Customers\Controller::page_slug,
103
+ array( $this->customerController, 'index' ) );
104
+ add_submenu_page( 'ab-system', $notifications, $notifications, 'manage_options', 'ab-notifications',
105
+ array( $this->notificationsController, 'index' ) );
106
+ add_submenu_page( 'ab-system', $sms, $sms, 'manage_options', Modules\Sms\Controller::page_slug,
107
+ array( $this->smsController, 'index' ) );
108
+ add_submenu_page( 'ab-system', $payments, $payments, 'manage_options', 'ab-payments',
109
+ array( $this->paymentController, 'index' ) );
110
+ add_submenu_page( 'ab-system', $appearance, $appearance, 'manage_options', 'ab-appearance',
111
+ array( $this->apearanceController, 'index' ) );
112
+ add_submenu_page( 'ab-system', $custom_fields, $custom_fields, 'manage_options', 'ab-custom-fields',
113
+ array( $this->customFieldsController, 'index' ) );
114
+ add_submenu_page( 'ab-system', $coupons, $coupons, 'manage_options', 'ab-coupons',
115
+ array( $this->couponsController, 'index' ) );
116
+ add_submenu_page( 'ab-system', $settings, $settings, 'manage_options', Modules\Settings\Controller::page_slug,
117
+ array( $this->settingsController, 'index' ) );
118
+
119
+ if ( isset ( $_GET['page'] ) && $_GET['page'] == 'ab-debug' ) {
120
+ add_submenu_page( 'ab-system', 'Debug', 'Debug', 'manage_options', 'ab-debug',
121
+ array( $this->debugController, 'index' ) );
122
+ }
123
+
124
+ global $submenu;
125
+ do_action( 'bookly_admin_menu', 'ab-system' );
126
+ unset ( $submenu['ab-system'][0] );
127
+ }
128
+ }
129
+ }
130
+
131
+ }
backend/modules/appearance/AB_AppearanceController.php DELETED
@@ -1,152 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
-
3
- /**
4
- * Class AB_AppearanceController
5
- */
6
- class AB_AppearanceController extends AB_Controller {
7
-
8
- /**
9
- * Default Action
10
- */
11
- public function index()
12
- {
13
- /** @var WP_Locale $wp_locale */
14
- global $wp_locale;
15
-
16
- $this->enqueueStyles( array(
17
- 'frontend' => array(
18
- 'css/intlTelInput.css',
19
- 'css/ladda.min.css',
20
- 'css/bookly-main.css',
21
- 'css/ab-columnizer.css',
22
- 'css/picker.classic.css',
23
- 'css/picker.classic.date.css',
24
- 'css/ab-picker.css',
25
- ),
26
- 'backend' => array(
27
- 'css/bookly.main-backend.css',
28
- 'bootstrap/css/bootstrap.min.css',
29
- 'css/bootstrap-editable.css',
30
- ),
31
- 'wp' => array(
32
- 'wp-color-picker',
33
- ),
34
- 'module' => array(
35
- 'css/appearance.css',
36
- )
37
- ) );
38
-
39
- $this->enqueueScripts( array(
40
- 'backend' => array(
41
- 'bootstrap/js/bootstrap.min.js' => array( 'jquery' ),
42
- 'js/bootstrap-editable.min.js' => array( 'jquery' ),
43
- ),
44
- 'frontend' => array(
45
- 'js/picker.js' => array( 'jquery' ),
46
- 'js/picker.date.js' => array( 'jquery' ),
47
- 'js/spin.min.js' => array( 'jquery' ),
48
- 'js/ladda.min.js' => array( 'jquery' ),
49
- 'js/intlTelInput.min.js' => array( 'ab-picker.date.js' )
50
- ),
51
- 'wp' => array(
52
- 'wp-color-picker',
53
- ),
54
- 'module' => array(
55
- 'js/appearance.js' => array( 'jquery' ),
56
- )
57
- ) );
58
-
59
- wp_localize_script( 'ab-picker.date.js', 'BooklyL10n', array(
60
- 'today' => __( 'Today', 'bookly' ),
61
- 'months' => array_values( $wp_locale->month ),
62
- 'days' => array_values( $wp_locale->weekday_abbrev ),
63
- 'nextMonth' => __( 'Next month', 'bookly' ),
64
- 'prevMonth' => __( 'Previous month', 'bookly' ),
65
- 'date_format' => AB_DateTimeUtils::convertFormat( 'date', AB_DateTimeUtils::FORMAT_PICKADATE ),
66
- 'start_of_week' => (int) get_option( 'start_of_week' ),
67
- 'intlTelInput_utils' => plugins_url( 'intlTelInput.utils.js', AB_PATH . '/frontend/resources/js/intlTelInput.utils.js' ),
68
- ) );
69
-
70
- // Initialize steps (tabs).
71
- $this->steps = array(
72
- 1 => get_option( 'ab_appearance_text_step_service' ),
73
- 2 => get_option( 'ab_appearance_text_step_time' ),
74
- 3 => get_option( 'ab_appearance_text_step_details' ),
75
- 4 => get_option( 'ab_appearance_text_step_payment' ),
76
- 5 => get_option( 'ab_appearance_text_step_done' )
77
- );
78
-
79
- // Render general layout.
80
- $this->render( 'index' );
81
- } // index
82
-
83
- /**
84
- * Update options
85
- */
86
- public function executeUpdateAppearanceOptions()
87
- {
88
- if ( $this->hasParameter( 'options' ) ) {
89
- $get_option = $this->getParameter( 'options' );
90
- $options = array(
91
- // Info text.
92
- 'ab_appearance_text_info_first_step' => $get_option['text_info_first_step'],
93
- 'ab_appearance_text_info_second_step' => $get_option['text_info_second_step'],
94
- 'ab_appearance_text_info_third_step' => $get_option['text_info_third_step'],
95
- 'ab_appearance_text_info_third_step_guest' => $get_option['text_info_third_step_guest'],
96
- 'ab_appearance_text_info_fourth_step' => $get_option['text_info_fourth_step'],
97
- 'ab_appearance_text_info_fifth_step' => $get_option['text_info_fifth_step'],
98
- 'ab_appearance_text_info_coupon' => $get_option['text_info_coupon'],
99
- // Color.
100
- 'ab_appearance_color' => $get_option['color'],
101
- // Step, label and option texts.
102
- 'ab_appearance_text_step_service' => $get_option['text_step_service'],
103
- 'ab_appearance_text_step_time' => $get_option['text_step_time'],
104
- 'ab_appearance_text_step_details' => $get_option['text_step_details'],
105
- 'ab_appearance_text_step_payment' => $get_option['text_step_payment'],
106
- 'ab_appearance_text_step_done' => $get_option['text_step_done'],
107
- 'ab_appearance_text_label_category' => $get_option['text_label_category'],
108
- 'ab_appearance_text_label_service' => $get_option['text_label_service'],
109
- 'ab_appearance_text_label_number_of_persons' => $get_option['text_label_number_of_persons'],
110
- 'ab_appearance_text_label_employee' => $get_option['text_label_employee'],
111
- 'ab_appearance_text_label_select_date' => $get_option['text_label_select_date'],
112
- 'ab_appearance_text_label_start_from' => $get_option['text_label_start_from'],
113
- 'ab_appearance_text_label_finish_by' => $get_option['text_label_finish_by'],
114
- 'ab_appearance_text_label_name' => $get_option['text_label_name'],
115
- 'ab_appearance_text_label_phone' => $get_option['text_label_phone'],
116
- 'ab_appearance_text_label_email' => $get_option['text_label_email'],
117
- 'ab_appearance_text_option_service' => $get_option['text_option_service'],
118
- 'ab_appearance_text_option_category' => $get_option['text_option_category'],
119
- 'ab_appearance_text_option_employee' => $get_option['text_option_employee'],
120
- 'ab_appearance_text_label_coupon' => $get_option['text_label_coupon'],
121
- 'ab_appearance_text_label_pay_locally' => $get_option['text_label_pay_locally'],
122
- // Checkboxes.
123
- 'ab_appearance_show_progress_tracker' => $get_option['progress_tracker'],
124
- 'ab_appearance_show_blocked_timeslots' => $get_option['blocked_timeslots'],
125
- 'ab_appearance_show_day_one_column' => $get_option['day_one_column'],
126
- 'ab_appearance_show_calendar' => $get_option['show_calendar'],
127
- );
128
-
129
- // Save options.
130
- foreach ( $options as $option_name => $option_value ) {
131
- update_option( $option_name, $option_value );
132
- // Register string for translate in WPML.
133
- if ( strpos( $option_name, 'ab_appearance_text_' ) === 0 ) {
134
- do_action( 'wpml_register_single_string', 'bookly', $option_name, $option_value );
135
- }
136
- }
137
- }
138
- exit;
139
- }
140
-
141
- /**
142
- * Override parent method to add 'wp_ajax_ab_' prefix
143
- * so current 'execute*' methods look nicer.
144
- *
145
- * @param string $prefix
146
- */
147
- protected function registerWpActions( $prefix = '' )
148
- {
149
- parent::registerWpActions( 'wp_ajax_ab_' );
150
- }
151
-
152
- }
backend/modules/appearance/Controller.php ADDED
@@ -0,0 +1,202 @@
1
+ <?php
2
+ namespace BooklyLite\Backend\Modules\Appearance;
3
+
4
+ use BooklyLite\Lib;
5
+
6
+ /**
7
+ * Class Controller
8
+ * @package BooklyLite\Backend\Modules\Appearance
9
+ */
10
+ class Controller extends Lib\Base\Controller
11
+ {
12
+ /**
13
+ * Default Action
14
+ */
15
+ public function index()
16
+ {
17
+ /** @var \WP_Locale $wp_locale */
18
+ global $wp_locale;
19
+
20
+ $this->enqueueStyles( array(
21
+ 'frontend' => array_merge(
22
+ ( get_option( 'ab_settings_phone_default_country' ) == 'disabled'
23
+ ? array()
24
+ : array( 'css/intlTelInput.css' ) ),
25
+ array(
26
+ 'css/ladda.min.css',
27
+ 'css/picker.classic.css',
28
+ 'css/picker.classic.date.css',
29
+ 'css/bookly-main.css',
30
+ )
31
+ ),
32
+ 'backend' => array(
33
+ 'bootstrap/css/bootstrap-theme.min.css',
34
+ 'css/bootstrap-editable.css',
35
+ ),
36
+ 'wp' => array( 'wp-color-picker' ),
37
+ ) );
38
+
39
+ $this->enqueueScripts( array(
40
+ 'backend' => array(
41
+ 'bootstrap/js/bootstrap.min.js' => array( 'jquery' ),
42
+ 'js/bootstrap-editable.min.js' => array( 'jquery' ),
43
+ 'js/alert.js' => array( 'jquery' ),
44
+ ),
45
+ 'frontend' => array_merge(
46
+ array(
47
+ 'js/picker.js' => array( 'jquery' ),
48
+ 'js/picker.date.js' => array( 'jquery' ),
49
+ 'js/spin.min.js' => array( 'jquery' ),
50
+ 'js/ladda.min.js' => array( 'jquery' ),
51
+ ),
52
+ get_option( 'ab_settings_phone_default_country' ) == 'disabled'
53
+ ? array()
54
+ : array( 'js/intlTelInput.min.js' => array( 'jquery' ) )
55
+ ),
56
+ 'wp' => array( 'wp-color-picker' ),
57
+ 'module' => array( 'js/appearance.js' => array( 'jquery' ) )
58
+ ) );
59
+
60
+ wp_localize_script( 'ab-picker.date.js', 'BooklyL10n', array(
61
+ 'today' => __( 'Today', 'bookly' ),
62
+ 'months' => array_values( $wp_locale->month ),
63
+ 'days' => array_values( $wp_locale->weekday_abbrev ),
64
+ 'nextMonth' => __( 'Next month', 'bookly' ),
65
+ 'prevMonth' => __( 'Previous month', 'bookly' ),
66
+ 'date_format' => Lib\Utils\DateTime::convertFormat( 'date', Lib\Utils\DateTime::FORMAT_PICKADATE ),
67
+ 'start_of_week' => (int) get_option( 'start_of_week' ),
68
+ 'saved' => __( 'Settings saved.', 'bookly' ),
69
+ 'intlTelInput' => array(
70
+ 'enabled' => ( get_option( 'ab_settings_phone_default_country' ) != 'disabled' ),
71
+ 'utils' => plugins_url( 'intlTelInput.utils.js', Lib\Plugin::getDirectory() . '/frontend/resources/js/intlTelInput.utils.js' ),
72
+ 'country' => get_option( 'ab_settings_phone_default_country' ),
73
+ )
74
+ ) );
75
+
76
+ // Initialize steps (tabs).
77
+ $this->steps = array(
78
+ 1 => get_option( 'ab_appearance_text_step_service' ),
79
+ get_option( 'ab_appearance_text_step_extras' ),
80
+ get_option( 'ab_appearance_text_step_time' ),
81
+ get_option( 'ab_appearance_text_step_cart' ),
82
+ get_option( 'ab_appearance_text_step_details' ),
83
+ get_option( 'ab_appearance_text_step_payment' ),
84
+ get_option( 'ab_appearance_text_step_done' )
85
+ );
86
+
87
+ // Render general layout.
88
+ $this->render( 'index' );
89
+ }
90
+
91
+ /**
92
+ * Update options
93
+ */
94
+ public function executeUpdateAppearanceOptions()
95
+ {
96
+ if ( $this->hasParameter( 'options' ) ) {
97
+ $get_option = $this->getParameter( 'options' );
98
+ $options = array(
99
+ // Info text.
100
+ 'ab_appearance_text_info_cart_step' => $get_option['text_info_cart_step'],
101
+ 'ab_appearance_text_info_complete_step' => $get_option['text_info_complete_step'],
102
+ 'ab_appearance_text_info_coupon' => $get_option['text_info_coupon'],
103
+ 'ab_appearance_text_info_details_step' => $get_option['text_info_details_step'],
104
+ 'ab_appearance_text_info_details_step_guest' => $get_option['text_info_details_step_guest'],
105
+ 'ab_appearance_text_info_payment_step' => $get_option['text_info_payment_step'],
106
+ 'ab_appearance_text_info_service_step' => $get_option['text_info_service_step'],
107
+ 'ab_appearance_text_info_time_step' => $get_option['text_info_time_step'],
108
+ // Color.
109
+ 'ab_appearance_color' => $get_option['color'],
110
+ // Step, label and option texts.
111
+ 'ab_appearance_text_button_apply' => $get_option['text_button_apply'],
112
+ 'ab_appearance_text_button_back' => $get_option['text_button_back'],
113
+ 'ab_appearance_text_button_book_more' => $get_option['text_button_book_more'],
114
+ 'ab_appearance_text_button_next' => $get_option['text_button_next'],
115
+ 'ab_appearance_text_label_category' => $get_option['text_label_category'],
116
+ 'ab_appearance_text_label_ccard_code' => $get_option['text_label_ccard_code'],
117
+ 'ab_appearance_text_label_ccard_expire' => $get_option['text_label_ccard_expire'],
118
+ 'ab_appearance_text_label_ccard_number' => $get_option['text_label_ccard_number'],
119
+ 'ab_appearance_text_label_coupon' => $get_option['text_label_coupon'],
120
+ 'ab_appearance_text_label_email' => $get_option['text_label_email'],
121
+ 'ab_appearance_text_label_employee' => $get_option['text_label_employee'],
122
+ 'ab_appearance_text_label_finish_by' => $get_option['text_label_finish_by'],
123
+ 'ab_appearance_text_label_name' => $get_option['text_label_name'],
124
+ 'ab_appearance_text_label_number_of_persons' => $get_option['text_label_number_of_persons'],
125
+ 'ab_appearance_text_label_pay_ccard' => $get_option['text_label_pay_ccard'],
126
+ 'ab_appearance_text_label_pay_locally' => $get_option['text_label_pay_locally'],
127
+ 'ab_appearance_text_label_pay_mollie' => $get_option['text_label_pay_mollie'],
128
+ 'ab_appearance_text_label_pay_paypal' => $get_option['text_label_pay_paypal'],
129
+ 'ab_appearance_text_label_phone' => $get_option['text_label_phone'],
130
+ 'ab_appearance_text_label_select_date' => $get_option['text_label_select_date'],
131
+ 'ab_appearance_text_label_service' => $get_option['text_label_service'],
132
+ 'ab_appearance_text_label_start_from' => $get_option['text_label_start_from'],
133
+ 'ab_appearance_text_option_category' => $get_option['text_option_category'],
134
+ 'ab_appearance_text_option_employee' => $get_option['text_option_employee'],
135
+ 'ab_appearance_text_option_service' => $get_option['text_option_service'],
136
+ 'ab_appearance_text_step_cart' => $get_option['text_step_cart'],
137
+ 'ab_appearance_text_step_details' => $get_option['text_step_details'],
138
+ 'ab_appearance_text_step_done' => $get_option['text_step_done'],
139
+ 'ab_appearance_text_step_payment' => $get_option['text_step_payment'],
140
+ 'ab_appearance_text_step_service' => $get_option['text_step_service'],
141
+ 'ab_appearance_text_step_time' => $get_option['text_step_time'],
142
+ // Validator errors.
143
+ 'ab_appearance_text_required_email' => $get_option['text_required_email'],
144
+ 'ab_appearance_text_required_employee' => $get_option['text_required_employee'],
145
+ 'ab_appearance_text_required_name' => $get_option['text_required_name'],
146
+ 'ab_appearance_text_required_phone' => $get_option['text_required_phone'],
147
+ 'ab_appearance_text_required_service' => $get_option['text_required_service'],
148
+ // Checkboxes.
149
+ 'ab_appearance_required_employee' => $get_option['required_employee'],
150
+ 'ab_appearance_show_blocked_timeslots' => $get_option['blocked_timeslots'],
151
+ 'ab_appearance_show_calendar' => $get_option['show_calendar'],
152
+ 'ab_appearance_show_day_one_column' => $get_option['day_one_column'],
153
+ 'ab_appearance_show_progress_tracker' => $get_option['progress_tracker'],
154
+ 'ab_appearance_staff_name_with_price' => $get_option['staff_name_with_price'],
155
+ );
156
+
157
+ if ( Lib\Config::extrasEnabled() ) {
158
+ $options['ab_appearance_text_info_extras_step'] = $get_option['text_info_extras_step'];
159
+ $options['ab_appearance_text_step_extras'] = $get_option['text_step_extras'];
160
+ }
161
+ if ( Lib\Config::locationsEnabled() ) {
162
+ $options['ab_appearance_required_location'] = $get_option['required_location'];
163
+ $options['ab_appearance_text_label_location'] = $get_option['text_label_location'];
164
+ $options['ab_appearance_text_option_location'] = $get_option['text_option_location'];
165
+ $options['ab_appearance_text_required_location'] = $get_option['text_required_location'];
166
+ }
167
+ if ( Lib\Config::multiplyAppointmentsEnabled() ) {
168
+ $options['ab_appearance_text_label_multiply'] = $get_option['text_label_multiply'];
169
+ }
170
+
171
+ // Save options.
172
+ foreach ( $options as $option_name => $option_value ) {
173
+ update_option( $option_name, $option_value );
174
+ // Register string for translate in WPML.
175
+ if ( strpos( $option_name, 'ab_appearance_text_' ) === 0 ) {
176
+ do_action( 'wpml_register_single_string', 'bookly', $option_name, $option_value );
177
+ }
178
+ }
179
+ }
180
+ exit;
181
+ }
182
+
183
+ /**
184
+ * Ajax request to dismiss appearance notice for current user.
185
+ */
186
+ public function executeDismissAppearanceNotice()
187
+ {
188
+ update_user_meta( get_current_user_id(), Lib\Plugin::getPrefix() . 'dismiss_appearance_notice', 1 );
189
+ }
190
+
191
+ /**
192
+ * Override parent method to add 'wp_ajax_ab_' prefix
193
+ * so current 'execute*' methods look nicer.
194
+ *
195
+ * @param string $prefix
196
+ */
197
+ protected function registerWpActions( $prefix = '' )
198
+ {
199
+ parent::registerWpActions( 'wp_ajax_ab_' );
200
+ }
201
+
202
+ }
backend/modules/appearance/resources/css/appearance.css DELETED
@@ -1,42 +0,0 @@
1
- /* Backend-Appearance */
2
- #ab-appearance { max-width: 960px; }
3
- div.controls {
4
- float: right;
5
- margin-right: 15px;
6
- margin-top: 10px;
7
- }
8
-
9
- span.spinner {
10
- float: left;
11
- margin-right: 20px;
12
- }
13
-
14
- .editable-click {
15
- cursor: pointer;
16
- }
17
-
18
- .ab-first-step .select-list {
19
- background: transparent;
20
- }
21
-
22
- input.appearance-color-picker{
23
- height: 24px !important;
24
- background:#f3f3f3;
25
- background-image:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
26
- background-image:-webkit-linear-gradient(top,#fefefe,#f4f4f4);
27
- background-image:-moz-linear-gradient(top,#fefefe,#f4f4f4);
28
- background-image:-o-linear-gradient(top,#fefefe,#f4f4f4);
29
- background-image:linear-gradient(to bottom,#fefefe,#f4f4f4);
30
- }
31
-
32
- .editable-container.popover { z-index: 10001; }
33
- .editable-container.editable-popup .arrow { margin-left: 0 !important; }
34
- .editable-input > textarea { width: 475px!important; }
35
-
36
- .editableform-loading { background: url('../../../../resources/images/loading.gif') center center no-repeat !important; }
37
- .editable-clear-x { background: url('../../../../resources/images/clear.png') center center no-repeat !important; }
38
-
39
- /* media query */
40
- @media screen and (max-width: 782px) {
41
- .ab-columnizer-wrap { height: 662px!important; }
42
- }
backend/modules/appearance/resources/js/appearance.js CHANGED
@@ -1,23 +1,28 @@
1
jQuery(function($) {
2
var // Progress Tracker.
3
$progress_tracker_option = $('input#ab-progress-tracker-checkbox'),
4
// Time slots setting.
5
$blocked_timeslots_option = $('input#ab-blocked-timeslots-checkbox'),
6
$day_one_column_option = $('input#ab-day-one-column-checkbox'),
7
$show_calendar_option = $('input#ab-show-calendar-checkbox'),
8
- // Tabs.
9
- $tabs = $('div.tabbable').find('.nav-tabs'),
10
- $tab_content = $('div.tab-content'),
11
// Buttons.
12
$save_button = $('#ajax-send-appearance'),
13
$reset_button = $('button[type=reset]'),
14
// Texts.
15
$text_step_service = $('#ab-text-step-service'),
16
$text_step_time = $('#ab-text-step-time'),
17
$text_step_details = $('#ab-text-step-details'),
18
$text_step_payment = $('#ab-text-step-payment'),
19
$text_step_done = $('#ab-text-step-done'),
20
$text_label_category = $('#ab-text-label-category'),
21
$text_option_category = $('#ab-text-option-category'),
22
$text_option_service = $('#ab-text-option-service'),
23
$text_option_employee = $('#ab-text-option-employee'),
@@ -26,54 +31,85 @@ jQuery(function($) {
26
$text_label_employee = $('#ab-text-label-employee'),
27
$text_label_select_date = $('#ab-text-label-select_date'),
28
$text_label_start_from = $('#ab-text-label-start_from'),
29
$text_label_finish_by = $('#ab-text-label-finish_by'),
30
$text_label_name = $('#ab-text-label-name'),
31
$text_label_phone = $('#ab-text-label-phone'),
32
$text_label_email = $('#ab-text-label-email'),
33
$text_label_coupon = $('#ab-text-label-coupon'),
34
- $text_info_service = $('#ab-text-info-first'),
35
- $text_info_time = $('#ab-text-info-second'),
36
- $text_info_details = $('#ab-text-info-third'),
37
- $text_info_details_guest = $('#ab-text-info-third-guest'),
38
- $text_info_payment = $('#ab-text-info-fourth'),
39
- $text_info_done = $('#ab-text-info-fifth'),
40
$text_info_coupon = $('#ab-text-info-coupon'),
41
- $color_picker = $('.wp-color-picker'),
42
$ab_editable = $('.ab_editable'),
43
$text_label_pay_locally = $('#ab-text-label-pay-locally'),
44
// Calendars.
45
$second_step_calendar = $('.ab-selected-date'),
46
- $second_step_calendar_wrap = $('.ab-slot-calendar')
47
;
48
49
- $('.ab-user-phone').intlTelInput({
50
- defaultCountry: 'auto',
51
- geoIpLookup: function(callback) {
52
- $.get(ajaxurl, {action: 'ab_ip_info'}, function() {}, 'json').always(function(resp) {
53
- var countryCode = (resp && resp.country) ? resp.country : '';
54
- callback(countryCode);
55
- });
56
- },
57
- utilsScript: BooklyL10n.intlTelInput_utils
58
- });
59
60
// menu fix for WP 3.8.1
61
$('#toplevel_page_ab-system > ul').css('margin-left', '0px');
62
63
// Tabs.
64
- $tabs.find('.ab-step-tabs').on('click', function() {
65
- var $step_id = $(this).data('step-id');
66
- // Hide all other tab content and show only current.
67
- $tab_content.children('div[data-step-id!="' + $step_id + '"]').removeClass('active').hide();
68
- $tab_content.children('div[data-step-id="' + $step_id + '"]').addClass('active').show();
69
- }).filter('li:first').trigger('click');
70
71
// Apply color from color picker.
72
var applyColor = function() {
73
var color_important = $color_picker.wpColorPicker('color') + '!important';
74
- $('div.ab-progress-tracker').find('li.ab-step-tabs').filter('.active').find('a').css('color', $color_picker.wpColorPicker('color'));
75
- $('div.ab-progress-tracker').find('li.ab-step-tabs').filter('.active').find('div.step').css('background', $color_picker.wpColorPicker('color'));
76
$('.ab-mobile-step_1 label').css('color', $color_picker.wpColorPicker('color'));
77
$('.ab-next-step, .ab-mobile-next-step').css('background', $color_picker.wpColorPicker('color'));
78
$('.ab-week-days label').css('background-color', $color_picker.wpColorPicker('color'));
79
$('.picker__frame').attr('style', 'background: ' + color_important);
@@ -84,12 +120,12 @@ jQuery(function($) {
84
$('.picker__day--selected').attr('style', 'color: ' + color_important);
85
$('.picker__button--clear').attr('style', 'color: ' + color_important);
86
$('.picker__button--today').attr('style', 'color: ' + color_important);
87
- $('.ab-columnizer .ab-available-day').css({
88
'background': $color_picker.wpColorPicker('color'),
89
'border-color': $color_picker.wpColorPicker('color')
90
});
91
- $('.ab-nav-tabs .ladda-button, .ab-nav-steps .ladda-button, .ab-btn.ladda-button').css('background-color', $color_picker.wpColorPicker('color'));
92
- $('.ab-columnizer .ab-available-hour').off().hover(
93
function() { // mouse-on
94
$(this).css({
95
'color': $color_picker.wpColorPicker('color'),
@@ -117,18 +153,15 @@ jQuery(function($) {
117
});
118
}
119
);
120
- $('div.ab-formGroup > label.ab-formLabel').css('color', $color_picker.wpColorPicker('color'));
121
- $('.ab-to-second-step, .ab-to-fourth-step, .ab-to-third-step, .ab-final-step')
122
- .css('background', $color_picker.wpColorPicker('color'));
123
};
124
$color_picker.wpColorPicker({
125
- change : function() {
126
- applyColor();
127
- var style_arrow = '' +
128
- '.picker__nav--next:before { border-left: 6px solid ' + $color_picker.wpColorPicker('color') + '!important; } ' +
129
- '.picker__nav--prev:before { border-right: 6px solid ' + $color_picker.wpColorPicker('color') + '!important; }';
130
- $('#ab_update_arrow').html(style_arrow);
131
- }
132
});
133
// Init calendars.
134
$('.ab-date-from').pickadate({
@@ -166,8 +199,6 @@ jQuery(function($) {
166
onClose : function() {
167
this.open(false);
168
}
169
-
170
-
171
});
172
$second_step_calendar_wrap.find('.picker__holder').css({ top : '0px', left : '0px' });
173
$second_step_calendar_wrap.toggle($show_calendar_option.prop('checked'));
@@ -181,39 +212,66 @@ jQuery(function($) {
181
// Color.
182
'color' : $color_picker.wpColorPicker('color'),
183
// Info text.
184
- 'text_info_first_step' : $.trim($text_info_service.text() == 'Empty' ? '' : $text_info_service.text()),
185
- 'text_info_second_step' : $.trim($text_info_time.text() == 'Empty' ? '' : $text_info_time.text()),
186
- 'text_info_third_step' : $.trim($text_info_details.text() == 'Empty' ? '' : $text_info_details.text()),
187
- 'text_info_third_step_guest' : $.trim($text_info_details_guest.text() == 'Empty' ? '' : $text_info_details_guest.text()),
188
- 'text_info_fourth_step' : $.trim($text_info_payment.text() == 'Empty' ? '' : $text_info_payment.text()),
189
- 'text_info_fifth_step' : $.trim($text_info_done.text() == 'Empty' ? '' : $text_info_done.text()),
190
- 'text_info_coupon' : $.trim($text_info_coupon.text() == 'Empty' ? '' : $text_info_coupon.text()),
191
// Step and label texts.
192
- 'text_step_service' : $.trim($text_step_service.text() == 'Empty' ? '' : $text_step_service.text()),
193
- 'text_step_time' : $.trim($text_step_time.text() == 'Empty' ? '' : $text_step_time.text()),
194
- 'text_step_details' : $.trim($text_step_details.text() == 'Empty' ? '' : $text_step_details.text()),
195
- 'text_step_payment' : $.trim($text_step_payment.text() == 'Empty' ? '' : $text_step_payment.text()),
196
- 'text_step_done' : $.trim($text_step_done.text() == 'Empty' ? '' : $text_step_done.text()),
197
- 'text_label_category' : $.trim($text_label_category.text() == 'Empty' ? '' : $text_label_category.text()),
198
- 'text_label_service' : $.trim($text_label_service.text() == 'Empty' ? '' : $text_label_service.text()),
199
- 'text_label_number_of_persons' : $.trim($text_label_number_of_persons.text() == 'Empty' ? '' : $text_label_number_of_persons.text()),
200
- 'text_label_employee' : $.trim($text_label_employee.text() == 'Empty' ? '' : $text_label_employee.text()),
201
- 'text_label_select_date' : $.trim($text_label_select_date.text() == 'Empty' ? '' : $text_label_select_date.text()),
202
- 'text_label_start_from' : $.trim($text_label_start_from.text() == 'Empty' ? '' : $text_label_start_from.text()),
203
- 'text_label_finish_by' : $.trim($text_label_finish_by.text() == 'Empty' ? '' : $text_label_finish_by.text()),
204
- 'text_label_name' : $.trim($text_label_name.text() == 'Empty' ? '' : $text_label_name.text()),
205
- 'text_label_phone' : $.trim($text_label_phone.text() == 'Empty' ? '' : $text_label_phone.text()),
206
- 'text_label_email' : $.trim($text_label_email.text() == 'Empty' ? '' : $text_label_email.text()),
207
- 'text_label_coupon' : $.trim($text_label_coupon.text() == 'Empty' ? '' : $text_label_coupon.text()),
208
- 'text_option_category' : $.trim($text_option_category.text() == 'Empty' ? '' : $text_option_category.text()),
209
- 'text_option_service' : $.trim($text_option_service.text() == 'Empty' ? '' : $text_option_service.text()),
210
- 'text_option_employee' : $.trim($text_option_employee.text() == 'Empty' ? '' : $text_option_employee.text()),
211
- 'text_label_pay_locally' : $.trim($text_label_pay_locally.text() == 'Empty' ? '' : $text_label_pay_locally.text()),
212
// Checkboxes.
213
'progress_tracker' : Number($progress_tracker_option.prop('checked')),
214
'blocked_timeslots' : Number($blocked_timeslots_option.prop('checked')),
215
'day_one_column' : Number($day_one_column_option.prop('checked')),
216
- 'show_calendar' : Number($show_calendar_option.prop('checked'))
217
} // options
218
}; // data
219
@@ -222,7 +280,7 @@ jQuery(function($) {
222
ladda.start();
223
$.post(ajaxurl, data, function (response) {
224
ladda.stop();
225
- $('.notice-success').show();
226
});
227
});
228
@@ -233,69 +291,105 @@ jQuery(function($) {
233
234
// Reset texts.
235
jQuery.each($('.editable'), function() {
236
- var $default_value = $(this).data('default'),
237
- $steps = $(this).data('link-class');
238
239
- $(this).text($default_value); //default value for texts
240
- $('.' + $steps).text($default_value); //default value for steps
241
- $(this).editable('setValue', $default_value); // default value for editable inputs
242
});
243
244
// default value for multiple inputs
245
$text_label_category.editable('setValue', {
246
label: $text_label_category.text(),
247
option: $text_option_category.text(),
248
- id_option: $text_label_category.data('link-class')
249
});
250
251
$text_label_service.editable('setValue', {
252
label: $text_label_service.text(),
253
option: $text_option_service.text(),
254
- id_option: $text_label_service.data('link-class')
255
});
256
257
$text_label_employee.editable('setValue', {
258
label: $text_label_employee.text(),
259
option: $text_option_employee.text(),
260
- id_option: $text_label_employee.data('link-class')
261
});
262
263
});
264
265
$progress_tracker_option.change(function(){
266
- $(this).is(':checked') ? $('div.ab-progress-tracker').show() : $('div.ab-progress-tracker').hide();
267
}).trigger('change');
268
269
- var clickTwoStep = function() {
270
- $tabs.children('li').removeClass('active');
271
- $tabs.children('li[data-step-id="2"]').trigger('click').addClass('active');
272
- };
273
-
274
var day_one_column = $('.ab-day-one-column'),
275
day_columns = $('.ab-day-columns');
276
277
// Change show calendar
278
$show_calendar_option.change(function() {
279
if (this.checked) {
280
$second_step_calendar_wrap.show();
281
- day_columns.find('.col5,.col6,.col7').hide();
282
- day_one_column.find('.col5,.col6,.col7').hide();
283
} else {
284
$second_step_calendar_wrap.hide();
285
- day_one_column.find('.col5,.col6,.col7').css('display','inline-block');
286
- day_columns.find('.col5,.col6,.col7').css('display','inline-block');
287
}
288
- clickTwoStep();
289
});
290
291
// Change blocked time slots.
292
$blocked_timeslots_option.change(function(){
293
if (this.checked) {
294
- $('.ab-available-hour.no-booked').removeClass('no-booked').addClass('booked');
295
} else {
296
- $('.ab-available-hour.booked').removeClass('booked').addClass('no-booked');
297
}
298
- clickTwoStep();
299
});
300
301
// Change day one column.
@@ -307,7 +401,6 @@ jQuery(function($) {
307
day_one_column.hide();
308
day_columns.show();
309
}
310
- clickTwoStep();
311
});
312
313
// Clickable week-days.
@@ -330,6 +423,7 @@ jQuery(function($) {
330
$.extend(multiple.prototype, {
331
render: function() {
332
this.$input = this.$tpl.find('input');
333
},
334
335
value2html: function(value, element) {
@@ -339,6 +433,7 @@ jQuery(function($) {
339
}
340
$(element).text(value.label);
341
$('#' + value.id_option).text(value.option);
342
},
343
344
activate: function () {
@@ -349,29 +444,47 @@ jQuery(function($) {
349
if(!value) {
350
return;
351
}
352
this.$input.filter('[name="label"]').val(value.label);
353
this.$input.filter('[name="option"]').val(value.option);
354
this.$input.filter('[name="id_option"]').val(value.id_option);
355
},
356
357
input2value: function() {
358
return {
359
- label: this.$input.filter('[name="label"]').val(),
360
- option: this.$input.filter('[name="option"]').val(),
361
- id_option: this.$input.filter('[name="id_option"]').val()
362
};
363
}
364
});
365
366
multiple.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
367
- tpl: '<div class="editable-multiple"><label><input type="text" name="label" class="input-medium form-control"></label></div>'+
368
- '<div style="margin-top:5px;" class="editable-multiple"><label><input type="text" name="option" class="input-medium form-control"><input type="hidden" name="id_option"></label></div>',
369
370
inputclass: ''
371
});
372
373
$.fn.editabletypes.multiple = multiple;
374
-
375
$text_label_category.editable({
376
value: {
377
label: $text_label_category.text(),
@@ -383,45 +496,88 @@ jQuery(function($) {
383
value: {
384
label: $text_label_service.text(),
385
option: $text_option_service.text(),
386
- id_option: $text_label_service.data('option-id')
387
}
388
});
389
$text_label_employee.editable({
390
value: {
391
label: $text_label_employee.text(),
392
option: $text_option_employee.text(),
393
- id_option: $text_label_employee.data('option-id')
394
}
395
});
396
397
- $text_info_service.add('#ab-text-info-second').add('#ab-text-info-third').add('#ab-text-info-fourth').add('#ab-text-info-fifth').add('#ab-text-info-coupon').editable({placement: 'right'});
398
$ab_editable.editable();
399
400
- $.fn.editableform.template = '<form class="form-inline editableform"> <div class="control-group"> <div> <div class="editable-input"></div><div class="editable-buttons"></div></div><div style="margin-top: 10px;" class="editable-notes"></div><div class="editable-error-block"></div></div> </form>';
401
402
$ab_editable.on('shown', function(e, editable) {
403
$('.editable-notes').html($(e.target).data('notes'));
404
});
405
-
406
- $("span[data-link-class^='text_step_']").on('save', function(e, params) {
407
- $("span[data-link-class='" + $(e.target).data('link-class') + "']").editable('setValue', params.newValue);
408
- $("span." + $(e.target).data('link-class')).text(params.newValue);
409
});
410
411
- if(jQuery('.ab-authorizenet-payment').is(':checked')) {
412
- jQuery('form.ab-authorizenet').show();
413
- }
414
-
415
- if(jQuery('.ab-stripe-payment').is(':checked')) {
416
- jQuery('form.ab-stripe').show();
417
- }
418
419
- jQuery('input[type=radio]').change( function() {
420
- jQuery('form.ab-authorizenet').add('form.ab-stripe').hide();
421
- if(jQuery('.ab-authorizenet-payment').is(':checked')) {
422
- jQuery('form.ab-authorizenet').show();
423
- } else if(jQuery('.ab-stripe-payment').is(':checked')) {
424
- jQuery('form.ab-stripe').show();
425
}
426
});
427
}); // jQuery
1
jQuery(function($) {
2
var // Progress Tracker.
3
$progress_tracker_option = $('input#ab-progress-tracker-checkbox'),
4
+ $staff_name_with_price_option = $('input#ab-staff-name-with-price-checkbox'),
5
// Time slots setting.
6
$blocked_timeslots_option = $('input#ab-blocked-timeslots-checkbox'),
7
$day_one_column_option = $('input#ab-day-one-column-checkbox'),
8
$show_calendar_option = $('input#ab-show-calendar-checkbox'),
9
+ $required_employee_option = $('input#ab-required-employee-checkbox'),
10
+ $required_location_option = $('input#ab-required-location-checkbox'),
11
// Buttons.
12
$save_button = $('#ajax-send-appearance'),
13
$reset_button = $('button[type=reset]'),
14
// Texts.
15
$text_step_service = $('#ab-text-step-service'),
16
+ $text_step_extras = $('#ab-text-step-extras'),
17
$text_step_time = $('#ab-text-step-time'),
18
+ $text_step_cart = $('#ab-text-step-cart'),
19
$text_step_details = $('#ab-text-step-details'),
20
$text_step_payment = $('#ab-text-step-payment'),
21
$text_step_done = $('#ab-text-step-done'),
22
+ $text_label_location = $('#ab-text-label-location'),
23
+ $text_label_multiply = $('#ab-text-label-multiply'),
24
$text_label_category = $('#ab-text-label-category'),
25
+ $text_option_location = $('#ab-text-option-location'),
26
$text_option_category = $('#ab-text-option-category'),
27
$text_option_service = $('#ab-text-option-service'),
28
$text_option_employee = $('#ab-text-option-employee'),
31
$text_label_employee = $('#ab-text-label-employee'),
32
$text_label_select_date = $('#ab-text-label-select_date'),
33
$text_label_start_from = $('#ab-text-label-start_from'),
34
+ $text_button_next = $('#ab-text-button-next'),
35
+ $text_button_back = $('#ab-text-button-back'),
36
+ $text_button_book_more = $('#ab-text-button-book-more'),
37
+ $text_button_apply = $('#ab-text-button-apply'),
38
$text_label_finish_by = $('#ab-text-label-finish_by'),
39
$text_label_name = $('#ab-text-label-name'),
40
$text_label_phone = $('#ab-text-label-phone'),
41
$text_label_email = $('#ab-text-label-email'),
42
$text_label_coupon = $('#ab-text-label-coupon'),
43
+ $text_info_service = $('#ab-text-info-service'),
44
+ $text_info_extras = $('#ab-text-info-extras'),
45
+ $text_info_time = $('#ab-text-info-time'),
46
+ $text_info_cart = $('#ab-text-info-cart'),
47
+ $text_info_details = $('#ab-text-info-details'),
48
+ $text_info_details_guest = $('#ab-text-info-details-guest'),
49
$text_info_coupon = $('#ab-text-info-coupon'),
50
+ $text_info_payment = $('#ab-text-info-payment'),
51
+ $text_info_complete = $('#ab-text-info-complete'),
52
+ $text_label_pay_paypal = $('#ab-text-label-pay-paypal'),
53
+ $text_label_pay_ccard = $('#ab-text-label-pay-ccard'),
54
+ $text_label_ccard_number = $('#ab-text-label-ccard-number'),
55
+ $text_label_ccard_expire = $('#ab-text-label-ccard-expire'),
56
+ $text_label_ccard_code = $('#ab-text-label-ccard-code'),
57
+ $color_picker = $('.bookly-js-color-picker'),
58
$ab_editable = $('.ab_editable'),
59
$text_label_pay_locally = $('#ab-text-label-pay-locally'),
60
+ $text_label_pay_mollie = $('#ab-text-label-pay-mollie'),
61
// Calendars.
62
$second_step_calendar = $('.ab-selected-date'),
63
+ $second_step_calendar_wrap = $('.ab-slot-calendar'),
64
+ // Step settings.
65
+ $step_settings = $('#bookly-js-step-settings')
66
;
67
68
+ if (BooklyL10n.intlTelInput.enabled) {
69
+ $('.ab-user-phone').intlTelInput({
70
+ preferredCountries: [BooklyL10n.intlTelInput.country],
71
+ defaultCountry: BooklyL10n.intlTelInput.country,
72
+ geoIpLookup: function (callback) {
73
+ $.get(ajaxurl, {action: 'ab_ip_info'}, function () {
74
+ }, 'json').always(function (resp) {
75
+ var countryCode = (resp && resp.country) ? resp.country : '';
76
+ callback(countryCode);
77
+ });
78
+ },
79
+ utilsScript: BooklyL10n.intlTelInput.utils
80
+ });
81
+ }
82
+
83
+ $staff_name_with_price_option.on('change', function () {
84
+ var staff = $('.ab-select-employee').val();
85
+ if (staff) {
86
+ $('.ab-select-employee').val(staff * -1);
87
+ }
88
+ $('.employee-name-price').toggle($staff_name_with_price_option.prop("checked"));
89
+ $('.employee-name').toggle(!$staff_name_with_price_option.prop("checked"));
90
+ }).trigger('change');
91
92
// menu fix for WP 3.8.1
93
$('#toplevel_page_ab-system > ul').css('margin-left', '0px');
94
95
// Tabs.
96
+ $('li.bookly-nav-item').on('shown.bs.tab', function (e) {
97
+ $step_settings.children().hide();
98
+ switch (e.target.getAttribute('data-target')) {
99
+ case '#ab-step-1': $step_settings.find('#bookly-js-step-service').show(); break;
100
+ case '#ab-step-3': $step_settings.find('#bookly-js-step-time').show(); break;
101
+ }
102
+ });
103
104
+ function getEditableValue(val) {
105
+ return $.trim(val == 'Empty' ? '' : val);
106
+ }
107
// Apply color from color picker.
108
var applyColor = function() {
109
var color_important = $color_picker.wpColorPicker('color') + '!important';
110
+ $('.ab-progress-tracker').find('.active').css('color', $color_picker.wpColorPicker('color')).find('.step').css('background', $color_picker.wpColorPicker('color'));
111
$('.ab-mobile-step_1 label').css('color', $color_picker.wpColorPicker('color'));
112
+ $('.bookly-js-actions > a').css('background-color', $color_picker.wpColorPicker('color'));
113
$('.ab-next-step, .ab-mobile-next-step').css('background', $color_picker.wpColorPicker('color'));
114
$('.ab-week-days label').css('background-color', $color_picker.wpColorPicker('color'));
115
$('.picker__frame').attr('style', 'background: ' + color_important);
120
$('.picker__day--selected').attr('style', 'color: ' + color_important);
121
$('.picker__button--clear').attr('style', 'color: ' + color_important);
122
$('.picker__button--today').attr('style', 'color: ' + color_important);
123
+ $('.ab-extra-step .bookly-extras-thumb.bookly-extras-selected').css('border-color', $color_picker.wpColorPicker('color'));
124
+ $('.ab-columnizer .ab-day').css({
125
'background': $color_picker.wpColorPicker('color'),
126
'border-color': $color_picker.wpColorPicker('color')
127
});
128
+ $('.ab-columnizer .ab-hour').off().hover(
129
function() { // mouse-on
130
$(this).css({
131
'color': $color_picker.wpColorPicker('color'),
153
});
154
}
155
);
156
+ $('.ab-details-step label').css('color', $color_picker.wpColorPicker('color'));
157
+ $('.ab-card-form label').css('color', $color_picker.wpColorPicker('color'));
158
+ $('.ab-nav-tabs .ladda-button, .ab-nav-steps .ladda-button, .ab-btn, .bookly-round-button').css('background-color', $color_picker.wpColorPicker('color'));
159
+ $('.ab-back-step, .ab-next-step').css('background', $color_picker.wpColorPicker('color'));
160
+ var style_arrow = '.picker__nav--next:before { border-left: 6px solid ' + $color_picker.wpColorPicker('color') + '!important; } .picker__nav--prev:before { border-right: 6px solid ' + $color_picker.wpColorPicker('color') + '!important; }';
161
+ $('#ab--style-arrow').html(style_arrow);
162
};
163
$color_picker.wpColorPicker({
164
+ change : applyColor
165
});
166
// Init calendars.
167
$('.ab-date-from').pickadate({
199
onClose : function() {
200
this.open(false);
201
}
202
});
203
$second_step_calendar_wrap.find('.picker__holder').css({ top : '0px', left : '0px' });
204
$second_step_calendar_wrap.toggle($show_calendar_option.prop('checked'));
212
// Color.
213
'color' : $color_picker.wpColorPicker('color'),
214
// Info text.
215
+ 'text_info_service_step' : getEditableValue($text_info_service.text()),
216
+ 'text_info_extras_step' : getEditableValue($text_info_extras.text()),
217
+ 'text_info_time_step' : getEditableValue($text_info_time.text()),
218
+ 'text_info_cart_step' : getEditableValue($text_info_cart.text()),
219
+ 'text_info_details_step' : getEditableValue($text_info_details.text()),
220
+ 'text_info_details_step_guest' : getEditableValue($text_info_details_guest.text()),
221
+ 'text_info_payment_step' : getEditableValue($text_info_payment.text()),
222
+ 'text_info_complete_step' : getEditableValue($text_info_complete.text()),
223
+ 'text_info_coupon' : getEditableValue($text_info_coupon.text()),
224
// Step and label texts.
225
+ 'text_step_service' : getEditableValue($text_step_service.text()),
226
+ 'text_step_extras' : getEditableValue($text_step_extras.text()),
227
+ 'text_step_time' : getEditableValue($text_step_time.text()),
228
+ 'text_step_cart' : getEditableValue($text_step_cart.text()),
229
+ 'text_step_details' : getEditableValue($text_step_details.text()),
230
+ 'text_step_payment' : getEditableValue($text_step_payment.text()),
231
+ 'text_step_done' : getEditableValue($text_step_done.text()),
232
+ 'text_label_location' : getEditableValue($text_label_location.text()),
233
+ 'text_label_category' : getEditableValue($text_label_category.text()),
234
+ 'text_label_service' : getEditableValue($text_label_service.text()),
235
+ 'text_label_number_of_persons' : getEditableValue($text_label_number_of_persons.text()),
236
+ 'text_label_multiply' : getEditableValue($text_label_multiply.text()),
237
+ 'text_label_employee' : getEditableValue($text_label_employee.text()),
238
+ 'text_label_select_date' : getEditableValue($text_label_select_date.text()),
239
+ 'text_label_start_from' : getEditableValue($text_label_start_from.text()),
240
+ 'text_button_next' : getEditableValue($text_button_next.text()),
241
+ 'text_button_back' : getEditableValue($text_button_back.text()),
242
+ 'text_button_apply' : getEditableValue($text_button_apply.text()),
243
+ 'text_button_book_more' : getEditableValue($text_button_book_more.text()),
244
+ 'text_label_finish_by' : getEditableValue($text_label_finish_by.text()),
245
+ 'text_label_name' : getEditableValue($text_label_name.text()),
246
+ 'text_label_phone' : getEditableValue($text_label_phone.text()),
247
+ 'text_label_email' : getEditableValue($text_label_email.text()),
248
+ 'text_label_coupon' : getEditableValue($text_label_coupon.text()),
249
+ 'text_option_location' : getEditableValue($text_option_location.text()),
250
+ 'text_option_category' : getEditableValue($text_option_category.text()),
251
+ 'text_option_service' : getEditableValue($text_option_service.text()),
252
+ 'text_option_employee' : getEditableValue($text_option_employee.text()),
253
+ 'text_label_pay_locally' : getEditableValue($text_label_pay_locally.text()),
254
+ 'text_label_pay_mollie' : getEditableValue($text_label_pay_mollie.text()),
255
+ 'text_label_pay_paypal' : getEditableValue($text_label_pay_paypal.text()),
256
+ 'text_label_pay_ccard' : getEditableValue($text_label_pay_ccard.text()),
257
+ 'text_label_ccard_number' : getEditableValue($text_label_ccard_number.text()),
258
+ 'text_label_ccard_expire' : getEditableValue($text_label_ccard_expire.text()),
259
+ 'text_label_ccard_code' : getEditableValue($text_label_ccard_code.text()),
260
+ // Validator.
261
+ 'text_required_location' : getEditableValue($('#ab_appearance_text_required_location').html()),
262
+ 'text_required_service' : getEditableValue($('#ab_appearance_text_required_service').html()),
263
+ 'text_required_employee' : getEditableValue($('#ab_appearance_text_required_employee').html()),
264
+ 'text_required_name' : getEditableValue($('#ab_appearance_text_required_name').html()),
265
+ 'text_required_phone' : getEditableValue($('#ab_appearance_text_required_phone').html()),
266
+ 'text_required_email' : getEditableValue($('#ab_appearance_text_required_email').html()),
267
// Checkboxes.
268
'progress_tracker' : Number($progress_tracker_option.prop('checked')),
269
+ 'staff_name_with_price': Number($staff_name_with_price_option.prop('checked')),
270
'blocked_timeslots' : Number($blocked_timeslots_option.prop('checked')),
271
'day_one_column' : Number($day_one_column_option.prop('checked')),
272
+ 'show_calendar' : Number($show_calendar_option.prop('checked')),
273
+ 'required_employee' : Number($required_employee_option.prop('checked')),
274
+ 'required_location' : Number($required_location_option.prop('checked'))
275
} // options
276
}; // data
277
280
ladda.start();
281
$.post(ajaxurl, data, function (response) {
282
ladda.stop();
283
+ booklyAlert({success : [BooklyL10n.saved]});
284
});
285
});
286
291
292
// Reset texts.
293
jQuery.each($('.editable'), function() {
294
+ $(this).text($(this).data('default')); //default value for texts
295
+ $(this).editable('setValue', $(this).data('default')); // default value for editable inputs
296
+ });
297
298
+ // Reset texts.
299
+ jQuery.each($('.ab-service-list, .ab-employee-list'), function() {
300
+ $(this).html($(this).data('default')); //default value
301
});
302
303
// default value for multiple inputs
304
+
305
+ $text_label_location.editable('setValue', {
306
+ label: $text_label_location.text(),
307
+ option: $text_option_location.text(),
308
+ id_option: $text_label_location.data('option-id'),
309
+ extended: true,
310
+ option2: $text_label_location.data('default-error'),
311
+ id_option2: $text_label_location.data('error-id')
312
+ });
313
+
314
$text_label_category.editable('setValue', {
315
label: $text_label_category.text(),
316
option: $text_option_category.text(),
317
+ id_option: $text_label_category.data('option-id')
318
});
319
320
$text_label_service.editable('setValue', {
321
label: $text_label_service.text(),
322
option: $text_option_service.text(),
323
+ id_option: $text_label_service.data('option-id'),
324
+ extended: true,
325
+ option2: $text_label_service.data('default-error'),
326
+ id_option2: $text_label_service.data('error-id')
327
});
328
329
$text_label_employee.editable('setValue', {
330
label: $text_label_employee.text(),
331
option: $text_option_employee.text(),
332
+ id_option: $text_label_employee.data('option-id'),
333
+ extended: true,
334
+ option2: $text_label_employee.data('default-error'),
335
+ id_option2: $text_label_employee.data('error-id')
336
});
337
338
+ $text_label_name.editable('setValue', {
339
+ label: $text_label_name.text(),
340
+ option: $text_label_name.data('default-error'),
341
+ id_option: $text_label_name.data('option-id')
342
+ });
343
+
344
+ $text_label_phone.editable('setValue', {
345
+ label: $text_label_phone.text(),
346
+ option: $text_label_phone.data('default-error'),
347
+ id_option: $text_label_phone.data('option-id')
348
+ });
349
+
350
+ $text_label_email.editable('setValue', {
351
+ label: $text_label_email.text(),
352
+ option: $text_label_email.data('default-error'),
353
+ id_option: $text_label_email.data('option-id')
354
+ });
355
});
356
357
$progress_tracker_option.change(function(){
358
+ $('.ab-progress-tracker').toggle($(this).is(':checked'));
359
}).trigger('change');
360
361
var day_one_column = $('.ab-day-one-column'),
362
day_columns = $('.ab-day-columns');
363
364
+ if ($show_calendar_option.prop('checked')) {
365
+ $second_step_calendar_wrap.show();
366
+ day_columns.find('.col3,.col4,.col5,.col6,.col7').hide();
367
+ day_columns.find('.col2 button:gt(0)').attr('style', 'display: none !important');
368
+ day_one_column.find('.col2,.col3,.col4,.col5,.col6,.col7').hide();
369
+ }
370
+
371
// Change show calendar
372
$show_calendar_option.change(function() {
373
if (this.checked) {
374
$second_step_calendar_wrap.show();
375
+ day_columns.find('.col3,.col4,.col5,.col6,.col7').hide();
376
+ day_columns.find('.col2 button:gt(0)').attr('style', 'display: none !important');
377
+ day_one_column.find('.col2,.col3,.col4,.col5,.col6,.col7').hide();
378
} else {
379
$second_step_calendar_wrap.hide();
380
+ day_columns.find('.col2 button:gt(0)').attr('style', 'display: block !important');
381
+ day_columns.find('.col3,.col4,.col5,.col6,.col7').css('display','inline-block');
382
+ day_one_column.find('.col2,.col3,.col4,.col5,.col6,.col7').css('display','inline-block');
383
}
384
});
385
386
// Change blocked time slots.
387
$blocked_timeslots_option.change(function(){
388
if (this.checked) {
389
+ $('.ab-hour.no-booked').removeClass('no-booked').addClass('booked');
390
} else {
391
+ $('.ab-hour.booked').removeClass('booked').addClass('no-booked');
392
}
393
});
394
395
// Change day one column.
401
day_one_column.hide();
402
day_columns.show();
403
}
404
});
405
406
// Clickable week-days.
423
$.extend(multiple.prototype, {
424
render: function() {
425
this.$input = this.$tpl.find('input');
426
+ this.$more = jQuery('div.ad--extend', this.tpl);
427
},
428
429
value2html: function(value, element) {
433
}
434
$(element).text(value.label);
435
$('#' + value.id_option).text(value.option);
436
+ $('#' + value.id_option2).text(value.option2);
437
},
438
439
activate: function () {
444
if(!value) {
445
return;
446
}
447
+ if (value.extended) {
448
+ this.$more.show();
449
+ }
450
this.$input.filter('[name="label"]').val(value.label);
451
this.$input.filter('[name="option"]').val(value.option);
452
this.$input.filter('[name="id_option"]').val(value.id_option);
453
+ this.$input.filter('[name="option2"]').val(value.option2);
454
+ this.$input.filter('[name="id_option2"]').val(value.id_option2);
455
},
456
457
input2value: function() {
458
return {
459
+ label: this.$input.filter('[name="label"]').val(),
460
+ option: this.$input.filter('[name="option"]').val(),
461
+ id_option: this.$input.filter('[name="id_option"]').val(),
462
+ option2: this.$input.filter('[name="option2"]').val(),
463
+ id_option2: this.$input.filter('[name="id_option2"]').val(),
464
+ extended: this.$more.is(':visible')
465
};
466
}
467
});
468
469
multiple.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
470
+ tpl: '<div class="editable-multiple"><input type="text" name="label" class="form-control input-sm" /></div>'+
471
+ '<div style="margin-top:5px;" class="editable-multiple"><input type="text" name="option" class="form-control input-sm" /><input type="hidden" name="id_option" /></div><div class="ad--extend" style="display:none">'+
472
+ '<div style="margin-top:5px;" class="editable-multiple"><input type="text" name="option2" class="form-control input-sm" /><input type="hidden" name="id_option2" /></div></div></div>',
473
474
inputclass: ''
475
});
476
477
$.fn.editabletypes.multiple = multiple;
478
+ $text_label_location.editable({
479
+ value: {
480
+ label: $text_label_location.text(),
481
+ option: $text_option_location.text(),
482
+ id_option: $text_label_location.data('option-id'),
483
+ extended: true,
484
+ option2: $text_label_location.data('default-error'),
485
+ id_option2: $text_label_location.data('error-id')
486
+ }
487
+ });
488
$text_label_category.editable({
489
value: {
490
label: $text_label_category.text(),
496
value: {
497
label: $text_label_service.text(),
498
option: $text_option_service.text(),
499
+ id_option: $text_label_service.data('option-id'),
500
+ extended: true,
501
+ option2: $text_label_service.data('default-error'),
502
+ id_option2: $text_label_service.data('error-id')
503
}
504
});
505
$text_label_employee.editable({
506
value: {
507
label: $text_label_employee.text(),
508
option: $text_option_employee.text(),
509
+ id_option: $text_label_employee.data('option-id'),
510
+ extended: true,
511
+ option2: $text_label_employee.data('default-error'),
512
+ id_option2: $text_label_employee.data('error-id')
513
+ }
514
+ });
515
+
516
+ $text_label_name.editable({
517
+ value: {
518
+ label: $text_label_name.text(),
519
+ option: $text_label_name.data('default-error'),
520
+ id_option: $text_label_name.data('option-id')
521
+ }
522
+ });
523
+
524
+ $text_label_phone.editable({
525
+ value: {
526
+ label: $text_label_phone.text(),
527
+ option: $text_label_phone.data('default-error'),
528
+ id_option: $text_label_phone.data('option-id')
529
}
530
});
531
532
+ $text_label_email.editable({
533
+ value: {
534
+ label: $text_label_email.text(),
535
+ option: $text_label_email.data('default-error'),
536
+ id_option: $text_label_email.data('option-id')
537
+ }
538
+ });
539
+
540
+ $text_info_service.add('#ab-text-info-time').add('#ab-text-info-details').add('#ab-text-info-payment').add('#ab-text-info-complete').add('#ab-text-info-coupon').editable({placement: 'right'});
541
$ab_editable.editable();
542
543
+ $.fn.editableform.template = '<form class="form-inline editableform"> <div class="control-group"> <div> <div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-notes"></div><div class="editable-error-block"></div></div> </form>';
544
+ $.fn.editableform.buttons = '<div class="btn-group btn-group-sm"><button type="submit" class="btn btn-success editable-submit"><span class="glyphicon glyphicon-ok"></span></button><button type="button" class="btn btn-default editable-cancel"><span class="glyphicon glyphicon-remove"></span></button></div>';
545
546
$ab_editable.on('shown', function(e, editable) {
547
+ $('.popover').find('.arrow').removeClass().addClass('popover-arrow');
548
$('.editable-notes').html($(e.target).data('notes'));
549
});
550
+ $('[data-type="multiple"]').on('shown', function(e, editable) {
551
+ $('.popover').find('.arrow').removeClass().addClass('popover-arrow');
552
});
553
554
+ $("[data-mirror^='text_']").on('save', function (e, params) {
555
+ $("." + $(e.target).data('mirror')).editable('setValue', params.newValue);
556
+ switch ($(e.target).data('mirror')){
557
+ case 'text_services':
558
+ $(".ab-service-list").html(params.newValue.label);
559
+ break;
560
+ case 'text_locations':
561
+ $(".ab-location-list").html(params.newValue.label);
562
+ break;
563
+ case 'text_employee':
564
+ $(".ab-employee-list").html(params.newValue.label);
565
+ break;
566
+ }
567
+ });
568
569
+ $('input[type=radio]').change(function () {
570
+ if ($('.ab-card-payment').is(':checked')) {
571
+ $('form.ab-card-form').show();
572
+ } else {
573
+ $('form.ab-card-form').hide();
574
}
575
});
576
+
577
+ $('#bookly-js-hint-alert').on('closed.bs.alert', function () {
578
+ $.ajax({
579
+ url: ajaxurl,
580
+ data: { action: 'ab_dismiss_appearance_notice' }
581
+ });
582
+ })
583
}); // jQuery
backend/modules/appearance/templates/_1_service.php CHANGED
@@ -2,21 +2,30 @@
2
/** @var WP_Locale $wp_locale */
3
global $wp_locale;
4
?>
5
- <div class="ab-booking-form">
6
7
- <!-- Progress Tracker-->
8
- <?php $step = 1; include '_progress_tracker.php'; ?>
9
-
10
- <div class="ab-first-step">
11
- <div class="ab-row-fluid">
12
- <span data-inputclass="input-xxlarge" data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_info_first_step' ) ) ?>" class="ab-bold ab_editable" id="ab-text-info-first" data-rows="7" data-type="textarea"><?php echo esc_html( get_option( 'ab_appearance_text_info_first_step' ) ) ?></span>
13
</div>
14
- <div class=ab-service-form>
15
- <div class="ab-mobile-step_1 ab-four-cols ab-row-fluid">
16
- <div class="ab-formGroup ab-left">
17
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_category' ) ) ?>" class="ab-formLabel text_category_label" id="ab-text-label-category" data-type="multiple" data-option-id="ab-text-option-category"><?php echo esc_html( get_option( 'ab_appearance_text_label_category' ) ) ?></label>
18
- <div class="ab-formField">
19
- <select class="ab-formElement ab-select-mobile ab-select-category" style="width: 100%">
20
<option value="" class="editable" id="ab-text-option-category" data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_option_category' ) ) ?>"><?php echo esc_html( get_option( 'ab_appearance_text_option_category' ) ) ?></option>
21
<option value="1">Cosmetic Dentistry</option>
22
<option value="2">Invisalign</option>
@@ -25,113 +34,162 @@
25
</select>
26
</div>
27
</div>
28
- <div class="ab-formGroup ab-left">
29
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_service' ) ) ?>" class="ab-formLabel text_service_label" id="ab-text-label-service" data-type="multiple" data-option-id="ab-text-option-service"><?php echo esc_html( get_option( 'ab_appearance_text_label_service' ) ) ?></label>
30
- <div class="ab-formField">
31
- <select class="ab-formElement ab-select-mobile ab-select-service" style="width: 100%">
32
- <option value="" class="editable" id="ab-text-option-service" data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_option_service' ) ); ?>"><?php echo esc_html( get_option( 'ab_appearance_text_option_service' ) ) ?></option>
33
- <option value="1">Crown and Bridge</option>
34
- <option value="2">Teeth Whitening</option>
35
- <option value="3">Veneers</option>
36
- <option value="4">Invisalign (invisable braces)</option>
37
- <option value="5">Orthodontics (braces)</option>
38
- <option value="6">Wisdom tooth Removal</option>
39
- <option value="7">Root Canal Treatment</option>
40
- <option value="8">Dentures</option>
41
</select>
42
</div>
43
</div>
44
- <div class="ab-formGroup ab-left">
45
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_employee' ) ) ?>" class="ab-formLabel text_employee_label" id="ab-text-label-employee" data-type="multiple" data-option-id="ab-text-option-employee"><?php echo esc_html( get_option( 'ab_appearance_text_label_employee' ) ) ?></label>
46
- <div class="ab-formField">
47
- <select class="ab-formElement ab-select-mobile ab-select-employee" style="width: 100%">
48
- <option value="" class="editable" id="ab-text-option-employee" data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_option_employee' ) ) ?>"><?php echo esc_html( get_option( 'ab_appearance_text_option_employee' ) ) ?></option>
49
- <option value="1">Nick Knight</option>
50
- <option value="2">Jane Howard</option>
51
- <option value="3">Ashley Stamp</option>
52
- <option value="4">Bradley Tannen</option>
53
- <option value="5">Wayne Turner</option>
54
- <option value="6">Emily Taylor</option>
55
- <option value="7">Hugh Canberg</option>
56
- <option value="8">Jim Gonzalez</option>
57
- <option value="9">Nancy Stinson</option>
58
- <option value="10">Marry Murphy</option>
59
</select>
60
</div>
61
</div>
62
- <div class="ab-formGroup ab-left">
63
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_number_of_persons' ) ) ?>" class="ab-formLabel ab_editable" data-type="text" id="ab-text-label-number-of-persons"><?php echo esc_html( get_option( 'ab_appearance_text_label_number_of_persons' ) ) ?></label>
64
- <div class="ab-formField">
65
- <select class="ab-formElement ab-select-mobile ab-select-number-of-persons">
66
- <option value="1">1</option>
67
- <option value="2">2</option>
68
- <option value="3">3</option>
69
</select>
70
</div>
71
</div>
72
-
73
- <button class="ab-right ab-mobile-next-step ab-btn ab-none ladda-button" onclick="return false">
74
- <span><?php _e( 'Next', 'bookly' ) ?></span>
75
- </button>
76
- </div>
77
- <div class="ab-mobile-step_2">
78
- <div class="ab-row-fluid">
79
- <div class="ab-available-date ab-formGroup ab-lastGroup ab-left">
80
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_select_date' ) ) ?>" class="ab_editable ab-nowrap" id="ab-text-label-select_date" data-type="text"><?php echo esc_html( get_option( 'ab_appearance_text_label_select_date' ) ) ?></label>
81
- <div class="ab-input-wrap ab-formField">
82
- <span class="ab-date-wrap">
83
- <input style="background: white" class="ab-date-from ab-formElement picker__input--active" type="text" data-value="<?php echo date( 'Y-m-d' ) ?>" />
84
- </span>
85
- </div>
86
</div>
87
- <div class="ab-available-days ab-left">
88
- <ul class="ab-week-days">
89
- <?php foreach ( $wp_locale->weekday_abbrev as $weekday_abbrev ): ?>
90
- <li>
91
- <div class="ab-bold"><?php echo $weekday_abbrev ?></div>
92
- <label class="active">
93
- <input class="ab-week-day" value="1" checked="checked" type="checkbox">
94
- </label>
95
- </li>
96
- <?php endforeach ?>
97
- </ul>
98
</div>
99
- <div class="ab-time-range ab-left">
100
- <div class="ab-time-from ab-left">
101
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_start_from' ) ) ?>" class="ab_editable" id="ab-text-label-start_from" data-type="text"><?php echo esc_html( get_option( 'ab_appearance_text_label_start_from' ) ) ?></label>
102
<div>
103
- <select class="select-list ab-select-time-from">
104
- <?php for ( $i = 28800; $i <= 64800; $i += 3600 ): ?>
105
- <option><?php echo AB_DateTimeUtils::formatTime( $i ) ?></option>
106
- <?php endfor ?>
107
- </select>
108
</div>
109
</div>
110
- <div class="ab-time-to ab-left">
111
- <label data-default="<?php echo esc_attr( get_option( 'ab_appearance_text_label_finish_by' ) ) ?>" class="ab_editable" id="ab-text-label-finish_by" data-type="text"><?php echo esc_html( get_option( 'ab_appearance_text_label_finish_by' ) ) ?></label>
112
<div>
113
- <select class="select-list ab-select-time-to">
114
- <?php for ( $i = 28800; $i <= 64800; $i += 3600 ): ?>
115
- <option<?php selected( $i == 64800 ) ?>><?php echo AB_DateTimeUtils::formatTime( $i ) ?></option>
116
- <?php endfor ?>
117
- </select>
118
</div>