Changeset 1479172
- Timestamp:
- 08/19/2016 11:42:51 PM (10 years ago)
- Location:
- opentickets-community-edition/trunk
- Files:
-
- 5 edited
-
assets/js/utils/tools.js (modified) (1 diff)
-
inc/event-area/general-admission-area-type.class.php (modified) (8 diffs)
-
inc/event-area/post-type.class.php (modified) (5 diffs)
-
launcher.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
opentickets-community-edition/trunk/assets/js/utils/tools.js
r1386561 r1479172 610 610 611 611 function cb_trigger(name, params) { 612 var params = params || [] ;613 var cbs = cb_get(name);612 var params = params || [], 613 cbs = cb_get(name), res; 614 614 if (cbs instanceof Array) { 615 for (var i=0; i<cbs.length; i++) 616 cbs[i].f.apply(this, params); 617 } 615 for (var i=0; i<cbs.length; i++) { 616 res = cbs[i].f.apply(this, params); 617 if ( false === res ) 618 break; 619 } 620 } 621 622 return res; 618 623 }; 619 624 -
opentickets-community-edition/trunk/inc/event-area/general-admission-area-type.class.php
r1437825 r1479172 667 667 if ( $qty <= 0 ) { 668 668 $resp['e'][] = __( 'The quantity must be greater than zero.', 'opentickets-community-edition' ); 669 return $this->_add_data( $resp, $event );669 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-reserve', $resp, $event, null, $ticket_type ), $event ); 670 670 } 671 671 … … 674 674 if ( ! is_object( $event_area ) ) { 675 675 $resp['e'][] = __( 'Could not find that event.', 'opentickets-community-edition' ); 676 return $this->_add_data( $resp, $event );676 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-reserve', $resp, $event, null, $ticket_type ), $event ); 677 677 } 678 678 … … 708 708 } 709 709 710 return $this->_add_data( $resp, $event, $event_area, $ticket_type );710 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-reserve', $resp, $event, $event_area, $ticket_type ), $event, $event_area, $ticket_type ); 711 711 } 712 712 … … 717 717 if ( ! is_object( $event_area ) ) { 718 718 $resp['e'][] = __( 'Could not find that event.', 'opentickets-community-edition' ); 719 return $this->_add_data( $resp, $event );719 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-remove', $resp, $event, null, $ticket_type ), $event ); 720 720 } 721 721 … … 767 767 } 768 768 769 return $this->_add_data( $resp, $event, $event_area, $ticket_type );769 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-remove', $resp, $event, $event_area, $ticket_type ), $event, $event_area, $ticket_type ); 770 770 } 771 771 … … 778 778 if ( $qty <= 0 ) { 779 779 $resp['e'][] = __( 'The quantity must be greater than zero.', 'opentickets-community-edition' ); 780 return $this->_add_data( $resp, $event );780 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-update', $resp, $event, null, $ticket_type ), $event ); 781 781 } 782 782 … … 785 785 if ( ! is_object( $event_area ) ) { 786 786 $resp['e'][] = __( 'Could not find that event.', 'opentickets-community-edition' ); 787 return $this->_add_data( $resp, $event );787 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-update', $resp, $event, null, $ticket_type ), $event ); 788 788 } 789 789 … … 822 822 } 823 823 824 return $this->_add_data( $resp, $event, $event_area, $ticket_type );824 return $this->_add_data( apply_filters( 'qsot-seating-ajax-response-update', $resp, $event, $event_area, $ticket_type ), $event, $event_area, $ticket_type ); 825 825 } 826 826 -
opentickets-community-edition/trunk/inc/event-area/post-type.class.php
r1458303 r1479172 105 105 106 106 // during transitions of order status (and order creation), we need to perform certain operations. we may need to confirm tickets, or cancel them, depending on the transition 107 add_action( 'woocommerce_checkout_ update_order_meta', array( &$this, 'update_order_id' ), 100, 2 );107 add_action( 'woocommerce_checkout_order_processed', array( &$this, 'update_order_id' ), 100, 2 ); 108 108 add_action( 'woocommerce_order_status_changed', array( &$this, 'order_status_changed' ), 100, 3 ); 109 109 //add_action( 'woocommerce_order_status_changed', array( &$this, 'order_status_changed_pending' ), 101, 3 ); 110 110 add_action( 'woocommerce_order_status_changed', array( &$this, 'order_status_changed_cancel' ), 102, 3 ); 111 add_action( 'woocommerce_checkout_update_order_meta', array( &$this, 'order_has_been_created' ), 10000, 2 ); 111 add_action( 'woocommerce_checkout_order_processed', array( &$this, 'order_has_been_created' ), 10000, 2 ); 112 add_action( 'woocommerce_resume_order', array( &$this, 'on_resume_order_disassociate' ), 10, 1 ); 112 113 113 114 // solve order again conundrum … … 887 888 // @NOTE: need more uniform way of determining 'reserved' is what we are looking for 888 889 $reserved = 'reserved'; 889 $results = QSOT_Zoner_Query::instance()->find( array( 'state' => $reserved, 'customer_id' => QSOT::current_user() ) ); 890 $confirmed = 'confirmed'; 891 $where = array(); 892 $user_ids = array_filter( (array) QSOT::current_user() ); 893 $where[] = 'state = "' . $reserved . '" and session_customer_id in ("' . implode( '","', array_map( 'esc_sql', $user_ids ) ) . '")'; 894 if ( isset( $WC->session->order_awaiting_payment ) && intval( $WC->session->order_awaiting_payment ) > 0 ) 895 $where[] = 'state = "' . $confirmed . '" and order_id = ' . absint( $WC->session->order_awaiting_payment ); 896 $results = QSOT_Zoner_Query::instance()->find( array( 'where__extra' => array( ' and ((' . implode( ') or (', $where ) . '))' ) ) ); 890 897 891 898 $event_to_area_type = $indexed = array(); … … 909 916 $indexed[ $row->event_id ][ $row->state ][ $row->ticket_type_id ][] = $row; 910 917 } 911 //die(var_dump($indexed ));912 918 913 919 // cycle through the cart items, and remove any that do not have a matched indexed item … … 923 929 $quantity = 0; 924 930 // if there is a basic indexed matched key for this item, then find the appropriate quantity to use 925 if ( isset( $indexed[ $eid ], $indexed[ $eid ][ $reserved ], $indexed[ $eid ][ $reserved ][ $pid ] ) ) { 926 // if there is not an appropriate area type for this event, then just pass it through using the indexed item quantity. this is the generic method, list_pluck 927 if ( ! isset( $event_to_area_type[ $eid ] ) || ! is_object( $event_to_area_type[ $eid ] ) || is_wp_error( $event_to_area_type[ $eid ] ) ) { 928 $quantity = array_sum( wp_list_pluck( $indexed[ $eid ][ $reserved ][ $pid ], 'quantity' ) ); 929 // otherwise use the method of finding the quantity defined by the area_type itself 930 } else { 931 $quantity = $event_to_area_type[ $eid ]->cart_item_match_quantity( $item, $indexed[ $eid ][ $reserved ][ $pid ] ); 931 if ( isset( $indexed[ $eid ] ) ) { 932 if ( isset( $indexed[ $eid ][ $reserved ], $indexed[ $eid ][ $reserved ][ $pid ] ) ) { 933 // if there is not an appropriate area type for this event, then just pass it through using the indexed item quantity. this is the generic method, list_pluck 934 if ( ! isset( $event_to_area_type[ $eid ] ) || ! is_object( $event_to_area_type[ $eid ] ) || is_wp_error( $event_to_area_type[ $eid ] ) ) { 935 $quantity = array_sum( wp_list_pluck( $indexed[ $eid ][ $reserved ][ $pid ], 'quantity' ) ); 936 // otherwise use the method of finding the quantity defined by the area_type itself 937 } else { 938 $quantity = $event_to_area_type[ $eid ]->cart_item_match_quantity( $item, $indexed[ $eid ][ $reserved ][ $pid ] ); 939 } 940 } else if ( isset( $indexed[ $eid ][ $confirmed ], $indexed[ $eid ][ $confirmed ][ $pid ] ) ) { 941 // if these items have an order id 942 $order_ids = array_filter( wp_list_pluck( $indexed[ $eid ][ $confirmed ][ $pid ], 'order_id' ) ); 943 if ( count( $order_ids ) == count( $indexed[ $eid ][ $confirmed ][ $pid ] ) ) { 944 // if there is not an appropriate area type for this event, then just pass it through using the indexed item quantity. this is the generic method, list_pluck 945 if ( ! isset( $event_to_area_type[ $eid ] ) || ! is_object( $event_to_area_type[ $eid ] ) || is_wp_error( $event_to_area_type[ $eid ] ) ) { 946 $quantity = array_sum( wp_list_pluck( $indexed[ $eid ][ $confirmed ][ $pid ], 'quantity' ) ); 947 // otherwise use the method of finding the quantity defined by the area_type itself 948 } else { 949 $quantity = $event_to_area_type[ $eid ]->cart_item_match_quantity( $item, $indexed[ $eid ][ $confirmed ][ $pid ] ); 950 } 951 } 932 952 } 933 953 } … … 980 1000 981 1001 $wpdb->query( $q ); 1002 } 1003 1004 // when resuming an order, we need to disassociate all order_item_ids from previous records, because the order items are about to get removed and recreated by core WC. 1005 // this means we will not be able to properly update the order item id associations, because the original order item id will be gone 1006 public function on_resume_order_disassociate( $order_id ) { 1007 // start a basic zoner to do our bidding 1008 $zoner = QSOT_General_Admission_Zoner::instance(); 1009 1010 $args = array( 1011 'event_id' => false, 1012 'ticket_type_id' => false, 1013 'quantity' => '', 1014 'customer_id' => '', 1015 'order_id' => $order_id, 1016 'order_item_id' => '', 1017 'state' => '*', 1018 'where__extra' => '', 1019 ); 1020 // find all rows that are associated with the order 1021 $rows = $zoner->find( $args ); 1022 1023 // udpate each row to not be associated with the order_item_id it previously was 1024 if ( is_array( $rows ) ) foreach ( $rows as $row ) { 1025 $zoner->update( 1026 false, 1027 array( 1028 'order_id' => $order_id, 1029 'order_item_id' => $row->order_item_id, 1030 'state' => $row->state, 1031 ), 1032 array( 1033 'order_item_id' => 0, 1034 ) 1035 ); 1036 } 982 1037 } 983 1038 -
opentickets-community-edition/trunk/launcher.php
r1465000 r1479172 4 4 * Plugin URI: http://opentickets.com/ 5 5 * Description: Event Management and Online Ticket Sales Platform 6 * Version: 2.4. 46 * Version: 2.4.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.4. 4',56 'version' => '2.4.5', 57 57 'min_wc_version' => '2.6.1', 58 58 'core_post_type' => 'qsot-event', -
opentickets-community-edition/trunk/readme.txt
r1465000 r1479172 172 172 == Changelog == 173 173 174 = 2.4.4 - 07/29/2016= 174 = 2.4.5 - 08/19/2016 = 175 * [new] support for the new Table Service plugin 176 * [fix] repaired bug where logged out users who create an account during checkout, and fail their first payment, do no lose their tickets 177 178 = 2.4.4 - 07/29/2016 = 175 179 * fixing modal issues caused by changing in WooCommerce CSS 176 180
Note: See TracChangeset
for help on using the changeset viewer.