Plugin Directory

Changeset 1745709


Ignore:
Timestamp:
10/12/2017 10:13:03 PM (8 years ago)
Author:
loushou
Message:
  • [tweak] adding new hooks for new plugins to interrupt js flow
  • [tweak] changes for the family tickets plugin to work
  • [fix] possible solution to seating issues
  • [fix] updating a template to use new WC3 fetching of order information

loushou

Location:
opentickets-community-edition/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • opentickets-community-edition/trunk/assets/js/admin/order/ticket-selection.js

    r1634310 r1745709  
    477477        // start the UI with the mindset of 'changing' an existing reservation
    478478        me.change_ticket_ui = function( e ) {
    479             console.log( 'fucing click' );
    480479            e.preventDefault();
    481480
  • opentickets-community-edition/trunk/inc/event-area/base-event-area-zoner.abstract-dep.php

    r1359200 r1745709  
    6060    }
    6161
    62     // clear out any temporary locks that have expired
    63     public static function clear_locks( $event_id=0, $customer_id=false ) {
    64         global $wpdb;
    65         // require either required basic information type
    66         if ( empty( $event_id ) && empty( $customer_id ) )
    67             return;
    68 
    69         // get a list of all the expirable states
    70         $temp_states = $this->get_temp_stati();
    71 
    72         // cycle through the list of temp states and remove any expired keys with those states based on the supplied information
    73         foreach ( $temp_states as $state ) {
    74             // if this is not a temp state, then skip it
    75             if ( $state[1] >= 0 )
    76                 continue;
    77 
    78             // build a query that will find all locks that have expired, based on the supplied criteria. we fetch the list so that we can
    79             // notify other sources that these locks are going away (such as other plugins, or upgrades to this plugin)
    80             $q = $wpdb->prepare( 'select * from ' . $wpdb->qsot_event_zone_to_order . ' where state = %s and since < NOW() - INTERVAL %d SECOND', $state[0], $state[1] );
    81 
    82             // if the event was supplied, reduce the list to only ones for this event
    83             if ( ! empty( $event_id ) )
    84                 $q .= $wpdb->prepare( ' and event_id = %d', $event_id );
    85 
    86             // if the customer id was supplied then, add that to the sql
    87             if ( ! empty( $customer_id ) ) {
    88                 if ( is_array( $customer_id ) )
    89                     $q .= ' and session_customer_id in(\'' . implode( '\',\'', array_map( 'esc_sql', $customer_id ) ) . '\')';
    90                 else
    91                     $q .= $wpdb->prepare( ' and session_customer_id = %s', $customer_id );
    92             }
    93 
    94             // fetch a list of existing locks.
    95             $locks = $wpdb->get_results( $q );
    96 
    97             // if there are no locks to remove, then skip this item
    98             if ( empty( $locks ) )
    99                 continue;
    100 
    101             // tell everyone that the locks are going away
    102             do_action( 'qsot-removing-zone-locks', $locks, $state[0], $event_id, $customer_id );
    103 
    104             // delete the locks we said we would delete in the above action.
    105             // this is done in this manner, because we need to only delete the ones we told others about.
    106             // technically, if the above action call takes too long, other locks could have expired by the time we get to delete them.
    107             // thus we need to explicitly delete ONLY the ones we told everyone we were deleting, so that none are removed without the others being notified.
    108             $q = 'delete from ' . $wpdb->qsot_event_zone_to_order . ' where '; // base query
    109             $wheres = array(); // holder for queries defining each specific row to delete
    110 
    111             // cycle through all the locks we said we would delete
    112             foreach ( $locks as $lock ) {
    113                 // aggregate a partial where statement, that specifically identifies this row, using all fields for positive id
    114                 $fields = array();
    115                 foreach ( $lock as $k => $v )
    116                     $fields[] = $wpdb->prepare( $k.' = %s', $v );
    117                 if ( ! empty( $fields ) )
    118                     $wheres[] = implode( ' and ', $fields );
    119             }
    120 
    121             // if we have where statements for at least one row to remove
    122             if ( ! empty( $wheres ) ) {
    123                 // glue the query together, and run it to delete the rows
    124                 $q .= '(' . implode( ') or (', $wheres ) . ')';
    125                 $wpdb->query( $q );
    126             }
    127         }
    128     }
    129 
    13062    // setup the options for allowing timers to be set
    13163    protected function _setup_options() {}
  • opentickets-community-edition/trunk/inc/event-area/post-type.class.php

    r1647408 r1745709  
    922922        }
    923923
     924        // allow re-organization of index, to prevent problems with things like family tickets
     925        $indexed = apply_filters( 'qsot-sync-cart-tickets-indexed-list', $indexed );
     926
    924927        // cycle through the cart items, and remove any that do not have a matched indexed item
    925928        foreach ( $WC->cart->get_cart() as $key => $item ) {
     
    987990
    988991        global $wpdb;
    989         // start constructing the query
    990         $q = 'delete from ' . $wpdb->qsot_event_zone_to_order . ' where ';
     992    // find all the rows to delete first
     993    // @NOTE - if a lock is associated to an order, never delete it
     994    $q = 'select * from ' . $wpdb->qsot_event_zone_to_order . ' where order_id > 0 and ';
    991995
    992996        // construct the stati part of the query
     
    10041008            $q .= $wpdb->prepare( ' and session_customer_id = %s', $args['customer_id'] );
    10051009
    1006         $wpdb->query( $q );
     1010    // get all the rows
     1011    $locks = $wpdb->get_results( $q );
     1012
     1013    // if there are no locks to remove, then skip this item
     1014    if ( empty( $locks ) )
     1015      return;
     1016
     1017    // tell everyone that the locks are going away
     1018    do_action( 'qsot-removing-zone-locks', $locks, $state[0], $event_id, $customer_id );
     1019
     1020    // delete the locks we said we would delete in the above action.
     1021    // this is done in this manner, because we need to only delete the ones we told others about.
     1022    // technically, if the above action call takes too long, other locks could have expired by the time we get to delete them.
     1023    // thus we need to explicitly delete ONLY the ones we told everyone we were deleting, so that none are removed without the others being notified.
     1024    $q = 'delete from ' . $wpdb->qsot_event_zone_to_order . ' where '; // base query
     1025    $wheres = array(); // holder for queries defining each specific row to delete
     1026
     1027    // cycle through all the locks we said we would delete
     1028    foreach ( $locks as $lock ) {
     1029      // aggregate a partial where statement, that specifically identifies this row, using all fields for positive id
     1030      $fields = array();
     1031      foreach ( $lock as $k => $v )
     1032        $fields[] = $wpdb->prepare( $k.' = %s', $v );
     1033      if ( ! empty( $fields ) )
     1034        $wheres[] = implode( ' and ', $fields );
     1035    }
     1036
     1037    // if we have where statements for at least one row to remove
     1038    if ( ! empty( $wheres ) ) {
     1039      // glue the query together, and run it to delete the rows
     1040      $q .= '(' . implode( ') or (', $wheres ) . ')';
     1041      $wpdb->query( $q );
     1042    }
    10071043    }
    10081044
     
    11051141            // have the event_area determine how to update the order item info in the ticket table
    11061142            //$result = $area_type->confirm_tickets( $item, $item_id, $order, $event, $event_area );
    1107             $result = $this->_update_order_id( $order, $item, $item_id, $event, $event_area, $area_type );
     1143            //$result = $this->_update_order_id( $order, $item, $item_id, $event, $event_area, $area_type );
    11081144            $result_status = $area_type->confirm_tickets( $item, $item_id, $order, $event, $event_area );
    11091145
    11101146            // notify externals of the change
    1111             do_action( 'qsot-updated-order-id', $order, $item, $item_id, $result );
     1147            //do_action( 'qsot-updated-order-id', $order, $item, $item_id, $result );
    11121148            do_action( 'qsot-confirmed-ticket', $order, $item, $item_id, $result_status );
    11131149        }
  • opentickets-community-edition/trunk/launcher.php

    r1667093 r1745709  
    44 * Plugin URI:  http://opentickets.com/
    55 * Description: Event Management and Online Ticket Sales Platform
    6  * Version:     2.8.5
     6 * Version:     2.8.6
    77 * Author:      Quadshot Software LLC
    88 * Author URI:  http://quadshot.com/
     
    5555            'fctm' => 'fc',
    5656            'always_reserve' => 0,
    57             'version' => '2.8.5',
    58             'min_wc_version' => '3.0.0',
     57            'version' => '2.8.6',
     58            'min_wc_version' => '3.2.0',
    5959            'core_post_type' => 'qsot-event',
    6060            'core_post_rewrite_slug' => 'event',
  • opentickets-community-edition/trunk/readme.txt

    r1667093 r1745709  
    171171
    172172== Changelog ==
     173
     174= 2.8.6 - Oct/12/2017 =
     175* [tweak] adding new hooks for new plugins to interrupt js flow
     176* [tweak] changes for the family tickets plugin to work
     177* [fix] possible solution to seating issues
     178* [fix] updating a template to use new WC3 fetching of order information
    173179
    174180= 2.8.5 - May/30/2017 =
  • opentickets-community-edition/trunk/templates/checkin/occupy-success.php

    r1536371 r1745709  
    55//get_header();
    66
    7 $owner = $ticket->order->billing_first_name . ' ' . $ticket->order->billing_last_name . ' (' . $ticket->order->billing_email . ')';
     7$WC3 = QSOT_WC3();
     8$owner = $WC3->order_data( $ticket->order, 'billing_first_name' ) . ' ' . $WC3->order_data( $ticket->order, 'billing_last_name' ) . ' (' . $WC3->order_data( $ticket->order, 'billing_email' ) . ')';
    89$index = '[' . $ticket->owns['occupied'] . ' / ' . array_sum( array_values( $ticket->owns ) ) . ']';
    910$msg = __('Check-In SUCCESSFUL','opentickets-community-edition');
Note: See TracChangeset for help on using the changeset viewer.