Plugin Directory

Changeset 1539126


Ignore:
Timestamp:
11/23/2016 01:46:23 PM (9 years ago)
Author:
loushou
Message:
  • [fix] fixed issue where sometimes the 'event area' would show as '0' during event creation
  • [fix] fixed issue where some time formats were always interpreted as AM when PM would be appropriate

loushou

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

Legend:

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

    r1495176 r1539126  
    88    });
    99
     10    // when data on the event settings is selected, make sure to udate the ui appropriately
    1011    EditSetting.callbacks.add('update', function(data, adjust) {
     12        // if the selected data was a venue
    1113        if (this.tag == 'venue' && ($.inArray(typeof data.venue, ['string', 'number']) != -1 || (typeof data.venue == 'object' && typeof data.venue.toString == 'function'))) {
     14            // store the venue id to test for
    1215            var test = $.inArray(typeof data.venue, ['string', 'number']) != -1 ? data.venue : data.venue.toString(),
     16                    // find the element that holds the current setting for event area
    1317                    ea = this.elements.main_form.find('[tag="event-area"]');
     18            // if we found the element
    1419            if (ea.length) {
     20                // get the ea object from the element
    1521                ea = ea.qsEditSetting('get');
     22
     23                // if we got an ea object..
    1624                if (typeof ea == 'object' && ea.initialized) {
     25                    // find the event area pool
    1726                    var pool = ea.elements.form.find('[name="event-area-pool"]'),
     27                            // find the element to display the event area name
    1828                            display = ea.elements.form.find('[name="event-area"]'),
     29                            // get the current event area id
    1930                            current = data['event-area'] || display.val();
     31                    // clear out the display
    2032                    display.empty();
     33
     34                    // copy all non-associated event areas to the display container
    2135                    pool.find('option').not('[venue-id]').clone().appendTo( display );
     36
     37                    // copy all eas that belong to the venue, to the display container
    2238                    pool.find('option[venue-id="'+test+'"]').clone().appendTo( display );
    23                     pool.find('option[value="'+current+'"]').clone().prop( 'selected', 'selected' ).appendTo( display );
     39
     40                    // select the current value from the display box
     41                    if ( ! display.find( 'option[value="' + current + '"]' ).length )
     42                        pool.find( 'option[value="' + current + '"]' ).clone().appendTo( display );
     43                    display.find( 'option[value="' + current + '"]' ).prop( 'selected', 'selected' );
    2444                }
    2545            }
  • opentickets-community-edition/trunk/assets/js/admin/event-ui.js

    r1536371 r1539126  
    55            new_post_id = -1;
    66
    7     console.log( 'timezone', _qsot_event_ui_settings, S );
    87    // set the default timezone for momentjs
    98    moment.tz.setDefault( S.tz );
     
    102101
    103102        function normalize_time( str ) {
    104             var matches = str.toLowerCase().match( /^(\d{1,2})(:(\d{1,2})(.?(\d{1,2})?)?)?.?([pa]m?)?$/ ),
     103            var matches = str.toLowerCase().match( /^(\d{1,2})(:(\d{1,2})(\.?(\d{1,2})?)?)?.?([pa]m?)?$/ ),
    105104                    res = matches
    106105                        ? {
     
    328327                });
    329328
    330                 var i = undefined;
    331                 for (i in settings) {
     329                var n = undefined,
     330                        i = undefined,
     331                        ordered = _order_keys( settings );
     332                for ( n = 0; n < ordered.length; n++ ) {
     333                    i = ordered[ n ];
    332334                    var field = t.elements.bulk_edit.settings_form.find('[name="settings['+i+']"]');
    333335                    if (field.length > 0) {
     
    352354                $('[rel=edit]', t.elements.bulk_edit.settings_form).show();
    353355            }
     356        }
     357
     358        function _order_keys( obj ) {
     359            var raw = Object.keys( obj ),
     360                    map = { 'venue':1, 'event-area':2, 'price-struct':3 };
     361            raw.sort( function( a, b ) {
     362                var aval = map[ a ] ? map[ a ] : 9999,
     363                        bval = map[ b ] ? map[ b ] : 9999;
     364                return aval - bval;
     365            } );
     366            return raw;
    354367        }
    355368
  • opentickets-community-edition/trunk/assets/js/utils/tools.js

    r1479172 r1539126  
    10161016                }
    10171017
    1018                 if (typeof d == 'string') {
     1018                if (typeof d == 'string' && d != '' && d != '0' && d != 0) {
    10191019                    ret = QS.ucFirst(d);
    10201020                    break;
  • opentickets-community-edition/trunk/inc/event-area/base-event-area-type.abstract-dep.php

    r1437825 r1539126  
    1818    protected $name = '';
    1919    protected $slug = '';
     20
     21    // features supported by this area type
     22    protected $supported = array( 'tickets' => 1 );
    2023
    2124    // basic constructor for the area type
     
    2730        $this->slug = sanitize_title_with_dashes( 'area-type-' . $this->priority );
    2831        $this->name = sprintf( __( 'Area Type %d', 'opentickets-community-edition' ), $this->priority );
     32    }
     33
     34    // check if a feature is supported
     35    public function supports( $feature=null ) {
     36        if ( null === $feature )
     37            return $this->supported;
     38        return is_string( $feature ) && isset( $this->supported[ $feature ] );
    2939    }
    3040
  • opentickets-community-edition/trunk/launcher.php

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

    r1536371 r1539126  
    171171
    172172== Changelog ==
     173
     174= 2.6.1 - Nov/23/2016 =
     175* [fix] fixed issue where sometimes the 'event area' would show as '0' during event creation
     176* [fix] fixed issue where some time formats were always interpreted as AM when PM would be appropriate
    173177
    174178= 2.6.0 - Nov/18/2016 =
Note: See TracChangeset for help on using the changeset viewer.