Version Description
Download this release
Release Info
Developer | borkweb |
Plugin | Event Tickets |
Version | 5.2.0.1 |
Comparing to | |
See all releases |
Code changes from version 5.2.0 to 5.2.0.1
- common/vendor/autoload.php +1 -1
- common/vendor/autoload_52.php +1 -1
- common/vendor/composer/autoload_real.php +4 -4
- common/vendor/composer/autoload_real_52.php +3 -3
- common/vendor/composer/autoload_static.php +5 -5
- event-tickets.php +1 -1
- lang/event-tickets-cs_CZ.mo +0 -0
- lang/event-tickets-da_DK.mo +0 -0
- lang/event-tickets-de_DE.mo +0 -0
- lang/event-tickets-es_ES.mo +0 -0
- lang/event-tickets-fr_FR.mo +0 -0
- lang/event-tickets-hu_HU.mo +0 -0
- lang/event-tickets-it_IT.mo +0 -0
- lang/event-tickets-nb_NO.mo +0 -0
- lang/event-tickets-nl_NL.mo +0 -0
- lang/event-tickets-pt_BR.mo +0 -0
- lang/event-tickets-ro_RO.mo +0 -0
- lang/event-tickets-ru_RU.mo +0 -0
- lang/event-tickets-sq.mo +0 -0
- lang/event-tickets-sr_RS.mo +0 -0
- lang/event-tickets-sv_SE.mo +0 -0
- lang/event-tickets-tr_TR.mo +0 -0
- readme.txt +5 -1
- src/Tickets/Commerce/Attendee.php +114 -2
- src/Tickets/Commerce/Flag_Actions/Archive_Attendees.php +31 -8
- src/Tickets/Commerce/Models/Attendee_Model.php +1 -1
- src/Tickets/Commerce/Models/Order_Model.php +1 -1
- src/Tickets/Commerce/Repositories/Attendees_Repository.php +136 -0
- src/Tribe/Main.php +1 -1
- src/Tribe/Tickets_View.php +1 -0
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
common/vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit751463ad88433b20339ab8e2fbb405a0::getLoader();
|
common/vendor/autoload_52.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit60baf9a12681eca8f8edc7296e3c4dbc::getLoader();
|
common/vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitb53837a8c1428672f8ec1944182c5ba7
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit751463ad88433b20339ab8e2fbb405a0
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit751463ad88433b20339ab8e2fbb405a0', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit751463ad88433b20339ab8e2fbb405a0', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit751463ad88433b20339ab8e2fbb405a0::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
common/vendor/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit3410cd31e8268fa68b879e75e76a2048 {
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
+
class ComposerAutoloaderInit60baf9a12681eca8f8edc7296e3c4dbc {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit60baf9a12681eca8f8edc7296e3c4dbc', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit60baf9a12681eca8f8edc7296e3c4dbc', 'loadClassLoader'));
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
common/vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'T' =>
|
@@ -245,10 +245,10 @@ class ComposerStaticInitb53837a8c1428672f8ec1944182c5ba7
|
|
245 |
public static function getInitializer(ClassLoader $loader)
|
246 |
{
|
247 |
return \Closure::bind(function () use ($loader) {
|
248 |
-
$loader->prefixLengthsPsr4 =
|
249 |
-
$loader->prefixDirsPsr4 =
|
250 |
-
$loader->prefixesPsr0 =
|
251 |
-
$loader->classMap =
|
252 |
|
253 |
}, null, ClassLoader::class);
|
254 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit751463ad88433b20339ab8e2fbb405a0
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'T' =>
|
245 |
public static function getInitializer(ClassLoader $loader)
|
246 |
{
|
247 |
return \Closure::bind(function () use ($loader) {
|
248 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit751463ad88433b20339ab8e2fbb405a0::$prefixLengthsPsr4;
|
249 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit751463ad88433b20339ab8e2fbb405a0::$prefixDirsPsr4;
|
250 |
+
$loader->prefixesPsr0 = ComposerStaticInit751463ad88433b20339ab8e2fbb405a0::$prefixesPsr0;
|
251 |
+
$loader->classMap = ComposerStaticInit751463ad88433b20339ab8e2fbb405a0::$classMap;
|
252 |
|
253 |
}, null, ClassLoader::class);
|
254 |
}
|
event-tickets.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Event Tickets
|
4 |
Plugin URI: https://evnt.is/1acb
|
5 |
Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event.
|
6 |
-
Version: 5.2.0
|
7 |
Author: The Events Calendar
|
8 |
Author URI: https://evnt.is/1aor
|
9 |
License: GPLv2 or later
|
3 |
Plugin Name: Event Tickets
|
4 |
Plugin URI: https://evnt.is/1acb
|
5 |
Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event.
|
6 |
+
Version: 5.2.0.1
|
7 |
Author: The Events Calendar
|
8 |
Author URI: https://evnt.is/1aor
|
9 |
License: GPLv2 or later
|
lang/event-tickets-cs_CZ.mo
CHANGED
Binary file
|
lang/event-tickets-da_DK.mo
CHANGED
Binary file
|
lang/event-tickets-de_DE.mo
CHANGED
Binary file
|
lang/event-tickets-es_ES.mo
CHANGED
Binary file
|
lang/event-tickets-fr_FR.mo
CHANGED
Binary file
|
lang/event-tickets-hu_HU.mo
CHANGED
Binary file
|
lang/event-tickets-it_IT.mo
CHANGED
Binary file
|
lang/event-tickets-nb_NO.mo
CHANGED
Binary file
|
lang/event-tickets-nl_NL.mo
CHANGED
Binary file
|
lang/event-tickets-pt_BR.mo
CHANGED
Binary file
|
lang/event-tickets-ro_RO.mo
CHANGED
Binary file
|
lang/event-tickets-ru_RU.mo
CHANGED
Binary file
|
lang/event-tickets-sq.mo
CHANGED
Binary file
|
lang/event-tickets-sr_RS.mo
CHANGED
Binary file
|
lang/event-tickets-sv_SE.mo
CHANGED
Binary file
|
lang/event-tickets-tr_TR.mo
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: theeventscalendar, brianjessee, camwynsp, paulkim, aguseo, bordoni
|
|
4 |
Tags: tickets, registration, The Events Calendar, RSVP, ticket sales, attendee management
|
5 |
Requires at least: 5.6
|
6 |
Tested up to: 5.8.1
|
7 |
-
Stable tag: 5.2.0
|
8 |
Requires PHP: 7.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -179,6 +179,10 @@ Check out our extensive [knowledgebase](https://evnt.is/18wm) for articles on us
|
|
179 |
|
180 |
== Changelog ==
|
181 |
|
|
|
|
|
|
|
|
|
182 |
= [5.2.0] 2021-11-04 =
|
183 |
|
184 |
* Feature - Introduction of Tickets Commerce, the new and improved solution you can set up to sell tickets with Event Tickets.
|
4 |
Tags: tickets, registration, The Events Calendar, RSVP, ticket sales, attendee management
|
5 |
Requires at least: 5.6
|
6 |
Tested up to: 5.8.1
|
7 |
+
Stable tag: 5.2.0.1
|
8 |
Requires PHP: 7.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
179 |
|
180 |
== Changelog ==
|
181 |
|
182 |
+
= [5.2.0.1] 2021-11-10 =
|
183 |
+
|
184 |
+
* Fix - Ensures that Tickets Commerce attendees get archived properly when an order is canceled or not completed. [ET-1322]
|
185 |
+
|
186 |
= [5.2.0] 2021-11-04 =
|
187 |
|
188 |
* Feature - Introduction of Tickets Commerce, the new and improved solution you can set up to sell tickets with Event Tickets.
|
src/Tickets/Commerce/Attendee.php
CHANGED
@@ -8,6 +8,7 @@ use TEC\Tickets\Commerce\Status\Status_Handler;
|
|
8 |
use \Tribe__Tickets__Ticket_Object as Ticket_Object;
|
9 |
use Tribe__Utils__Array as Arr;
|
10 |
use Tribe__Date_Utils;
|
|
|
11 |
|
12 |
/**
|
13 |
* Class Attendee
|
@@ -228,6 +229,110 @@ class Attendee {
|
|
228 |
register_post_type( static::POSTTYPE, $post_type_args );
|
229 |
}
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
/**
|
232 |
* Creates an individual attendee given an Order and Ticket.
|
233 |
*
|
@@ -337,6 +442,8 @@ class Attendee {
|
|
337 |
* the Attendees Report rather than the PayPal Ticket attendees post list (because that's kind of
|
338 |
* confusing)
|
339 |
*
|
|
|
|
|
340 |
* @since 5.1.9
|
341 |
*
|
342 |
* @param int $post_id WP_Post ID.
|
@@ -348,6 +455,11 @@ class Attendee {
|
|
348 |
return;
|
349 |
}
|
350 |
|
|
|
|
|
|
|
|
|
|
|
351 |
$args = [
|
352 |
'post_type' => 'tribe_events',
|
353 |
'page' => \Tribe__Tickets__Tickets_Handler::$attendees_slug,
|
@@ -527,7 +639,7 @@ class Attendee {
|
|
527 |
/**
|
528 |
* Hydrate attendee object with ticket data
|
529 |
*
|
530 |
-
* @todo
|
531 |
*
|
532 |
* @since 5.2.0
|
533 |
*
|
@@ -555,7 +667,7 @@ class Attendee {
|
|
555 |
/**
|
556 |
* Loads event, ticket, order and other data into an attendee object
|
557 |
*
|
558 |
-
* @todo
|
559 |
*
|
560 |
* @since 5.2.0
|
561 |
*
|
8 |
use \Tribe__Tickets__Ticket_Object as Ticket_Object;
|
9 |
use Tribe__Utils__Array as Arr;
|
10 |
use Tribe__Date_Utils;
|
11 |
+
use WP_Post;
|
12 |
|
13 |
/**
|
14 |
* Class Attendee
|
229 |
register_post_type( static::POSTTYPE, $post_type_args );
|
230 |
}
|
231 |
|
232 |
+
/**
|
233 |
+
* Archives an attendee. In WordPress this means the attendee post will have `trash` status, but it won't be
|
234 |
+
* deleted.
|
235 |
+
*
|
236 |
+
* @since TBD
|
237 |
+
*
|
238 |
+
* @param int $attendee_id The Attendee ID.
|
239 |
+
*/
|
240 |
+
public function archive( $attendee_id ) {
|
241 |
+
/**
|
242 |
+
* Allows filtering the Attendee ID for archival.
|
243 |
+
*
|
244 |
+
* @since TBD
|
245 |
+
*
|
246 |
+
* @param int $attendee_id The Attendee ID.
|
247 |
+
*/
|
248 |
+
$attendee_id = apply_filters( 'tec_tickets_commerce_attendee_to_archive', $attendee_id );
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Allows actions to run right before archiving an attendee.
|
252 |
+
*
|
253 |
+
* @since TBD
|
254 |
+
*
|
255 |
+
* @param int $attendee_id The Attendee ID.
|
256 |
+
*/
|
257 |
+
do_action( 'tec_tickets_commerce_attendee_before_archive', $attendee_id );
|
258 |
+
|
259 |
+
$result = wp_trash_post( $attendee_id );
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Allows actions to run right after archiving an attendee.
|
263 |
+
*
|
264 |
+
* @since TBD
|
265 |
+
*
|
266 |
+
* @param int $attendee_id The Attendee ID.
|
267 |
+
* @param WP_Post|false|null $result Attendee post data on success, false or null on failure.
|
268 |
+
*/
|
269 |
+
do_action( 'tec_tickets_commerce_attendee_after_archive', $attendee_id, $result );
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Allows filtering of the return from the `wp_trash_post`.
|
273 |
+
*
|
274 |
+
* @since TBD
|
275 |
+
*
|
276 |
+
* @param WP_Post|false|null $result Attendee post data on success, false or null on failure.
|
277 |
+
* @param int $attendee_id The Attendee ID.
|
278 |
+
*/
|
279 |
+
return apply_filters( 'tec_tickets_commerce_attendee_archived', $result, $attendee_id );
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Permanently deletes an attendee.
|
284 |
+
*
|
285 |
+
* @since TBD
|
286 |
+
*
|
287 |
+
* @param int $attendee_id The Attendee ID.
|
288 |
+
* @param boolean $force Force the deletion.
|
289 |
+
*/
|
290 |
+
public function delete( $attendee_id, $force = true ) {
|
291 |
+
/**
|
292 |
+
* Allows filtering the Attendee ID for deletion.
|
293 |
+
*
|
294 |
+
* @since TBD
|
295 |
+
*
|
296 |
+
* @param int $attendee_id The Attendee ID
|
297 |
+
* @param boolean $force Force the deletion.
|
298 |
+
*/
|
299 |
+
$attendee_id = apply_filters( 'tec_tickets_commerce_attendee_to_delete', $attendee_id, $force );
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Allows actions to run right before deleting an attendee.
|
303 |
+
*
|
304 |
+
* @since TBD
|
305 |
+
*
|
306 |
+
* @param int $attendee_id The Attendee ID.
|
307 |
+
* @param boolean $force Force the deletion.
|
308 |
+
*/
|
309 |
+
do_action( 'tec_tickets_commerce_attendee_before_delete', $attendee_id, $force );
|
310 |
+
|
311 |
+
$result = wp_delete_post( $attendee_id, true );
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Allows actions to run right after deleting an attendee.
|
315 |
+
*
|
316 |
+
* @since TBD
|
317 |
+
*
|
318 |
+
* @param int $attendee_id The Attendee ID.
|
319 |
+
* @param WP_Post|false|null $result Attendee post data on success, false or null on failure.
|
320 |
+
* @param boolean $force Force the deletion.
|
321 |
+
*/
|
322 |
+
do_action( 'tec_tickets_commerce_attendee_after_delete', $attendee_id, $result, $force );
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Allows filtering of the return from the `wp_delete_post`.
|
326 |
+
*
|
327 |
+
* @since TBD
|
328 |
+
*
|
329 |
+
* @param WP_Post|false|null $result Attendee post data on success, false or null on failure.
|
330 |
+
* @param int $attendee_id The Attendee ID.
|
331 |
+
* @param boolean $force Force the deletion.
|
332 |
+
*/
|
333 |
+
return apply_filters( 'tec_tickets_commerce_attendee_deleted', $result, $attendee_id, $force );
|
334 |
+
}
|
335 |
+
|
336 |
/**
|
337 |
* Creates an individual attendee given an Order and Ticket.
|
338 |
*
|
442 |
* the Attendees Report rather than the PayPal Ticket attendees post list (because that's kind of
|
443 |
* confusing)
|
444 |
*
|
445 |
+
* @todo @backend this should probably be moved to the Archive Attendees flag action and handled from there.
|
446 |
+
*
|
447 |
* @since 5.1.9
|
448 |
*
|
449 |
* @param int $post_id WP_Post ID.
|
455 |
return;
|
456 |
}
|
457 |
|
458 |
+
// Do not redirect if this status change is being handled by a Flag Action.
|
459 |
+
if ( did_action( 'tec_tickets_commerce_order_status_flag_archive_attendees' ) ) {
|
460 |
+
return;
|
461 |
+
}
|
462 |
+
|
463 |
$args = [
|
464 |
'post_type' => 'tribe_events',
|
465 |
'page' => \Tribe__Tickets__Tickets_Handler::$attendees_slug,
|
639 |
/**
|
640 |
* Hydrate attendee object with ticket data
|
641 |
*
|
642 |
+
* @todo We should not be using this particular piece of the code until it's using `tec_tc_get_attendee`.
|
643 |
*
|
644 |
* @since 5.2.0
|
645 |
*
|
667 |
/**
|
668 |
* Loads event, ticket, order and other data into an attendee object
|
669 |
*
|
670 |
+
* @todo We should not be using this particular piece of the code until it's using `tec_tc_get_attendee`.
|
671 |
*
|
672 |
* @since 5.2.0
|
673 |
*
|
src/Tickets/Commerce/Flag_Actions/Archive_Attendees.php
CHANGED
@@ -22,6 +22,7 @@ use Tribe__Utils__Array as Arr;
|
|
22 |
* @package TEC\Tickets\Commerce\Flag_Actions
|
23 |
*/
|
24 |
class Archive_Attendees extends Flag_Action_Abstract {
|
|
|
25 |
/**
|
26 |
* {@inheritDoc}
|
27 |
*/
|
@@ -33,15 +34,14 @@ class Archive_Attendees extends Flag_Action_Abstract {
|
|
33 |
* {@inheritDoc}
|
34 |
*/
|
35 |
protected $post_types = [
|
36 |
-
Order::POSTTYPE
|
37 |
];
|
38 |
|
39 |
/**
|
40 |
* {@inheritDoc}
|
41 |
*/
|
42 |
public function handle( Status_Interface $new_status, $old_status, \WP_Post $post ) {
|
43 |
-
|
44 |
-
if ( empty( $post->items ) ) {
|
45 |
return;
|
46 |
}
|
47 |
|
@@ -51,16 +51,39 @@ class Archive_Attendees extends Flag_Action_Abstract {
|
|
51 |
continue;
|
52 |
}
|
53 |
|
54 |
-
$
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
// Skip
|
57 |
-
if (
|
58 |
continue;
|
59 |
}
|
60 |
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
-
|
64 |
}
|
65 |
}
|
66 |
}
|
22 |
* @package TEC\Tickets\Commerce\Flag_Actions
|
23 |
*/
|
24 |
class Archive_Attendees extends Flag_Action_Abstract {
|
25 |
+
|
26 |
/**
|
27 |
* {@inheritDoc}
|
28 |
*/
|
34 |
* {@inheritDoc}
|
35 |
*/
|
36 |
protected $post_types = [
|
37 |
+
Order::POSTTYPE,
|
38 |
];
|
39 |
|
40 |
/**
|
41 |
* {@inheritDoc}
|
42 |
*/
|
43 |
public function handle( Status_Interface $new_status, $old_status, \WP_Post $post ) {
|
44 |
+
if ( empty( $post->items ) || $new_status->get_slug() !== $post->status_obj->get_slug() ) {
|
|
|
45 |
return;
|
46 |
}
|
47 |
|
51 |
continue;
|
52 |
}
|
53 |
|
54 |
+
$attendees_repo = tec_tc_attendees();
|
55 |
+
$attendees_repo->by( 'ticket_id', $ticket->ID );
|
56 |
+
$attendees_repo->by( 'parent', $post->ID );
|
57 |
+
$attendees_repo->by( 'status', 'any' );
|
58 |
+
|
59 |
+
$attendees = $attendees_repo->all();
|
60 |
|
61 |
+
// Skip archiving for zero-ed items.
|
62 |
+
if ( ! $attendees_repo->found() ) {
|
63 |
continue;
|
64 |
}
|
65 |
|
66 |
+
foreach ( $attendees as $attendee ) {
|
67 |
+
/**
|
68 |
+
* Allows filtering whether an attendee should archived, or hard-deleted from the database.
|
69 |
+
*
|
70 |
+
* To permanently delete an attendee, this filter must return a boolean false. Any other value will fallback to archiving.
|
71 |
+
*
|
72 |
+
* @since TBD
|
73 |
+
*
|
74 |
+
* @param \WP_Post $attendee the attendee data
|
75 |
+
* @param \Tribe__Tickets__Ticket_Object $ticket the ticket
|
76 |
+
* @param \WP_Post $post the order
|
77 |
+
*/
|
78 |
+
$archive_attendee = apply_filters( 'tec_tickets_commerce_archive_attendee_delete_permanently', true, $attendee, $ticket, $post );
|
79 |
+
|
80 |
+
if ( false === $archive_attendee ) {
|
81 |
+
tribe( Attendee::class )->delete( $attendee->ID );
|
82 |
+
|
83 |
+
return;
|
84 |
+
}
|
85 |
|
86 |
+
tribe( Attendee::class )->archive( $attendee->ID );
|
87 |
}
|
88 |
}
|
89 |
}
|
src/Tickets/Commerce/Models/Attendee_Model.php
CHANGED
@@ -46,7 +46,7 @@ class Attendee_Model extends Base {
|
|
46 |
$checked_in = Arr::get( $post_meta, [ Attendee::$checked_in_meta_key, 0 ] );
|
47 |
$security = Arr::get( $post_meta, [ Attendee::$security_code_meta_key, 0 ] );
|
48 |
$opt_out = tribe_is_truthy( Arr::get( $post_meta, [ Attendee::$optout_meta_key, 0 ] ) );
|
49 |
-
$status = $order->
|
50 |
$ticket_sent = (int) Arr::get( $post_meta, [ Attendee::$ticket_sent_meta_key, 0 ] );
|
51 |
$deleted_ticket_title = Arr::get( $post_meta, [ Attendee::$deleted_ticket_meta_key, 0 ] );
|
52 |
$full_name = Arr::get( $post_meta, [ Attendee::$full_name_meta_key, 0 ] );
|
46 |
$checked_in = Arr::get( $post_meta, [ Attendee::$checked_in_meta_key, 0 ] );
|
47 |
$security = Arr::get( $post_meta, [ Attendee::$security_code_meta_key, 0 ] );
|
48 |
$opt_out = tribe_is_truthy( Arr::get( $post_meta, [ Attendee::$optout_meta_key, 0 ] ) );
|
49 |
+
$status = $order->status_obj->get_name();
|
50 |
$ticket_sent = (int) Arr::get( $post_meta, [ Attendee::$ticket_sent_meta_key, 0 ] );
|
51 |
$deleted_ticket_title = Arr::get( $post_meta, [ Attendee::$deleted_ticket_meta_key, 0 ] );
|
52 |
$full_name = Arr::get( $post_meta, [ Attendee::$full_name_meta_key, 0 ] );
|
src/Tickets/Commerce/Models/Order_Model.php
CHANGED
@@ -62,7 +62,7 @@ class Order_Model extends Base {
|
|
62 |
'provider' => Module::class,
|
63 |
'provider_slug' => Commerce::ABBR,
|
64 |
'status_log' => $status_log,
|
65 |
-
'
|
66 |
'gateway' => $gateway_slug,
|
67 |
'gateway_order_id' => $gateway_order_id,
|
68 |
'gateway_payload' => $gateway_payload,
|
62 |
'provider' => Module::class,
|
63 |
'provider_slug' => Commerce::ABBR,
|
64 |
'status_log' => $status_log,
|
65 |
+
'status_obj' => $status,
|
66 |
'gateway' => $gateway_slug,
|
67 |
'gateway_order_id' => $gateway_order_id,
|
68 |
'gateway_payload' => $gateway_payload,
|
src/Tickets/Commerce/Repositories/Attendees_Repository.php
CHANGED
@@ -81,6 +81,19 @@ class Attendees_Repository extends Tribe__Repository {
|
|
81 |
$this->update_fields_aliases,
|
82 |
$aliases
|
83 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
|
86 |
/**
|
@@ -144,4 +157,127 @@ class Attendees_Repository extends Tribe__Repository {
|
|
144 |
|
145 |
return $postarr;
|
146 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
81 |
$this->update_fields_aliases,
|
82 |
$aliases
|
83 |
);
|
84 |
+
|
85 |
+
$this->schema = array_merge(
|
86 |
+
$this->schema,
|
87 |
+
[
|
88 |
+
'tickets' => [ $this, 'filter_by_tickets' ],
|
89 |
+
'tickets_not' => [ $this, 'filter_by_tickets_not' ],
|
90 |
+
'events' => [ $this, 'filter_by_events' ],
|
91 |
+
'events_not' => [ $this, 'filter_by_events_not' ],
|
92 |
+
]
|
93 |
+
);
|
94 |
+
|
95 |
+
$this->add_simple_meta_schema_entry( 'ticket_id', Attendee::$ticket_relation_meta_key, 'meta_equals' );
|
96 |
+
$this->add_simple_meta_schema_entry( 'event_id', Attendee::$event_relation_meta_key, 'meta_equals' );
|
97 |
}
|
98 |
|
99 |
/**
|
157 |
|
158 |
return $postarr;
|
159 |
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Cleans up a list of Post IDs into an usable array for DB query.
|
163 |
+
*
|
164 |
+
* @since TBD
|
165 |
+
*
|
166 |
+
* @param int|\WP_Post|int[]|\WP_Post[] $posts Which posts we are filtering by.
|
167 |
+
*
|
168 |
+
* @return array
|
169 |
+
*/
|
170 |
+
protected function clean_post_ids( $posts ) {
|
171 |
+
return array_unique( array_filter( array_map( static function ( $post ) {
|
172 |
+
if ( is_numeric( $post ) ) {
|
173 |
+
return $post;
|
174 |
+
}
|
175 |
+
|
176 |
+
if ( $post instanceof \WP_Post ) {
|
177 |
+
return $post->ID;
|
178 |
+
}
|
179 |
+
|
180 |
+
return null;
|
181 |
+
}, (array) $posts ) ) );
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Filters order by whether or not it contains a given ticket/s.
|
186 |
+
*
|
187 |
+
* @since TBD
|
188 |
+
*
|
189 |
+
* @param int|\WP_Post|int[]|\WP_Post[] $tickets Which tickets we are filtering by.
|
190 |
+
*
|
191 |
+
* @return null
|
192 |
+
*/
|
193 |
+
public function filter_by_tickets( $tickets = null ) {
|
194 |
+
if ( empty( $tickets ) ) {
|
195 |
+
return null;
|
196 |
+
}
|
197 |
+
|
198 |
+
$tickets = $this->clean_post_ids( $tickets );
|
199 |
+
|
200 |
+
if ( empty( $tickets ) ) {
|
201 |
+
return null;
|
202 |
+
}
|
203 |
+
|
204 |
+
$this->by( 'meta_in', Attendee::$ticket_relation_meta_key, $tickets );
|
205 |
+
|
206 |
+
return null;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Filters order by whether or not it contains a given ticket/s.
|
211 |
+
*
|
212 |
+
* @since TBD
|
213 |
+
*
|
214 |
+
* @param int|\WP_Post|int[]|\WP_Post[] $tickets Which tickets we are filtering by.
|
215 |
+
*
|
216 |
+
* @return null
|
217 |
+
*/
|
218 |
+
public function filter_by_tickets_not( $tickets = null ) {
|
219 |
+
if ( empty( $tickets ) ) {
|
220 |
+
return null;
|
221 |
+
}
|
222 |
+
|
223 |
+
$tickets = $this->clean_post_ids( $tickets );
|
224 |
+
|
225 |
+
if ( empty( $tickets ) ) {
|
226 |
+
return null;
|
227 |
+
}
|
228 |
+
|
229 |
+
$this->by( 'meta_not_in', Attendee::$ticket_relation_meta_key, $tickets );
|
230 |
+
|
231 |
+
return null;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Filters order by whether or not it contains a given ticket/s.
|
236 |
+
*
|
237 |
+
* @since TBD
|
238 |
+
*
|
239 |
+
* @param int|\WP_Post|int[]|\WP_Post[] $events Which events we are filtering by.
|
240 |
+
*
|
241 |
+
* @return null
|
242 |
+
*/
|
243 |
+
public function filter_by_events( $events = null ) {
|
244 |
+
if ( empty( $events ) ) {
|
245 |
+
return null;
|
246 |
+
}
|
247 |
+
|
248 |
+
$events = $this->clean_post_ids( $events );
|
249 |
+
|
250 |
+
if ( empty( $events ) ) {
|
251 |
+
return null;
|
252 |
+
}
|
253 |
+
|
254 |
+
$this->by( 'meta_in', Attendee::$event_relation_meta_key, $events );
|
255 |
+
|
256 |
+
return null;
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Filters order by whether or not it contains a given event/s.
|
261 |
+
*
|
262 |
+
* @since TBD
|
263 |
+
*
|
264 |
+
* @param int|\WP_Post|int[]|\WP_Post[] $events Which events we are filtering by.
|
265 |
+
*
|
266 |
+
* @return null
|
267 |
+
*/
|
268 |
+
public function filter_by_events_not( $events = null ) {
|
269 |
+
if ( empty( $events ) ) {
|
270 |
+
return null;
|
271 |
+
}
|
272 |
+
|
273 |
+
$events = $this->clean_post_ids( $events );
|
274 |
+
|
275 |
+
if ( empty( $events ) ) {
|
276 |
+
return null;
|
277 |
+
}
|
278 |
+
|
279 |
+
$this->by( 'meta_not_in', Attendee::$event_relation_meta_key, $events );
|
280 |
+
|
281 |
+
return null;
|
282 |
+
}
|
283 |
}
|
src/Tribe/Main.php
CHANGED
@@ -7,7 +7,7 @@ class Tribe__Tickets__Main {
|
|
7 |
/**
|
8 |
* Current version of this plugin
|
9 |
*/
|
10 |
-
const VERSION = '5.2.0';
|
11 |
|
12 |
/**
|
13 |
* Used to store the version history.
|
7 |
/**
|
8 |
* Current version of this plugin
|
9 |
*/
|
10 |
+
const VERSION = '5.2.0.1';
|
11 |
|
12 |
/**
|
13 |
* Used to store the version history.
|
src/Tribe/Tickets_View.php
CHANGED
@@ -770,6 +770,7 @@ class Tribe__Tickets__Tickets_View {
|
|
770 |
$args = [
|
771 |
'by' => [
|
772 |
'provider__not_in' => 'rsvp',
|
|
|
773 |
],
|
774 |
];
|
775 |
|
770 |
$args = [
|
771 |
'by' => [
|
772 |
'provider__not_in' => 'rsvp',
|
773 |
+
'status' => 'publish',
|
774 |
],
|
775 |
];
|
776 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitf68555ab0151b77e0b33d6ee303195f3::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitf0f8f20c527ca1a6cf9c57305f645c8c
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitf68555ab0151b77e0b33d6ee303195f3
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitf68555ab0151b77e0b33d6ee303195f3', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitf68555ab0151b77e0b33d6ee303195f3', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitf68555ab0151b77e0b33d6ee303195f3::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'T' =>
|
@@ -161,9 +161,9 @@ class ComposerStaticInitf0f8f20c527ca1a6cf9c57305f645c8c
|
|
161 |
public static function getInitializer(ClassLoader $loader)
|
162 |
{
|
163 |
return \Closure::bind(function () use ($loader) {
|
164 |
-
$loader->prefixLengthsPsr4 =
|
165 |
-
$loader->prefixDirsPsr4 =
|
166 |
-
$loader->classMap =
|
167 |
|
168 |
}, null, ClassLoader::class);
|
169 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitf68555ab0151b77e0b33d6ee303195f3
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'T' =>
|
161 |
public static function getInitializer(ClassLoader $loader)
|
162 |
{
|
163 |
return \Closure::bind(function () use ($loader) {
|
164 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitf68555ab0151b77e0b33d6ee303195f3::$prefixLengthsPsr4;
|
165 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitf68555ab0151b77e0b33d6ee303195f3::$prefixDirsPsr4;
|
166 |
+
$loader->classMap = ComposerStaticInitf68555ab0151b77e0b33d6ee303195f3::$classMap;
|
167 |
|
168 |
}, null, ClassLoader::class);
|
169 |
}
|