Changeset 2797313
- Timestamp:
- 10/11/2022 02:41:45 PM (3 years ago)
- Location:
- events-manager/trunk
- Files:
-
- 8 edited
-
classes/em-booking.php (modified) (2 diffs)
-
classes/em-bookings.php (modified) (2 diffs)
-
classes/em-event.php (modified) (1 diff)
-
classes/em-location.php (modified) (1 diff)
-
classes/em-person.php (modified) (1 diff)
-
classes/event-locations/em-event-location.php (modified) (1 diff)
-
events-manager.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
events-manager/trunk/classes/em-booking.php
r2795697 r2797313 1074 1074 $this->feedback_message = sprintf(__('Booking %s.','events-manager'), $action_string); 1075 1075 $result = apply_filters('em_booking_set_status', $result, $this); // run the filter before emails go out, in case others need to hook in first 1076 if( $result && $ email && $this->previous_status != $this->booking_status ){ //email if status has changed1076 if( $result && $this->previous_status != $this->booking_status ){ //email if status has changed 1077 1077 do_action('em_booking_status_changed', $this, array('status' => $status, 'email' => $email, 'ignore_spaces' => $ignore_spaces)); // method params passed as array 1078 if( $this->email() ){ 1079 if( $this->mails_sent > 0 ){ 1080 $this->feedback_message .= " ".__('Email Sent.','events-manager'); 1081 } 1082 }else{ 1083 //extra errors may be logged by email() in EM_Object 1084 $this->feedback_message .= ' <span style="color:red">'.__('ERROR : Email Not Sent.','events-manager').'</span>'; 1085 $this->add_error(__('ERROR : Email Not Sent.','events-manager')); 1078 if( $email ){ 1079 if( $this->email() ){ 1080 if( $this->mails_sent > 0 ){ 1081 $this->feedback_message .= " ".__('Email Sent.','events-manager'); 1082 } 1083 }else{ 1084 //extra errors may be logged by email() in EM_Object 1085 $this->feedback_message .= ' <span style="color:red">'.__('ERROR : Email Not Sent.','events-manager').'</span>'; 1086 $this->add_error(__('ERROR : Email Not Sent.','events-manager')); 1087 } 1086 1088 } 1087 1089 } … … 1491 1493 return $booking; 1492 1494 } 1495 1496 function to_api( $args = array('event' => true), $version = 'v1' ){ 1497 $booking = array ( 1498 'id' => $this->booking_id, 1499 'event_id' => $this->event_id, 1500 'uuid' => $this->booking_uuid, 1501 'person_id' => $this->person_id, 1502 'status' => $this->booking_status, 1503 'spaces' => $this->booking_spaces, 1504 'price' => $this->get_price(), 1505 'tax_rate' => $this->get_tax_rate(true), // returned as decimal/percen 1506 'taxes' => $this->booking_taxes, 1507 'comment' => $this->booking_comment, 1508 'meta' => $this->booking_meta, 1509 'tickets' => array(), 1510 ); 1511 // add tickets 1512 foreach ( $this->get_tickets_bookings() as $EM_Ticket_Bookings ){ 1513 $booking['tickets'][$EM_Ticket_Bookings->ticket_id] = array( 1514 'name' => $EM_Ticket_Bookings->get_ticket()->ticket_name, 1515 'description' => $EM_Ticket_Bookings->get_ticket()->ticket_name, 1516 'spaces' => $EM_Ticket_Bookings->get_spaces(), 1517 'price' => $EM_Ticket_Bookings->get_price(), 1518 'attendees' => array(), 1519 ); 1520 foreach ( $EM_Ticket_Bookings as $EM_Ticket_Booking ){ 1521 $booking['tickets'][$EM_Ticket_Bookings->ticket_id]['attendees'][] = array( 1522 'uuid' => $EM_Ticket_Booking->ticket_uuid, 1523 'price' => $EM_Ticket_Booking->ticket_booking_price, 1524 'meta' => $EM_Ticket_Booking->meta, 1525 ); 1526 } 1527 } 1528 // if event data should be sent 1529 if( !empty($args['event']) ) { 1530 $booking['event'] = $this->get_event()->to_api(); 1531 } 1532 return apply_filters('em_booking_to_api', $booking, array(), $this); 1533 } 1493 1534 } 1494 1535 ?> -
events-manager/trunk/classes/em-bookings.php
r2784153 r2797313 6 6 * @property EM_Event $event 7 7 */ 8 class EM_Bookings extends EM_Object implements Iterator {8 class EM_Bookings extends EM_Object implements Iterator, ArrayAccess { 9 9 10 10 /** … … 866 866 return $var; 867 867 } 868 869 // ArrayAccess Implementation 870 #[\ReturnTypeWillChange] 871 /** 872 * @param $offset 873 * @param $value 874 * @return void 875 */ 876 public function offsetSet($offset, $value) { 877 if (is_null($offset)) { 878 $this->bookings[] = $value; 879 } else { 880 $this->bookings[$offset] = $value; 881 } 882 } 883 #[\ReturnTypeWillChange] 884 /** 885 * @param $offset 886 * @return bool 887 */ 888 public function offsetExists($offset) { 889 return isset($this->bookings[$offset]); 890 } 891 #[\ReturnTypeWillChange] 892 /** 893 * @param $offset 894 * @return void 895 */ 896 public function offsetUnset($offset) { 897 unset($this->bookings[$offset]); 898 } 899 #[\ReturnTypeWillChange] 900 /** 901 * @param $offset 902 * @return EM_Ticket_Bookings|null 903 */ 904 public function offsetGet($offset) { 905 return isset($this->bookings[$offset]) ? $this->bookings[$offset] : null; 906 } 868 907 } 869 908 ?> -
events-manager/trunk/classes/em-event.php
r2784153 r2797313 3597 3597 return apply_filters('em_event_can_manage', parent::can_manage($owner_capability, $admin_capability, $user_to_check), $this, $owner_capability, $admin_capability, $user_to_check); 3598 3598 } 3599 3600 /** 3601 * Outputs a JSON-encodable associative array of data to output to REST or other remote operations 3602 * @return array 3603 */ 3604 function to_api(){ 3605 $event = array ( 3606 'name' => $this->event_name, 3607 'id' => $this->event_id, 3608 'post_id' => $this->post_id, 3609 'parent' => $this->event_parent, 3610 'owner' => $this->event_owner, // overwritten further down 3611 'blog_id' => $this->blog_id, 3612 'group_id' => $this->group_id, 3613 'slug' => $this->event_slug, 3614 'status' => $this->event_private, 3615 'content' => $this->post_content, 3616 'bookings' => array ( 3617 'end_date' => '$this->event_rsvp_date', 3618 'end_time' => '$this->event_rsvp_time', 3619 'rsvp_spaces' => '$this->event_rsvp_spaces', 3620 'spaces' => $this->event_spaces, 3621 ), 3622 'when' => array( 3623 'all_day' => $this->event_all_day, 3624 'start' => $this->event_start, 3625 'start_date' => $this->event_start_date, 3626 'start_time' => $this->event_start_time, 3627 'end' => $this->event_end, 3628 'end_date' => $this->event_end_date, 3629 'end_time' => $this->event_end_time, 3630 'timezone' => $this->event_timezone, 3631 ), 3632 'location' => false, 3633 'recurrence' => false, 3634 'language' => $this->event_language, 3635 'translation' => $this->event_translation, 3636 ); 3637 if( $this->event_owner ){ 3638 // anonymous 3639 $event['owner'] = array( 3640 'guest' => true, 3641 'email' => $this->get_contact()->user_email, 3642 'name' => $this->get_contact()->get_name(), 3643 ); 3644 }else{ 3645 // user 3646 $event['owner'] = array( 3647 'guest' => false, 3648 'email' => $this->get_contact()->user_email, 3649 'name' => $this->get_contact()->get_name(), 3650 ); 3651 } 3652 if( $this->recurrence_id ){ 3653 $event['recurrence_id'] = $this->recurrence_id; 3654 } 3655 if( $this->recurrence ){ 3656 $event['recurrence'] = array ( 3657 'interval' => $this->recurrence_interval, 3658 'freq' => $this->recurrence_freq, 3659 'days' => $this->recurrence_days, 3660 'byday' => $this->recurrence_byday, 3661 'byweekno' => $this->recurrence_byweekno, 3662 'rsvp_days' => $this->recurrence_rsvp_days, 3663 ); 3664 } 3665 if( $this->location_type ){ 3666 $event['location_type'] = $this->event_location_type; 3667 if( $this->has_location() ) { 3668 $EM_Location = $this->get_location(); 3669 $event['location'] = $EM_Location->to_api(); 3670 }elseif( $this->has_event_location() ){ 3671 $event['location'] = $this->get_event_location()->to_api(); 3672 } 3673 } 3674 return $event; 3675 } 3599 3676 } 3600 3677 -
events-manager/trunk/classes/em-location.php
r2760880 r2797313 1171 1171 return apply_filters('em_location_get_google_maps_embed_url', $url, $this); 1172 1172 } 1173 1174 public function to_api(){ 1175 return array ( 1176 'name' => $this->location_name, 1177 'id' => $this->location_id, 1178 'parent' => $this->location_parent, 1179 'post_id' => $this->post_id, 1180 'blog_id' => $this->blog_id, 1181 'owner' => $this->location_owner, 1182 'status' => $this->location_status, 1183 'slug' => $this->location_slug, 1184 'content' => $this->post_content, 1185 'geo' => array( 1186 'latitude' => $this->location_latitude, 1187 'longitude' => $this->location_longitude, 1188 ), 1189 'address' => array( 1190 'address' => $this->location_address, 1191 'town' => $this->location_town, 1192 'region' => $this->location_region, 1193 'state' => $this->location_state, 1194 'postcode' => $this->location_postcode, 1195 'country' => $this->location_country, 1196 ), 1197 'language' => $this->location_language, 1198 'translation' => $this->location_translation, 1199 ); 1200 } 1173 1201 } -
events-manager/trunk/classes/em-person.php
r2569289 r2797313 124 124 return apply_filters('em_person_get_name', $name, $this); 125 125 } 126 127 function to_api(){ 128 $person = array( 129 'id' => $this->ID, // maybe hide this depending on permissions 130 'name' => $this->get_name(), 131 'name_first' => $this->first_name, 132 'name_last' => $this->last_name, 133 'email' => $this->user_email, 134 'phone' => $this->phone, 135 'guest' => $this->ID > 0, // whether person is registered or not 136 ); 137 $person = array_merge( $person, $this->custom_user_fields ); 138 return apply_filters('em_person_to_api', $person); 139 } 126 140 } 127 141 ?> -
events-manager/trunk/classes/event-locations/em-event-location.php
r2623955 r2797313 206 206 return false; 207 207 } 208 209 public function to_api(){ 210 return array_merge( $this->data, array( 211 'type' => static::$type, 212 )); 213 } 208 214 } 209 215 -
events-manager/trunk/events-manager.php
r2795697 r2797313 2 2 /* 3 3 Plugin Name: Events Manager 4 Version: 6.1.2. 54 Version: 6.1.2.6 5 5 Plugin URI: http://wp-events-plugin.com 6 6 Description: Event registration and booking management for WordPress. Recurring events, locations, webinars, google maps, rss, ical, booking registration and more! … … 29 29 30 30 // Setting constants 31 define('EM_VERSION', '6.1.2. 5'); //self expanatory, although version currently may not correspond directly with published version number. until 6.0 we're stuck updating 5.999.x31 define('EM_VERSION', '6.1.2.6'); //self expanatory, although version currently may not correspond directly with published version number. until 6.0 we're stuck updating 5.999.x 32 32 define('EM_PRO_MIN_VERSION', '3.0'); //self expanatory 33 33 define('EM_PRO_MIN_VERSION_CRITICAL', '3.0'); //self expanatory -
events-manager/trunk/readme.txt
r2795697 r2797313 136 136 137 137 == Changelog == 138 = 6.1.2. 5(dev) =138 = 6.1.2.6 (dev) = 139 139 * fixed datepicker range JS issues 140 140 * added ability to override email formats (currently only upon installation for event approval email template) … … 158 158 * added em_booking_output_show_condition filter to help determine whether to show a condition 159 159 * fixed search results coming back with incorrect styling layout when in responsive/mobile mode 160 * added output methods for APIs via array for JSON for main objects (events, locations, bookings) 160 161 161 162 = 6.1.2.1 =
Note: See TracChangeset
for help on using the changeset viewer.