Changeset 1592531
- Timestamp:
- 02/09/2017 02:07:05 PM (9 years ago)
- Location:
- opentickets-community-edition/trunk
- Files:
-
- 2 added
- 9 edited
-
inc/core/post-type.class.php (modified) (2 diffs)
-
inc/event-area/post-type.class.php (modified) (1 diff)
-
inc/sys/extensions/updater.php (modified) (1 diff)
-
inc/sys/pages/system-status.page.php (modified) (2 diffs)
-
inc/sys/utils.php (modified) (4 diffs)
-
inc/ticket/ticket.class.php (modified) (4 diffs)
-
langs/opentickets-community-edition-da_DK.mo (added)
-
langs/opentickets-community-edition-da_DK.po (added)
-
launcher.php (modified) (2 diffs)
-
opentickets.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
opentickets-community-edition/trunk/inc/core/post-type.class.php
r1567191 r1592531 864 864 if (empty($html) || empty($post_thumbnail_id)) { 865 865 $post = get_post($post_id); 866 if (is_object($post) && isset($post->post_type) && $post->post_type == self::$o->core_post_type && !empty($post->post_parent) ) {866 if (is_object($post) && isset($post->post_type) && $post->post_type == self::$o->core_post_type && !empty($post->post_parent) && $post->post_parent != $post->ID) { 867 867 $html = get_the_post_thumbnail($post->post_parent, $size, $attr); 868 868 } … … 896 896 897 897 // if the supplied object is an event, and it is not a parent event, then... 898 if ( $map[ $object_id . '' ] == self::$o->core_post_type && $key == '_thumbnail_id' && $parent_id = wp_get_post_parent_id( $object_id )) {898 if ( $map[ $object_id . '' ] == self::$o->core_post_type && $key == '_thumbnail_id' && ( $parent_id = wp_get_post_parent_id( $object_id ) ) && $parent_id != $object_id ) { 899 899 // prevent weird recursion 900 900 remove_filter( 'get_post_metadata', array( __CLASS__, 'cascade_thumbnail_id' ), 10 ); -
opentickets-community-edition/trunk/inc/event-area/post-type.class.php
r1536371 r1592531 494 494 // get the event area object 495 495 $event_area = get_post( $event_area_id ); 496 if ( ! ( $event_area instanceof WP_Post ) ) 497 return $current; 498 499 // add the meta 496 500 $event_area->meta = get_post_meta( $event_area->ID ); 497 501 foreach ( $event_area->meta as $k => $v ) 498 502 $event_area->meta[ $k ] = current( $v ); 503 504 // add the area type 499 505 $event_area->area_type = $this->event_area_type_from_event_area( $event_area ); 500 506 -
opentickets-community-edition/trunk/inc/sys/extensions/updater.php
r1299061 r1592531 216 216 if ( ! $is_force && time() < $expires ) 217 217 return array(); 218 update_option( 'qsot-extensions-updater-last-expires', time() + ( 12 * HOUR_IN_SECONDS ) ); 218 219 219 220 // otherwise, run our update fetch request -
opentickets-community-edition/trunk/inc/sys/pages/system-status.page.php
r1536371 r1592531 129 129 ) 130 130 ); 131 $this->register_tool( 132 'resTsFix', 133 array( 134 'name' => __( 'Attempt Repair of start and end times (very rare)', 'opentickets-community-edition' ), 135 'description' => __( 'If you have an issue where all your event times changed after updating, you might need to run this tool. Contact support though.', 'opentickets-community-edition' ), 136 'function' => array( &$this, 'tool_resTsFix' ), 137 'messages' => array( 138 'updated-restses' => $this->_updatedw( __( 'Restored all the start and end times for all events, to their original values.', 'opentickets-community-edition' ) ), 139 ), 140 ) 141 ); 131 142 } 132 143 … … 947 958 } 948 959 960 // cycle through all events, and update the timezone of the start and end times to match the site timezone, using the original ts values instead 961 public function tool_resTsFix( $result, $args ) { 962 // check that the repair can run 963 if ( ! $this->_verify_action_nonce( 'resTsFix' ) ) 964 return $result; 965 966 // update all the event times to use the same tz as the site (non-dst) 967 QSOT_Utils::restore_event_times(); 968 969 // update and return the results data 970 $result[1]['performed'] = 'updated-restses'; 971 $result[0] = true; 972 return $result; 973 } 974 949 975 950 976 // empty all files from a directory (skips subdirs) -
opentickets-community-edition/trunk/inc/sys/utils.php
r1574067 r1592531 435 435 ); 436 436 437 $force = isset( $_COOKIE, $_COOKIE['qs-force'] ) && '1' == $_COOKIE['qs-force']; 438 437 439 // grab the next 1000 438 440 while ( $event_ids = get_posts( $args ) ) { … … 446 448 $event_id = array_shift( $event_ids ); 447 449 448 // get the start and end time of this event from db 449 $start = get_post_meta( $event_id, '_start', true ); 450 $end = get_post_meta( $event_id, '_end', true ); 451 $orig_values = array( 'start' => $start, 'end' => $end ); 450 // see if this thing has gone through a tsfix before 451 $tsfix = get_post_meta( $event_id, '_tsFix_update', true ); 452 453 // if not, setup a tsfix update key now 454 if ( ! $tsfix ) { 455 // get the start and end time of this event from db 456 $start = get_post_meta( $event_id, '_start', true ); 457 $end = get_post_meta( $event_id, '_end', true ); 458 $orig_values = array( 'start' => $start, 'end' => $end ); 459 460 // if the old values have a timezone designation, just skip this item, unless being forced 461 if ( ! $force && '+' == substr( $orig_values['start'], '-6', 1 ) ) 462 continue; 463 464 add_post_meta( $event_id, '_tsFix_update', $orig_values ); 465 } 452 466 453 467 // normalize the timestamp to UTC … … 458 472 update_post_meta( $event_id, '_start', $start ); 459 473 update_post_meta( $event_id, '_end', $end ); 460 // save original bad values for posterity461 add_post_meta( $event_id, '_tsFix_update', $orig_values );462 474 } 463 475 } … … 465 477 // add a record of the last time this ran 466 478 update_option( '_last_run_otce_normalize_event_times', time() . '|' . self::$normalize_version ); 479 } 480 481 // restore ticket times from a tsfix value 482 public static function restore_event_times() { 483 // get current site timeoffset 484 $offset = self::non_dst_tz_offset(); 485 486 $perpage = 1000; 487 $pg_offset = 1; 488 // get a list of all the event ids to update. throttle at 1000 per cycle 489 $args = array( 490 'post_type' => 'qsot-event', 491 'post_status' => array( 'any', 'trash' ), 492 'post_parent__not_in' => array( 0 ), 493 'fields' => 'ids', 494 'posts_per_page' => $perpage, 495 'paged' => $pg_offset, 496 ); 497 498 $force = isset( $_COOKIE, $_COOKIE['qs-force'] ) && '1' == $_COOKIE['qs-force']; 499 500 // grab the next 1000 501 while ( $event_ids = get_posts( $args ) ) { 502 // inc page for next iteration 503 $pg_offset++; 504 $args['paged'] = $pg_offset; 505 506 // cycle through all results 507 while ( is_array( $event_ids ) && count( $event_ids ) ) { 508 // get the next event_id to update 509 $event_id = array_shift( $event_ids ); 510 511 // see if this thing has gone through a tsfix before 512 $tsfix = get_post_meta( $event_id, '_tsFix_update', true ); 513 514 // if it hasnt, bail 515 if ( ! is_array( $tsfix ) || ! isset( $tsfix['start'], $tsfix['end'] ) ) 516 continue; 517 518 // save the current, potentially munged values, incase we have to restore a restore 519 add_post_meta( $event_id, '_resTsFix_update', array( 'start' => get_post_meta( $event_id, '_start', true ), 'end' => get_post_meta( $event_id, '_end', true ) ) ); 520 521 $start = $end = ''; 522 // if the original dates have a timezone... then they are effect up and need to be adjusted to assume the timezone is wrong 523 if ( '+' == substr( $tsfix['start'], '-6', 1 ) ) { 524 $start = explode( '+', $tsfix['start'] ); 525 $start = current( $start ); 526 $end = explode( '+', $tsfix['end'] ); 527 $end = current( $end ); 528 // otherwise, assume the dates were for the site timezone, and update the ts 529 } else { 530 $start = str_replace( 'T', ' ', $tsfix['start'] ); 531 $end = str_replace( 'T', ' ', $tsfix['end'] ); 532 } 533 534 // save both times in the new format 535 update_post_meta( $event_id, '_start', $start . $offset ); 536 update_post_meta( $event_id, '_end', $end . $offset ); 537 } 538 } 539 540 // add a record of the last time this ran 541 update_option( '_last_run_otce_restore_event_times', time() . '|' . self::$normalize_version ); 467 542 } 468 543 } -
opentickets-community-edition/trunk/inc/ticket/ticket.class.php
r1511879 r1592531 200 200 // if we ARE using a permalink struct, then return a pretty permalink 201 201 if ( ! empty( $wp_rewrite->permalink_structure ) ) { 202 $final = site_url( '/ticket/' . $code . '/' );202 $final = home_url( '/ticket/' . $code . '/' ); 203 203 // otherwise, return an ugly permalink 204 204 } else { … … 206 206 'qsot-ticket' => 1, 207 207 'qsot-ticket-id' => $code, 208 ), site_url() );208 ), home_url() ); 209 209 } 210 210 … … 224 224 // if we ARE using a permalink struct, then return a pretty permalink 225 225 if ( ! empty( $wp_rewrite->permalink_structure ) ) { 226 $final = site_url( '/order-tickets/' . $order->order_key . '/' );226 $final = home_url( '/order-tickets/' . $order->order_key . '/' ); 227 227 // otherwise, return an ugly permalink 228 228 } else { … … 230 230 'qsot-order-tickets' => 1, 231 231 'qsot-order-ticket-id' => $order->order_key, 232 ), site_url() );232 ), home_url() ); 233 233 } 234 234 -
opentickets-community-edition/trunk/launcher.php
r1574067 r1592531 4 4 * Plugin URI: http://opentickets.com/ 5 5 * Description: Event Management and Online Ticket Sales Platform 6 * Version: 2.6. 46 * Version: 2.6.5 7 7 * Author: Quadshot Software LLC 8 8 * Author URI: http://quadshot.com/ … … 54 54 'fctm' => 'fc', 55 55 'always_reserve' => 0, 56 'version' => '2.6. 4',56 'version' => '2.6.5', 57 57 'min_wc_version' => '2.6.1', 58 58 'core_post_type' => 'qsot-event', -
opentickets-community-edition/trunk/opentickets.php
r1554772 r1592531 753 753 // on admin load, check if we need to update all the event timestamps now. if so, do it 754 754 public static function maybe_update_event_timestamps() { 755 return; 756 /* NO LONGER DO THIS ON UPDATE. CAN MUNGE DATA 755 757 // find out the last time the timestamp updater ran 756 758 $last_run = explode( '|', get_option( '_last_run_otce_normalize_event_times', '' ) ); … … 766 768 if ( $run_now ) 767 769 QSOT_Utils::normalize_event_times(); 770 */ 768 771 } 769 772 -
opentickets-community-edition/trunk/readme.txt
r1574067 r1592531 172 172 == Changelog == 173 173 174 = 2.6.4- Jan/13/2017 = 174 = 2.6.5 - Feb/06/2017 = 175 * [new] added tool to restore event tart/end times from backed up values that autoscript created 176 * [tweak] changed logic of start/end time autofix script, to only run for events that do not have a TZ designation 177 * [tweak] using home_url instead of site_url for ticket links 178 * [tweak] added code to prevent php warning in some confirmation emails 179 * [fix] fixed conflict with cart addons woo plugin 180 * [fix] repaired an issue where updates were being checked too many times throughout the day, in some case 181 182 = 2.6.4 - Jan/13/2017 = 175 183 * [tweak] made a javascript change that works around the new WC change that prevents the 'change seat' button from working in the admin 176 184 * [tweak] another adjustment that solves an edge case daylights savings time issue
Note: See TracChangeset
for help on using the changeset viewer.