Plugin Directory

Changeset 1369465


Ignore:
Timestamp:
03/11/2016 08:11:34 PM (10 years ago)
Author:
loushou
Message:
  • [tweak] added code to prevent as many third party plugin and theme PHP errors as possible during PDF generation
  • [tweak] saving WYSIWYG based settings no longer strips out formatting
  • [tweak] 'custom completed order email message' now only shows on the completed order email
  • [fix] fixed frontend calendar population problem, when using an HTTP frontend and an HTTPS backend
  • [fix] fixed the 'red x' buttons on the 'black event boxes' on the calendar in the edit event admin page

loushou

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

Legend:

Unmodified
Added
Removed
  • opentickets-community-edition/trunk/assets/js/admin/event-ui.js

    r1367916 r1369465  
    627627            for (var i=0; i<this.events.length; i++) {
    628628                // if the current array item (event) matches the event we are trying to remove
    629                 if (this.events[i]._id == ev._id) {
     629                if (this.events[i].post_id == ev.post_id) {
    630630                    // remove this item
    631631                    delete this.events[i];
     
    646646            var exists = $('[rel="items-removed"]', this.elements.main);
    647647            if (exists.length == 0) $('<input type="hidden" rel="items-removed" name="events-removed" value="1" />').appendTo(this.elements.main);
     648
     649            this.updateSources();
     650            this.updateEventList();
    648651        },
    649652
  • opentickets-community-edition/trunk/assets/js/admin/order/metaboxes.js

    r1013663 r1369465  
    6363                    };
    6464                    QS.cbs.trigger( 'calculate-action', [ all_totals ] );
    65                     console.log('calculate-action', all_totals);
     65                    //console.log('calculate-action', all_totals);
    6666
    6767                    // Set Total
  • opentickets-community-edition/trunk/assets/js/admin/order/ticket-selection.js

    r1340883 r1369465  
    367367                    // set the global event holder with the event data
    368368                    me.event_obj = r.data;
    369                     console.log( 'Loaded Event:', me.event_obj );
     369                    //console.log( 'Loaded Event:', me.event_obj );
    370370
    371371                    // make sure that event area type is initialized, and tell it to load the event
  • opentickets-community-edition/trunk/assets/js/features/calendar/calendar.js

    r1340883 r1369465  
    314314                        url: T.options.ajaxurl,
    315315                        data: get_url_params,
    316                         xhrFields: { withCredneitals:true }
     316                        xhrFields: { withCredentials:true }
    317317                    }
    318318                ],
  • opentickets-community-edition/trunk/assets/js/features/event-area/ui.js

    r1311266 r1369465  
    5656            }
    5757            if ( S.edata.available <= 0 && 0 == S.owns ) {
    58                 console.log( S );
     58                //console.log( S );
    5959                _show_msg('sold-out');
    6060                return false;
  • opentickets-community-edition/trunk/inc/order/admin.class.php

    r1367916 r1369465  
    3131            add_action('admin_notices', array(__CLASS__, 'cannot_use_guest'), 10);
    3232
    33             add_action('woocommerce_email_customer_details', array(__CLASS__, 'print_custom_email_message'), 1000);
    34             add_action('woocommerce_email_before_order_table', array(__CLASS__, 'print_custom_email_message_top'), 1000);
     33            // add messages to the completed order email only
     34            add_action( 'woocommerce_email_subject_customer_completed_order', array( __CLASS__, 'add_completed_order_email_messages' ), 1, 1 );
    3535            add_filter('qsot-order-has-tickets', array(__CLASS__, 'has_tickets'), 10, 2);
    3636
     
    621621    }
    622622
     623    // only add the extra custom completed order email messages, to the complete order emails
     624    public static function add_completed_order_email_messages( $subject ) {
     625        add_action('woocommerce_email_customer_details', array(__CLASS__, 'print_custom_email_message'), 1000);
     626        add_action('woocommerce_email_before_order_table', array(__CLASS__, 'print_custom_email_message_top'), 1000);
     627        return $subject;
     628    }
     629
    623630    public static function print_custom_email_message_top($order, $html=true) {
    624631        $print = apply_filters('qsot-order-has-tickets', false, $order);
  • opentickets-community-edition/trunk/inc/sys/admin-settings.php

    r1367916 r1369465  
    1818            // load the woocommerce wysiwyg field js
    1919            add_action( 'woocommerce_admin_field_wysiwyg', array( __CLASS__, 'field_wysiwyg' ) );
     20
     21            // allow html in wysiwyg fields
     22            add_filter( 'woocommerce_admin_settings_sanitize_option', array( __CLASS__, 'save_field_wysiwyg' ), 10, 3 );
    2023
    2124            // handle qtranslate LSB fields
     
    113116    }
    114117
     118    // when saving the wysiwyg field, we need to allow html
     119    public static function save_field_wysiwyg( $value, $option, $raw ) {
     120        // if this is not a wysiwyg field, then pass the value through
     121        if ( ! isset( $option['type'] ) || 'wysiwyg' !== $option['type'] )
     122            return $value;
     123
     124        return wp_kses_post( trim( $raw ) );
     125    }
     126
    115127    /**
    116128     * Add a message
  • opentickets-community-edition/trunk/inc/ticket/ticket.class.php

    r1318942 r1369465  
    1414    protected static $templates = array();
    1515    protected static $stylesheets = array();
     16
     17    // containers for current settings when protecting pdf output from errors
     18    protected static $ERROR_REPORTING = null;
     19    protected static $DISPLAY_ERRORS = null;
    1620
    1721    // order tracking
     
    3034            self::_setup_admin_options();
    3135        }
     36
     37        // hide errors as soon as possible, if we are transmitting a pdf
     38        if ( isset( $_GET['frmt'] ) && 'pdf' == $_GET['frmt'] )
     39            self::_hide_errors();
    3240
    3341        // setup the db tables for the ticket code lookup
     
    439447    }
    440448
     449    // hide errors
     450    protected static function _hide_errors() {
     451        self::$ERROR_REPORTING = error_reporting( 0 );
     452        self::$DISPLAY_ERRORS = ini_get( 'display_errors' );
     453        ini_set( 'display_errors', 0 );
     454    }
     455
     456    // restore errors
     457    protected static function _restore_errors() {
     458        if ( null !== self::$ERROR_REPORTING )
     459            error_reporting( self::$ERROR_REPORTING );
     460        if ( null !== self::$DISPLAY_ERRORS )
     461            ini_set( 'display_errors', self::$DISPLAY_ERRORS );
     462
     463        self::$ERROR_REPORTING = self::$DISPLAY_ERRORS = null;
     464    }
     465
    441466    // display the order tickets, or an error, depending on if we can load the tickets or not
    442467    public static function display_order_ticket( $order_key ) {
     
    444469        $order_id = wc_get_order_id_by_order_key( $order_key );
    445470        $order = wc_get_order( $order_id );
    446         if ( ! is_object( $order ) && ! is_wp_error( $order ) )
     471        if ( ! is_object( $order ) && ! is_wp_error( $order ) ) {
     472            self::_restore_errors();
    447473            return false;
     474        }
    448475
    449476        // verify that the user can view these tickets
     
    547574        }
    548575
     576        self::_restore_errors();
     577
    549578        exit;
    550579    }
     
    556585
    557586        // make sure we have the basic required data for loading the ticket
    558         if ( ! is_array( $args ) || ! isset( $args['order_id'], $args['order_item_id'] ) || empty( $args['order_id'] ) || empty( $args['order_item_id'] ) )
     587        if ( ! is_array( $args ) || ! isset( $args['order_id'], $args['order_item_id'] ) || empty( $args['order_id'] ) || empty( $args['order_item_id'] ) ) {
     588            self::_restore_errors();
    559589            return false;
     590        }
    560591
    561592        // make sure that the current user can view this ticket
    562         if ( ! self::_can_user_view_ticket( $args ) )
     593        if ( ! self::_can_user_view_ticket( $args ) ) {
     594            self::_restore_errors();
    563595            return false;
     596        }
    564597
    565598        // load all the data needed to render the ticket
     
    643676            default: echo $out; break;
    644677        }
     678
     679        self::_restore_errors();
    645680
    646681        exit;
  • opentickets-community-edition/trunk/launcher.php

    r1368520 r1369465  
    44 * Plugin URI:  http://opentickets.com/
    55 * Description: Event Management and Online Ticket Sales Platform
    6  * Version:     2.2.2
     6 * Version:     2.2.3
    77 * Author:      Quadshot Software LLC
    88 * Author URI:  http://quadshot.com/
     
    5454            'fctm' => 'fc',
    5555            'always_reserve' => 0,
    56             'version' => '2.2.2',
     56            'version' => '2.2.3',
    5757            'min_wc_version' => '2.4.12',
    5858            'core_post_type' => 'qsot-event',
  • opentickets-community-edition/trunk/readme.txt

    r1368520 r1369465  
    171171
    172172== Changelog ==
     173
     174= 2.2.3 - Mar/11/2016 =
     175* [tweak] added code to prevent as many third party plugin and theme PHP errors as possible during PDF generation
     176* [tweak] saving WYSIWYG based settings no longer strips out formatting
     177* [tweak] 'custom completed order email message' now only shows on the completed order email
     178* [fix] fixed frontend calendar population problem, when using an HTTP frontend and an HTTPS backend
     179* [fix] fixed the 'red x' buttons on the 'black event boxes' on the calendar in the edit event admin page
    173180
    174181= 2.2.2 - Mar/9/2016 =
Note: See TracChangeset for help on using the changeset viewer.