Changeset 1574067
- Timestamp:
- 01/13/2017 02:05:31 PM (9 years ago)
- Location:
- opentickets-community-edition/trunk
- Files:
-
- 4 edited
-
assets/js/admin/order/ticket-selection.js (modified) (2 diffs)
-
inc/sys/utils.php (modified) (6 diffs)
-
launcher.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
opentickets-community-edition/trunk/assets/js/admin/order/ticket-selection.js
r1529668 r1574067 295 295 function _setup_basic_events() { 296 296 me.e.scope.on( 'click', '[rel="add-tickets-btn"]', me.add_ticket_ui ); 297 me.e. scope.on( 'click', '.change-ticket', me.change_ticket_ui );297 me.e.order_items.on( 'click', '.change-ticket', me.change_ticket_ui ); 298 298 299 299 qs.cbs.trigger( 'setup-events', [ me, S ] ); … … 476 476 // start the UI with the mindset of 'changing' an existing reservation 477 477 me.change_ticket_ui = function( e ) { 478 console.log( 'fucing click' ); 478 479 e.preventDefault(); 479 480 -
opentickets-community-edition/trunk/inc/sys/utils.php
r1567191 r1574067 68 68 69 69 // adjust the raw time we got above, to achieve the GMT time 70 return $raw + ( ( 'to' == $method ? -1 : 1 ) * ( get_option( 'gmt_offset', 0) * HOUR_IN_SECONDS ) );70 return $raw + ( ( 'to' == $method ? -1 : 1 ) * ( ( get_option( 'gmt_offset', 0 ) + ( self::in_dst( $date ) ? '1' : 0 ) ) * HOUR_IN_SECONDS ) ); 71 71 } 72 72 … … 138 138 139 139 $time = null === $time ? time() : $time; 140 $time = ! is_numeric( $time ) ? strtotime( $time ) : $time; 140 141 // get the current dst status 141 142 $dst_status = date( 'I', $time ); … … 150 151 // make a timestamp UTC 151 152 public static function make_utc( $timestamp ) { 152 $diff = QSOT_Utils::tz_diff( $timestamp ); 153 return date( 'c', strtotime( $timestamp ) - $diff ); 153 static $site = false; 154 // site settings 155 if ( false === $site ) 156 $site = self::site_offset(); 157 158 // return an adjusted time, by accepting the hour/minute and date from the frontend, changing the tz to the site tz, and converting to utc 159 return date( 'c', strtotime( self::change_offset( $timestamp, self::number_to_tz( $site[ self::in_dst( $timestamp ) ? 'dst' : 'non' ] ) ) ) ); 160 } 161 162 // get the site's offset informatino 163 public static function site_offset() { 164 static $site = false; 165 // site settings 166 if ( false === $site ) { 167 $site = array( 168 'non' => self::tz_to_number( self::non_dst_tz_offset() ), 169 'dst' => self::tz_to_number( self::dst_tz_offset() ), 170 'in_dst' => self::in_dst(), 171 ); 172 } 173 return $site; 154 174 } 155 175 … … 159 179 // site settings 160 180 if ( false === $site ) 161 $site = self:: tz_to_number( self::non_dst_tz_offset());181 $site = self::site_offset(); 162 182 163 183 // timestamp tz 164 $tz = preg_replace( '# \d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}#', '', $timestamp );184 $tz = preg_replace( '#(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2})#', '', $timestamp ); 165 185 if ( $tz == $timestamp || ! strlen( $tz ) ) 166 186 return 0; 167 187 168 188 // flatten tz to number 169 $tz = self::tz_to_number( $tz ) ;189 $tz = self::tz_to_number( $tz ) - ( $site['in_dst'] ? 1 : 0 ); 170 190 171 191 // return the difference in seconds 172 return $zero_if_utc && 0 == $tz ? 0 : ( $site - $tz ) * HOUR_IN_SECONDS;192 return $zero_if_utc && 0 == $tz ? 0 : ( $site[ self::in_dst( $timestamp ) ? 'dst' : 'non' ] - $tz ) * HOUR_IN_SECONDS; 173 193 } 174 194 … … 187 207 } 188 208 209 // number to timezone 210 public static function number_to_tz( $number ) { 211 return sprintf( 212 '%s%02s:%02s', 213 $number < 0 ? '-' : '+', 214 absint( floor( $number ) ), 215 $number - floor( $number ) > 0 ? '30' : '00' 216 ); 217 } 218 189 219 // make a fake datestamp UTC 190 220 public static function fake_utc_date( $datestamp ) { … … 214 244 $offset = get_option( 'gmt_offset', 0 ); 215 245 216 return $offset = sprintf( 217 $format, 218 $offset < 0 ? '-' : '+', 219 absint( floor( $offset ) ), 220 $offset - floor( $offset ) > 0 ? '30' : '00' 221 ); 246 return $offset = self::number_to_tz( $offset ); 247 } 248 249 // get the DST timezone 250 public static function dst_tz_offset( $format='%s%02s:%02s' ) { 251 static $offset = null; 252 // do this once per page load 253 if ( null !== $offset ) 254 return $offset; 255 256 // get the numeric offset from the db 257 $offset = get_option( 'gmt_offset', 0 ) + 1; 258 259 return $offset = self::number_to_tz( $offset ); 222 260 } 223 261 -
opentickets-community-edition/trunk/launcher.php
r1567191 r1574067 4 4 * Plugin URI: http://opentickets.com/ 5 5 * Description: Event Management and Online Ticket Sales Platform 6 * Version: 2.6. 36 * Version: 2.6.4 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.6. 3',56 'version' => '2.6.4', 57 57 'min_wc_version' => '2.6.1', 58 58 'core_post_type' => 'qsot-event', -
opentickets-community-edition/trunk/readme.txt
r1567191 r1574067 171 171 172 172 == Changelog == 173 174 = 2.6.4- Jan/13/2017 = 175 * [tweak] made a javascript change that works around the new WC change that prevents the 'change seat' button from working in the admin 176 * [tweak] another adjustment that solves an edge case daylights savings time issue 173 177 174 178 = 2.6.3 - Jan/3/2017 =
Note: See TracChangeset
for help on using the changeset viewer.