Version Description
Download this release
Release Info
| Developer | bordoni |
| Plugin | |
| Version | 5.5.3 |
| Comparing to | |
| See all releases | |
Code changes from version 5.5.2 to 5.5.3
- common/lang/tribe-common-af.mo +0 -0
- common/lang/tribe-common-da_DK.mo +0 -0
- common/lang/tribe-common-de_DE.mo +0 -0
- common/lang/tribe-common-en_GB.mo +0 -0
- common/lang/tribe-common-et.mo +0 -0
- common/lang/tribe-common-fi.mo +0 -0
- common/lang/tribe-common-id_ID.mo +0 -0
- common/lang/tribe-common-is_IS.mo +0 -0
- common/lang/tribe-common-lt_LT.mo +0 -0
- common/lang/tribe-common-sl_SI.mo +0 -0
- common/lang/tribe-common-sr_RS.mo +0 -0
- common/lang/tribe-common-zh_CN.mo +0 -0
- common/lang/tribe-common-zh_TW.mo +0 -0
- 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-da_DK.mo +0 -0
- lang/event-tickets-de_DE.mo +0 -0
- lang/event-tickets-nl_NL.mo +0 -0
- lang/event-tickets.pot +22 -22
- readme.txt +13 -1
- src/Tickets/Commerce/Module.php +10 -0
- src/Tribe/Attendee_Repository.php +73 -0
- src/Tribe/Main.php +2 -2
- src/Tribe/Plugin_Register.php +1 -1
- src/Tribe/REST/V1/Attendee_Repository.php +1 -1
- src/Tribe/REST/V1/Endpoints/Attendee_Archive.php +47 -7
- src/Tribe/REST/V1/Endpoints/Single_Attendee.php +12 -2
- src/Tribe/REST/V1/Endpoints/Ticket_Archive.php +4 -2
- src/Tribe/REST/V1/Main.php +70 -2
- src/Tribe/REST/V1/Post_Repository.php +11 -8
- src/Tribe/RSVP.php +4 -3
- src/Tribe/Repositories/Post_Repository.php +1 -0
- src/Tribe/Repositories/Traits/Post_Tickets.php +22 -17
- src/Tribe/Tickets.php +35 -3
- src/template-tags/tickets.php +15 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
common/lang/tribe-common-af.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-da_DK.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-de_DE.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-en_GB.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-et.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-fi.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-id_ID.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-is_IS.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-lt_LT.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-sl_SI.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-sr_RS.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-zh_CN.mo
CHANGED
|
Binary file
|
common/lang/tribe-common-zh_TW.mo
CHANGED
|
Binary file
|
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 ComposerAutoloaderInitfa3326926b3e0647d366833632fd7160::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 ComposerAutoloaderInitbffd0929a2123e9d1d886dcb6a396f06::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 ComposerAutoloaderInit46586e50609ff65f96658fb5e4e2c9e8
|
|
| 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 ComposerAutoloaderInitfa3326926b3e0647d366833632fd7160
|
| 6 |
{
|
| 7 |
private static $loader;
|
| 8 |
|
| 19 |
return self::$loader;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
spl_autoload_register(array('ComposerAutoloaderInitfa3326926b3e0647d366833632fd7160', 'loadClassLoader'), true, true);
|
| 23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
| 24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitfa3326926b3e0647d366833632fd7160', '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\ComposerStaticInitfa3326926b3e0647d366833632fd7160::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 ComposerAutoloaderInit10017778b88eefa5ac363af5e02e4d1e {
|
|
| 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 ComposerAutoloaderInitbffd0929a2123e9d1d886dcb6a396f06 {
|
| 6 |
private static $loader;
|
| 7 |
|
| 8 |
public static function loadClassLoader($class) {
|
| 19 |
return self::$loader;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
spl_autoload_register(array('ComposerAutoloaderInitbffd0929a2123e9d1d886dcb6a396f06', 'loadClassLoader'), true /*, true */);
|
| 23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
| 24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitbffd0929a2123e9d1d886dcb6a396f06', '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' =>
|
|
@@ -273,10 +273,10 @@ class ComposerStaticInit46586e50609ff65f96658fb5e4e2c9e8
|
|
| 273 |
public static function getInitializer(ClassLoader $loader)
|
| 274 |
{
|
| 275 |
return \Closure::bind(function () use ($loader) {
|
| 276 |
-
$loader->prefixLengthsPsr4 =
|
| 277 |
-
$loader->prefixDirsPsr4 =
|
| 278 |
-
$loader->prefixesPsr0 =
|
| 279 |
-
$loader->classMap =
|
| 280 |
|
| 281 |
}, null, ClassLoader::class);
|
| 282 |
}
|
| 4 |
|
| 5 |
namespace Composer\Autoload;
|
| 6 |
|
| 7 |
+
class ComposerStaticInitfa3326926b3e0647d366833632fd7160
|
| 8 |
{
|
| 9 |
public static $prefixLengthsPsr4 = array (
|
| 10 |
'T' =>
|
| 273 |
public static function getInitializer(ClassLoader $loader)
|
| 274 |
{
|
| 275 |
return \Closure::bind(function () use ($loader) {
|
| 276 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitfa3326926b3e0647d366833632fd7160::$prefixLengthsPsr4;
|
| 277 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitfa3326926b3e0647d366833632fd7160::$prefixDirsPsr4;
|
| 278 |
+
$loader->prefixesPsr0 = ComposerStaticInitfa3326926b3e0647d366833632fd7160::$prefixesPsr0;
|
| 279 |
+
$loader->classMap = ComposerStaticInitfa3326926b3e0647d366833632fd7160::$classMap;
|
| 280 |
|
| 281 |
}, null, ClassLoader::class);
|
| 282 |
}
|
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.5.
|
| 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.5.3
|
| 7 |
Author: The Events Calendar
|
| 8 |
Author URI: https://evnt.is/1aor
|
| 9 |
License: GPLv2 or later
|
lang/event-tickets-da_DK.mo
CHANGED
|
Binary file
|
lang/event-tickets-de_DE.mo
CHANGED
|
Binary file
|
lang/event-tickets-nl_NL.mo
CHANGED
|
Binary file
|
lang/event-tickets.pot
CHANGED
|
@@ -2,17 +2,17 @@
|
|
| 2 |
# This file is distributed under the same license as the Event Tickets package.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
-
"Project-Id-Version: Event Tickets 5.5.
|
| 6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/event-tickets\n"
|
| 7 |
-
"POT-Creation-Date: 2022-
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
| 11 |
-
"PO-Revision-Date: 2022-
|
| 12 |
"Last-Translator: \n"
|
| 13 |
"Language-Team: \n"
|
| 14 |
|
| 15 |
-
#. #-#-#-#-# event-tickets.pot (Event Tickets 5.5.
|
| 16 |
#. Plugin Name of the plugin/theme
|
| 17 |
#: event-tickets.php:61 src/Tribe/Admin/Notices.php:92 src/Tribe/Main.php:690
|
| 18 |
#: src/Tribe/Privacy.php:59 src/admin-views/admin-welcome-message.php:73
|
|
@@ -5434,11 +5434,11 @@ msgstr ""
|
|
| 5434 |
msgid "%s will be available on %s at %s"
|
| 5435 |
msgstr ""
|
| 5436 |
|
| 5437 |
-
#: src/Tickets/Commerce/Status/Pending.php:163 src/Tribe/Tickets.php:
|
| 5438 |
msgid "%s are no longer available."
|
| 5439 |
msgstr ""
|
| 5440 |
|
| 5441 |
-
#: src/Tickets/Commerce/Status/Pending.php:165 src/Tribe/Tickets.php:
|
| 5442 |
msgid "There are no %s available at this time."
|
| 5443 |
msgstr ""
|
| 5444 |
|
|
@@ -6791,28 +6791,28 @@ msgstr ""
|
|
| 6791 |
msgid "Are you sure you want to cancel?"
|
| 6792 |
msgstr ""
|
| 6793 |
|
| 6794 |
-
#: src/Tribe/Editor/Blocks/Tickets.php:282 src/Tribe/Tickets.php:
|
| 6795 |
msgctxt "Error message title, will be followed by the error code."
|
| 6796 |
msgid "API Error"
|
| 6797 |
msgstr ""
|
| 6798 |
|
| 6799 |
-
#: src/Tribe/Editor/Blocks/Tickets.php:283 src/Tribe/Tickets.php:
|
| 6800 |
msgid ""
|
| 6801 |
"Refresh this page or wait a few minutes before trying again. If this happens "
|
| 6802 |
"repeatedly, please contact the Site Admin."
|
| 6803 |
msgstr ""
|
| 6804 |
|
| 6805 |
-
#: src/Tribe/Editor/Blocks/Tickets.php:284 src/Tribe/Tickets.php:
|
| 6806 |
msgid ""
|
| 6807 |
"The ticket for this event has sold out and has been removed from your cart."
|
| 6808 |
msgstr ""
|
| 6809 |
|
| 6810 |
-
#: src/Tribe/Editor/Blocks/Tickets.php:285 src/Tribe/Tickets.php:
|
| 6811 |
#: src/views/v2/commerce/order/header/title-empty.php:28
|
| 6812 |
msgid "Whoops!"
|
| 6813 |
msgstr ""
|
| 6814 |
|
| 6815 |
-
#: src/Tribe/Editor/Blocks/Tickets.php:286 src/Tribe/Tickets.php:
|
| 6816 |
msgctxt "The %s will change based on the error produced."
|
| 6817 |
msgid "You have %s ticket(s) with a field that requires information."
|
| 6818 |
msgstr ""
|
|
@@ -8056,51 +8056,51 @@ msgstr ""
|
|
| 8056 |
msgid "Capacity"
|
| 8057 |
msgstr ""
|
| 8058 |
|
| 8059 |
-
#: src/Tribe/Tickets.php:
|
| 8060 |
msgctxt "delete link"
|
| 8061 |
msgid "Delete %s"
|
| 8062 |
msgstr ""
|
| 8063 |
|
| 8064 |
-
#: src/Tribe/Tickets.php:
|
| 8065 |
msgid "Move %s"
|
| 8066 |
msgstr ""
|
| 8067 |
|
| 8068 |
-
#: src/Tribe/Tickets.php:
|
| 8069 |
msgid "Shared capacity with other tickets"
|
| 8070 |
msgstr ""
|
| 8071 |
|
| 8072 |
-
#: src/Tribe/Tickets.php:
|
| 8073 |
msgid "Set capacity for this ticket only"
|
| 8074 |
msgstr ""
|
| 8075 |
|
| 8076 |
#. translators: %1$s: The singular of "RSVP" or "ticket", %2$s: The plural of
|
| 8077 |
#. "RSVPs" or "tickets", %3$s: The site name.
|
| 8078 |
-
#: src/Tribe/Tickets.php:
|
| 8079 |
msgctxt "The default RSVP/ticket email subject"
|
| 8080 |
msgid "Your %1$s from %3$s"
|
| 8081 |
msgid_plural "Your %2$s from %3$s"
|
| 8082 |
msgstr[0] ""
|
| 8083 |
msgstr[1] ""
|
| 8084 |
|
| 8085 |
-
#: src/Tribe/Tickets.php:
|
| 8086 |
msgid "%s are not available as this %s has passed."
|
| 8087 |
msgstr ""
|
| 8088 |
|
| 8089 |
-
#: src/Tribe/Tickets.php:
|
| 8090 |
msgid "%s will be available on "
|
| 8091 |
msgstr ""
|
| 8092 |
|
| 8093 |
-
#: src/Tribe/Tickets.php:
|
| 8094 |
msgid " at "
|
| 8095 |
msgstr ""
|
| 8096 |
|
| 8097 |
#. translators: %s: Tickets label
|
| 8098 |
-
#: src/Tribe/Tickets.php:
|
| 8099 |
#: src/views/v2/tickets/item/content/inactive.php:53
|
| 8100 |
msgid "%s are not yet available"
|
| 8101 |
msgstr ""
|
| 8102 |
|
| 8103 |
-
#: src/Tribe/Tickets.php:
|
| 8104 |
msgid "(copy)"
|
| 8105 |
msgstr ""
|
| 8106 |
|
|
@@ -8110,7 +8110,7 @@ msgstr ""
|
|
| 8110 |
msgid "Unlimited"
|
| 8111 |
msgstr ""
|
| 8112 |
|
| 8113 |
-
#: src/Tribe/Tickets_Handler.php:
|
| 8114 |
msgid "Invalid ticket capacity data."
|
| 8115 |
msgstr ""
|
| 8116 |
|
| 2 |
# This file is distributed under the same license as the Event Tickets package.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
+
"Project-Id-Version: Event Tickets 5.5.1\n"
|
| 6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/event-tickets\n"
|
| 7 |
+
"POT-Creation-Date: 2022-10-19 18:28:41+00:00\n"
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
| 11 |
+
"PO-Revision-Date: 2022-10-19 18:28\n"
|
| 12 |
"Last-Translator: \n"
|
| 13 |
"Language-Team: \n"
|
| 14 |
|
| 15 |
+
#. #-#-#-#-# event-tickets.pot (Event Tickets 5.5.1) #-#-#-#-#
|
| 16 |
#. Plugin Name of the plugin/theme
|
| 17 |
#: event-tickets.php:61 src/Tribe/Admin/Notices.php:92 src/Tribe/Main.php:690
|
| 18 |
#: src/Tribe/Privacy.php:59 src/admin-views/admin-welcome-message.php:73
|
| 5434 |
msgid "%s will be available on %s at %s"
|
| 5435 |
msgstr ""
|
| 5436 |
|
| 5437 |
+
#: src/Tickets/Commerce/Status/Pending.php:163 src/Tribe/Tickets.php:3195
|
| 5438 |
msgid "%s are no longer available."
|
| 5439 |
msgstr ""
|
| 5440 |
|
| 5441 |
+
#: src/Tickets/Commerce/Status/Pending.php:165 src/Tribe/Tickets.php:3197
|
| 5442 |
msgid "There are no %s available at this time."
|
| 5443 |
msgstr ""
|
| 5444 |
|
| 6791 |
msgid "Are you sure you want to cancel?"
|
| 6792 |
msgstr ""
|
| 6793 |
|
| 6794 |
+
#: src/Tribe/Editor/Blocks/Tickets.php:282 src/Tribe/Tickets.php:4325
|
| 6795 |
msgctxt "Error message title, will be followed by the error code."
|
| 6796 |
msgid "API Error"
|
| 6797 |
msgstr ""
|
| 6798 |
|
| 6799 |
+
#: src/Tribe/Editor/Blocks/Tickets.php:283 src/Tribe/Tickets.php:4326
|
| 6800 |
msgid ""
|
| 6801 |
"Refresh this page or wait a few minutes before trying again. If this happens "
|
| 6802 |
"repeatedly, please contact the Site Admin."
|
| 6803 |
msgstr ""
|
| 6804 |
|
| 6805 |
+
#: src/Tribe/Editor/Blocks/Tickets.php:284 src/Tribe/Tickets.php:4327
|
| 6806 |
msgid ""
|
| 6807 |
"The ticket for this event has sold out and has been removed from your cart."
|
| 6808 |
msgstr ""
|
| 6809 |
|
| 6810 |
+
#: src/Tribe/Editor/Blocks/Tickets.php:285 src/Tribe/Tickets.php:4328
|
| 6811 |
#: src/views/v2/commerce/order/header/title-empty.php:28
|
| 6812 |
msgid "Whoops!"
|
| 6813 |
msgstr ""
|
| 6814 |
|
| 6815 |
+
#: src/Tribe/Editor/Blocks/Tickets.php:286 src/Tribe/Tickets.php:4329
|
| 6816 |
msgctxt "The %s will change based on the error produced."
|
| 6817 |
msgid "You have %s ticket(s) with a field that requires information."
|
| 6818 |
msgstr ""
|
| 8056 |
msgid "Capacity"
|
| 8057 |
msgstr ""
|
| 8058 |
|
| 8059 |
+
#: src/Tribe/Tickets.php:459
|
| 8060 |
msgctxt "delete link"
|
| 8061 |
msgid "Delete %s"
|
| 8062 |
msgstr ""
|
| 8063 |
|
| 8064 |
+
#: src/Tribe/Tickets.php:541
|
| 8065 |
msgid "Move %s"
|
| 8066 |
msgstr ""
|
| 8067 |
|
| 8068 |
+
#: src/Tribe/Tickets.php:1781
|
| 8069 |
msgid "Shared capacity with other tickets"
|
| 8070 |
msgstr ""
|
| 8071 |
|
| 8072 |
+
#: src/Tribe/Tickets.php:1782
|
| 8073 |
msgid "Set capacity for this ticket only"
|
| 8074 |
msgstr ""
|
| 8075 |
|
| 8076 |
#. translators: %1$s: The singular of "RSVP" or "ticket", %2$s: The plural of
|
| 8077 |
#. "RSVPs" or "tickets", %3$s: The site name.
|
| 8078 |
+
#: src/Tribe/Tickets.php:2399
|
| 8079 |
msgctxt "The default RSVP/ticket email subject"
|
| 8080 |
msgid "Your %1$s from %3$s"
|
| 8081 |
msgid_plural "Your %2$s from %3$s"
|
| 8082 |
msgstr[0] ""
|
| 8083 |
msgstr[1] ""
|
| 8084 |
|
| 8085 |
+
#: src/Tribe/Tickets.php:3147
|
| 8086 |
msgid "%s are not available as this %s has passed."
|
| 8087 |
msgstr ""
|
| 8088 |
|
| 8089 |
+
#: src/Tribe/Tickets.php:3183
|
| 8090 |
msgid "%s will be available on "
|
| 8091 |
msgstr ""
|
| 8092 |
|
| 8093 |
+
#: src/Tribe/Tickets.php:3189
|
| 8094 |
msgid " at "
|
| 8095 |
msgstr ""
|
| 8096 |
|
| 8097 |
#. translators: %s: Tickets label
|
| 8098 |
+
#: src/Tribe/Tickets.php:3192 src/views/blocks/tickets/content-inactive.php:19
|
| 8099 |
#: src/views/v2/tickets/item/content/inactive.php:53
|
| 8100 |
msgid "%s are not yet available"
|
| 8101 |
msgstr ""
|
| 8102 |
|
| 8103 |
+
#: src/Tribe/Tickets.php:3644
|
| 8104 |
msgid "(copy)"
|
| 8105 |
msgstr ""
|
| 8106 |
|
| 8110 |
msgid "Unlimited"
|
| 8111 |
msgstr ""
|
| 8112 |
|
| 8113 |
+
#: src/Tribe/Tickets_Handler.php:668
|
| 8114 |
msgid "Invalid ticket capacity data."
|
| 8115 |
msgstr ""
|
| 8116 |
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Contributors: theeventscalendar, brianjessee, camwynsp, aguseo, bordoni, borkweb
|
|
| 4 |
Tags: tickets, registration, event registration, RSVP, ticket sales, attendee management
|
| 5 |
Requires at least: 5.8.5
|
| 6 |
Tested up to: 6.0.3
|
| 7 |
-
Stable tag: 5.5.
|
| 8 |
Requires PHP: 7.3
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
@@ -188,6 +188,18 @@ Check out our extensive [knowledgebase](https://evnt.is/18wm) for articles on us
|
|
| 188 |
|
| 189 |
== Changelog ==
|
| 190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
= [5.5.2] 2022-10-20 =
|
| 192 |
|
| 193 |
* Fix - Update version of Firebase/JWT in Common from 5.x to 6.3.0
|
| 4 |
Tags: tickets, registration, event registration, RSVP, ticket sales, attendee management
|
| 5 |
Requires at least: 5.8.5
|
| 6 |
Tested up to: 6.0.3
|
| 7 |
+
Stable tag: 5.5.3
|
| 8 |
Requires PHP: 7.3
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 188 |
|
| 189 |
== Changelog ==
|
| 190 |
|
| 191 |
+
= [5.5.3] 2022-10-31 =
|
| 192 |
+
|
| 193 |
+
* Fix - Orderby param not working for Attendee archive REST API. [ET-1591]
|
| 194 |
+
* Fix - Properly save the check-in details for attendees on check-in. [ETP-819]
|
| 195 |
+
* Fix - TicketsCommerce ticketed events not showing up for Events REST API. [ET-1567]
|
| 196 |
+
* Fix - Update version of Firebase/JWT in Common from 5.x to 6.3.0
|
| 197 |
+
* Enhancement - Added support for `name` and `email` param for searching in Attendee archive REST API. [ET-1591]
|
| 198 |
+
* Enhancement - Add template tag to properly check if The Events Calendar is active. [ETP-820]
|
| 199 |
+
* Enhancement - Add `attendance` information to the `events` REST API endpoint. [ET-1580]
|
| 200 |
+
* Enhancement - Add `check_in` argument support for `attendees` REST API endpoint. [ET-1588]
|
| 201 |
+
* Language - 0 new strings added, 18 updated, 0 fuzzied, and 0 obsoleted
|
| 202 |
+
|
| 203 |
= [5.5.2] 2022-10-20 =
|
| 204 |
|
| 205 |
* Fix - Update version of Firebase/JWT in Common from 5.x to 6.3.0
|
src/Tickets/Commerce/Module.php
CHANGED
|
@@ -762,6 +762,16 @@ class Module extends \Tribe__Tickets__Tickets {
|
|
| 762 |
$attendee->set( 'email', $attendee_data['email'] );
|
| 763 |
}
|
| 764 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 765 |
$attendee->save();
|
| 766 |
|
| 767 |
// Send attendee email.
|
| 762 |
$attendee->set( 'email', $attendee_data['email'] );
|
| 763 |
}
|
| 764 |
|
| 765 |
+
if ( isset( $attendee_data['check_in'] ) ) {
|
| 766 |
+
$attendee->set( 'checked_in', $attendee_data['check_in'] );
|
| 767 |
+
|
| 768 |
+
if ( $attendee_data['check_in'] ) {
|
| 769 |
+
parent::checkin( $attendee_id );
|
| 770 |
+
} else {
|
| 771 |
+
parent::uncheckin( $attendee_id );
|
| 772 |
+
}
|
| 773 |
+
}
|
| 774 |
+
|
| 775 |
$attendee->save();
|
| 776 |
|
| 777 |
// Send attendee email.
|
src/Tribe/Attendee_Repository.php
CHANGED
|
@@ -131,6 +131,7 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
|
|
| 131 |
'price_currency' => '_tribe_tickets_price_currency_symbol',
|
| 132 |
'full_name' => '_tribe_tickets_full_name',
|
| 133 |
'email' => '_tribe_tickets_email',
|
|
|
|
| 134 |
]
|
| 135 |
);
|
| 136 |
|
|
@@ -901,6 +902,7 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
|
|
| 901 |
'attendee_status' => null,
|
| 902 |
'price_paid' => null,
|
| 903 |
'optout' => null,
|
|
|
|
| 904 |
];
|
| 905 |
|
| 906 |
$args = array_merge( $args, $attendee_data );
|
|
@@ -970,6 +972,11 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
|
|
| 970 |
// Enforce a 0/1 value for the optout value.
|
| 971 |
$args['optout'] = (int) tribe_is_truthy( $args['optout'] );
|
| 972 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 973 |
}
|
| 974 |
|
| 975 |
// Handle any customizations per provider for the attendee arguments.
|
|
@@ -1190,12 +1197,36 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
|
|
| 1190 |
// Maybe send the attendee email.
|
| 1191 |
$this->maybe_send_attendee_email( $attendee_data['attendee_id'], $attendee_data );
|
| 1192 |
|
|
|
|
|
|
|
| 1193 |
// Clear the attendee cache if post_id is provided.
|
| 1194 |
if ( ! empty( $this->updates['post_id'] ) && $this->attendee_provider ) {
|
| 1195 |
$this->attendee_provider->clear_attendees_cache( $this->updates['post_id'] );
|
| 1196 |
}
|
| 1197 |
}
|
| 1198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1199 |
/**
|
| 1200 |
* Create an order for an attendee.
|
| 1201 |
*
|
|
@@ -1354,6 +1385,9 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
|
|
| 1354 |
$override = $loop === 0;
|
| 1355 |
|
| 1356 |
switch ( $order_by ) {
|
|
|
|
|
|
|
|
|
|
| 1357 |
case 'security_code':
|
| 1358 |
$this->order_by_security_code( $order, $after, $override );
|
| 1359 |
break;
|
|
@@ -1396,6 +1430,45 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
|
|
| 1396 |
}
|
| 1397 |
}
|
| 1398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1399 |
/**
|
| 1400 |
* Sets up the query filters to order attendees by the security code meta.
|
| 1401 |
*
|
| 131 |
'price_currency' => '_tribe_tickets_price_currency_symbol',
|
| 132 |
'full_name' => '_tribe_tickets_full_name',
|
| 133 |
'email' => '_tribe_tickets_email',
|
| 134 |
+
'check_in' => current( $this->checked_in_keys() ),
|
| 135 |
]
|
| 136 |
);
|
| 137 |
|
| 902 |
'attendee_status' => null,
|
| 903 |
'price_paid' => null,
|
| 904 |
'optout' => null,
|
| 905 |
+
'check_in' => null,
|
| 906 |
];
|
| 907 |
|
| 908 |
$args = array_merge( $args, $attendee_data );
|
| 972 |
// Enforce a 0/1 value for the optout value.
|
| 973 |
$args['optout'] = (int) tribe_is_truthy( $args['optout'] );
|
| 974 |
}
|
| 975 |
+
|
| 976 |
+
if ( isset( $args['check_in'] ) ) {
|
| 977 |
+
// Enforce a 0/1 value for the check_in value.
|
| 978 |
+
$args['check_in'] = (int) tribe_is_truthy( $args['check_in'] );
|
| 979 |
+
}
|
| 980 |
}
|
| 981 |
|
| 982 |
// Handle any customizations per provider for the attendee arguments.
|
| 1197 |
// Maybe send the attendee email.
|
| 1198 |
$this->maybe_send_attendee_email( $attendee_data['attendee_id'], $attendee_data );
|
| 1199 |
|
| 1200 |
+
$this->maybe_handle_checkin( $attendee_data['attendee_id'], $attendee_data );
|
| 1201 |
+
|
| 1202 |
// Clear the attendee cache if post_id is provided.
|
| 1203 |
if ( ! empty( $this->updates['post_id'] ) && $this->attendee_provider ) {
|
| 1204 |
$this->attendee_provider->clear_attendees_cache( $this->updates['post_id'] );
|
| 1205 |
}
|
| 1206 |
}
|
| 1207 |
|
| 1208 |
+
|
| 1209 |
+
/**
|
| 1210 |
+
* Handle check in actions.
|
| 1211 |
+
*
|
| 1212 |
+
* @since TBD
|
| 1213 |
+
*
|
| 1214 |
+
* @param int $attendee_id The attendee ID.
|
| 1215 |
+
* @param array $attendee_data List of attendee data that was used for saving.
|
| 1216 |
+
* @return void
|
| 1217 |
+
*/
|
| 1218 |
+
public function maybe_handle_checkin( $attendee_id, $attendee_data ): void {
|
| 1219 |
+
if ( ! isset( $attendee_data['check_in'] ) ) {
|
| 1220 |
+
return;
|
| 1221 |
+
}
|
| 1222 |
+
|
| 1223 |
+
if ( $attendee_data['check_in'] ) {
|
| 1224 |
+
$this->attendee_provider->checkin( $attendee_id );
|
| 1225 |
+
} else {
|
| 1226 |
+
$this->attendee_provider->uncheckin( $attendee_id );
|
| 1227 |
+
}
|
| 1228 |
+
}
|
| 1229 |
+
|
| 1230 |
/**
|
| 1231 |
* Create an order for an attendee.
|
| 1232 |
*
|
| 1385 |
$override = $loop === 0;
|
| 1386 |
|
| 1387 |
switch ( $order_by ) {
|
| 1388 |
+
case 'full_name':
|
| 1389 |
+
$this->order_by_full_name( $order, $after, $override );
|
| 1390 |
+
break;
|
| 1391 |
case 'security_code':
|
| 1392 |
$this->order_by_security_code( $order, $after, $override );
|
| 1393 |
break;
|
| 1430 |
}
|
| 1431 |
}
|
| 1432 |
|
| 1433 |
+
/**
|
| 1434 |
+
* Sets up the query filters to order attendees by the full name meta.
|
| 1435 |
+
*
|
| 1436 |
+
* @since 5.5.2
|
| 1437 |
+
*
|
| 1438 |
+
* @param string $order The order direction, either `ASC` or `DESC`; defaults to `null` to use the order
|
| 1439 |
+
* specified in the current query or default arguments.
|
| 1440 |
+
* @param bool $after Whether to append the duration ORDER BY clause to the existing clauses or not;
|
| 1441 |
+
* defaults to `false` to prepend the duration clause to the existing ORDER BY
|
| 1442 |
+
* clauses.
|
| 1443 |
+
* @param bool $override Whether to override existing ORDER BY clauses with this one or not; default to
|
| 1444 |
+
* `true` to override existing ORDER BY clauses.
|
| 1445 |
+
*/
|
| 1446 |
+
protected function order_by_full_name( $order = null, $after = false, $override = true ) {
|
| 1447 |
+
global $wpdb;
|
| 1448 |
+
|
| 1449 |
+
$meta_alias = 'full_name';
|
| 1450 |
+
$meta_keys_in = $this->prepare_interval( $this->holder_name_keys() );
|
| 1451 |
+
$postmeta_table = "orderby_{$meta_alias}_meta";
|
| 1452 |
+
$filter_id = 'order_by_full_name';
|
| 1453 |
+
|
| 1454 |
+
$this->filter_query->join(
|
| 1455 |
+
"
|
| 1456 |
+
LEFT JOIN {$wpdb->postmeta} AS {$postmeta_table}
|
| 1457 |
+
ON (
|
| 1458 |
+
{$postmeta_table}.post_id = {$wpdb->posts}.ID
|
| 1459 |
+
AND {$postmeta_table}.meta_key IN {$meta_keys_in}
|
| 1460 |
+
)
|
| 1461 |
+
",
|
| 1462 |
+
$filter_id,
|
| 1463 |
+
true
|
| 1464 |
+
);
|
| 1465 |
+
|
| 1466 |
+
$order = $this->get_query_order_type( $order );
|
| 1467 |
+
|
| 1468 |
+
$this->filter_query->orderby( [ $meta_alias => $order ], $filter_id, true, $after );
|
| 1469 |
+
$this->filter_query->fields( "{$postmeta_table}.meta_value AS {$meta_alias}", $filter_id, $override );
|
| 1470 |
+
}
|
| 1471 |
+
|
| 1472 |
/**
|
| 1473 |
* Sets up the query filters to order attendees by the security code meta.
|
| 1474 |
*
|
src/Tribe/Main.php
CHANGED
|
@@ -8,7 +8,7 @@ class Tribe__Tickets__Main {
|
|
| 8 |
/**
|
| 9 |
* Current version of this plugin
|
| 10 |
*/
|
| 11 |
-
const VERSION = '5.5.
|
| 12 |
|
| 13 |
/**
|
| 14 |
* Used to store the version history.
|
|
@@ -43,7 +43,7 @@ class Tribe__Tickets__Main {
|
|
| 43 |
*
|
| 44 |
* @since 4.10
|
| 45 |
*/
|
| 46 |
-
protected $min_tec_version = '6.0.
|
| 47 |
|
| 48 |
/**
|
| 49 |
* Name of the provider
|
| 8 |
/**
|
| 9 |
* Current version of this plugin
|
| 10 |
*/
|
| 11 |
+
const VERSION = '5.5.3';
|
| 12 |
|
| 13 |
/**
|
| 14 |
* Used to store the version history.
|
| 43 |
*
|
| 44 |
* @since 4.10
|
| 45 |
*/
|
| 46 |
+
protected $min_tec_version = '6.0.3-dev';
|
| 47 |
|
| 48 |
/**
|
| 49 |
* Name of the provider
|
src/Tribe/Plugin_Register.php
CHANGED
|
@@ -9,7 +9,7 @@ class Tribe__Tickets__Plugin_Register extends Tribe__Abstract_Plugin_Register {
|
|
| 9 |
|
| 10 |
protected $dependencies = [
|
| 11 |
'addon-dependencies' => [
|
| 12 |
-
'Tribe__Tickets_Plus__Main' => '5.6.
|
| 13 |
'Tribe__Events__Community__Tickets__Main' => '4.8.0-dev',
|
| 14 |
],
|
| 15 |
];
|
| 9 |
|
| 10 |
protected $dependencies = [
|
| 11 |
'addon-dependencies' => [
|
| 12 |
+
'Tribe__Tickets_Plus__Main' => '5.6.2-dev',
|
| 13 |
'Tribe__Events__Community__Tickets__Main' => '4.8.0-dev',
|
| 14 |
],
|
| 15 |
];
|
src/Tribe/REST/V1/Attendee_Repository.php
CHANGED
|
@@ -86,7 +86,7 @@ class Tribe__Tickets__REST__V1__Attendee_Repository
|
|
| 86 |
'relevance' => 'relevance',
|
| 87 |
'id' => 'id',
|
| 88 |
'include' => 'meta_value_num',
|
| 89 |
-
'title' => '
|
| 90 |
'slug' => 'name',
|
| 91 |
);
|
| 92 |
|
| 86 |
'relevance' => 'relevance',
|
| 87 |
'id' => 'id',
|
| 88 |
'include' => 'meta_value_num',
|
| 89 |
+
'title' => 'full_name',
|
| 90 |
'slug' => 'name',
|
| 91 |
);
|
| 92 |
|
src/Tribe/REST/V1/Endpoints/Attendee_Archive.php
CHANGED
|
@@ -105,7 +105,7 @@ class Tribe__Tickets__REST__V1__Endpoints__Attendee_Archive
|
|
| 105 |
'before' => 'before_date',
|
| 106 |
'include' => 'post__in',
|
| 107 |
'exclude' => 'post__not_in',
|
| 108 |
-
'
|
| 109 |
'post_status' => 'event_status',
|
| 110 |
'status' => 'post_status',
|
| 111 |
'order_status' => 'order_status',
|
|
@@ -138,24 +138,28 @@ class Tribe__Tickets__REST__V1__Endpoints__Attendee_Archive
|
|
| 138 |
->by_args( $fetch_args )
|
| 139 |
->permission( $permission );
|
| 140 |
|
| 141 |
-
if ( $request['order'] ) {
|
| 142 |
-
$query->order( $request['order'] );
|
| 143 |
-
}
|
| 144 |
-
|
| 145 |
if ( $request['orderby'] ) {
|
| 146 |
$query->order_by( $request['orderby'] );
|
| 147 |
}
|
| 148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
if ( $request['offset'] ) {
|
| 150 |
$query->offset( $request['offset'] );
|
| 151 |
}
|
| 152 |
|
|
|
|
|
|
|
| 153 |
$query_args = array_intersect_key( $query_args, $this->READ_args() );
|
| 154 |
$found = $query->found();
|
| 155 |
|
|
|
|
|
|
|
| 156 |
if ( 0 === $found && 1 === $page ) {
|
| 157 |
$attendees = [];
|
| 158 |
-
} elseif ( 1 !== $page && $page
|
| 159 |
return new WP_Error( 'invalid-page-number', $this->messages->get_message( 'invalid-page-number' ), [ 'status' => 400 ] );
|
| 160 |
} else {
|
| 161 |
$attendees = $query
|
|
@@ -176,7 +180,7 @@ class Tribe__Tickets__REST__V1__Endpoints__Attendee_Archive
|
|
| 176 |
|
| 177 |
$data['rest_url'] = add_query_arg( $query_args, $main->get_url( '/attendees/' ) );
|
| 178 |
$data['total'] = $found;
|
| 179 |
-
$data['total_pages'] =
|
| 180 |
$data['attendees'] = $attendees;
|
| 181 |
|
| 182 |
$headers = [
|
|
@@ -187,6 +191,32 @@ class Tribe__Tickets__REST__V1__Endpoints__Attendee_Archive
|
|
| 187 |
return new WP_REST_Response( $data, 200, $headers );
|
| 188 |
}
|
| 189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
/**
|
| 191 |
* Returns the content of the `args` array that should be used to register the endpoint
|
| 192 |
* with the `register_rest_route` function.
|
|
@@ -424,6 +454,16 @@ class Tribe__Tickets__REST__V1__Endpoints__Attendee_Archive
|
|
| 424 |
'required' => false,
|
| 425 |
'type' => 'boolean',
|
| 426 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
);
|
| 428 |
}
|
| 429 |
}
|
| 105 |
'before' => 'before_date',
|
| 106 |
'include' => 'post__in',
|
| 107 |
'exclude' => 'post__not_in',
|
| 108 |
+
'order_id' => 'order',
|
| 109 |
'post_status' => 'event_status',
|
| 110 |
'status' => 'post_status',
|
| 111 |
'order_status' => 'order_status',
|
| 138 |
->by_args( $fetch_args )
|
| 139 |
->permission( $permission );
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
if ( $request['orderby'] ) {
|
| 142 |
$query->order_by( $request['orderby'] );
|
| 143 |
}
|
| 144 |
|
| 145 |
+
if ( $request['order'] ) {
|
| 146 |
+
$query->order( $request['order'] );
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
if ( $request['offset'] ) {
|
| 150 |
$query->offset( $request['offset'] );
|
| 151 |
}
|
| 152 |
|
| 153 |
+
$query = $this->process_search( $query_args, $query );
|
| 154 |
+
|
| 155 |
$query_args = array_intersect_key( $query_args, $this->READ_args() );
|
| 156 |
$found = $query->found();
|
| 157 |
|
| 158 |
+
$total_pages = (int) ceil( $found / $per_page );
|
| 159 |
+
|
| 160 |
if ( 0 === $found && 1 === $page ) {
|
| 161 |
$attendees = [];
|
| 162 |
+
} elseif ( 1 !== $page && $page > $total_pages ) {
|
| 163 |
return new WP_Error( 'invalid-page-number', $this->messages->get_message( 'invalid-page-number' ), [ 'status' => 400 ] );
|
| 164 |
} else {
|
| 165 |
$attendees = $query
|
| 180 |
|
| 181 |
$data['rest_url'] = add_query_arg( $query_args, $main->get_url( '/attendees/' ) );
|
| 182 |
$data['total'] = $found;
|
| 183 |
+
$data['total_pages'] = $total_pages;
|
| 184 |
$data['attendees'] = $attendees;
|
| 185 |
|
| 186 |
$headers = [
|
| 191 |
return new WP_REST_Response( $data, 200, $headers );
|
| 192 |
}
|
| 193 |
|
| 194 |
+
/**
|
| 195 |
+
* Process the search terms for attendees.
|
| 196 |
+
*
|
| 197 |
+
* @since 5.5.2
|
| 198 |
+
*
|
| 199 |
+
* @param array $request_args Array of request args.
|
| 200 |
+
* @param Tribe__Tickets__REST__V1__Attendee_Repository $query The query object.
|
| 201 |
+
*
|
| 202 |
+
* @return Tribe__Tickets__REST__V1__Attendee_Repository $query The query object.
|
| 203 |
+
*/
|
| 204 |
+
protected function process_search( array $request_args, Tribe__Tickets__REST__V1__Attendee_Repository $query ) {
|
| 205 |
+
|
| 206 |
+
$search_keys = [
|
| 207 |
+
'name' => 'holder_name__like',
|
| 208 |
+
'email' => 'holder_email__like',
|
| 209 |
+
];
|
| 210 |
+
|
| 211 |
+
foreach ( $search_keys as $key => $search_term ) {
|
| 212 |
+
if ( isset( $request_args[ $key ] ) ) {
|
| 213 |
+
$query->by( $search_term, '%' . sanitize_text_field( $request_args[ $key ] ) . '%' );
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
return $query;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
/**
|
| 221 |
* Returns the content of the `args` array that should be used to register the endpoint
|
| 222 |
* with the `register_rest_route` function.
|
| 454 |
'required' => false,
|
| 455 |
'type' => 'boolean',
|
| 456 |
),
|
| 457 |
+
'name' => array(
|
| 458 |
+
'description' => __( 'Limit results to attendees by name. It will search for names that are like the specified value', 'event-tickets' ),
|
| 459 |
+
'required' => false,
|
| 460 |
+
'type' => 'string',
|
| 461 |
+
),
|
| 462 |
+
'email' => array(
|
| 463 |
+
'description' => __( 'Limit results to attendees by email. It will search for emails that are like the specified value', 'event-tickets' ),
|
| 464 |
+
'required' => false,
|
| 465 |
+
'type' => 'string',
|
| 466 |
+
),
|
| 467 |
);
|
| 468 |
}
|
| 469 |
}
|
src/Tribe/REST/V1/Endpoints/Single_Attendee.php
CHANGED
|
@@ -116,7 +116,7 @@ class Tribe__Tickets__REST__V1__Endpoints__Single_Attendee
|
|
| 116 |
return new WP_Error( 'attendee-creation-failed', __( 'Something went wrong! Attendee creation failed.', 'event-tickets' ) );
|
| 117 |
}
|
| 118 |
|
| 119 |
-
$attendee =
|
| 120 |
$response = new WP_REST_Response( $attendee );
|
| 121 |
$response->set_status( 201 );
|
| 122 |
|
|
@@ -155,6 +155,11 @@ class Tribe__Tickets__REST__V1__Endpoints__Single_Attendee
|
|
| 155 |
'type' => 'string',
|
| 156 |
'description' => __( 'Order Status for the attendee.', 'event-tickets' ),
|
| 157 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
];
|
| 160 |
|
|
@@ -193,7 +198,7 @@ class Tribe__Tickets__REST__V1__Endpoints__Single_Attendee
|
|
| 193 |
return new WP_Error( 'attendee-update-failed', __( 'Something went wrong! Attendee update failed.', 'event-tickets' ) );
|
| 194 |
}
|
| 195 |
|
| 196 |
-
$attendee =
|
| 197 |
$response = new WP_REST_Response( $attendee );
|
| 198 |
$response->set_status( 201 );
|
| 199 |
|
|
@@ -216,6 +221,11 @@ class Tribe__Tickets__REST__V1__Endpoints__Single_Attendee
|
|
| 216 |
'description' => __( 'The attendee post ID', 'event-tickets' ),
|
| 217 |
'required' => true,
|
| 218 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
];
|
| 220 |
|
| 221 |
/**
|
| 116 |
return new WP_Error( 'attendee-creation-failed', __( 'Something went wrong! Attendee creation failed.', 'event-tickets' ) );
|
| 117 |
}
|
| 118 |
|
| 119 |
+
$attendee = tribe_attendees( 'restv1' )->by_primary_key( $attendee_object->ID );
|
| 120 |
$response = new WP_REST_Response( $attendee );
|
| 121 |
$response->set_status( 201 );
|
| 122 |
|
| 155 |
'type' => 'string',
|
| 156 |
'description' => __( 'Order Status for the attendee.', 'event-tickets' ),
|
| 157 |
],
|
| 158 |
+
'check_in' => [
|
| 159 |
+
'required' => false,
|
| 160 |
+
'type' => 'bool',
|
| 161 |
+
'description' => __( 'Check in value for the attendee.', 'event-tickets' ),
|
| 162 |
+
],
|
| 163 |
|
| 164 |
];
|
| 165 |
|
| 198 |
return new WP_Error( 'attendee-update-failed', __( 'Something went wrong! Attendee update failed.', 'event-tickets' ) );
|
| 199 |
}
|
| 200 |
|
| 201 |
+
$attendee = tribe_attendees( 'restv1' )->by_primary_key( $post_data['attendee_id'] );
|
| 202 |
$response = new WP_REST_Response( $attendee );
|
| 203 |
$response->set_status( 201 );
|
| 204 |
|
| 221 |
'description' => __( 'The attendee post ID', 'event-tickets' ),
|
| 222 |
'required' => true,
|
| 223 |
],
|
| 224 |
+
'check_in' => [
|
| 225 |
+
'required' => false,
|
| 226 |
+
'type' => 'bool',
|
| 227 |
+
'description' => __( 'Check in value for the attendee.', 'event-tickets' ),
|
| 228 |
+
],
|
| 229 |
];
|
| 230 |
|
| 231 |
/**
|
src/Tribe/REST/V1/Endpoints/Ticket_Archive.php
CHANGED
|
@@ -192,9 +192,11 @@ class Tribe__Tickets__REST__V1__Endpoints__Ticket_Archive
|
|
| 192 |
|
| 193 |
$found = $query->found();
|
| 194 |
|
|
|
|
|
|
|
| 195 |
if ( 0 === $found && 1 === $page ) {
|
| 196 |
$tickets = array();
|
| 197 |
-
} elseif ( 1 !== $page && $
|
| 198 |
return new WP_Error( 'invalid-page-number', $this->messages->get_message( 'invalid-page-number' ), array( 'status' => 400 ) );
|
| 199 |
} else {
|
| 200 |
$tickets = $query
|
|
@@ -216,7 +218,7 @@ class Tribe__Tickets__REST__V1__Endpoints__Ticket_Archive
|
|
| 216 |
|
| 217 |
$data['rest_url'] = add_query_arg( $query_args, $main->get_url( '/tickets/' ) );
|
| 218 |
$data['total'] = $found;
|
| 219 |
-
$data['total_pages'] =
|
| 220 |
$data['tickets'] = $tickets;
|
| 221 |
|
| 222 |
$headers = array(
|
| 192 |
|
| 193 |
$found = $query->found();
|
| 194 |
|
| 195 |
+
$total_pages = (int) ceil( $found / $per_page );
|
| 196 |
+
|
| 197 |
if ( 0 === $found && 1 === $page ) {
|
| 198 |
$tickets = array();
|
| 199 |
+
} elseif ( 1 !== $page && $per_page > $total_pages ) {
|
| 200 |
return new WP_Error( 'invalid-page-number', $this->messages->get_message( 'invalid-page-number' ), array( 'status' => 400 ) );
|
| 201 |
} else {
|
| 202 |
$tickets = $query
|
| 218 |
|
| 219 |
$data['rest_url'] = add_query_arg( $query_args, $main->get_url( '/tickets/' ) );
|
| 220 |
$data['total'] = $found;
|
| 221 |
+
$data['total_pages'] = $total_pages;
|
| 222 |
$data['tickets'] = $tickets;
|
| 223 |
|
| 224 |
$headers = array(
|
src/Tribe/REST/V1/Main.php
CHANGED
|
@@ -13,7 +13,7 @@ class Tribe__Tickets__REST__V1__Main extends Tribe__REST__Main {
|
|
| 13 |
/**
|
| 14 |
* Event Tickets REST API URL prefix.
|
| 15 |
*
|
| 16 |
-
* This
|
| 17 |
*
|
| 18 |
* @var string
|
| 19 |
*/
|
|
@@ -41,7 +41,75 @@ class Tribe__Tickets__REST__V1__Main extends Tribe__REST__Main {
|
|
| 41 |
}
|
| 42 |
|
| 43 |
// Add support for `ticketed` param on tribe_events filter on REST API.
|
| 44 |
-
add_filter( 'tribe_events_archive_get_args', [ $this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
/**
|
| 13 |
/**
|
| 14 |
* Event Tickets REST API URL prefix.
|
| 15 |
*
|
| 16 |
+
* This prefix is appended to the `The Events Calendar` REST API URL ones.
|
| 17 |
*
|
| 18 |
* @var string
|
| 19 |
*/
|
| 41 |
}
|
| 42 |
|
| 43 |
// Add support for `ticketed` param on tribe_events filter on REST API.
|
| 44 |
+
add_filter( 'tribe_events_archive_get_args', [ $this, 'parse_events_rest_args' ], 10, 3 );
|
| 45 |
+
|
| 46 |
+
add_filter( 'tribe_rest_event_data', [ $this, 'rest_event_data_add_attendance' ], 10, 2 );
|
| 47 |
+
add_filter( 'tribe_rest_events_archive_data', [ $this, 'rest_events_archive_add_attendance' ], 10, 2 );
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* Filters the data that will be returned for the events endpoint, adding attendance.
|
| 52 |
+
*
|
| 53 |
+
* @since 5.5.2
|
| 54 |
+
*
|
| 55 |
+
* @param array $data The retrieved data.
|
| 56 |
+
* @param WP_REST_Request $request The original request.
|
| 57 |
+
*
|
| 58 |
+
* @return array $data The retrieved data, updated with attendance if the request has access.
|
| 59 |
+
*/
|
| 60 |
+
public function rest_events_archive_add_attendance( $data, $request ) : array {
|
| 61 |
+
|
| 62 |
+
if ( ! $this->request_has_manage_access() ) {
|
| 63 |
+
return $data;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
if ( empty( $data['events'] ) ) {
|
| 67 |
+
return $data;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
foreach ( $data['events'] as $event ) {
|
| 71 |
+
$event_id = is_array( $event ) ? $event['id'] : $event->id;
|
| 72 |
+
$attendee_count = Tribe__Tickets__Tickets::get_event_attendees_count( $event_id );
|
| 73 |
+
$checked_in = Tribe__Tickets__Tickets::get_event_checkedin_attendees_count( $event_id );
|
| 74 |
+
|
| 75 |
+
$event['attendance'] = [
|
| 76 |
+
'total_attendees' => $attendee_count,
|
| 77 |
+
'checked_in' => $checked_in,
|
| 78 |
+
'not_checked_in' => $attendee_count - $checked_in,
|
| 79 |
+
];
|
| 80 |
+
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
return $data;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* Filters the data that will be returned for a single event, adding attendance.
|
| 88 |
+
*
|
| 89 |
+
* @since 5.5.2
|
| 90 |
+
*
|
| 91 |
+
* @param array $data The data that will be returned in the response.
|
| 92 |
+
* @param WP_Post $event The requested event.
|
| 93 |
+
*
|
| 94 |
+
* @return array $data The retrieved data, updated with attendance if the request has access.
|
| 95 |
+
*/
|
| 96 |
+
public function rest_event_data_add_attendance( $data, $event ) : array {
|
| 97 |
+
|
| 98 |
+
if ( ! $this->request_has_manage_access() ) {
|
| 99 |
+
return $data;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
$post_id = $event->ID;
|
| 103 |
+
$attendee_count = Tribe__Tickets__Tickets::get_event_attendees_count( $post_id );
|
| 104 |
+
$checked_in = Tribe__Tickets__Tickets::get_event_checkedin_attendees_count( $post_id );
|
| 105 |
+
|
| 106 |
+
$data['attendance'] = [
|
| 107 |
+
'total_attendees' => $attendee_count,
|
| 108 |
+
'checked_in' => $checked_in,
|
| 109 |
+
'not_checked_in' => $attendee_count - $checked_in,
|
| 110 |
+
];
|
| 111 |
+
|
| 112 |
+
return $data;
|
| 113 |
}
|
| 114 |
|
| 115 |
/**
|
src/Tribe/REST/V1/Post_Repository.php
CHANGED
|
@@ -991,14 +991,17 @@ class Tribe__Tickets__REST__V1__Post_Repository
|
|
| 991 |
/** @var Tribe__Tickets__Commerce__Currency $currency */
|
| 992 |
$currency = tribe( 'tickets.commerce.currency' );
|
| 993 |
$ticket_object = $this->get_ticket_object( $attendee['product_id'] );
|
| 994 |
-
|
| 995 |
-
$
|
| 996 |
-
|
| 997 |
-
'
|
| 998 |
-
|
| 999 |
-
|
| 1000 |
-
|
| 1001 |
-
|
|
|
|
|
|
|
|
|
|
| 1002 |
}
|
| 1003 |
}
|
| 1004 |
}
|
| 991 |
/** @var Tribe__Tickets__Commerce__Currency $currency */
|
| 992 |
$currency = tribe( 'tickets.commerce.currency' );
|
| 993 |
$ticket_object = $this->get_ticket_object( $attendee['product_id'] );
|
| 994 |
+
|
| 995 |
+
if ( ! is_wp_error( $ticket_object ) ) {
|
| 996 |
+
$purchase_time = Tribe__Utils__Array::get( $order_data, 'purchase_time', get_post_time( Tribe__Date_Utils::DBDATETIMEFORMAT, false, $attendee_id ) );
|
| 997 |
+
$attendee_data['payment'] = array(
|
| 998 |
+
'provider' => Tribe__Utils__Array::get( $order_data, 'provider_slug', $this->get_provider_slug( $provider ) ),
|
| 999 |
+
'price' => ! empty( $ticket_object->price ) ? $ticket_object->price : '',
|
| 1000 |
+
'currency' => html_entity_decode( $currency->get_currency_symbol( $attendee['product_id'] ) ),
|
| 1001 |
+
'date' => $purchase_time,
|
| 1002 |
+
'date_details' => $this->get_date_details( $purchase_time ),
|
| 1003 |
+
);
|
| 1004 |
+
}
|
| 1005 |
}
|
| 1006 |
}
|
| 1007 |
}
|
src/Tribe/RSVP.php
CHANGED
|
@@ -2171,11 +2171,11 @@ class Tribe__Tickets__RSVP extends Tribe__Tickets__Tickets {
|
|
| 2171 |
update_post_meta( $attendee_id, '_tribe_qr_status', 1 );
|
| 2172 |
}
|
| 2173 |
|
| 2174 |
-
$checkin_details =
|
| 2175 |
'date' => current_time( 'mysql' ),
|
| 2176 |
-
'source' =>
|
| 2177 |
'author' => get_current_user_id(),
|
| 2178 |
-
|
| 2179 |
|
| 2180 |
/**
|
| 2181 |
* Filters the checkin details for this attendee checkin.
|
|
@@ -2216,6 +2216,7 @@ class Tribe__Tickets__RSVP extends Tribe__Tickets__Tickets {
|
|
| 2216 |
}
|
| 2217 |
|
| 2218 |
delete_post_meta( $attendee_id, $this->checkin_key );
|
|
|
|
| 2219 |
delete_post_meta( $attendee_id, '_tribe_qr_status' );
|
| 2220 |
do_action( 'rsvp_uncheckin', $attendee_id );
|
| 2221 |
|
| 2171 |
update_post_meta( $attendee_id, '_tribe_qr_status', 1 );
|
| 2172 |
}
|
| 2173 |
|
| 2174 |
+
$checkin_details = [
|
| 2175 |
'date' => current_time( 'mysql' ),
|
| 2176 |
+
'source' => ! empty( $qr ) ? 'app' : 'site',
|
| 2177 |
'author' => get_current_user_id(),
|
| 2178 |
+
];
|
| 2179 |
|
| 2180 |
/**
|
| 2181 |
* Filters the checkin details for this attendee checkin.
|
| 2216 |
}
|
| 2217 |
|
| 2218 |
delete_post_meta( $attendee_id, $this->checkin_key );
|
| 2219 |
+
delete_post_meta( $attendee_id, $this->checkin_key . '_details' );
|
| 2220 |
delete_post_meta( $attendee_id, '_tribe_qr_status' );
|
| 2221 |
do_action( 'rsvp_uncheckin', $attendee_id );
|
| 2222 |
|
src/Tribe/Repositories/Post_Repository.php
CHANGED
|
@@ -60,6 +60,7 @@ class Post_Repository extends Tribe__Repository {
|
|
| 60 |
'cost_currency_symbol' => [ $this, 'filter_by_cost_currency_symbol' ],
|
| 61 |
'has_tickets' => [ $this, 'filter_by_has_tickets' ],
|
| 62 |
'has_rsvp' => [ $this, 'filter_by_has_rsvp' ],
|
|
|
|
| 63 |
|
| 64 |
// These filter methods are added by the Post_Attendees trait.
|
| 65 |
'has_attendees' => [ $this, 'filter_by_has_attendees' ],
|
| 60 |
'cost_currency_symbol' => [ $this, 'filter_by_cost_currency_symbol' ],
|
| 61 |
'has_tickets' => [ $this, 'filter_by_has_tickets' ],
|
| 62 |
'has_rsvp' => [ $this, 'filter_by_has_rsvp' ],
|
| 63 |
+
'has_rsvp_or_tickets' => [ $this, 'filter_by_has_rsvp_or_tickets' ],
|
| 64 |
|
| 65 |
// These filter methods are added by the Post_Attendees trait.
|
| 66 |
'has_attendees' => [ $this, 'filter_by_has_attendees' ],
|
src/Tribe/Repositories/Traits/Post_Tickets.php
CHANGED
|
@@ -13,6 +13,7 @@ use Tribe__Repository;
|
|
| 13 |
use Tribe__Repository__Usage_Error;
|
| 14 |
use Tribe__Repository__Void_Query_Exception;
|
| 15 |
use Tribe__Utils__Array;
|
|
|
|
| 16 |
|
| 17 |
/**
|
| 18 |
* Class Post_Tickets
|
|
@@ -79,6 +80,7 @@ trait Post_Tickets {
|
|
| 79 |
|
| 80 |
$operator_name = Tribe__Utils__Array::get( Tribe__Repository::get_comparison_operators(), $operator, '' );
|
| 81 |
$prefix = str_replace( '-', '_', 'by_cost_' . $operator_name );
|
|
|
|
| 82 |
|
| 83 |
global $wpdb;
|
| 84 |
|
|
@@ -86,7 +88,11 @@ trait Post_Tickets {
|
|
| 86 |
$repo->join_clause( "JOIN {$wpdb->postmeta} {$prefix}_ticket_event
|
| 87 |
ON (
|
| 88 |
{$prefix}_ticket_event.meta_value = {$wpdb->posts}.ID
|
| 89 |
-
AND
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
)" );
|
| 91 |
|
| 92 |
$price_regexp_frags = [
|
|
@@ -279,11 +285,17 @@ trait Post_Tickets {
|
|
| 279 |
return;
|
| 280 |
}
|
| 281 |
|
|
|
|
|
|
|
| 282 |
// Join to the meta that relates tickets to events.
|
| 283 |
$repo->join_clause( "LEFT JOIN {$wpdb->postmeta} {$prefix}_ticket_event
|
| 284 |
ON (
|
| 285 |
{$prefix}_ticket_event.meta_value = {$wpdb->posts}.ID
|
| 286 |
-
AND
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
)" );
|
| 288 |
// Keep any event without tickets or not related to an RSVP ticket.
|
| 289 |
$repo->where_clause( "{$prefix}_ticket_event.meta_id IS NULL
|
|
@@ -298,30 +310,23 @@ trait Post_Tickets {
|
|
| 298 |
* @param bool $has_rsvp_or_tickets Indicates if the event should have RSVP or tickets attached to it or not.
|
| 299 |
*/
|
| 300 |
public function filter_by_has_rsvp_or_tickets( $has_rsvp_or_tickets = true ) {
|
| 301 |
-
$repo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
|
| 303 |
// If the repo is decorated, use that.
|
| 304 |
if ( ! empty( $repo ) ) {
|
| 305 |
$repo = $this->decorated;
|
| 306 |
}
|
| 307 |
|
| 308 |
-
global $wpdb;
|
| 309 |
-
$prefix = 'has_rsvp_or_tickets_';
|
| 310 |
-
|
| 311 |
if ( (bool) $has_rsvp_or_tickets ) {
|
| 312 |
-
|
| 313 |
-
$repo->join_clause( "JOIN {$wpdb->postmeta} {$prefix}_ticket_event ON (
|
| 314 |
-
{$prefix}_ticket_event.meta_value = {$wpdb->posts}.ID
|
| 315 |
-
AND {$prefix}_ticket_event.meta_key REGEXP '^_tribe_.*_for_event$'
|
| 316 |
-
)" );
|
| 317 |
-
|
| 318 |
return;
|
| 319 |
}
|
| 320 |
|
| 321 |
-
|
| 322 |
-
$repo->join_clause( "LEFT JOIN {$wpdb->postmeta} {$prefix}_ticket_event
|
| 323 |
-
ON {$prefix}_ticket_event.meta_value = {$wpdb->posts}.ID" );
|
| 324 |
-
// Keep events that have no tickets assigned or are assigned RSVP tickets.
|
| 325 |
-
$repo->where_clause( "{$prefix}_ticket_event.meta_id IS NULL" );
|
| 326 |
}
|
| 327 |
}
|
| 13 |
use Tribe__Repository__Usage_Error;
|
| 14 |
use Tribe__Repository__Void_Query_Exception;
|
| 15 |
use Tribe__Utils__Array;
|
| 16 |
+
use TEC\Tickets\Commerce\Ticket as TEC_Ticket;
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Class Post_Tickets
|
| 80 |
|
| 81 |
$operator_name = Tribe__Utils__Array::get( Tribe__Repository::get_comparison_operators(), $operator, '' );
|
| 82 |
$prefix = str_replace( '-', '_', 'by_cost_' . $operator_name );
|
| 83 |
+
$tc_relation_meta_key = TEC_Ticket::$event_relation_meta_key;
|
| 84 |
|
| 85 |
global $wpdb;
|
| 86 |
|
| 88 |
$repo->join_clause( "JOIN {$wpdb->postmeta} {$prefix}_ticket_event
|
| 89 |
ON (
|
| 90 |
{$prefix}_ticket_event.meta_value = {$wpdb->posts}.ID
|
| 91 |
+
AND (
|
| 92 |
+
{$prefix}_ticket_event.meta_key = '{$tc_relation_meta_key}'
|
| 93 |
+
OR
|
| 94 |
+
{$prefix}_ticket_event.meta_key REGEXP '^_tribe_.*_for_event$'
|
| 95 |
+
)
|
| 96 |
)" );
|
| 97 |
|
| 98 |
$price_regexp_frags = [
|
| 285 |
return;
|
| 286 |
}
|
| 287 |
|
| 288 |
+
$tc_relation_meta_key = TEC_Ticket::$event_relation_meta_key;
|
| 289 |
+
|
| 290 |
// Join to the meta that relates tickets to events.
|
| 291 |
$repo->join_clause( "LEFT JOIN {$wpdb->postmeta} {$prefix}_ticket_event
|
| 292 |
ON (
|
| 293 |
{$prefix}_ticket_event.meta_value = {$wpdb->posts}.ID
|
| 294 |
+
AND (
|
| 295 |
+
{$prefix}_ticket_event.meta_key = '{$tc_relation_meta_key}'
|
| 296 |
+
OR
|
| 297 |
+
{$prefix}_ticket_event.meta_key REGEXP '^_tribe_.*_for_event$'
|
| 298 |
+
)
|
| 299 |
)" );
|
| 300 |
// Keep any event without tickets or not related to an RSVP ticket.
|
| 301 |
$repo->where_clause( "{$prefix}_ticket_event.meta_id IS NULL
|
| 310 |
* @param bool $has_rsvp_or_tickets Indicates if the event should have RSVP or tickets attached to it or not.
|
| 311 |
*/
|
| 312 |
public function filter_by_has_rsvp_or_tickets( $has_rsvp_or_tickets = true ) {
|
| 313 |
+
$repo = $this;
|
| 314 |
+
$modules = \Tribe__Tickets__Tickets::modules();
|
| 315 |
+
|
| 316 |
+
foreach ( $modules as $module => $name ) {
|
| 317 |
+
$module_keys[] = tribe( $module )->get_event_key();
|
| 318 |
+
}
|
| 319 |
|
| 320 |
// If the repo is decorated, use that.
|
| 321 |
if ( ! empty( $repo ) ) {
|
| 322 |
$repo = $this->decorated;
|
| 323 |
}
|
| 324 |
|
|
|
|
|
|
|
|
|
|
| 325 |
if ( (bool) $has_rsvp_or_tickets ) {
|
| 326 |
+
$repo->by_related_to_min( $module_keys, 1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
return;
|
| 328 |
}
|
| 329 |
|
| 330 |
+
$repo->by_not_related_to( $module_keys );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
}
|
| 332 |
}
|
src/Tribe/Tickets.php
CHANGED
|
@@ -377,7 +377,7 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
|
|
| 377 |
*
|
| 378 |
* @since 5.5.0 refactored to use the tickets ORM.
|
| 379 |
* @since 4.6
|
| 380 |
-
* @since
|
| 381 |
*
|
| 382 |
* @param int|WP_Post $post_id Build the args to query only
|
| 383 |
* for tickets related to this post ID.
|
|
@@ -1006,7 +1006,7 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
|
|
| 1006 |
}
|
| 1007 |
|
| 1008 |
/**
|
| 1009 |
-
* Mark an attendee as checked in
|
| 1010 |
*
|
| 1011 |
* @abstract
|
| 1012 |
*
|
|
@@ -1018,12 +1018,14 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
|
|
| 1018 |
update_post_meta( $attendee_id, $this->checkin_key, 1 );
|
| 1019 |
|
| 1020 |
$args = func_get_args();
|
| 1021 |
-
$qr
|
| 1022 |
|
| 1023 |
if ( isset( $args[1] ) && $qr = (bool) $args[1] ) {
|
| 1024 |
update_post_meta( $attendee_id, '_tribe_qr_status', 1 );
|
| 1025 |
}
|
| 1026 |
|
|
|
|
|
|
|
| 1027 |
/**
|
| 1028 |
* Fires a checkin action
|
| 1029 |
*
|
|
@@ -1037,6 +1039,35 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
|
|
| 1037 |
return true;
|
| 1038 |
}
|
| 1039 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1040 |
/**
|
| 1041 |
* Mark an attendee as not checked in
|
| 1042 |
*
|
|
@@ -1047,6 +1078,7 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
|
|
| 1047 |
*/
|
| 1048 |
public function uncheckin( $attendee_id ) {
|
| 1049 |
delete_post_meta( $attendee_id, $this->checkin_key );
|
|
|
|
| 1050 |
delete_post_meta( $attendee_id, '_tribe_qr_status' );
|
| 1051 |
|
| 1052 |
/**
|
| 377 |
*
|
| 378 |
* @since 5.5.0 refactored to use the tickets ORM.
|
| 379 |
* @since 4.6
|
| 380 |
+
* @since 5.5.2 Set default query args.
|
| 381 |
*
|
| 382 |
* @param int|WP_Post $post_id Build the args to query only
|
| 383 |
* for tickets related to this post ID.
|
| 1006 |
}
|
| 1007 |
|
| 1008 |
/**
|
| 1009 |
+
* Mark an attendee as checked in.
|
| 1010 |
*
|
| 1011 |
* @abstract
|
| 1012 |
*
|
| 1018 |
update_post_meta( $attendee_id, $this->checkin_key, 1 );
|
| 1019 |
|
| 1020 |
$args = func_get_args();
|
| 1021 |
+
$qr = null;
|
| 1022 |
|
| 1023 |
if ( isset( $args[1] ) && $qr = (bool) $args[1] ) {
|
| 1024 |
update_post_meta( $attendee_id, '_tribe_qr_status', 1 );
|
| 1025 |
}
|
| 1026 |
|
| 1027 |
+
$this->save_checkin_details( $attendee_id, $qr );
|
| 1028 |
+
|
| 1029 |
/**
|
| 1030 |
* Fires a checkin action
|
| 1031 |
*
|
| 1039 |
return true;
|
| 1040 |
}
|
| 1041 |
|
| 1042 |
+
/**
|
| 1043 |
+
* Save the attendee checkin details.
|
| 1044 |
+
*
|
| 1045 |
+
* @since 5.5.2
|
| 1046 |
+
*
|
| 1047 |
+
* @param int $attendee_id The ID of the attendee that's being checked-in.
|
| 1048 |
+
* @param mixed $qr True if the check-in is from a QR code.
|
| 1049 |
+
*/
|
| 1050 |
+
public function save_checkin_details( $attendee_id, $qr ) {
|
| 1051 |
+
$checkin_details = [
|
| 1052 |
+
'date' => current_time( 'mysql' ),
|
| 1053 |
+
'source' => ! empty( $qr ) ? 'app' : 'site',
|
| 1054 |
+
'author' => get_current_user_id(),
|
| 1055 |
+
];
|
| 1056 |
+
|
| 1057 |
+
/**
|
| 1058 |
+
* Filters the checkin details for this attendee checkin.
|
| 1059 |
+
*
|
| 1060 |
+
* @since 5.5.2
|
| 1061 |
+
*
|
| 1062 |
+
* @param array $checkin_details The check-in details.
|
| 1063 |
+
* @param int $attendee_id The ID of the attendee that's being checked-in.
|
| 1064 |
+
* @param mixed $qr True if the check-in is from a QR code.
|
| 1065 |
+
*/
|
| 1066 |
+
$checkin_details = apply_filters( 'tec_tickets_checkin_details', $checkin_details, $attendee_id, $qr );
|
| 1067 |
+
|
| 1068 |
+
update_post_meta( $attendee_id, $this->checkin_key . '_details', $checkin_details );
|
| 1069 |
+
}
|
| 1070 |
+
|
| 1071 |
/**
|
| 1072 |
* Mark an attendee as not checked in
|
| 1073 |
*
|
| 1078 |
*/
|
| 1079 |
public function uncheckin( $attendee_id ) {
|
| 1080 |
delete_post_meta( $attendee_id, $this->checkin_key );
|
| 1081 |
+
delete_post_meta( $attendee_id, $this->checkin_key . '_details' );
|
| 1082 |
delete_post_meta( $attendee_id, '_tribe_qr_status' );
|
| 1083 |
|
| 1084 |
/**
|
src/template-tags/tickets.php
CHANGED
|
@@ -1834,4 +1834,18 @@ function tribe_tickets_get_provider_query_slug() {
|
|
| 1834 |
* @param string String for which the slug should be named.
|
| 1835 |
*/
|
| 1836 |
return apply_filters( 'tribe_tickets_get_provider_query_slug', 'tickets_provider' );
|
| 1837 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1834 |
* @param string String for which the slug should be named.
|
| 1835 |
*/
|
| 1836 |
return apply_filters( 'tribe_tickets_get_provider_query_slug', 'tickets_provider' );
|
| 1837 |
+
}
|
| 1838 |
+
|
| 1839 |
+
/**
|
| 1840 |
+
* Return if `The Events Calendar` is active.
|
| 1841 |
+
*
|
| 1842 |
+
* By checking if `tribe_events` function exists we avoid fatal errors when there are
|
| 1843 |
+
* version dependencies mismatches.
|
| 1844 |
+
*
|
| 1845 |
+
* @since 5.5.2
|
| 1846 |
+
*
|
| 1847 |
+
* @return bool True if The Events Calendar is active.
|
| 1848 |
+
*/
|
| 1849 |
+
function tec_tickets_tec_events_is_active() : bool {
|
| 1850 |
+
return function_exists( 'tribe_events' );
|
| 1851 |
+
}
|
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 ComposerAutoloaderInit404b81d8c23798606e43de80a7d9e300::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 ComposerAutoloaderInitfeb5d36e4a1fabfe35197a0cc78305ee
|
|
| 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 ComposerAutoloaderInit404b81d8c23798606e43de80a7d9e300
|
| 6 |
{
|
| 7 |
private static $loader;
|
| 8 |
|
| 19 |
return self::$loader;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
spl_autoload_register(array('ComposerAutoloaderInit404b81d8c23798606e43de80a7d9e300', 'loadClassLoader'), true, true);
|
| 23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
| 24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit404b81d8c23798606e43de80a7d9e300', '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\ComposerStaticInit404b81d8c23798606e43de80a7d9e300::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' =>
|
|
@@ -213,9 +213,9 @@ class ComposerStaticInitfeb5d36e4a1fabfe35197a0cc78305ee
|
|
| 213 |
public static function getInitializer(ClassLoader $loader)
|
| 214 |
{
|
| 215 |
return \Closure::bind(function () use ($loader) {
|
| 216 |
-
$loader->prefixLengthsPsr4 =
|
| 217 |
-
$loader->prefixDirsPsr4 =
|
| 218 |
-
$loader->classMap =
|
| 219 |
|
| 220 |
}, null, ClassLoader::class);
|
| 221 |
}
|
| 4 |
|
| 5 |
namespace Composer\Autoload;
|
| 6 |
|
| 7 |
+
class ComposerStaticInit404b81d8c23798606e43de80a7d9e300
|
| 8 |
{
|
| 9 |
public static $prefixLengthsPsr4 = array (
|
| 10 |
'T' =>
|
| 213 |
public static function getInitializer(ClassLoader $loader)
|
| 214 |
{
|
| 215 |
return \Closure::bind(function () use ($loader) {
|
| 216 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit404b81d8c23798606e43de80a7d9e300::$prefixLengthsPsr4;
|
| 217 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit404b81d8c23798606e43de80a7d9e300::$prefixDirsPsr4;
|
| 218 |
+
$loader->classMap = ComposerStaticInit404b81d8c23798606e43de80a7d9e300::$classMap;
|
| 219 |
|
| 220 |
}, null, ClassLoader::class);
|
| 221 |
}
|
