Plugin Directory

Changeset 1647408


Ignore:
Timestamp:
04/28/2017 12:45:25 PM (9 years ago)
Author:
loushou
Message:
  • [fix] fixing new user button issue on edit-order admin screen
  • [fix] fixing license key removal issue
  • [fix] fixing extension update detection issue by making update checks more aggressive and vastly more numerous

loushou

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

Legend:

Unmodified
Added
Removed
  • opentickets-community-edition/trunk/assets/js/admin/order/new-user.js

    r1274167 r1647408  
    22    var d = $(document); /// THIS.... is dumb
    33    var settings = _qsot_new_user || {};
     4    var qt = QS.Tools;
    45
    56    if (typeof settings.templates != 'object') return;
    67    var form = undefined;
     8
     9    // dumb we have to do this with select2 v4
     10    function _select2_update_data( control, data, select_value ) {
     11        // empty the select element
     12        control.find( 'option' ).remove();
     13
     14        data = qt.isO( data ) && qt.is( data.results ) ? data.results : data;
     15        // add a new item to the element for each possible value
     16        $.each( data, function( k, row ) {
     17            $( '<option></option>' ).html( row.text ).attr( 'value', row.id ).appendTo( control );
     18        } );
     19
     20        // if the select value is set, use it
     21        if ( select_value )
     22            control.val( select_value );
     23
     24        // refresh the select2 element
     25        control.trigger( 'change' );
     26    }
    727       
    828    function load_customer_billing_information() {
     
    3050            success: function( response ) {
    3151                var info = response;
     52                console.log( 'loaded billing', info );
    3253
    33                 if (info) {
     54                if (info && info.billing) {
     55                    $('input#_billing.first_name').val( info.billing.first_name );
     56                    $('input#_billing.last_name').val( info.billing.last_name );
     57                    $('input#_billing.company').val( info.billing.company );
     58                    $('input#_billing.address_1').val( info.billing.address_1 );
     59                    $('input#_billing.address_2').val( info.billing.address_2 );
     60                    $('input#_billing.city').val( info.billing.city );
     61                    $('input#_billing.postcode').val( info.billing.postcode );
     62                    $('#_billing.country').val( info.billing.country );
     63                    $('input#_billing.state').val( info.billing.state );
     64                    $('input#_billing.email').val( info.billing.email );
     65                    $('input#_billing.phone').val( info.billing.phone );
     66                } else if ( info && info.billing_first_name ) {
    3467                    $('input#_billing_first_name').val( info.billing_first_name );
    3568                    $('input#_billing_last_name').val( info.billing_last_name );
     
    80113
    81114    $(function() {
    82         d.on('select2-selecting data-updated', '#customer_user', function() {
     115        d.on('select2:selecting data-updated', '#customer_user', function() {
    83116            if ($(this).val() != '') {
    84117                $('._billing_first_name_field').closest('.order_data_column').find('a.edit_address').click();//.closest('.order_data_column').find('button.load_customer_billing').click();
     
    111144                        dia.unblock();
    112145                        if (r.s) {
    113                             $( '#customer_user' ).select2( 'data', $.extend( {}, r.c ) ).trigger( 'data-updated' );
     146                            _select2_update_data( $( '#customer_user' ), [r.c], r.c.id );
     147                            $( '#customer_user' ).trigger( 'data-updated' );
    114148                            form.dialog('close');
    115149                            form.find('input').val('');
  • opentickets-community-edition/trunk/inc/core/post-type.class.php

    r1624856 r1647408  
    305305        $fields = array();
    306306        $join = array();
    307         $where = array();
     307        $where = array( 'and pm.meta_value != "" and pm.meta_value != 0' );
    308308        $fmt = 'Y-m-d H:i:s';
    309309
     
    18621862
    18631863        // get just the date and time portions
    1864         $start_time = date( QSOT_Date_Formats::php_date_format( 'g:ia' ), QSOT_Utils::gmt_timestamp( $start, 'from', 'g:ia' ) );
    1865         $end_time = date( QSOT_Date_Formats::php_date_format( 'g:ia' ), QSOT_Utils::gmt_timestamp( $end, 'from', 'g:ia' ) );
     1864        $start_time = date( QSOT_Date_Formats::php_date_format( 'g:ia' ), QSOT_Utils::local_timestamp( $start ) );
     1865        $end_time = date( QSOT_Date_Formats::php_date_format( 'g:ia' ), QSOT_Utils::local_timestamp( $end ) );
    18661866
    18671867        // render the settings box
  • opentickets-community-edition/trunk/inc/event-area/post-type.class.php

    r1634310 r1647408  
    843843    protected function _draw_item_ticket_info( $item_id, $item, $product, $edit=false ) {
    844844        // if the product is not a ticket, then never display event meta
    845         if ( get_post_meta( $product->get_id(), '_ticket', true ) != 'yes' )
     845        if ( ! is_object( $product ) || get_post_meta( $product->get_id(), '_ticket', true ) != 'yes' )
    846846            return;
    847847
  • opentickets-community-edition/trunk/inc/sys/extensions/settings/licenses.php

    r1536371 r1647408  
    3535        // add a hook that runs on loading of this page, which checks if there are any onetime requests, like deactivating a license
    3636        @list( $uri, $hook ) = apply_filters( 'qsot-get-menu-page-uri', '', 'settings' );
    37         add_action( 'load-' . $hook, array( &$this, 'maybe_one_time_requests' ), 1 );
     37        if ( did_action( 'load-' . $hook ) )
     38            $this->maybe_one_time_requests();
     39        else
     40            add_action( 'load-' . $hook, array( &$this, 'maybe_one_time_requests' ), 1 );
    3841    }
    3942
     
    240243        if ( empty( $list ) ) {
    241244            update_option( 'qsot-licenses', array(), 'no' );
     245            do_action( 'qsot-force-update-check', true );
    242246            return;
    243247        }
     
    260264
    261265        // if there are no licenses that are trying to be activated, then just bail
    262         if ( empty( $request ) )
     266        if ( empty( $request ) ) {
     267            do_action( 'qsot-force-update-check', true );
    263268            return;
     269        }
    264270
    265271        // get the api response for activation
     
    275281            $errors = $this->_array_from_error( $response );
    276282            update_option( 'qsot-licenses-error', $errors, 'no' );
     283            do_action( 'qsot-force-update-check', true );
    277284            return;
    278285        }
     
    297304        // finally, update our option containing the option status for each item
    298305        QSOT_Extensions::instance()->save_licenses( $list );
     306        do_action( 'qsot-force-update-check', true );
    299307    }
    300308
  • opentickets-community-edition/trunk/inc/sys/extensions/updater.php

    r1592531 r1647408  
    1515        add_filter( 'pre_http_request', array( __CLASS__, 'check_for_updates' ), 10000, 3 );
    1616
     17        // allow a force update check
     18        add_action( 'qsot-force-update-check', array( __CLASS__, 'force_update_check' ), 10000, 1 );
     19
    1720        // infuse our last extension update check response into the list of plugin updates for the site
    1821        //add_filter( 'pre_set_site_transient_update_plugins', array( __CLASS__, 'add_extension_updates_to_plugin_updates' ), 10000, 1 );
     
    4346            return $response;
    4447
     48        return self::force_update_check( false, $response );
     49    }
     50
     51    // force an update check for our plugins
     52    public static function force_update_check( $force_update=false, $response=null ) {
    4553        // maybe trigger our additional updater logic
    46         $extra = self::_maybe_extension_updates();
     54        $extra = self::_maybe_extension_updates( $force_update );
    4755
    4856        // if there are no extra updates to add to the list, or if there are any errors, then bail right here
     
    5260        // store the result for later use
    5361        update_option( self::$ns . 'updater-response', @base64_encode( @json_encode( $extra ) ), 'no' );
     62
     63        // if we are forcing an update of plugins list, do that now
     64        if ( $force_update ) {
     65            $current = get_site_transient( 'update_plugins' );
     66            set_site_transient( 'update_plugins', $current );
     67        }
    5468
    5569        return $response;
     
    208222
    209223    // maybe trigger our manual extensions updates, if we are being forced to or if the timer has expired
    210     protected static function _maybe_extension_updates() {
     224    protected static function _maybe_extension_updates( $force=false ) {
    211225        // figure out the expiration of our last fetch, and if this is a force request
    212226        $expires = get_option( 'qsot-extensions-updater-last-expires', 0 );
    213         $is_force = isset( $_GET['force-check'] ) && 1 == $_GET['force-check'];
     227        $is_force = $force || ( isset( $_GET['force-check'] ) && 1 == $_GET['force-check'] );
    214228
    215229        // if the last fetch is not expired, and this is not a force request, then bail
  • opentickets-community-edition/trunk/inc/ticket/product.class.php

    r1644954 r1647408  
    9696    // fetch a list of all ticket products, and add their various pricing metas to the result
    9797    public static function get_all_ticket_products( $list, $format='objects' ) {
     98        global $QSOT_WC3;
    9899        // args used in the get_post() method to find all ticket products
    99100        $args = array(
     
    139140            // add some of the basic meta for pricing
    140141            $ticket->post->meta = array();
    141             $ticket->post->meta['price_raw'] = $ticket->price;
    142             $ticket->post->meta['price_html'] = wc_price($ticket->post->meta['price_raw']);
    143             $ticket->post->meta['price'] = apply_filters('qsot-price-formatted', $ticket->post->meta['price_raw']);
     142            $ticket->post->meta['price_raw'] = $QSOT_WC3->product_data( $ticket, 'price' );
     143            $ticket->post->meta['price_html'] = wc_price( $ticket->post->meta['price_raw'] );
     144            $ticket->post->meta['price'] = apply_filters( 'qsot-price-formatted', $ticket->post->meta['price_raw'] );
    144145
    145146            // shorthand the propername of the ticket, so we dont have to keep doing it
    146             $ticket->post->proper_name = apply_filters( 'the_title', $ticket->get_title(), $ticket->id );
     147            $ticket->post->proper_name = apply_filters( 'the_title', $ticket->get_title(), $id );
    147148
    148149            // add the ticket to the indexed return list
    149             $tickets[ '' . $ticket->post->ID ] = $ticket;
     150            $tickets[ '' . $id ] = $ticket;
    150151        }
    151152
  • opentickets-community-edition/trunk/launcher.php

    r1644954 r1647408  
    44 * Plugin URI:  http://opentickets.com/
    55 * Description: Event Management and Online Ticket Sales Platform
    6  * Version:     2.8.1
     6 * Version:     2.8.2
    77 * Author:      Quadshot Software LLC
    88 * Author URI:  http://quadshot.com/
     
    5555            'fctm' => 'fc',
    5656            'always_reserve' => 0,
    57             'version' => '2.8.1',
     57            'version' => '2.8.2',
    5858            'min_wc_version' => '2.6.14',
    5959            'core_post_type' => 'qsot-event',
  • opentickets-community-edition/trunk/readme.txt

    r1644954 r1647408  
    172172== Changelog ==
    173173
    174 = 2.8.1 - Apr/10/2017 =
     174= 2.8.2 - Apr/28/2017 =
     175* [fix] fixing new user button issue on edit-order admin screen
     176* [fix] fixing license key removal issue
     177* [fix] fixing extension update detection issue by making update checks more aggressive and vastly more numerous
     178
     179= 2.8.1 - Apr/25/2017 =
    175180* [tweak] more changes to resolve WC3 compatibility issues, when OTCE is used with extensions
     181* [tweak] changes to core plugin so that extensions work with new WC
    176182
    177183= 2.8.0 - Apr/10/2017 =
Note: See TracChangeset for help on using the changeset viewer.