PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/bookings/api-booking.php +16 -2 1.0.63 → 1.0.64 View file →
@@ -935,9 +935,23 @@
935 935 } else {
936 936 $status = $default_status;
937 937 }
938 938 } else {
939 - $current_status = ( new Booking( $id ) )->get_status();
939 + $current_booking = new Booking( $id );
940 +
941 + // Reschedule only moves time.
942 + if ( (int) $current_booking->get_appointment() !== $appointment ) {
943 + return new WP_HTTP_Response(
944 + [
945 + 'status_code' => 403,
946 + 'success' => 0,
947 + 'message' => esc_html__( 'You can not change the appointment of a booking.', 'timetics' ),
948 + ],
949 + 403
950 + );
951 + }
952 +
953 + $current_status = $current_booking->get_status();
940 954 if ( 'cancel' === $client_status ) {
941 955 $status = 'cancel';
942 956 } else {
943 957 $status = $current_status;
@@ -1100,9 +1114,9 @@
1100 1114 'date' => $date,
1101 1115 'end_date' => $end_date,
1102 1116 'start_time' => $start_time,
1103 1117 'end_time' => $end_time,
1104 - 'order_total' => $this->calculate_order_total( $data ),
1118 + 'order_total' => ( $id && ! $is_privileged ) ? $booking->get_total() : $this->calculate_order_total( $data ),
1105 1119 'post_status' => $status,
1106 1120 'location' => $location,
1107 1121 'location_type' => $location_type,
1108 1122 'timezone' => $timezone,