Completed
Branch barista (126f7d)
by
unknown
53:38 queued 34:59
created
core/domain/services/admin/events/editor/EventEditorGraphQLData.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,21 +99,21 @@
 block discarded – undo
99 99
             $datetimes = $this->datetimes->getData(['eventId' => $eventId]);
100 100
         }
101 101
 
102
-        if (! empty($datetimes['nodes'])) {
102
+        if ( ! empty($datetimes['nodes'])) {
103 103
             $datetimeIn = wp_list_pluck($datetimes['nodes'], 'id');
104 104
 
105
-            if (! empty($datetimeIn)) {
105
+            if ( ! empty($datetimeIn)) {
106 106
                 $tickets = $this->tickets->getData(['datetimeIn' => $datetimeIn]);
107 107
             }
108 108
         }
109 109
 
110
-        if (! empty($tickets['nodes'])) {
110
+        if ( ! empty($tickets['nodes'])) {
111 111
             $ticketIn = wp_list_pluck($tickets['nodes'], 'id');
112 112
         }
113 113
 
114 114
         $pricesArgs = ['includeDefaultPrices' => true];
115 115
 
116
-        if (! empty($ticketIn)) {
116
+        if ( ! empty($ticketIn)) {
117 117
             $pricesArgs['ticketIn'] = $ticketIn;
118 118
         }
119 119
         $prices = $this->prices->getData($pricesArgs);
Please login to merge, or discard this patch.
Indentation   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -21,133 +21,133 @@
 block discarded – undo
21 21
 class EventEditorGraphQLData
22 22
 {
23 23
 
24
-    /**
25
-     * @var Event $event
26
-     */
27
-    protected $event;
28
-
29
-    /**
30
-     * @var Datetimes $datetimes
31
-     */
32
-    protected $datetimes;
33
-
34
-    /**
35
-     * @var Prices $prices
36
-     */
37
-    protected $prices;
38
-
39
-    /**
40
-     * @var PriceTypes $price_types
41
-     */
42
-    protected $price_types;
43
-
44
-    /**
45
-     * @var Tickets $tickets
46
-     */
47
-    protected $tickets;
48
-
49
-    /**
50
-     * @var EventEntityRelations $relations
51
-     */
52
-    protected $relations;
53
-
54
-    /**
55
-     * @var EventManagers $managers
56
-     */
57
-    protected $managers;
58
-
59
-    /**
60
-     * @var NewEventDefaultEntities $default_entities
61
-     */
62
-    protected $default_entities;
63
-
64
-
65
-    /**
66
-     * EventEditorGraphQLData constructor.
67
-     *
68
-     * @param Datetimes               $datetimes
69
-     * @param Event                   $event
70
-     * @param Prices                  $prices
71
-     * @param PriceTypes              $price_types
72
-     * @param Tickets                 $tickets
73
-     * @param EventEntityRelations    $relations
74
-     * @param EventManagers           $managers
75
-     * @param NewEventDefaultEntities $default_entities
76
-     */
77
-    public function __construct(
78
-        Datetimes $datetimes,
79
-        Event $event,
80
-        Prices $prices,
81
-        PriceTypes $price_types,
82
-        Tickets $tickets,
83
-        EventEntityRelations $relations,
84
-        EventManagers $managers,
85
-        NewEventDefaultEntities $default_entities
86
-    ) {
87
-        $this->datetimes        = $datetimes;
88
-        $this->event            = $event;
89
-        $this->default_entities = $default_entities;
90
-        $this->prices           = $prices;
91
-        $this->price_types      = $price_types;
92
-        $this->managers         = $managers;
93
-        $this->relations        = $relations;
94
-        $this->tickets          = $tickets;
95
-    }
96
-
97
-
98
-    /**
99
-     * @param int $eventId
100
-     * @return array
101
-     * @throws EE_Error
102
-     * @throws ReflectionException
103
-     * @since $VID:$
104
-     */
105
-    public function getData(int $eventId)
106
-    {
107
-        $event = $this->event->getData(['id' => $eventId]);
108
-        $datetimes = $this->datetimes->getData(['eventId' => $eventId]);
109
-        $eventManagers = $this->managers ->getData($eventId);
110
-
111
-        // Avoid undefined variable warning in PHP >= 7.3
112
-        $tickets = null;
113
-        $prices  = null;
114
-
115
-        if (empty($datetimes['nodes']) || (isset($_REQUEST['action']) && $_REQUEST['action'] === 'create_new')) {
116
-            $this->default_entities->getData($eventId);
117
-            $datetimes = $this->datetimes->getData(['eventId' => $eventId]);
118
-        }
119
-
120
-        if (! empty($datetimes['nodes'])) {
121
-            $datetimeIn = wp_list_pluck($datetimes['nodes'], 'id');
122
-
123
-            if (! empty($datetimeIn)) {
124
-                $tickets = $this->tickets->getData(['datetimeIn' => $datetimeIn]);
125
-            }
126
-        }
127
-
128
-        if (! empty($tickets['nodes'])) {
129
-            $ticketIn = wp_list_pluck($tickets['nodes'], 'id');
130
-        }
131
-
132
-        $pricesArgs = ['includeDefaultPrices' => true];
133
-
134
-        if (! empty($ticketIn)) {
135
-            $pricesArgs['ticketIn'] = $ticketIn;
136
-        }
137
-        $prices = $this->prices->getData($pricesArgs);
138
-
139
-        $priceTypes = $this->price_types->getData();
140
-
141
-        $relations = $this->relations->getData($eventId);
142
-
143
-        return compact(
144
-            'datetimes',
145
-            'event',
146
-            'eventManagers',
147
-            'prices',
148
-            'priceTypes',
149
-            'relations',
150
-            'tickets'
151
-        );
152
-    }
24
+	/**
25
+	 * @var Event $event
26
+	 */
27
+	protected $event;
28
+
29
+	/**
30
+	 * @var Datetimes $datetimes
31
+	 */
32
+	protected $datetimes;
33
+
34
+	/**
35
+	 * @var Prices $prices
36
+	 */
37
+	protected $prices;
38
+
39
+	/**
40
+	 * @var PriceTypes $price_types
41
+	 */
42
+	protected $price_types;
43
+
44
+	/**
45
+	 * @var Tickets $tickets
46
+	 */
47
+	protected $tickets;
48
+
49
+	/**
50
+	 * @var EventEntityRelations $relations
51
+	 */
52
+	protected $relations;
53
+
54
+	/**
55
+	 * @var EventManagers $managers
56
+	 */
57
+	protected $managers;
58
+
59
+	/**
60
+	 * @var NewEventDefaultEntities $default_entities
61
+	 */
62
+	protected $default_entities;
63
+
64
+
65
+	/**
66
+	 * EventEditorGraphQLData constructor.
67
+	 *
68
+	 * @param Datetimes               $datetimes
69
+	 * @param Event                   $event
70
+	 * @param Prices                  $prices
71
+	 * @param PriceTypes              $price_types
72
+	 * @param Tickets                 $tickets
73
+	 * @param EventEntityRelations    $relations
74
+	 * @param EventManagers           $managers
75
+	 * @param NewEventDefaultEntities $default_entities
76
+	 */
77
+	public function __construct(
78
+		Datetimes $datetimes,
79
+		Event $event,
80
+		Prices $prices,
81
+		PriceTypes $price_types,
82
+		Tickets $tickets,
83
+		EventEntityRelations $relations,
84
+		EventManagers $managers,
85
+		NewEventDefaultEntities $default_entities
86
+	) {
87
+		$this->datetimes        = $datetimes;
88
+		$this->event            = $event;
89
+		$this->default_entities = $default_entities;
90
+		$this->prices           = $prices;
91
+		$this->price_types      = $price_types;
92
+		$this->managers         = $managers;
93
+		$this->relations        = $relations;
94
+		$this->tickets          = $tickets;
95
+	}
96
+
97
+
98
+	/**
99
+	 * @param int $eventId
100
+	 * @return array
101
+	 * @throws EE_Error
102
+	 * @throws ReflectionException
103
+	 * @since $VID:$
104
+	 */
105
+	public function getData(int $eventId)
106
+	{
107
+		$event = $this->event->getData(['id' => $eventId]);
108
+		$datetimes = $this->datetimes->getData(['eventId' => $eventId]);
109
+		$eventManagers = $this->managers ->getData($eventId);
110
+
111
+		// Avoid undefined variable warning in PHP >= 7.3
112
+		$tickets = null;
113
+		$prices  = null;
114
+
115
+		if (empty($datetimes['nodes']) || (isset($_REQUEST['action']) && $_REQUEST['action'] === 'create_new')) {
116
+			$this->default_entities->getData($eventId);
117
+			$datetimes = $this->datetimes->getData(['eventId' => $eventId]);
118
+		}
119
+
120
+		if (! empty($datetimes['nodes'])) {
121
+			$datetimeIn = wp_list_pluck($datetimes['nodes'], 'id');
122
+
123
+			if (! empty($datetimeIn)) {
124
+				$tickets = $this->tickets->getData(['datetimeIn' => $datetimeIn]);
125
+			}
126
+		}
127
+
128
+		if (! empty($tickets['nodes'])) {
129
+			$ticketIn = wp_list_pluck($tickets['nodes'], 'id');
130
+		}
131
+
132
+		$pricesArgs = ['includeDefaultPrices' => true];
133
+
134
+		if (! empty($ticketIn)) {
135
+			$pricesArgs['ticketIn'] = $ticketIn;
136
+		}
137
+		$prices = $this->prices->getData($pricesArgs);
138
+
139
+		$priceTypes = $this->price_types->getData();
140
+
141
+		$relations = $this->relations->getData($eventId);
142
+
143
+		return compact(
144
+			'datetimes',
145
+			'event',
146
+			'eventManagers',
147
+			'prices',
148
+			'priceTypes',
149
+			'relations',
150
+			'tickets'
151
+		);
152
+	}
153 153
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/admin/EspressoEventEditor.php 1 patch
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -18,137 +18,137 @@
 block discarded – undo
18 18
 class EspressoEventEditor extends EspressoEventsAdmin
19 19
 {
20 20
 
21
-    /**
22
-     * returns true if the current request matches this route
23
-     *
24
-     * @return bool
25
-     * @since   $VID:$
26
-     */
27
-    public function matchesCurrentRequest()
28
-    {
29
-        return parent::matchesCurrentRequest()
30
-               && $this->admin_config->useAdvancedEditor()
31
-               && (
32
-                $this->request->getRequestParam('action') === 'create_new'
33
-                || $this->request->getRequestParam('action') === 'edit'
34
-            );
35
-    }
21
+	/**
22
+	 * returns true if the current request matches this route
23
+	 *
24
+	 * @return bool
25
+	 * @since   $VID:$
26
+	 */
27
+	public function matchesCurrentRequest()
28
+	{
29
+		return parent::matchesCurrentRequest()
30
+			   && $this->admin_config->useAdvancedEditor()
31
+			   && (
32
+				$this->request->getRequestParam('action') === 'create_new'
33
+				|| $this->request->getRequestParam('action') === 'edit'
34
+			);
35
+	}
36 36
 
37 37
 
38
-    /**
39
-     * @since $VID:$
40
-     */
41
-    protected function registerDependencies()
42
-    {
43
-        $this->dependency_map->registerDependencies(
44
-            'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData',
45
-            [
46
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Datetimes'                 => EE_Dependency_Map::load_from_cache,
47
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Event'                     => EE_Dependency_Map::load_from_cache,
48
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Prices'                    => EE_Dependency_Map::load_from_cache,
49
-                'EventEspresso\core\domain\entities\admin\GraphQLData\PriceTypes'                => EE_Dependency_Map::load_from_cache,
50
-                'EventEspresso\core\domain\entities\admin\GraphQLData\Tickets'                   => EE_Dependency_Map::load_from_cache,
51
-                'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities' => EE_Dependency_Map::load_from_cache,
52
-                '\EventEspresso\core\domain\services\admin\events\editor\EventManagers'          => EE_Dependency_Map::load_from_cache,
53
-                'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations'    => EE_Dependency_Map::load_from_cache,
54
-            ]
55
-        );
56
-        $this->dependency_map->registerDependencies(
57
-            'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations',
58
-            [
59
-                'EEM_Datetime'                                         => EE_Dependency_Map::load_from_cache,
60
-                'EEM_Event'                                            => EE_Dependency_Map::load_from_cache,
61
-                'EEM_Price'                                            => EE_Dependency_Map::load_from_cache,
62
-                'EEM_Price_Type'                                       => EE_Dependency_Map::load_from_cache,
63
-                'EEM_Ticket'                                           => EE_Dependency_Map::load_from_cache,
64
-                'EventEspresso\core\domain\services\graphql\Utilities' => EE_Dependency_Map::load_from_cache,
65
-            ]
66
-        );
67
-        $this->dependency_map->registerDependencies(
68
-            'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities',
69
-            [
70
-                'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes' => EE_Dependency_Map::load_from_cache,
71
-                'EEM_Datetime'                                                       => EE_Dependency_Map::load_from_cache,
72
-                'EEM_Event'                                                          => EE_Dependency_Map::load_from_cache,
73
-                'EEM_Price'                                                          => EE_Dependency_Map::load_from_cache,
74
-                'EEM_Price_Type'                                                     => EE_Dependency_Map::load_from_cache,
75
-                'EEM_Ticket'                                                         => EE_Dependency_Map::load_from_cache,
76
-                'EventEspresso\core\domain\services\graphql\Utilities'               => EE_Dependency_Map::load_from_cache,
77
-            ]
78
-        );
79
-        $this->dependency_map->registerDependencies(
80
-            'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes',
81
-            [
82
-                'EventEspresso\core\domain\services\admin\entities\DefaultTickets' => EE_Dependency_Map::load_from_cache,
83
-                'EEM_Datetime'                                                     => EE_Dependency_Map::load_from_cache,
84
-            ]
85
-        );
86
-        $this->dependency_map->registerDependencies(
87
-            'EventEspresso\core\domain\services\admin\entities\DefaultTickets',
88
-            [
89
-                'EventEspresso\core\domain\services\admin\entities\DefaultPrices' => EE_Dependency_Map::load_from_cache,
90
-                'EEM_Ticket'                                                      => EE_Dependency_Map::load_from_cache,
91
-            ]
92
-        );
93
-        $this->dependency_map->registerDependencies(
94
-            'EventEspresso\core\domain\services\admin\entities\DefaultPrices',
95
-            [
96
-                'EEM_Price'      => EE_Dependency_Map::load_from_cache,
97
-                'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
98
-            ]
99
-        );
100
-        $this->dependency_map->registerDependencies(
101
-            'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor',
102
-            [
103
-                'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData' => EE_Dependency_Map::load_from_cache,
104
-                'EventEspresso\core\services\json\JsonDataNodeValidator'                        => EE_Dependency_Map::load_from_cache,
105
-            ]
106
-        );
107
-        $this->dependency_map->registerDependencies(
108
-            'EventEspresso\core\domain\services\assets\EventEditorAssetManager',
109
-            [
110
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
111
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
112
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
113
-            ]
114
-        );
115
-        $this->dependency_map->registerDependencies(
116
-            'EventEspresso\core\domain\services\admin\events\editor\EventManagers',
117
-            [
118
-                'EventEspresso\core\domain\services\graphql\Utilities' => EE_Dependency_Map::load_from_cache,
119
-            ]
120
-        );
121
-        $this->loader->getShared(
122
-            'EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData'
123
-        );
124
-        /** @var EventEditor $data_node */
125
-        $data_node = $this->loader->getShared(
126
-            'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor'
127
-        );
128
-        $this->setDataNode($data_node);
129
-    }
38
+	/**
39
+	 * @since $VID:$
40
+	 */
41
+	protected function registerDependencies()
42
+	{
43
+		$this->dependency_map->registerDependencies(
44
+			'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData',
45
+			[
46
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Datetimes'                 => EE_Dependency_Map::load_from_cache,
47
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Event'                     => EE_Dependency_Map::load_from_cache,
48
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Prices'                    => EE_Dependency_Map::load_from_cache,
49
+				'EventEspresso\core\domain\entities\admin\GraphQLData\PriceTypes'                => EE_Dependency_Map::load_from_cache,
50
+				'EventEspresso\core\domain\entities\admin\GraphQLData\Tickets'                   => EE_Dependency_Map::load_from_cache,
51
+				'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities' => EE_Dependency_Map::load_from_cache,
52
+				'\EventEspresso\core\domain\services\admin\events\editor\EventManagers'          => EE_Dependency_Map::load_from_cache,
53
+				'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations'    => EE_Dependency_Map::load_from_cache,
54
+			]
55
+		);
56
+		$this->dependency_map->registerDependencies(
57
+			'EventEspresso\core\domain\services\admin\events\editor\EventEntityRelations',
58
+			[
59
+				'EEM_Datetime'                                         => EE_Dependency_Map::load_from_cache,
60
+				'EEM_Event'                                            => EE_Dependency_Map::load_from_cache,
61
+				'EEM_Price'                                            => EE_Dependency_Map::load_from_cache,
62
+				'EEM_Price_Type'                                       => EE_Dependency_Map::load_from_cache,
63
+				'EEM_Ticket'                                           => EE_Dependency_Map::load_from_cache,
64
+				'EventEspresso\core\domain\services\graphql\Utilities' => EE_Dependency_Map::load_from_cache,
65
+			]
66
+		);
67
+		$this->dependency_map->registerDependencies(
68
+			'EventEspresso\core\domain\services\admin\events\editor\NewEventDefaultEntities',
69
+			[
70
+				'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes' => EE_Dependency_Map::load_from_cache,
71
+				'EEM_Datetime'                                                       => EE_Dependency_Map::load_from_cache,
72
+				'EEM_Event'                                                          => EE_Dependency_Map::load_from_cache,
73
+				'EEM_Price'                                                          => EE_Dependency_Map::load_from_cache,
74
+				'EEM_Price_Type'                                                     => EE_Dependency_Map::load_from_cache,
75
+				'EEM_Ticket'                                                         => EE_Dependency_Map::load_from_cache,
76
+				'EventEspresso\core\domain\services\graphql\Utilities'               => EE_Dependency_Map::load_from_cache,
77
+			]
78
+		);
79
+		$this->dependency_map->registerDependencies(
80
+			'EventEspresso\core\domain\services\admin\entities\DefaultDatetimes',
81
+			[
82
+				'EventEspresso\core\domain\services\admin\entities\DefaultTickets' => EE_Dependency_Map::load_from_cache,
83
+				'EEM_Datetime'                                                     => EE_Dependency_Map::load_from_cache,
84
+			]
85
+		);
86
+		$this->dependency_map->registerDependencies(
87
+			'EventEspresso\core\domain\services\admin\entities\DefaultTickets',
88
+			[
89
+				'EventEspresso\core\domain\services\admin\entities\DefaultPrices' => EE_Dependency_Map::load_from_cache,
90
+				'EEM_Ticket'                                                      => EE_Dependency_Map::load_from_cache,
91
+			]
92
+		);
93
+		$this->dependency_map->registerDependencies(
94
+			'EventEspresso\core\domain\services\admin\entities\DefaultPrices',
95
+			[
96
+				'EEM_Price'      => EE_Dependency_Map::load_from_cache,
97
+				'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
98
+			]
99
+		);
100
+		$this->dependency_map->registerDependencies(
101
+			'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor',
102
+			[
103
+				'EventEspresso\core\domain\services\admin\events\editor\EventEditorGraphQLData' => EE_Dependency_Map::load_from_cache,
104
+				'EventEspresso\core\services\json\JsonDataNodeValidator'                        => EE_Dependency_Map::load_from_cache,
105
+			]
106
+		);
107
+		$this->dependency_map->registerDependencies(
108
+			'EventEspresso\core\domain\services\assets\EventEditorAssetManager',
109
+			[
110
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
111
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
112
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
113
+			]
114
+		);
115
+		$this->dependency_map->registerDependencies(
116
+			'EventEspresso\core\domain\services\admin\events\editor\EventManagers',
117
+			[
118
+				'EventEspresso\core\domain\services\graphql\Utilities' => EE_Dependency_Map::load_from_cache,
119
+			]
120
+		);
121
+		$this->loader->getShared(
122
+			'EventEspresso\core\domain\entities\routing\data_nodes\EventEspressoData'
123
+		);
124
+		/** @var EventEditor $data_node */
125
+		$data_node = $this->loader->getShared(
126
+			'EventEspresso\core\domain\entities\routing\data_nodes\domains\EventEditor'
127
+		);
128
+		$this->setDataNode($data_node);
129
+	}
130 130
 
131 131
 
132
-    /**
133
-     * implements logic required to run during request
134
-     *
135
-     * @return bool
136
-     * @since   $VID:$
137
-     */
138
-    protected function requestHandler()
139
-    {
140
-        if (! class_exists('WPGraphQL')) {
141
-            require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php';
142
-        }
143
-        /** @var GraphQLManager $graphQL_manager */
144
-        $graphQL_manager = $this->loader->getShared('EventEspresso\core\services\graphql\GraphQLManager');
145
-        $graphQL_manager->init();
132
+	/**
133
+	 * implements logic required to run during request
134
+	 *
135
+	 * @return bool
136
+	 * @since   $VID:$
137
+	 */
138
+	protected function requestHandler()
139
+	{
140
+		if (! class_exists('WPGraphQL')) {
141
+			require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php';
142
+		}
143
+		/** @var GraphQLManager $graphQL_manager */
144
+		$graphQL_manager = $this->loader->getShared('EventEspresso\core\services\graphql\GraphQLManager');
145
+		$graphQL_manager->init();
146 146
 
147
-        /** @var EventEditorAssetManager $asset_manager */
148
-        $asset_manager = $this->loader->getShared(
149
-            'EventEspresso\core\domain\services\assets\EventEditorAssetManager'
150
-        );
151
-        add_action('admin_enqueue_scripts', [$asset_manager, 'enqueueEventEditor']);
152
-        return true;
153
-    }
147
+		/** @var EventEditorAssetManager $asset_manager */
148
+		$asset_manager = $this->loader->getShared(
149
+			'EventEspresso\core\domain\services\assets\EventEditorAssetManager'
150
+		);
151
+		add_action('admin_enqueue_scripts', [$asset_manager, 'enqueueEventEditor']);
152
+		return true;
153
+	}
154 154
 }
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 2 patches
Indentation   +2875 added lines, -2875 removed lines patch added patch discarded remove patch
@@ -15,2879 +15,2879 @@
 block discarded – undo
15 15
 class Events_Admin_Page extends EE_Admin_Page_CPT
16 16
 {
17 17
 
18
-    /**
19
-     * This will hold the event object for event_details screen.
20
-     *
21
-     * @access protected
22
-     * @var EE_Event $_event
23
-     */
24
-    protected $_event;
25
-
26
-
27
-    /**
28
-     * This will hold the category object for category_details screen.
29
-     *
30
-     * @var stdClass $_category
31
-     */
32
-    protected $_category;
33
-
34
-
35
-    /**
36
-     * This will hold the event model instance
37
-     *
38
-     * @var EEM_Event $_event_model
39
-     */
40
-    protected $_event_model;
41
-
42
-
43
-    /**
44
-     * @var EE_Event
45
-     */
46
-    protected $_cpt_model_obj = false;
47
-
48
-
49
-    /**
50
-     * Initialize page props for this admin page group.
51
-     */
52
-    protected function _init_page_props()
53
-    {
54
-        $this->page_slug = EVENTS_PG_SLUG;
55
-        $this->page_label = EVENTS_LABEL;
56
-        $this->_admin_base_url = EVENTS_ADMIN_URL;
57
-        $this->_admin_base_path = EVENTS_ADMIN;
58
-        $this->_cpt_model_names = array(
59
-            'create_new' => 'EEM_Event',
60
-            'edit'       => 'EEM_Event',
61
-        );
62
-        $this->_cpt_edit_routes = array(
63
-            'espresso_events' => 'edit',
64
-        );
65
-        add_action(
66
-            'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
67
-            array($this, 'verify_event_edit'),
68
-            10,
69
-            2
70
-        );
71
-    }
72
-
73
-
74
-    /**
75
-     * Sets the ajax hooks used for this admin page group.
76
-     */
77
-    protected function _ajax_hooks()
78
-    {
79
-        add_action('wp_ajax_ee_save_timezone_setting', array($this, 'save_timezonestring_setting'));
80
-    }
81
-
82
-
83
-    /**
84
-     * Sets the page properties for this admin page group.
85
-     */
86
-    protected function _define_page_props()
87
-    {
88
-        $this->_admin_page_title = EVENTS_LABEL;
89
-        $this->_labels = array(
90
-            'buttons'      => array(
91
-                'add'             => esc_html__('Add New Event', 'event_espresso'),
92
-                'edit'            => esc_html__('Edit Event', 'event_espresso'),
93
-                'delete'          => esc_html__('Delete Event', 'event_espresso'),
94
-                'add_category'    => esc_html__('Add New Category', 'event_espresso'),
95
-                'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
96
-                'delete_category' => esc_html__('Delete Category', 'event_espresso'),
97
-            ),
98
-            'editor_title' => array(
99
-                'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
100
-            ),
101
-            'publishbox'   => array(
102
-                'create_new'        => esc_html__('Save New Event', 'event_espresso'),
103
-                'edit'              => esc_html__('Update Event', 'event_espresso'),
104
-                'add_category'      => esc_html__('Save New Category', 'event_espresso'),
105
-                'edit_category'     => esc_html__('Update Category', 'event_espresso'),
106
-                'template_settings' => esc_html__('Update Settings', 'event_espresso'),
107
-            ),
108
-        );
109
-    }
110
-
111
-
112
-    /**
113
-     * Sets the page routes property for this admin page group.
114
-     */
115
-    protected function _set_page_routes()
116
-    {
117
-        // load formatter helper
118
-        // load field generator helper
119
-        // is there a evt_id in the request?
120
-        $evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
121
-            ? $this->_req_data['EVT_ID']
122
-            : 0;
123
-        $evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
124
-        $this->_page_routes = array(
125
-            'default'                       => array(
126
-                'func'       => '_events_overview_list_table',
127
-                'capability' => 'ee_read_events',
128
-            ),
129
-            'create_new'                    => array(
130
-                'func'       => '_create_new_cpt_item',
131
-                'capability' => 'ee_edit_events',
132
-            ),
133
-            'edit'                          => array(
134
-                'func'       => '_edit_cpt_item',
135
-                'capability' => 'ee_edit_event',
136
-                'obj_id'     => $evt_id,
137
-            ),
138
-            'copy_event'                    => array(
139
-                'func'       => '_copy_events',
140
-                'capability' => 'ee_edit_event',
141
-                'obj_id'     => $evt_id,
142
-                'noheader'   => true,
143
-            ),
144
-            'trash_event'                   => array(
145
-                'func'       => '_trash_or_restore_event',
146
-                'args'       => array('event_status' => 'trash'),
147
-                'capability' => 'ee_delete_event',
148
-                'obj_id'     => $evt_id,
149
-                'noheader'   => true,
150
-            ),
151
-            'trash_events'                  => array(
152
-                'func'       => '_trash_or_restore_events',
153
-                'args'       => array('event_status' => 'trash'),
154
-                'capability' => 'ee_delete_events',
155
-                'noheader'   => true,
156
-            ),
157
-            'restore_event'                 => array(
158
-                'func'       => '_trash_or_restore_event',
159
-                'args'       => array('event_status' => 'draft'),
160
-                'capability' => 'ee_delete_event',
161
-                'obj_id'     => $evt_id,
162
-                'noheader'   => true,
163
-            ),
164
-            'restore_events'                => array(
165
-                'func'       => '_trash_or_restore_events',
166
-                'args'       => array('event_status' => 'draft'),
167
-                'capability' => 'ee_delete_events',
168
-                'noheader'   => true,
169
-            ),
170
-            'delete_event'                  => array(
171
-                'func'       => '_delete_event',
172
-                'capability' => 'ee_delete_event',
173
-                'obj_id'     => $evt_id,
174
-                'noheader'   => true,
175
-            ),
176
-            'delete_events'                 => array(
177
-                'func'       => '_delete_events',
178
-                'capability' => 'ee_delete_events',
179
-                'noheader'   => true,
180
-            ),
181
-            'view_report'                   => array(
182
-                'func'      => '_view_report',
183
-                'capability' => 'ee_edit_events',
184
-            ),
185
-            'default_event_settings'        => array(
186
-                'func'       => '_default_event_settings',
187
-                'capability' => 'manage_options',
188
-            ),
189
-            'update_default_event_settings' => array(
190
-                'func'       => '_update_default_event_settings',
191
-                'capability' => 'manage_options',
192
-                'noheader'   => true,
193
-            ),
194
-            'template_settings'             => array(
195
-                'func'       => '_template_settings',
196
-                'capability' => 'manage_options',
197
-            ),
198
-            // event category tab related
199
-            'add_category'                  => array(
200
-                'func'       => '_category_details',
201
-                'capability' => 'ee_edit_event_category',
202
-                'args'       => array('add'),
203
-            ),
204
-            'edit_category'                 => array(
205
-                'func'       => '_category_details',
206
-                'capability' => 'ee_edit_event_category',
207
-                'args'       => array('edit'),
208
-            ),
209
-            'delete_categories'             => array(
210
-                'func'       => '_delete_categories',
211
-                'capability' => 'ee_delete_event_category',
212
-                'noheader'   => true,
213
-            ),
214
-            'delete_category'               => array(
215
-                'func'       => '_delete_categories',
216
-                'capability' => 'ee_delete_event_category',
217
-                'noheader'   => true,
218
-            ),
219
-            'insert_category'               => array(
220
-                'func'       => '_insert_or_update_category',
221
-                'args'       => array('new_category' => true),
222
-                'capability' => 'ee_edit_event_category',
223
-                'noheader'   => true,
224
-            ),
225
-            'update_category'               => array(
226
-                'func'       => '_insert_or_update_category',
227
-                'args'       => array('new_category' => false),
228
-                'capability' => 'ee_edit_event_category',
229
-                'noheader'   => true,
230
-            ),
231
-            'category_list'                 => array(
232
-                'func'       => '_category_list_table',
233
-                'capability' => 'ee_manage_event_categories',
234
-            ),
235
-        );
236
-    }
237
-
238
-
239
-    /**
240
-     * Set the _page_config property for this admin page group.
241
-     */
242
-    protected function _set_page_config()
243
-    {
244
-        $this->_page_config = [
245
-            'default'                => [
246
-                'nav'           => [
247
-                    'label' => esc_html__('Overview', 'event_espresso'),
248
-                    'order' => 10,
249
-                ],
250
-                'list_table'    => 'Events_Admin_List_Table',
251
-                'help_tabs'     => [
252
-                    'events_overview_help_tab'                       => [
253
-                        'title'    => esc_html__('Events Overview', 'event_espresso'),
254
-                        'filename' => 'events_overview',
255
-                    ],
256
-                    'events_overview_table_column_headings_help_tab' => [
257
-                        'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
258
-                        'filename' => 'events_overview_table_column_headings',
259
-                    ],
260
-                    'events_overview_filters_help_tab'               => [
261
-                        'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
262
-                        'filename' => 'events_overview_filters',
263
-                    ],
264
-                    'events_overview_view_help_tab'                  => [
265
-                        'title'    => esc_html__('Events Overview Views', 'event_espresso'),
266
-                        'filename' => 'events_overview_views',
267
-                    ],
268
-                    'events_overview_other_help_tab'                 => [
269
-                        'title'    => esc_html__('Events Overview Other', 'event_espresso'),
270
-                        'filename' => 'events_overview_other',
271
-                    ],
272
-                ],
273
-                'help_tour'     => [
274
-                    'Event_Overview_Help_Tour',
275
-                    // 'New_Features_Test_Help_Tour' for testing multiple help tour
276
-                ],
277
-                'require_nonce' => false,
278
-                'qtips' => ['EE_Event_List_Table_Tips'],
279
-            ],
280
-            'create_new'             => [
281
-                'nav'           => [
282
-                    'label'      => esc_html__('Add Event', 'event_espresso'),
283
-                    'order'      => 5,
284
-                    'persistent' => false,
285
-                ],
286
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
287
-                'help_tabs'     => [
288
-                    'event_editor_help_tab'                            => [
289
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
290
-                        'filename' => 'event_editor',
291
-                    ],
292
-                    'event_editor_title_richtexteditor_help_tab'       => [
293
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
294
-                        'filename' => 'event_editor_title_richtexteditor',
295
-                    ],
296
-                    'event_editor_venue_details_help_tab'              => [
297
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
298
-                        'filename' => 'event_editor_venue_details',
299
-                    ],
300
-                    'event_editor_event_datetimes_help_tab'            => [
301
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
302
-                        'filename' => 'event_editor_event_datetimes',
303
-                    ],
304
-                    'event_editor_event_tickets_help_tab'              => [
305
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
306
-                        'filename' => 'event_editor_event_tickets',
307
-                    ],
308
-                    'event_editor_event_registration_options_help_tab' => [
309
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
310
-                        'filename' => 'event_editor_event_registration_options',
311
-                    ],
312
-                    'event_editor_tags_categories_help_tab'            => [
313
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
314
-                        'filename' => 'event_editor_tags_categories',
315
-                    ],
316
-                    'event_editor_questions_registrants_help_tab'      => [
317
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
318
-                        'filename' => 'event_editor_questions_registrants',
319
-                    ],
320
-                    'event_editor_save_new_event_help_tab'             => [
321
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
322
-                        'filename' => 'event_editor_save_new_event',
323
-                    ],
324
-                    'event_editor_other_help_tab'                      => [
325
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
326
-                        'filename' => 'event_editor_other',
327
-                    ],
328
-                ],
329
-                'help_tour'     => [
330
-                    'Event_Editor_Help_Tour',
331
-                ],
332
-                'require_nonce' => false,
333
-            ],
334
-            'edit'                   => [
335
-                'nav'           => [
336
-                    'label'      => esc_html__('Edit Event', 'event_espresso'),
337
-                    'order'      => 5,
338
-                    'persistent' => false,
339
-                    'url'        => isset($this->_req_data['post'])
340
-                        ? EE_Admin_Page::add_query_args_and_nonce(
341
-                            ['post' => $this->_req_data['post'], 'action' => 'edit'],
342
-                            $this->_current_page_view_url
343
-                        )
344
-                        : $this->_admin_base_url,
345
-                ],
346
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
347
-                'help_tabs'     => [
348
-                    'event_editor_help_tab'                            => [
349
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
350
-                        'filename' => 'event_editor',
351
-                    ],
352
-                    'event_editor_title_richtexteditor_help_tab'       => [
353
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
354
-                        'filename' => 'event_editor_title_richtexteditor',
355
-                    ],
356
-                    'event_editor_venue_details_help_tab'              => [
357
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
358
-                        'filename' => 'event_editor_venue_details',
359
-                    ],
360
-                    'event_editor_event_datetimes_help_tab'            => [
361
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
362
-                        'filename' => 'event_editor_event_datetimes',
363
-                    ],
364
-                    'event_editor_event_tickets_help_tab'              => [
365
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
366
-                        'filename' => 'event_editor_event_tickets',
367
-                    ],
368
-                    'event_editor_event_registration_options_help_tab' => [
369
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
370
-                        'filename' => 'event_editor_event_registration_options',
371
-                    ],
372
-                    'event_editor_tags_categories_help_tab'            => [
373
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
374
-                        'filename' => 'event_editor_tags_categories',
375
-                    ],
376
-                    'event_editor_questions_registrants_help_tab'      => [
377
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
378
-                        'filename' => 'event_editor_questions_registrants',
379
-                    ],
380
-                    'event_editor_save_new_event_help_tab'             => [
381
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
382
-                        'filename' => 'event_editor_save_new_event',
383
-                    ],
384
-                    'event_editor_other_help_tab'                      => [
385
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
386
-                        'filename' => 'event_editor_other',
387
-                    ],
388
-                ],
389
-                'require_nonce' => false,
390
-            ],
391
-            'default_event_settings' => [
392
-                'nav'           => [
393
-                    'label' => esc_html__('Default Settings', 'event_espresso'),
394
-                    'order' => 40,
395
-                ],
396
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
397
-                'labels'        => [
398
-                    'publishbox' => esc_html__('Update Settings', 'event_espresso'),
399
-                ],
400
-                'help_tabs'     => [
401
-                    'default_settings_help_tab'        => [
402
-                        'title'    => esc_html__('Default Event Settings', 'event_espresso'),
403
-                        'filename' => 'events_default_settings',
404
-                    ],
405
-                    'default_settings_status_help_tab' => [
406
-                        'title'    => esc_html__('Default Registration Status', 'event_espresso'),
407
-                        'filename' => 'events_default_settings_status',
408
-                    ],
409
-                    'default_maximum_tickets_help_tab' => [
410
-                        'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
411
-                        'filename' => 'events_default_settings_max_tickets',
412
-                    ],
413
-                ],
414
-                'help_tour'     => ['Event_Default_Settings_Help_Tour'],
415
-                'require_nonce' => false,
416
-            ],
417
-            // template settings
418
-            'template_settings'      => [
419
-                'nav'           => [
420
-                    'label' => esc_html__('Templates', 'event_espresso'),
421
-                    'order' => 30,
422
-                ],
423
-                'metaboxes'     => $this->_default_espresso_metaboxes,
424
-                'help_tabs'     => [
425
-                    'general_settings_templates_help_tab' => [
426
-                        'title'    => esc_html__('Templates', 'event_espresso'),
427
-                        'filename' => 'general_settings_templates',
428
-                    ],
429
-                ],
430
-                'help_tour'     => ['Templates_Help_Tour'],
431
-                'require_nonce' => false,
432
-            ],
433
-            // event category stuff
434
-            'add_category'           => [
435
-                'nav'           => [
436
-                    'label'      => esc_html__('Add Category', 'event_espresso'),
437
-                    'order'      => 15,
438
-                    'persistent' => false,
439
-                ],
440
-                'help_tabs'     => [
441
-                    'add_category_help_tab' => [
442
-                        'title'    => esc_html__('Add New Event Category', 'event_espresso'),
443
-                        'filename' => 'events_add_category',
444
-                    ],
445
-                ],
446
-                'help_tour'     => ['Event_Add_Category_Help_Tour'],
447
-                'metaboxes'     => ['_publish_post_box'],
448
-                'require_nonce' => false,
449
-            ],
450
-            'edit_category'          => [
451
-                'nav'           => [
452
-                    'label'      => esc_html__('Edit Category', 'event_espresso'),
453
-                    'order'      => 15,
454
-                    'persistent' => false,
455
-                    'url'        => isset($this->_req_data['EVT_CAT_ID'])
456
-                        ? add_query_arg(
457
-                            ['EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']],
458
-                            $this->_current_page_view_url
459
-                        )
460
-                        : $this->_admin_base_url,
461
-                ],
462
-                'help_tabs'     => [
463
-                    'edit_category_help_tab' => [
464
-                        'title'    => esc_html__('Edit Event Category', 'event_espresso'),
465
-                        'filename' => 'events_edit_category',
466
-                    ],
467
-                ],
468
-                /*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
469
-                'metaboxes'     => ['_publish_post_box'],
470
-                'require_nonce' => false,
471
-            ],
472
-            'category_list'          => [
473
-                'nav'           => [
474
-                    'label' => esc_html__('Categories', 'event_espresso'),
475
-                    'order' => 20,
476
-                ],
477
-                'list_table'    => 'Event_Categories_Admin_List_Table',
478
-                'help_tabs'     => [
479
-                    'events_categories_help_tab'                       => [
480
-                        'title'    => esc_html__('Event Categories', 'event_espresso'),
481
-                        'filename' => 'events_categories',
482
-                    ],
483
-                    'events_categories_table_column_headings_help_tab' => [
484
-                        'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
485
-                        'filename' => 'events_categories_table_column_headings',
486
-                    ],
487
-                    'events_categories_view_help_tab'                  => [
488
-                        'title'    => esc_html__('Event Categories Views', 'event_espresso'),
489
-                        'filename' => 'events_categories_views',
490
-                    ],
491
-                    'events_categories_other_help_tab'                 => [
492
-                        'title'    => esc_html__('Event Categories Other', 'event_espresso'),
493
-                        'filename' => 'events_categories_other',
494
-                    ],
495
-                ],
496
-                'help_tour'     => [
497
-                    'Event_Categories_Help_Tour',
498
-                ],
499
-                'metaboxes'     => $this->_default_espresso_metaboxes,
500
-                'require_nonce' => false,
501
-            ],
502
-        ];
503
-        // only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
504
-        $domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
505
-        if (! $domain->isCaffeinated()) {
506
-            $this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
507
-            $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips' ];
508
-        }
509
-    }
510
-
511
-
512
-    /**
513
-     * Used to register any global screen options if necessary for every route in this admin page group.
514
-     */
515
-    protected function _add_screen_options()
516
-    {
517
-    }
518
-
519
-
520
-    /**
521
-     * Implementing the screen options for the 'default' route.
522
-     *
523
-     * @throws InvalidArgumentException
524
-     * @throws InvalidDataTypeException
525
-     * @throws InvalidInterfaceException
526
-     */
527
-    protected function _add_screen_options_default()
528
-    {
529
-        $this->_per_page_screen_option();
530
-    }
531
-
532
-
533
-    /**
534
-     * Implementing screen options for the category list route.
535
-     *
536
-     * @throws InvalidArgumentException
537
-     * @throws InvalidDataTypeException
538
-     * @throws InvalidInterfaceException
539
-     */
540
-    protected function _add_screen_options_category_list()
541
-    {
542
-        $page_title = $this->_admin_page_title;
543
-        $this->_admin_page_title = esc_html__('Categories', 'event_espresso');
544
-        $this->_per_page_screen_option();
545
-        $this->_admin_page_title = $page_title;
546
-    }
547
-
548
-
549
-    /**
550
-     * Used to register any global feature pointers for the admin page group.
551
-     */
552
-    protected function _add_feature_pointers()
553
-    {
554
-    }
555
-
556
-
557
-    /**
558
-     * Registers and enqueues any global scripts and styles for the entire admin page group.
559
-     */
560
-    public function load_scripts_styles()
561
-    {
562
-        wp_register_style(
563
-            'events-admin-css',
564
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
565
-            [],
566
-            EVENT_ESPRESSO_VERSION
567
-        );
568
-        wp_register_style(
569
-            'ee-cat-admin',
570
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
571
-            [],
572
-            EVENT_ESPRESSO_VERSION
573
-        );
574
-        wp_enqueue_style('events-admin-css');
575
-        wp_enqueue_style('ee-cat-admin');
576
-        // scripts
577
-        wp_register_script(
578
-            'event_editor_js',
579
-            EVENTS_ASSETS_URL . 'event_editor.js',
580
-            ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
581
-            EVENT_ESPRESSO_VERSION,
582
-            true
583
-        );
584
-    }
585
-
586
-
587
-    /**
588
-     * Enqueuing scripts and styles specific to this view
589
-     */
590
-    public function load_scripts_styles_create_new()
591
-    {
592
-        $this->load_scripts_styles_edit();
593
-    }
594
-
595
-
596
-    /**
597
-     * Enqueuing scripts and styles specific to this view
598
-     */
599
-    public function load_scripts_styles_edit()
600
-    {
601
-        // styles
602
-        wp_enqueue_style('espresso-ui-theme');
603
-        wp_register_style(
604
-            'event-editor-css',
605
-            EVENTS_ASSETS_URL . 'event-editor.css',
606
-            ['ee-admin-css'],
607
-            EVENT_ESPRESSO_VERSION
608
-        );
609
-        wp_enqueue_style('event-editor-css');
610
-        // scripts
611
-        if (! $this->admin_config->useAdvancedEditor()) {
612
-            wp_register_script(
613
-                'event-datetime-metabox',
614
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
615
-                ['event_editor_js', 'ee-datepicker'],
616
-                EVENT_ESPRESSO_VERSION
617
-            );
618
-            wp_enqueue_script('event-datetime-metabox');
619
-        }
620
-    }
621
-
622
-
623
-    /**
624
-     * Populating the _views property for the category list table view.
625
-     */
626
-    protected function _set_list_table_views_category_list()
627
-    {
628
-        $this->_views = array(
629
-            'all' => array(
630
-                'slug'        => 'all',
631
-                'label'       => esc_html__('All', 'event_espresso'),
632
-                'count'       => 0,
633
-                'bulk_action' => array(
634
-                    'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
635
-                ),
636
-            ),
637
-        );
638
-    }
639
-
640
-
641
-    /**
642
-     * For adding anything that fires on the admin_init hook for any route within this admin page group.
643
-     */
644
-    public function admin_init()
645
-    {
646
-        EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
647
-            'Do you really want to delete this image? Please remember to update your event to complete the removal.',
648
-            'event_espresso'
649
-        );
650
-    }
651
-
652
-
653
-    /**
654
-     * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
655
-     * group.
656
-     */
657
-    public function admin_notices()
658
-    {
659
-    }
660
-
661
-
662
-    /**
663
-     * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
664
-     * this admin page group.
665
-     */
666
-    public function admin_footer_scripts()
667
-    {
668
-    }
669
-
670
-
671
-    /**
672
-     * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
673
-     * warning (via EE_Error::add_error());
674
-     *
675
-     * @param  EE_Event $event Event object
676
-     * @param string    $req_type
677
-     * @return void
678
-     * @throws EE_Error
679
-     * @access public
680
-     */
681
-    public function verify_event_edit($event = null, $req_type = '')
682
-    {
683
-        // don't need to do this when processing
684
-        if (! empty($req_type)) {
685
-            return;
686
-        }
687
-        // no event?
688
-        if (! $event instanceof EE_Event) {
689
-            $event = $this->_cpt_model_obj;
690
-        }
691
-        // STILL no event?
692
-        if (! $event instanceof EE_Event) {
693
-            return;
694
-        }
695
-        $orig_status = $event->status();
696
-        // first check if event is active.
697
-        if ($orig_status === EEM_Event::cancelled
698
-            || $orig_status === EEM_Event::postponed
699
-            || $event->is_expired()
700
-            || $event->is_inactive()
701
-        ) {
702
-            return;
703
-        }
704
-        // made it here so it IS active... next check that any of the tickets are sold.
705
-        if ($event->is_sold_out(true)) {
706
-            if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
707
-                EE_Error::add_attention(
708
-                    sprintf(
709
-                        esc_html__(
710
-                            'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
711
-                            'event_espresso'
712
-                        ),
713
-                        EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
714
-                    )
715
-                );
716
-            }
717
-            return;
718
-        }
719
-        if ($orig_status === EEM_Event::sold_out) {
720
-            EE_Error::add_attention(
721
-                sprintf(
722
-                    esc_html__(
723
-                        'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
724
-                        'event_espresso'
725
-                    ),
726
-                    EEH_Template::pretty_status($event->status(), false, 'sentence')
727
-                )
728
-            );
729
-        }
730
-        // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
731
-        if (! $event->tickets_on_sale()) {
732
-            return;
733
-        }
734
-        // made it here so show warning
735
-        $this->_edit_event_warning();
736
-    }
737
-
738
-
739
-    /**
740
-     * This is the text used for when an event is being edited that is public and has tickets for sale.
741
-     * When needed, hook this into a EE_Error::add_error() notice.
742
-     *
743
-     * @access protected
744
-     * @return void
745
-     */
746
-    protected function _edit_event_warning()
747
-    {
748
-        // we don't want to add warnings during these requests
749
-        if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
750
-            return;
751
-        }
752
-        EE_Error::add_attention(
753
-            sprintf(
754
-                esc_html__(
755
-                    'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
756
-                    'event_espresso'
757
-                ),
758
-                '<a class="espresso-help-tab-lnk">',
759
-                '</a>'
760
-            )
761
-        );
762
-    }
763
-
764
-
765
-    /**
766
-     * When a user is creating a new event, notify them if they haven't set their timezone.
767
-     * Otherwise, do the normal logic
768
-     *
769
-     * @return string
770
-     * @throws EE_Error
771
-     * @throws InvalidArgumentException
772
-     * @throws InvalidDataTypeException
773
-     * @throws InvalidInterfaceException
774
-     */
775
-    protected function _create_new_cpt_item()
776
-    {
777
-        $has_timezone_string = get_option('timezone_string');
778
-        // only nag them about setting their timezone if it's their first event, and they haven't already done it
779
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists(array())) {
780
-            EE_Error::add_attention(
781
-                sprintf(
782
-                    __(
783
-                        'Your website\'s timezone is currently set to a UTC offset. We recommend updating your timezone to a city or region near you before you create an event. Change your timezone now:%1$s%2$s%3$sChange Timezone%4$s',
784
-                        'event_espresso'
785
-                    ),
786
-                    '<br>',
787
-                    '<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
788
-                    . EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
789
-                    . '</select>',
790
-                    '<button class="button button-secondary timezone-submit">',
791
-                    '</button><span class="spinner"></span>'
792
-                ),
793
-                __FILE__,
794
-                __FUNCTION__,
795
-                __LINE__
796
-            );
797
-        }
798
-        parent::_create_new_cpt_item();
799
-    }
800
-
801
-
802
-    /**
803
-     * Sets the _views property for the default route in this admin page group.
804
-     */
805
-    protected function _set_list_table_views_default()
806
-    {
807
-        $this->_views = array(
808
-            'all'   => array(
809
-                'slug'        => 'all',
810
-                'label'       => esc_html__('View All Events', 'event_espresso'),
811
-                'count'       => 0,
812
-                'bulk_action' => array(
813
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
814
-                ),
815
-            ),
816
-            'draft' => array(
817
-                'slug'        => 'draft',
818
-                'label'       => esc_html__('Draft', 'event_espresso'),
819
-                'count'       => 0,
820
-                'bulk_action' => array(
821
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
822
-                ),
823
-            ),
824
-        );
825
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
826
-            $this->_views['trash'] = array(
827
-                'slug'        => 'trash',
828
-                'label'       => esc_html__('Trash', 'event_espresso'),
829
-                'count'       => 0,
830
-                'bulk_action' => array(
831
-                    'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
832
-                    'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
833
-                ),
834
-            );
835
-        }
836
-    }
837
-
838
-
839
-    /**
840
-     * Provides the legend item array for the default list table view.
841
-     *
842
-     * @return array
843
-     */
844
-    protected function _event_legend_items()
845
-    {
846
-        $items = array(
847
-            'view_details'   => array(
848
-                'class' => 'dashicons dashicons-search',
849
-                'desc'  => esc_html__('View Event', 'event_espresso'),
850
-            ),
851
-            'edit_event'     => array(
852
-                'class' => 'ee-icon ee-icon-calendar-edit',
853
-                'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
854
-            ),
855
-            'view_attendees' => array(
856
-                'class' => 'dashicons dashicons-groups',
857
-                'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
858
-            ),
859
-        );
860
-        $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
861
-        $statuses = array(
862
-            'sold_out_status'  => array(
863
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
864
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
865
-            ),
866
-            'active_status'    => array(
867
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
868
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
869
-            ),
870
-            'upcoming_status'  => array(
871
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
872
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
873
-            ),
874
-            'postponed_status' => array(
875
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
876
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
877
-            ),
878
-            'cancelled_status' => array(
879
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
880
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
881
-            ),
882
-            'expired_status'   => array(
883
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
884
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
885
-            ),
886
-            'inactive_status'  => array(
887
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
888
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
889
-            ),
890
-        );
891
-        $statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
892
-        return array_merge($items, $statuses);
893
-    }
894
-
895
-
896
-    /**
897
-     * @return EEM_Event
898
-     * @throws EE_Error
899
-     * @throws InvalidArgumentException
900
-     * @throws InvalidDataTypeException
901
-     * @throws InvalidInterfaceException
902
-     * @throws ReflectionException
903
-     */
904
-    private function _event_model()
905
-    {
906
-        if (! $this->_event_model instanceof EEM_Event) {
907
-            $this->_event_model = EE_Registry::instance()->load_model('Event');
908
-        }
909
-        return $this->_event_model;
910
-    }
911
-
912
-
913
-    /**
914
-     * Adds extra buttons to the WP CPT permalink field row.
915
-     * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
916
-     *
917
-     * @param  string $return    the current html
918
-     * @param  int    $id        the post id for the page
919
-     * @param  string $new_title What the title is
920
-     * @param  string $new_slug  what the slug is
921
-     * @return string            The new html string for the permalink area
922
-     */
923
-    public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
924
-    {
925
-        // make sure this is only when editing
926
-        if (! empty($id)) {
927
-            $post = get_post($id);
928
-            $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
929
-                       . esc_html__('Shortcode', 'event_espresso')
930
-                       . '</a> ';
931
-            $return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
932
-                       . $post->ID
933
-                       . ']">';
934
-        }
935
-        return $return;
936
-    }
937
-
938
-
939
-    /**
940
-     * _events_overview_list_table
941
-     * This contains the logic for showing the events_overview list
942
-     *
943
-     * @access protected
944
-     * @return void
945
-     * @throws DomainException
946
-     * @throws EE_Error
947
-     * @throws InvalidArgumentException
948
-     * @throws InvalidDataTypeException
949
-     * @throws InvalidInterfaceException
950
-     */
951
-    protected function _events_overview_list_table()
952
-    {
953
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
954
-        $this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
955
-            ? (array) $this->_template_args['after_list_table']
956
-            : array();
957
-        $this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
958
-                . EEH_Template::get_button_or_link(
959
-                    get_post_type_archive_link('espresso_events'),
960
-                    esc_html__('View Event Archive Page', 'event_espresso'),
961
-                    'button'
962
-                );
963
-        $this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
964
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
965
-            'create_new',
966
-            'add',
967
-            array(),
968
-            'add-new-h2'
969
-        );
970
-        $this->display_admin_list_table_page_with_no_sidebar();
971
-    }
972
-
973
-
974
-    /**
975
-     * this allows for extra misc actions in the default WP publish box
976
-     *
977
-     * @return void
978
-     * @throws DomainException
979
-     * @throws EE_Error
980
-     * @throws InvalidArgumentException
981
-     * @throws InvalidDataTypeException
982
-     * @throws InvalidInterfaceException
983
-     * @throws ReflectionException
984
-     */
985
-    public function extra_misc_actions_publish_box()
986
-    {
987
-        $this->_generate_publish_box_extra_content();
988
-    }
989
-
990
-
991
-    /**
992
-     * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
993
-     * saved.
994
-     * Typically you would use this to save any additional data.
995
-     * Keep in mind also that "save_post" runs on EVERY post update to the database.
996
-     * ALSO very important.  When a post transitions from scheduled to published,
997
-     * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
998
-     * other meta saves. So MAKE sure that you handle this accordingly.
999
-     *
1000
-     * @access protected
1001
-     * @abstract
1002
-     * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1003
-     * @param object $post    The post object of the cpt that was saved.
1004
-     * @return void
1005
-     * @throws EE_Error
1006
-     * @throws InvalidArgumentException
1007
-     * @throws InvalidDataTypeException
1008
-     * @throws InvalidInterfaceException
1009
-     * @throws ReflectionException
1010
-     */
1011
-    protected function _insert_update_cpt_item($post_id, $post)
1012
-    {
1013
-        if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1014
-            // get out we're not processing an event save.
1015
-            return;
1016
-        }
1017
-        $event_values = [
1018
-            'EVT_member_only'     => ! empty($this->_req_data['member_only']) ? 1 : 0,
1019
-            'EVT_allow_overflow'  => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
1020
-            'EVT_timezone_string' => ! empty($this->_req_data['timezone_string'])
1021
-                ? sanitize_text_field($this->_req_data['timezone_string'])
1022
-                : null,
1023
-        ];
1024
-        if (! $this->admin_config->useAdvancedEditor()) {
1025
-            $event_values['EVT_display_ticket_selector'] =
1026
-                ! empty($this->_req_data['display_ticket_selector'])
1027
-                    ? 1
1028
-                    : 0;
1029
-            $event_values['EVT_additional_limit'] = min(
1030
-                apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1031
-                ! empty($this->_req_data['additional_limit'])
1032
-                    ? absint($this->_req_data['additional_limit'])
1033
-                    : null
1034
-            );
1035
-            $event_values['EVT_default_registration_status'] =
1036
-                ! empty($this->_req_data['EVT_default_registration_status'])
1037
-                    ? sanitize_text_field($this->_req_data['EVT_default_registration_status'])
1038
-                    : EE_Registry::instance()->CFG->registration->default_STS_ID;
1039
-            $event_values['EVT_external_URL'] = ! empty($this->_req_data['externalURL'])
1040
-                ? esc_url_raw($this->_req_data['externalURL'])
1041
-                : null;
1042
-            $event_values['EVT_phone'] = ! empty($this->_req_data['event_phone'])
1043
-                ? sanitize_text_field($this->_req_data['event_phone'])
1044
-                : null;
1045
-        }
1046
-        // update event
1047
-        $success = $this->_event_model()->update_by_ID($event_values, $post_id);
1048
-        // get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
1049
-        $get_one_where = array(
1050
-            $this->_event_model()->primary_key_name() => $post_id,
1051
-            'OR'                                      => array(
1052
-                'status'   => $post->post_status,
1053
-                // if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1054
-                // but the returned object here has a status of "publish", so use the original post status as well
1055
-                'status*1' => $this->_req_data['original_post_status'],
1056
-            ),
1057
-        );
1058
-        $event = $this->_event_model()->get_one(array($get_one_where));
1059
-        // the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
1060
-        $event_update_callbacks = apply_filters(
1061
-            'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1062
-            array(
1063
-                array($this, '_default_venue_update'),
1064
-                array($this, '_default_tickets_update'),
1065
-            )
1066
-        );
1067
-        $att_success = true;
1068
-        foreach ($event_update_callbacks as $e_callback) {
1069
-            $_success = is_callable($e_callback)
1070
-                ? $e_callback($event, $this->_req_data)
1071
-                : false;
1072
-            // if ANY of these updates fail then we want the appropriate global error message
1073
-            $att_success = ! $att_success ? $att_success : $_success;
1074
-        }
1075
-        // any errors?
1076
-        if ($success && false === $att_success) {
1077
-            EE_Error::add_error(
1078
-                esc_html__(
1079
-                    'Event Details saved successfully but something went wrong with saving attachments.',
1080
-                    'event_espresso'
1081
-                ),
1082
-                __FILE__,
1083
-                __FUNCTION__,
1084
-                __LINE__
1085
-            );
1086
-        } elseif ($success === false) {
1087
-            EE_Error::add_error(
1088
-                esc_html__('Event Details did not save successfully.', 'event_espresso'),
1089
-                __FILE__,
1090
-                __FUNCTION__,
1091
-                __LINE__
1092
-            );
1093
-        }
1094
-    }
1095
-
1096
-
1097
-    /**
1098
-     * @param int $post_id
1099
-     * @param int $revision_id
1100
-     * @throws EE_Error
1101
-     * @throws InvalidArgumentException
1102
-     * @throws InvalidDataTypeException
1103
-     * @throws InvalidInterfaceException
1104
-     * @throws ReflectionException
1105
-     * @see parent::restore_item()
1106
-     */
1107
-    protected function _restore_cpt_item($post_id, $revision_id)
1108
-    {
1109
-        // copy existing event meta to new post
1110
-        $post_evt = $this->_event_model()->get_one_by_ID($post_id);
1111
-        if ($post_evt instanceof EE_Event) {
1112
-            // meta revision restore
1113
-            $post_evt->restore_revision($revision_id);
1114
-            // related objs restore
1115
-            $post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
1116
-        }
1117
-    }
1118
-
1119
-
1120
-    /**
1121
-     * Attach the venue to the Event
1122
-     *
1123
-     * @param EE_Event $evtobj Event Object to add the venue to
1124
-     * @param array    $data   The request data from the form
1125
-     * @return bool           Success or fail.
1126
-     * @throws EE_Error
1127
-     * @throws InvalidArgumentException
1128
-     * @throws InvalidDataTypeException
1129
-     * @throws InvalidInterfaceException
1130
-     * @throws ReflectionException
1131
-     */
1132
-    protected function _default_venue_update(EE_Event $evtobj, $data)
1133
-    {
1134
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1135
-        $venue_model = EE_Registry::instance()->load_model('Venue');
1136
-        $rows_affected = null;
1137
-        $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1138
-        // very important.  If we don't have a venue name...
1139
-        // then we'll get out because not necessary to create empty venue
1140
-        if (empty($data['venue_title'])) {
1141
-            return false;
1142
-        }
1143
-        $venue_array = array(
1144
-            'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1145
-            'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1146
-            'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1147
-            'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1148
-            'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1149
-                : null,
1150
-            'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1151
-            'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1152
-            'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1153
-            'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1154
-            'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1155
-            'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1156
-            'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1157
-            'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1158
-            'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1159
-            'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1160
-            'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1161
-            'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1162
-            'status'              => 'publish',
1163
-        );
1164
-        // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1165
-        if (! empty($venue_id)) {
1166
-            $update_where = array($venue_model->primary_key_name() => $venue_id);
1167
-            $rows_affected = $venue_model->update($venue_array, array($update_where));
1168
-            // we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1169
-            $evtobj->_add_relation_to($venue_id, 'Venue');
1170
-            return $rows_affected > 0;
1171
-        }
1172
-        // we insert the venue
1173
-        $venue_id = $venue_model->insert($venue_array);
1174
-        $evtobj->_add_relation_to($venue_id, 'Venue');
1175
-        return ! empty($venue_id) ? true : false;
1176
-        // when we have the ancestor come in it's already been handled by the revision save.
1177
-    }
1178
-
1179
-
1180
-    /**
1181
-     * Handles saving everything related to Tickets (datetimes, tickets, prices)
1182
-     *
1183
-     * @param EE_Event $evtobj The Event object we're attaching data to
1184
-     * @param array    $data   The request data from the form
1185
-     * @return array
1186
-     * @throws EE_Error
1187
-     * @throws InvalidArgumentException
1188
-     * @throws InvalidDataTypeException
1189
-     * @throws InvalidInterfaceException
1190
-     * @throws ReflectionException
1191
-     * @throws Exception
1192
-     */
1193
-    protected function _default_tickets_update(EE_Event $evtobj, $data)
1194
-    {
1195
-        if ($this->admin_config->useAdvancedEditor()) {
1196
-            return [];
1197
-        }
1198
-        $success = true;
1199
-        $saved_dtt = null;
1200
-        $saved_tickets = array();
1201
-        $incoming_date_formats = array('Y-m-d', 'h:i a');
1202
-        foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1203
-            // trim all values to ensure any excess whitespace is removed.
1204
-            $dtt = array_map('trim', $dtt);
1205
-            $dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end']
1206
-                : $dtt['DTT_EVT_start'];
1207
-            $datetime_values = array(
1208
-                'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1209
-                'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1210
-                'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1211
-                'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1212
-                'DTT_order'     => $row,
1213
-            );
1214
-            // if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1215
-            if (! empty($dtt['DTT_ID'])) {
1216
-                $DTM = EE_Registry::instance()
1217
-                                  ->load_model('Datetime', array($evtobj->get_timezone()))
1218
-                                  ->get_one_by_ID($dtt['DTT_ID']);
1219
-                $DTM->set_date_format($incoming_date_formats[0]);
1220
-                $DTM->set_time_format($incoming_date_formats[1]);
1221
-                foreach ($datetime_values as $field => $value) {
1222
-                    $DTM->set($field, $value);
1223
-                }
1224
-                // make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1225
-                $saved_dtts[ $DTM->ID() ] = $DTM;
1226
-            } else {
1227
-                $DTM = EE_Registry::instance()->load_class(
1228
-                    'Datetime',
1229
-                    array($datetime_values, $evtobj->get_timezone(), $incoming_date_formats),
1230
-                    false,
1231
-                    false
1232
-                );
1233
-                foreach ($datetime_values as $field => $value) {
1234
-                    $DTM->set($field, $value);
1235
-                }
1236
-            }
1237
-            $DTM->save();
1238
-            $DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
1239
-            // load DTT helper
1240
-            // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1241
-            if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
1242
-                $DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
1243
-                $DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
1244
-                $DTT->save();
1245
-            }
1246
-            // now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
1247
-            $saved_dtt = $DTT;
1248
-            $success = ! $success ? $success : $DTT;
1249
-            // if ANY of these updates fail then we want the appropriate global error message.
1250
-            // //todo this is actually sucky we need a better error message but this is what it is for now.
1251
-        }
1252
-        // no dtts get deleted so we don't do any of that logic here.
1253
-        // update tickets next
1254
-        $old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
1255
-        foreach ($data['edit_tickets'] as $row => $tkt) {
1256
-            $incoming_date_formats = array('Y-m-d', 'h:i a');
1257
-            $update_prices = false;
1258
-            $ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1259
-                ? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1260
-            // trim inputs to ensure any excess whitespace is removed.
1261
-            $tkt = array_map('trim', $tkt);
1262
-            if (empty($tkt['TKT_start_date'])) {
1263
-                // let's use now in the set timezone.
1264
-                $now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1265
-                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1266
-            }
1267
-            if (empty($tkt['TKT_end_date'])) {
1268
-                // use the start date of the first datetime
1269
-                $dtt = $evtobj->first_datetime();
1270
-                $tkt['TKT_end_date'] = $dtt->start_date_and_time(
1271
-                    $incoming_date_formats[0],
1272
-                    $incoming_date_formats[1]
1273
-                );
1274
-            }
1275
-            $TKT_values = array(
1276
-                'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1277
-                'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1278
-                'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1279
-                'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1280
-                'TKT_start_date'  => $tkt['TKT_start_date'],
1281
-                'TKT_end_date'    => $tkt['TKT_end_date'],
1282
-                'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1283
-                'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1284
-                'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1285
-                'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1286
-                'TKT_row'         => $row,
1287
-                'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1288
-                'TKT_price'       => $ticket_price,
1289
-            );
1290
-            // if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1291
-            if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1292
-                $TKT_values['TKT_ID'] = 0;
1293
-                $TKT_values['TKT_is_default'] = 0;
1294
-                $TKT_values['TKT_price'] = $ticket_price;
1295
-                $update_prices = true;
1296
-            }
1297
-            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1298
-            // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1299
-            // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1300
-            if (! empty($tkt['TKT_ID'])) {
1301
-                $TKT = EE_Registry::instance()
1302
-                                  ->load_model('Ticket', array($evtobj->get_timezone()))
1303
-                                  ->get_one_by_ID($tkt['TKT_ID']);
1304
-                if ($TKT instanceof EE_Ticket) {
1305
-                    $ticket_sold = $TKT->count_related(
1306
-                        'Registration',
1307
-                        array(
1308
-                            array(
1309
-                                'STS_ID' => array(
1310
-                                    'NOT IN',
1311
-                                    array(EEM_Registration::status_id_incomplete),
1312
-                                ),
1313
-                            ),
1314
-                        )
1315
-                    ) > 0;
1316
-                    // let's just check the total price for the existing ticket and determine if it matches the new
1317
-                    // total price.  if they are different then we create a new ticket (if tickets sold)
1318
-                    // if they aren't different then we go ahead and modify existing ticket.
1319
-                    $create_new_TKT = $ticket_sold && ! $TKT->deleted() && EEH_Money::compare_floats(
1320
-                        $ticket_price,
1321
-                        $TKT->get('TKT_price'),
1322
-                        '!=='
1323
-                    );
1324
-                    $TKT->set_date_format($incoming_date_formats[0]);
1325
-                    $TKT->set_time_format($incoming_date_formats[1]);
1326
-                    // set new values
1327
-                    foreach ($TKT_values as $field => $value) {
1328
-                        if ($field === 'TKT_qty') {
1329
-                            $TKT->set_qty($value);
1330
-                        } else {
1331
-                            $TKT->set($field, $value);
1332
-                        }
1333
-                    }
1334
-                    // if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1335
-                    if ($create_new_TKT) {
1336
-                        // archive the old ticket first
1337
-                        $TKT->set('TKT_deleted', 1);
1338
-                        $TKT->save();
1339
-                        // make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1340
-                        $saved_tickets[ $TKT->ID() ] = $TKT;
1341
-                        // create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1342
-                        $TKT = clone $TKT;
1343
-                        $TKT->set('TKT_ID', 0);
1344
-                        $TKT->set('TKT_deleted', 0);
1345
-                        $TKT->set('TKT_price', $ticket_price);
1346
-                        $TKT->set('TKT_sold', 0);
1347
-                        // now we need to make sure that $new prices are created as well and attached to new ticket.
1348
-                        $update_prices = true;
1349
-                    }
1350
-                    // make sure price is set if it hasn't been already
1351
-                    $TKT->set('TKT_price', $ticket_price);
1352
-                }
1353
-            } else {
1354
-                // no TKT_id so a new TKT
1355
-                $TKT_values['TKT_price'] = $ticket_price;
1356
-                $TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), false, false);
1357
-                if ($TKT instanceof EE_Ticket) {
1358
-                    // need to reset values to properly account for the date formats
1359
-                    $TKT->set_date_format($incoming_date_formats[0]);
1360
-                    $TKT->set_time_format($incoming_date_formats[1]);
1361
-                    $TKT->set_timezone($evtobj->get_timezone());
1362
-                    // set new values
1363
-                    foreach ($TKT_values as $field => $value) {
1364
-                        if ($field === 'TKT_qty') {
1365
-                            $TKT->set_qty($value);
1366
-                        } else {
1367
-                            $TKT->set($field, $value);
1368
-                        }
1369
-                    }
1370
-                    $update_prices = true;
1371
-                }
1372
-            }
1373
-            // cap ticket qty by datetime reg limits
1374
-            $TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1375
-            // update ticket.
1376
-            $TKT->save();
1377
-            // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1378
-            if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1379
-                $TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1380
-                $TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1381
-                $TKT->save();
1382
-            }
1383
-            // initially let's add the ticket to the dtt
1384
-            $saved_dtt->_add_relation_to($TKT, 'Ticket');
1385
-            $saved_tickets[ $TKT->ID() ] = $TKT;
1386
-            // add prices to ticket
1387
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1388
-        }
1389
-        // however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1390
-        $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? array() : $old_tickets;
1391
-        $tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1392
-        foreach ($tickets_removed as $id) {
1393
-            $id = absint($id);
1394
-            // get the ticket for this id
1395
-            $tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
1396
-            // need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1397
-            $dtts = $tkt_to_remove->get_many_related('Datetime');
1398
-            foreach ($dtts as $dtt) {
1399
-                $tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1400
-            }
1401
-            // need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1402
-            $tkt_to_remove->delete_related_permanently('Price');
1403
-            // finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1404
-            $tkt_to_remove->delete_permanently();
1405
-        }
1406
-        return array($saved_dtt, $saved_tickets);
1407
-    }
1408
-
1409
-
1410
-    /**
1411
-     * This attaches a list of given prices to a ticket.
1412
-     * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
1413
-     * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
1414
-     * price info and prices are automatically "archived" via the ticket.
1415
-     *
1416
-     * @access  private
1417
-     * @param array     $prices     Array of prices from the form.
1418
-     * @param EE_Ticket $ticket     EE_Ticket object that prices are being attached to.
1419
-     * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1420
-     * @return  void
1421
-     * @throws EE_Error
1422
-     * @throws InvalidArgumentException
1423
-     * @throws InvalidDataTypeException
1424
-     * @throws InvalidInterfaceException
1425
-     * @throws ReflectionException
1426
-     */
1427
-    private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false)
1428
-    {
1429
-        foreach ($prices as $row => $prc) {
1430
-            $PRC_values = array(
1431
-                'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1432
-                'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1433
-                'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1434
-                'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1435
-                'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1436
-                'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1437
-                'PRC_order'      => $row,
1438
-            );
1439
-            if ($new_prices || empty($PRC_values['PRC_ID'])) {
1440
-                $PRC_values['PRC_ID'] = 0;
1441
-                $PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), false, false);
1442
-            } else {
1443
-                $PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1444
-                // update this price with new values
1445
-                foreach ($PRC_values as $field => $newprc) {
1446
-                    $PRC->set($field, $newprc);
1447
-                }
1448
-                $PRC->save();
1449
-            }
1450
-            $ticket->_add_relation_to($PRC, 'Price');
1451
-        }
1452
-    }
1453
-
1454
-
1455
-    /**
1456
-     * Add in our autosave ajax handlers
1457
-     *
1458
-     */
1459
-    protected function _ee_autosave_create_new()
1460
-    {
1461
-    }
1462
-
1463
-
1464
-    /**
1465
-     * More autosave handlers.
1466
-     */
1467
-    protected function _ee_autosave_edit()
1468
-    {
1469
-    }
1470
-
1471
-
1472
-    /**
1473
-     *    _generate_publish_box_extra_content
1474
-     *
1475
-     * @throws DomainException
1476
-     * @throws EE_Error
1477
-     * @throws InvalidArgumentException
1478
-     * @throws InvalidDataTypeException
1479
-     * @throws InvalidInterfaceException
1480
-     * @throws ReflectionException
1481
-     */
1482
-    private function _generate_publish_box_extra_content()
1483
-    {
1484
-        // load formatter helper
1485
-        // args for getting related registrations
1486
-        $approved_query_args = array(
1487
-            array(
1488
-                'REG_deleted' => 0,
1489
-                'STS_ID'      => EEM_Registration::status_id_approved,
1490
-            ),
1491
-        );
1492
-        $not_approved_query_args = array(
1493
-            array(
1494
-                'REG_deleted' => 0,
1495
-                'STS_ID'      => EEM_Registration::status_id_not_approved,
1496
-            ),
1497
-        );
1498
-        $pending_payment_query_args = array(
1499
-            array(
1500
-                'REG_deleted' => 0,
1501
-                'STS_ID'      => EEM_Registration::status_id_pending_payment,
1502
-            ),
1503
-        );
1504
-        // publish box
1505
-        $publish_box_extra_args = array(
1506
-            'view_approved_reg_url'        => add_query_arg(
1507
-                array(
1508
-                    'action'      => 'default',
1509
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1510
-                    '_reg_status' => EEM_Registration::status_id_approved,
1511
-                ),
1512
-                REG_ADMIN_URL
1513
-            ),
1514
-            'view_not_approved_reg_url'    => add_query_arg(
1515
-                array(
1516
-                    'action'      => 'default',
1517
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1518
-                    '_reg_status' => EEM_Registration::status_id_not_approved,
1519
-                ),
1520
-                REG_ADMIN_URL
1521
-            ),
1522
-            'view_pending_payment_reg_url' => add_query_arg(
1523
-                array(
1524
-                    'action'      => 'default',
1525
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1526
-                    '_reg_status' => EEM_Registration::status_id_pending_payment,
1527
-                ),
1528
-                REG_ADMIN_URL
1529
-            ),
1530
-            'approved_regs'                => $this->_cpt_model_obj->count_related(
1531
-                'Registration',
1532
-                $approved_query_args
1533
-            ),
1534
-            'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1535
-                'Registration',
1536
-                $not_approved_query_args
1537
-            ),
1538
-            'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1539
-                'Registration',
1540
-                $pending_payment_query_args
1541
-            ),
1542
-            'misc_pub_section_class'       => apply_filters(
1543
-                'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1544
-                'misc-pub-section'
1545
-            ),
1546
-        );
1547
-        ob_start();
1548
-        do_action(
1549
-            'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1550
-            $this->_cpt_model_obj
1551
-        );
1552
-        $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1553
-        // load template
1554
-        EEH_Template::display_template(
1555
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1556
-            $publish_box_extra_args
1557
-        );
1558
-    }
1559
-
1560
-
1561
-    /**
1562
-     * @return EE_Event
1563
-     */
1564
-    public function get_event_object()
1565
-    {
1566
-        return $this->_cpt_model_obj;
1567
-    }
1568
-
1569
-
1570
-
1571
-
1572
-    /** METABOXES * */
1573
-    /**
1574
-     * _register_event_editor_meta_boxes
1575
-     * add all metaboxes related to the event_editor
1576
-     *
1577
-     * @return void
1578
-     * @throws EE_Error
1579
-     * @throws InvalidArgumentException
1580
-     * @throws InvalidDataTypeException
1581
-     * @throws InvalidInterfaceException
1582
-     * @throws ReflectionException
1583
-     */
1584
-    protected function _register_event_editor_meta_boxes()
1585
-    {
1586
-        $this->verify_cpt_object();
1587
-        if ($this->admin_config->useAdvancedEditor()) {
1588
-            add_action(
1589
-                'add_meta_boxes_espresso_events',
1590
-                function () {
1591
-                    global $current_screen;
1592
-                    remove_meta_box('authordiv', $current_screen, 'normal');
1593
-                },
1594
-                99
1595
-            );
1596
-            return;
1597
-        }
1598
-        add_meta_box(
1599
-            'espresso_event_editor_tickets',
1600
-            esc_html__('Event Datetime & Ticket', 'event_espresso'),
1601
-            [$this, 'ticket_metabox'],
1602
-            $this->page_slug,
1603
-            'normal',
1604
-            'high'
1605
-        );
1606
-        add_meta_box(
1607
-            'espresso_event_editor_event_options',
1608
-            esc_html__('Event Registration Options', 'event_espresso'),
1609
-            array($this, 'registration_options_meta_box'),
1610
-            $this->page_slug,
1611
-            'side'
1612
-        );
1613
-        // NOTE: if you're looking for other metaboxes in here,
1614
-        // where a metabox has a related management page in the admin
1615
-        // you will find it setup in the related management page's "_Hooks" file.
1616
-        // i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1617
-    }
1618
-
1619
-
1620
-    /**
1621
-     * @throws DomainException
1622
-     * @throws EE_Error
1623
-     * @throws InvalidArgumentException
1624
-     * @throws InvalidDataTypeException
1625
-     * @throws InvalidInterfaceException
1626
-     * @throws ReflectionException
1627
-     */
1628
-    public function ticket_metabox()
1629
-    {
1630
-        $existing_datetime_ids = $existing_ticket_ids = array();
1631
-        // defaults for template args
1632
-        $template_args = array(
1633
-            'existing_datetime_ids'    => '',
1634
-            'event_datetime_help_link' => '',
1635
-            'ticket_options_help_link' => '',
1636
-            'time'                     => null,
1637
-            'ticket_rows'              => '',
1638
-            'existing_ticket_ids'      => '',
1639
-            'total_ticket_rows'        => 1,
1640
-            'ticket_js_structure'      => '',
1641
-            'trash_icon'               => 'ee-lock-icon',
1642
-            'disabled'                 => '',
1643
-        );
1644
-        $event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1645
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1646
-        /**
1647
-         * 1. Start with retrieving Datetimes
1648
-         * 2. Fore each datetime get related tickets
1649
-         * 3. For each ticket get related prices
1650
-         */
1651
-        $times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1652
-        /** @type EE_Datetime $first_datetime */
1653
-        $first_datetime = reset($times);
1654
-        // do we get related tickets?
1655
-        if ($first_datetime instanceof EE_Datetime
1656
-            && $first_datetime->ID() !== 0
1657
-        ) {
1658
-            $existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1659
-            $template_args['time'] = $first_datetime;
1660
-            $related_tickets = $first_datetime->tickets(
1661
-                array(
1662
-                    array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)),
1663
-                    'default_where_conditions' => 'none',
1664
-                )
1665
-            );
1666
-            if (! empty($related_tickets)) {
1667
-                $template_args['total_ticket_rows'] = count($related_tickets);
1668
-                $row = 0;
1669
-                foreach ($related_tickets as $ticket) {
1670
-                    $existing_ticket_ids[] = $ticket->get('TKT_ID');
1671
-                    $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1672
-                    $row++;
1673
-                }
1674
-            } else {
1675
-                $template_args['total_ticket_rows'] = 1;
1676
-                /** @type EE_Ticket $ticket */
1677
-                $ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1678
-                $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1679
-            }
1680
-        } else {
1681
-            $template_args['time'] = $times[0];
1682
-            /** @type EE_Ticket $ticket */
1683
-            $ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1684
-            $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1685
-            // NOTE: we're just sending the first default row
1686
-            // (decaf can't manage default tickets so this should be sufficient);
1687
-        }
1688
-        $template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1689
-            'event_editor_event_datetimes_help_tab'
1690
-        );
1691
-        $template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1692
-        $template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1693
-        $template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1694
-        $template_args['ticket_js_structure'] = $this->_get_ticket_row(
1695
-            EE_Registry::instance()->load_model('Ticket')->create_default_object(),
1696
-            true
1697
-        );
1698
-        $template = apply_filters(
1699
-            'FHEE__Events_Admin_Page__ticket_metabox__template',
1700
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1701
-        );
1702
-        EEH_Template::display_template($template, $template_args);
1703
-    }
1704
-
1705
-
1706
-    /**
1707
-     * Setup an individual ticket form for the decaf event editor page
1708
-     *
1709
-     * @access private
1710
-     * @param EE_Ticket $ticket   the ticket object
1711
-     * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1712
-     * @param int       $row
1713
-     * @return string generated html for the ticket row.
1714
-     * @throws DomainException
1715
-     * @throws EE_Error
1716
-     * @throws InvalidArgumentException
1717
-     * @throws InvalidDataTypeException
1718
-     * @throws InvalidInterfaceException
1719
-     * @throws ReflectionException
1720
-     */
1721
-    private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1722
-    {
1723
-        $template_args = array(
1724
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1725
-            'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1726
-                : '',
1727
-            'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1728
-            'TKT_ID'              => $ticket->get('TKT_ID'),
1729
-            'TKT_name'            => $ticket->get('TKT_name'),
1730
-            'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1731
-            'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1732
-            'TKT_is_default'      => $ticket->get('TKT_is_default'),
1733
-            'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1734
-            'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1735
-            'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1736
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1737
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1738
-                ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1739
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1740
-                : ' disabled=disabled',
1741
-        );
1742
-        $price = $ticket->ID() !== 0
1743
-            ? $ticket->get_first_related('Price', array('default_where_conditions' => 'none'))
1744
-            : EE_Registry::instance()->load_model('Price')->create_default_object();
1745
-        $price_args = array(
1746
-            'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1747
-            'PRC_amount'            => $price->get('PRC_amount'),
1748
-            'PRT_ID'                => $price->get('PRT_ID'),
1749
-            'PRC_ID'                => $price->get('PRC_ID'),
1750
-            'PRC_is_default'        => $price->get('PRC_is_default'),
1751
-        );
1752
-        // make sure we have default start and end dates if skeleton
1753
-        // handle rows that should NOT be empty
1754
-        if (empty($template_args['TKT_start_date'])) {
1755
-            // if empty then the start date will be now.
1756
-            $template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1757
-        }
1758
-        if (empty($template_args['TKT_end_date'])) {
1759
-            // get the earliest datetime (if present);
1760
-            $earliest_dtt = $this->_cpt_model_obj->ID() > 0
1761
-                ? $this->_cpt_model_obj->get_first_related(
1762
-                    'Datetime',
1763
-                    array('order_by' => array('DTT_EVT_start' => 'ASC'))
1764
-                )
1765
-                : null;
1766
-            if (! empty($earliest_dtt)) {
1767
-                $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1768
-            } else {
1769
-                $template_args['TKT_end_date'] = date(
1770
-                    'Y-m-d h:i a',
1771
-                    mktime(0, 0, 0, date('m'), date('d') + 7, date('Y'))
1772
-                );
1773
-            }
1774
-        }
1775
-        $template_args = array_merge($template_args, $price_args);
1776
-        $template = apply_filters(
1777
-            'FHEE__Events_Admin_Page__get_ticket_row__template',
1778
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1779
-            $ticket
1780
-        );
1781
-        return EEH_Template::display_template($template, $template_args, true);
1782
-    }
1783
-
1784
-
1785
-    /**
1786
-     * @throws DomainException
1787
-     * @throws EE_Error
1788
-     */
1789
-    public function registration_options_meta_box()
1790
-    {
1791
-        $yes_no_values = array(
1792
-            array('id' => true, 'text' => esc_html__('Yes', 'event_espresso')),
1793
-            array('id' => false, 'text' => esc_html__('No', 'event_espresso')),
1794
-        );
1795
-        $default_reg_status_values = EEM_Registration::reg_status_array(
1796
-            array(
1797
-                EEM_Registration::status_id_cancelled,
1798
-                EEM_Registration::status_id_declined,
1799
-                EEM_Registration::status_id_incomplete,
1800
-            ),
1801
-            true
1802
-        );
1803
-        // $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1804
-        $template_args['_event'] = $this->_cpt_model_obj;
1805
-        $template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1806
-        $template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1807
-        $template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1808
-            'default_reg_status',
1809
-            $default_reg_status_values,
1810
-            $this->_cpt_model_obj->default_registration_status()
1811
-        );
1812
-        $template_args['display_description'] = EEH_Form_Fields::select_input(
1813
-            'display_desc',
1814
-            $yes_no_values,
1815
-            $this->_cpt_model_obj->display_description()
1816
-        );
1817
-        $template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1818
-            'display_ticket_selector',
1819
-            $yes_no_values,
1820
-            $this->_cpt_model_obj->display_ticket_selector(),
1821
-            '',
1822
-            '',
1823
-            false
1824
-        );
1825
-        $template_args['additional_registration_options'] = apply_filters(
1826
-            'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1827
-            '',
1828
-            $template_args,
1829
-            $yes_no_values,
1830
-            $default_reg_status_values
1831
-        );
1832
-        EEH_Template::display_template(
1833
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1834
-            $template_args
1835
-        );
1836
-    }
1837
-
1838
-
1839
-    /**
1840
-     * _get_events()
1841
-     * This method simply returns all the events (for the given _view and paging)
1842
-     *
1843
-     * @access public
1844
-     * @param int  $per_page     count of items per page (20 default);
1845
-     * @param int  $current_page what is the current page being viewed.
1846
-     * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1847
-     *                           If FALSE then we return an array of event objects
1848
-     *                           that match the given _view and paging parameters.
1849
-     * @return array an array of event objects.
1850
-     * @throws EE_Error
1851
-     * @throws InvalidArgumentException
1852
-     * @throws InvalidDataTypeException
1853
-     * @throws InvalidInterfaceException
1854
-     * @throws ReflectionException
1855
-     * @throws Exception
1856
-     * @throws Exception
1857
-     * @throws Exception
1858
-     */
1859
-    public function get_events($per_page = 10, $current_page = 1, $count = false)
1860
-    {
1861
-        $EEME = $this->_event_model();
1862
-        $offset = ($current_page - 1) * $per_page;
1863
-        $limit = $count ? null : $offset . ',' . $per_page;
1864
-        $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1865
-        $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1866
-        if (isset($this->_req_data['month_range'])) {
1867
-            $pieces = explode(' ', $this->_req_data['month_range'], 3);
1868
-            // simulate the FIRST day of the month, that fixes issues for months like February
1869
-            // where PHP doesn't know what to assume for date.
1870
-            // @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1871
-            $month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1872
-            $year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1873
-        }
1874
-        $where = array();
1875
-        $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1876
-        // determine what post_status our condition will have for the query.
1877
-        switch ($status) {
1878
-            case 'month':
1879
-            case 'today':
1880
-            case null:
1881
-            case 'all':
1882
-                break;
1883
-            case 'draft':
1884
-                $where['status'] = array('IN', array('draft', 'auto-draft'));
1885
-                break;
1886
-            default:
1887
-                $where['status'] = $status;
1888
-        }
1889
-        // categories?
1890
-        $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1891
-            ? $this->_req_data['EVT_CAT'] : null;
1892
-        if (! empty($category)) {
1893
-            $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1894
-            $where['Term_Taxonomy.term_id'] = $category;
1895
-        }
1896
-        // date where conditions
1897
-        $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1898
-        if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1899
-            $DateTime = new DateTime(
1900
-                $year_r . '-' . $month_r . '-01 00:00:00',
1901
-                new DateTimeZone('UTC')
1902
-            );
1903
-            $start = $DateTime->getTimestamp();
1904
-            // set the datetime to be the end of the month
1905
-            $DateTime->setDate(
1906
-                $year_r,
1907
-                $month_r,
1908
-                $DateTime->format('t')
1909
-            )->setTime(23, 59, 59);
1910
-            $end = $DateTime->getTimestamp();
1911
-            $where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1912
-        } elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'today') {
1913
-            $DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1914
-            $start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1915
-            $end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1916
-            $where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1917
-        } elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'month') {
1918
-            $now = date('Y-m-01');
1919
-            $DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1920
-            $start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1921
-            $end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1922
-                            ->setTime(23, 59, 59)
1923
-                            ->format(implode(' ', $start_formats));
1924
-            $where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1925
-        }
1926
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1927
-            $where['EVT_wp_user'] = get_current_user_id();
1928
-        } elseif (! isset($where['status'])
1929
-            && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1930
-        ) {
1931
-            $where['OR'] = array(
1932
-                'status*restrict_private' => array('!=', 'private'),
1933
-                'AND'                     => array(
1934
-                    'status*inclusive' => array('=', 'private'),
1935
-                    'EVT_wp_user'      => get_current_user_id(),
1936
-                ),
1937
-            );
1938
-        }
1939
-
1940
-        if (isset($this->_req_data['EVT_wp_user'])
1941
-            && (int) $this->_req_data['EVT_wp_user'] !== (int) get_current_user_id()
1942
-            && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1943
-        ) {
1944
-            $where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1945
-        }
1946
-        // search query handling
1947
-        if (isset($this->_req_data['s'])) {
1948
-            $search_string = '%' . $this->_req_data['s'] . '%';
1949
-            $where['OR'] = array(
1950
-                'EVT_name'       => array('LIKE', $search_string),
1951
-                'EVT_desc'       => array('LIKE', $search_string),
1952
-                'EVT_short_desc' => array('LIKE', $search_string),
1953
-            );
1954
-        }
1955
-        // filter events by venue.
1956
-        if (isset($this->_req_data['venue']) && ! empty($this->_req_data['venue'])) {
1957
-            $where['Venue.VNU_ID'] = absint($this->_req_data['venue']);
1958
-        }
1959
-        $where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1960
-        $query_params = apply_filters(
1961
-            'FHEE__Events_Admin_Page__get_events__query_params',
1962
-            array(
1963
-                $where,
1964
-                'limit'    => $limit,
1965
-                'order_by' => $orderby,
1966
-                'order'    => $order,
1967
-                'group_by' => 'EVT_ID',
1968
-            ),
1969
-            $this->_req_data
1970
-        );
1971
-
1972
-        // let's first check if we have special requests coming in.
1973
-        if (isset($this->_req_data['active_status'])) {
1974
-            switch ($this->_req_data['active_status']) {
1975
-                case 'upcoming':
1976
-                    return $EEME->get_upcoming_events($query_params, $count);
1977
-                    break;
1978
-                case 'expired':
1979
-                    return $EEME->get_expired_events($query_params, $count);
1980
-                    break;
1981
-                case 'active':
1982
-                    return $EEME->get_active_events($query_params, $count);
1983
-                    break;
1984
-                case 'inactive':
1985
-                    return $EEME->get_inactive_events($query_params, $count);
1986
-                    break;
1987
-            }
1988
-        }
1989
-
1990
-        $events = $count ? $EEME->count(array($where), 'EVT_ID', true) : $EEME->get_all($query_params);
1991
-        return $events;
1992
-    }
1993
-
1994
-
1995
-    /**
1996
-     * handling for WordPress CPT actions (trash, restore, delete)
1997
-     *
1998
-     * @param string $post_id
1999
-     * @throws EE_Error
2000
-     * @throws InvalidArgumentException
2001
-     * @throws InvalidDataTypeException
2002
-     * @throws InvalidInterfaceException
2003
-     * @throws ReflectionException
2004
-     */
2005
-    public function trash_cpt_item($post_id)
2006
-    {
2007
-        $this->_req_data['EVT_ID'] = $post_id;
2008
-        $this->_trash_or_restore_event('trash', false);
2009
-    }
2010
-
2011
-
2012
-    /**
2013
-     * @param string $post_id
2014
-     * @throws EE_Error
2015
-     * @throws InvalidArgumentException
2016
-     * @throws InvalidDataTypeException
2017
-     * @throws InvalidInterfaceException
2018
-     * @throws ReflectionException
2019
-     */
2020
-    public function restore_cpt_item($post_id)
2021
-    {
2022
-        $this->_req_data['EVT_ID'] = $post_id;
2023
-        $this->_trash_or_restore_event('draft', false);
2024
-    }
2025
-
2026
-
2027
-    /**
2028
-     * @param string $post_id
2029
-     * @throws EE_Error
2030
-     * @throws InvalidArgumentException
2031
-     * @throws InvalidDataTypeException
2032
-     * @throws InvalidInterfaceException
2033
-     * @throws ReflectionException
2034
-     */
2035
-    public function delete_cpt_item($post_id)
2036
-    {
2037
-        $this->_req_data['EVT_ID'] = $post_id;
2038
-        $this->_delete_event(false);
2039
-    }
2040
-
2041
-
2042
-    /**
2043
-     * _trash_or_restore_event
2044
-     *
2045
-     * @access protected
2046
-     * @param string $event_status
2047
-     * @param bool   $redirect_after
2048
-     * @throws EE_Error
2049
-     * @throws InvalidArgumentException
2050
-     * @throws InvalidDataTypeException
2051
-     * @throws InvalidInterfaceException
2052
-     * @throws ReflectionException
2053
-     */
2054
-    protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2055
-    {
2056
-        // determine the event id and set to array.
2057
-        $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
2058
-        // loop thru events
2059
-        if ($EVT_ID) {
2060
-            // clean status
2061
-            $event_status = sanitize_key($event_status);
2062
-            // grab status
2063
-            if (! empty($event_status)) {
2064
-                $success = $this->_change_event_status($EVT_ID, $event_status);
2065
-            } else {
2066
-                $success = false;
2067
-                $msg = esc_html__(
2068
-                    'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2069
-                    'event_espresso'
2070
-                );
2071
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2072
-            }
2073
-        } else {
2074
-            $success = false;
2075
-            $msg = esc_html__(
2076
-                'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2077
-                'event_espresso'
2078
-            );
2079
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2080
-        }
2081
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2082
-        if ($redirect_after) {
2083
-            $this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
2084
-        }
2085
-    }
2086
-
2087
-
2088
-    /**
2089
-     * _trash_or_restore_events
2090
-     *
2091
-     * @access protected
2092
-     * @param string $event_status
2093
-     * @return void
2094
-     * @throws EE_Error
2095
-     * @throws InvalidArgumentException
2096
-     * @throws InvalidDataTypeException
2097
-     * @throws InvalidInterfaceException
2098
-     * @throws ReflectionException
2099
-     */
2100
-    protected function _trash_or_restore_events($event_status = 'trash')
2101
-    {
2102
-        // clean status
2103
-        $event_status = sanitize_key($event_status);
2104
-        // grab status
2105
-        if (! empty($event_status)) {
2106
-            $success = true;
2107
-            // determine the event id and set to array.
2108
-            $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
2109
-            // loop thru events
2110
-            foreach ($EVT_IDs as $EVT_ID) {
2111
-                if ($EVT_ID = absint($EVT_ID)) {
2112
-                    $results = $this->_change_event_status($EVT_ID, $event_status);
2113
-                    $success = $results !== false ? $success : false;
2114
-                } else {
2115
-                    $msg = sprintf(
2116
-                        esc_html__(
2117
-                            'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2118
-                            'event_espresso'
2119
-                        ),
2120
-                        $EVT_ID
2121
-                    );
2122
-                    EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2123
-                    $success = false;
2124
-                }
2125
-            }
2126
-        } else {
2127
-            $success = false;
2128
-            $msg = esc_html__(
2129
-                'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2130
-                'event_espresso'
2131
-            );
2132
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2133
-        }
2134
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2135
-        $success = $success ? 2 : false;
2136
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2137
-        $this->_redirect_after_action($success, 'Events', $action, array('action' => 'default'));
2138
-    }
2139
-
2140
-
2141
-    /**
2142
-     * _trash_or_restore_events
2143
-     *
2144
-     * @access  private
2145
-     * @param int    $EVT_ID
2146
-     * @param string $event_status
2147
-     * @return bool
2148
-     * @throws EE_Error
2149
-     * @throws InvalidArgumentException
2150
-     * @throws InvalidDataTypeException
2151
-     * @throws InvalidInterfaceException
2152
-     * @throws ReflectionException
2153
-     */
2154
-    private function _change_event_status($EVT_ID = 0, $event_status = '')
2155
-    {
2156
-        // grab event id
2157
-        if (! $EVT_ID) {
2158
-            $msg = esc_html__(
2159
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2160
-                'event_espresso'
2161
-            );
2162
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2163
-            return false;
2164
-        }
2165
-        $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2166
-        // clean status
2167
-        $event_status = sanitize_key($event_status);
2168
-        // grab status
2169
-        if (empty($event_status)) {
2170
-            $msg = esc_html__(
2171
-                'An error occurred. No Event Status or an invalid Event Status was received.',
2172
-                'event_espresso'
2173
-            );
2174
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2175
-            return false;
2176
-        }
2177
-        // was event trashed or restored ?
2178
-        switch ($event_status) {
2179
-            case 'draft':
2180
-                $action = 'restored from the trash';
2181
-                $hook = 'AHEE_event_restored_from_trash';
2182
-                break;
2183
-            case 'trash':
2184
-                $action = 'moved to the trash';
2185
-                $hook = 'AHEE_event_moved_to_trash';
2186
-                break;
2187
-            default:
2188
-                $action = 'updated';
2189
-                $hook = false;
2190
-        }
2191
-        // use class to change status
2192
-        $this->_cpt_model_obj->set_status($event_status);
2193
-        $success = $this->_cpt_model_obj->save();
2194
-        if ($success === false) {
2195
-            $msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2196
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2197
-            return false;
2198
-        }
2199
-        if ($hook) {
2200
-            do_action($hook);
2201
-        }
2202
-        return true;
2203
-    }
2204
-
2205
-
2206
-    /**
2207
-     * _delete_event
2208
-     *
2209
-     * @access protected
2210
-     * @param bool $redirect_after
2211
-     * @throws EE_Error
2212
-     * @throws InvalidArgumentException
2213
-     * @throws InvalidDataTypeException
2214
-     * @throws InvalidInterfaceException
2215
-     * @throws ReflectionException
2216
-     */
2217
-    protected function _delete_event($redirect_after = true)
2218
-    {
2219
-        // determine the event id and set to array.
2220
-        $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
2221
-        $EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
2222
-        // loop thru events
2223
-        if ($EVT_ID) {
2224
-            $success = $this->_permanently_delete_event($EVT_ID);
2225
-            // get list of events with no prices
2226
-            $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2227
-            // remove this event from the list of events with no prices
2228
-            if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2229
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2230
-            }
2231
-            update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2232
-        } else {
2233
-            $success = false;
2234
-            $msg = esc_html__(
2235
-                'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2236
-                'event_espresso'
2237
-            );
2238
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2239
-        }
2240
-        if ($redirect_after) {
2241
-            $this->_redirect_after_action(
2242
-                $success,
2243
-                'Event',
2244
-                'deleted',
2245
-                array('action' => 'default', 'status' => 'trash')
2246
-            );
2247
-        }
2248
-    }
2249
-
2250
-
2251
-    /**
2252
-     * _delete_events
2253
-     *
2254
-     * @access protected
2255
-     * @return void
2256
-     * @throws EE_Error
2257
-     * @throws InvalidArgumentException
2258
-     * @throws InvalidDataTypeException
2259
-     * @throws InvalidInterfaceException
2260
-     * @throws ReflectionException
2261
-     */
2262
-    protected function _delete_events()
2263
-    {
2264
-        $success = true;
2265
-        // get list of events with no prices
2266
-        $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2267
-        // determine the event id and set to array.
2268
-        $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
2269
-        // loop thru events
2270
-        foreach ($EVT_IDs as $EVT_ID) {
2271
-            $EVT_ID = absint($EVT_ID);
2272
-            if ($EVT_ID) {
2273
-                $results = $this->_permanently_delete_event($EVT_ID);
2274
-                $success = $results !== false ? $success : false;
2275
-                // remove this event from the list of events with no prices
2276
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2277
-            } else {
2278
-                $success = false;
2279
-                $msg = esc_html__(
2280
-                    'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2281
-                    'event_espresso'
2282
-                );
2283
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2284
-            }
2285
-        }
2286
-        update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2287
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2288
-        $success = $success ? 2 : false;
2289
-        $this->_redirect_after_action($success, 'Events', 'deleted', array('action' => 'default'));
2290
-    }
2291
-
2292
-
2293
-    /**
2294
-     * _permanently_delete_event
2295
-     *
2296
-     * @access  private
2297
-     * @param int $EVT_ID
2298
-     * @return bool
2299
-     * @throws EE_Error
2300
-     * @throws InvalidArgumentException
2301
-     * @throws InvalidDataTypeException
2302
-     * @throws InvalidInterfaceException
2303
-     * @throws ReflectionException
2304
-     */
2305
-    private function _permanently_delete_event($EVT_ID = 0)
2306
-    {
2307
-        // grab event id
2308
-        if (! $EVT_ID) {
2309
-            $msg = esc_html__(
2310
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2311
-                'event_espresso'
2312
-            );
2313
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2314
-            return false;
2315
-        }
2316
-        if (! $this->_cpt_model_obj instanceof EE_Event
2317
-            || $this->_cpt_model_obj->ID() !== $EVT_ID
2318
-        ) {
2319
-            $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2320
-        }
2321
-        if (! $this->_cpt_model_obj instanceof EE_Event) {
2322
-            return false;
2323
-        }
2324
-        // need to delete related tickets and prices first.
2325
-        $datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2326
-        foreach ($datetimes as $datetime) {
2327
-            $this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2328
-            $tickets = $datetime->get_many_related('Ticket');
2329
-            foreach ($tickets as $ticket) {
2330
-                $ticket->_remove_relation_to($datetime, 'Datetime');
2331
-                $ticket->delete_related_permanently('Price');
2332
-                $ticket->delete_permanently();
2333
-            }
2334
-            $datetime->delete();
2335
-        }
2336
-        // what about related venues or terms?
2337
-        $venues = $this->_cpt_model_obj->get_many_related('Venue');
2338
-        foreach ($venues as $venue) {
2339
-            $this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2340
-        }
2341
-        // any attached question groups?
2342
-        $question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2343
-        if (! empty($question_groups)) {
2344
-            foreach ($question_groups as $question_group) {
2345
-                $this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2346
-            }
2347
-        }
2348
-        // Message Template Groups
2349
-        $this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2350
-        /** @type EE_Term_Taxonomy[] $term_taxonomies */
2351
-        $term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2352
-        foreach ($term_taxonomies as $term_taxonomy) {
2353
-            $this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2354
-        }
2355
-        $success = $this->_cpt_model_obj->delete_permanently();
2356
-        // did it all go as planned ?
2357
-        if ($success) {
2358
-            $msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2359
-            EE_Error::add_success($msg);
2360
-        } else {
2361
-            $msg = sprintf(
2362
-                esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2363
-                $EVT_ID
2364
-            );
2365
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2366
-            return false;
2367
-        }
2368
-        do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2369
-        return true;
2370
-    }
2371
-
2372
-
2373
-    /**
2374
-     * get total number of events
2375
-     *
2376
-     * @access public
2377
-     * @return int
2378
-     * @throws EE_Error
2379
-     * @throws InvalidArgumentException
2380
-     * @throws InvalidDataTypeException
2381
-     * @throws InvalidInterfaceException
2382
-     */
2383
-    public function total_events()
2384
-    {
2385
-        $count = EEM_Event::instance()->count(array('caps' => 'read_admin'), 'EVT_ID', true);
2386
-        return $count;
2387
-    }
2388
-
2389
-
2390
-    /**
2391
-     * get total number of draft events
2392
-     *
2393
-     * @access public
2394
-     * @return int
2395
-     * @throws EE_Error
2396
-     * @throws InvalidArgumentException
2397
-     * @throws InvalidDataTypeException
2398
-     * @throws InvalidInterfaceException
2399
-     */
2400
-    public function total_events_draft()
2401
-    {
2402
-        $where = array(
2403
-            'status' => array('IN', array('draft', 'auto-draft')),
2404
-        );
2405
-        $count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
2406
-        return $count;
2407
-    }
2408
-
2409
-
2410
-    /**
2411
-     * get total number of trashed events
2412
-     *
2413
-     * @access public
2414
-     * @return int
2415
-     * @throws EE_Error
2416
-     * @throws InvalidArgumentException
2417
-     * @throws InvalidDataTypeException
2418
-     * @throws InvalidInterfaceException
2419
-     */
2420
-    public function total_trashed_events()
2421
-    {
2422
-        $where = array(
2423
-            'status' => 'trash',
2424
-        );
2425
-        $count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
2426
-        return $count;
2427
-    }
2428
-
2429
-
2430
-    /**
2431
-     *    _default_event_settings
2432
-     *    This generates the Default Settings Tab
2433
-     *
2434
-     * @return void
2435
-     * @throws DomainException
2436
-     * @throws EE_Error
2437
-     * @throws InvalidArgumentException
2438
-     * @throws InvalidDataTypeException
2439
-     * @throws InvalidInterfaceException
2440
-     */
2441
-    protected function _default_event_settings()
2442
-    {
2443
-        $this->_set_add_edit_form_tags('update_default_event_settings');
2444
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
2445
-        $this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2446
-        $this->display_admin_page_with_sidebar();
2447
-    }
2448
-
2449
-
2450
-    /**
2451
-     * Return the form for event settings.
2452
-     *
2453
-     * @return EE_Form_Section_Proper
2454
-     * @throws EE_Error
2455
-     */
2456
-    protected function _default_event_settings_form()
2457
-    {
2458
-        $registration_config = EE_Registry::instance()->CFG->registration;
2459
-        $registration_stati_for_selection = EEM_Registration::reg_status_array(
2460
-            // exclude
2461
-            array(
2462
-                EEM_Registration::status_id_cancelled,
2463
-                EEM_Registration::status_id_declined,
2464
-                EEM_Registration::status_id_incomplete,
2465
-                EEM_Registration::status_id_wait_list,
2466
-            ),
2467
-            true
2468
-        );
2469
-        return new EE_Form_Section_Proper(
2470
-            array(
2471
-                'name'            => 'update_default_event_settings',
2472
-                'html_id'         => 'update_default_event_settings',
2473
-                'html_class'      => 'form-table',
2474
-                'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2475
-                'subsections'     => apply_filters(
2476
-                    'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2477
-                    array(
2478
-                        'default_reg_status'  => new EE_Select_Input(
2479
-                            $registration_stati_for_selection,
2480
-                            array(
2481
-                                'default'         => isset($registration_config->default_STS_ID)
2482
-                                                     && array_key_exists(
2483
-                                                         $registration_config->default_STS_ID,
2484
-                                                         $registration_stati_for_selection
2485
-                                                     )
2486
-                                    ? sanitize_text_field($registration_config->default_STS_ID)
2487
-                                    : EEM_Registration::status_id_pending_payment,
2488
-                                'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2489
-                                                     . EEH_Template::get_help_tab_link(
2490
-                                                         'default_settings_status_help_tab'
2491
-                                                     ),
2492
-                                'html_help_text'  => esc_html__(
2493
-                                    'This setting allows you to preselect what the default registration status setting is when creating an event.  Note that changing this setting does NOT retroactively apply it to existing events.',
2494
-                                    'event_espresso'
2495
-                                ),
2496
-                            )
2497
-                        ),
2498
-                        'default_max_tickets' => new EE_Integer_Input(
2499
-                            array(
2500
-                                'default'         => isset($registration_config->default_maximum_number_of_tickets)
2501
-                                    ? $registration_config->default_maximum_number_of_tickets
2502
-                                    : EEM_Event::get_default_additional_limit(),
2503
-                                'html_label_text' => esc_html__(
2504
-                                    'Default Maximum Tickets Allowed Per Order:',
2505
-                                    'event_espresso'
2506
-                                )
2507
-                                                     . EEH_Template::get_help_tab_link(
2508
-                                                         'default_maximum_tickets_help_tab"'
2509
-                                                     ),
2510
-                                'html_help_text'  => esc_html__(
2511
-                                    'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2512
-                                    'event_espresso'
2513
-                                ),
2514
-                            )
2515
-                        ),
2516
-                    )
2517
-                ),
2518
-            )
2519
-        );
2520
-    }
2521
-
2522
-
2523
-    /**
2524
-     * @return void
2525
-     * @throws EE_Error
2526
-     * @throws InvalidArgumentException
2527
-     * @throws InvalidDataTypeException
2528
-     * @throws InvalidInterfaceException
2529
-     */
2530
-    protected function _update_default_event_settings()
2531
-    {
2532
-        $form = $this->_default_event_settings_form();
2533
-        if ($form->was_submitted()) {
2534
-            $form->receive_form_submission();
2535
-            if ($form->is_valid()) {
2536
-                $registration_config = EE_Registry::instance()->CFG->registration;
2537
-                $valid_data = $form->valid_data();
2538
-                if (isset($valid_data['default_reg_status'])) {
2539
-                    $registration_config->default_STS_ID = $valid_data['default_reg_status'];
2540
-                }
2541
-                if (isset($valid_data['default_max_tickets'])) {
2542
-                    $registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2543
-                }
2544
-                do_action(
2545
-                    'AHEE__Events_Admin_Page___update_default_event_settings',
2546
-                    $valid_data,
2547
-                    EE_Registry::instance()->CFG,
2548
-                    $this
2549
-                );
2550
-                // update because data was valid!
2551
-                EE_Registry::instance()->CFG->update_espresso_config();
2552
-                EE_Error::overwrite_success();
2553
-                EE_Error::add_success(
2554
-                    __('Default Event Settings were updated', 'event_espresso')
2555
-                );
2556
-            }
2557
-        }
2558
-        $this->_redirect_after_action(0, '', '', array('action' => 'default_event_settings'), true);
2559
-    }
2560
-
2561
-
2562
-    /*************        Templates        *************/
2563
-    protected function _template_settings()
2564
-    {
2565
-        $this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2566
-        $this->_template_args['preview_img'] = '<img src="'
2567
-                                               . EVENTS_ASSETS_URL
2568
-                                               . '/images/'
2569
-                                               . 'caffeinated_template_features.jpg" alt="'
2570
-                                               . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2571
-                                               . '" />';
2572
-        $this->_template_args['preview_text'] = '<strong>'
2573
-                                                . esc_html__(
2574
-                                                    'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2575
-                                                    'event_espresso'
2576
-                                                ) . '</strong>';
2577
-        $this->display_admin_caf_preview_page('template_settings_tab');
2578
-    }
2579
-
2580
-
2581
-    /** Event Category Stuff **/
2582
-    /**
2583
-     * set the _category property with the category object for the loaded page.
2584
-     *
2585
-     * @access private
2586
-     * @return void
2587
-     */
2588
-    private function _set_category_object()
2589
-    {
2590
-        if (isset($this->_category->id) && ! empty($this->_category->id)) {
2591
-            return;
2592
-        } //already have the category object so get out.
2593
-        // set default category object
2594
-        $this->_set_empty_category_object();
2595
-        // only set if we've got an id
2596
-        if (! isset($this->_req_data['EVT_CAT_ID'])) {
2597
-            return;
2598
-        }
2599
-        $category_id = absint($this->_req_data['EVT_CAT_ID']);
2600
-        $term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2601
-        if (! empty($term)) {
2602
-            $this->_category->category_name = $term->name;
2603
-            $this->_category->category_identifier = $term->slug;
2604
-            $this->_category->category_desc = $term->description;
2605
-            $this->_category->id = $term->term_id;
2606
-            $this->_category->parent = $term->parent;
2607
-        }
2608
-    }
2609
-
2610
-
2611
-    /**
2612
-     * Clears out category properties.
2613
-     */
2614
-    private function _set_empty_category_object()
2615
-    {
2616
-        $this->_category = new stdClass();
2617
-        $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2618
-        $this->_category->id = $this->_category->parent = 0;
2619
-    }
2620
-
2621
-
2622
-    /**
2623
-     * @throws DomainException
2624
-     * @throws EE_Error
2625
-     * @throws InvalidArgumentException
2626
-     * @throws InvalidDataTypeException
2627
-     * @throws InvalidInterfaceException
2628
-     */
2629
-    protected function _category_list_table()
2630
-    {
2631
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2632
-        $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2633
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2634
-            'add_category',
2635
-            'add_category',
2636
-            array(),
2637
-            'add-new-h2'
2638
-        );
2639
-        $this->display_admin_list_table_page_with_sidebar();
2640
-    }
2641
-
2642
-
2643
-    /**
2644
-     * Output category details view.
2645
-     *
2646
-     * @param string $view
2647
-     * @throws DomainException
2648
-     * @throws EE_Error
2649
-     * @throws InvalidArgumentException
2650
-     * @throws InvalidDataTypeException
2651
-     * @throws InvalidInterfaceException
2652
-     */
2653
-    protected function _category_details($view)
2654
-    {
2655
-        // load formatter helper
2656
-        // load field generator helper
2657
-        $route = $view === 'edit' ? 'update_category' : 'insert_category';
2658
-        $this->_set_add_edit_form_tags($route);
2659
-        $this->_set_category_object();
2660
-        $id = ! empty($this->_category->id) ? $this->_category->id : '';
2661
-        $delete_action = 'delete_category';
2662
-        // custom redirect
2663
-        $redirect = EE_Admin_Page::add_query_args_and_nonce(
2664
-            array('action' => 'category_list'),
2665
-            $this->_admin_base_url
2666
-        );
2667
-        $this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2668
-        // take care of contents
2669
-        $this->_template_args['admin_page_content'] = $this->_category_details_content();
2670
-        $this->display_admin_page_with_sidebar();
2671
-    }
2672
-
2673
-
2674
-    /**
2675
-     * Output category details content.
2676
-     *
2677
-     * @throws DomainException
2678
-     */
2679
-    protected function _category_details_content()
2680
-    {
2681
-        $editor_args['category_desc'] = array(
2682
-            'type'          => 'wp_editor',
2683
-            'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2684
-            'class'         => 'my_editor_custom',
2685
-            'wpeditor_args' => array('media_buttons' => false),
2686
-        );
2687
-        $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2688
-        $all_terms = get_terms(
2689
-            array(EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY),
2690
-            array('hide_empty' => 0, 'exclude' => array($this->_category->id))
2691
-        );
2692
-        // setup category select for term parents.
2693
-        $category_select_values[] = array(
2694
-            'text' => esc_html__('No Parent', 'event_espresso'),
2695
-            'id'   => 0,
2696
-        );
2697
-        foreach ($all_terms as $term) {
2698
-            $category_select_values[] = array(
2699
-                'text' => $term->name,
2700
-                'id'   => $term->term_id,
2701
-            );
2702
-        }
2703
-        $category_select = EEH_Form_Fields::select_input(
2704
-            'category_parent',
2705
-            $category_select_values,
2706
-            $this->_category->parent
2707
-        );
2708
-        $template_args = array(
2709
-            'category'                 => $this->_category,
2710
-            'category_select'          => $category_select,
2711
-            'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2712
-            'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2713
-            'disable'                  => '',
2714
-            'disabled_message'         => false,
2715
-        );
2716
-        $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2717
-        return EEH_Template::display_template($template, $template_args, true);
2718
-    }
2719
-
2720
-
2721
-    /**
2722
-     * Handles deleting categories.
2723
-     */
2724
-    protected function _delete_categories()
2725
-    {
2726
-        $cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2727
-            : (array) $this->_req_data['category_id'];
2728
-        foreach ($cat_ids as $cat_id) {
2729
-            $this->_delete_category($cat_id);
2730
-        }
2731
-        // doesn't matter what page we're coming from... we're going to the same place after delete.
2732
-        $query_args = array(
2733
-            'action' => 'category_list',
2734
-        );
2735
-        $this->_redirect_after_action(0, '', '', $query_args);
2736
-    }
2737
-
2738
-
2739
-    /**
2740
-     * Handles deleting specific category.
2741
-     *
2742
-     * @param int $cat_id
2743
-     */
2744
-    protected function _delete_category($cat_id)
2745
-    {
2746
-        $cat_id = absint($cat_id);
2747
-        wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2748
-    }
2749
-
2750
-
2751
-    /**
2752
-     * Handles triggering the update or insertion of a new category.
2753
-     *
2754
-     * @param bool $new_category true means we're triggering the insert of a new category.
2755
-     * @throws EE_Error
2756
-     * @throws InvalidArgumentException
2757
-     * @throws InvalidDataTypeException
2758
-     * @throws InvalidInterfaceException
2759
-     */
2760
-    protected function _insert_or_update_category($new_category)
2761
-    {
2762
-        $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2763
-        $success = 0; // we already have a success message so lets not send another.
2764
-        if ($cat_id) {
2765
-            $query_args = array(
2766
-                'action'     => 'edit_category',
2767
-                'EVT_CAT_ID' => $cat_id,
2768
-            );
2769
-        } else {
2770
-            $query_args = array('action' => 'add_category');
2771
-        }
2772
-        $this->_redirect_after_action($success, '', '', $query_args, true);
2773
-    }
2774
-
2775
-
2776
-    /**
2777
-     * Inserts or updates category
2778
-     *
2779
-     * @param bool $update (true indicates we're updating a category).
2780
-     * @return bool|mixed|string
2781
-     */
2782
-    private function _insert_category($update = false)
2783
-    {
2784
-        $cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2785
-        $category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2786
-        $category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2787
-        $category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2788
-        if (empty($category_name)) {
2789
-            $msg = esc_html__('You must add a name for the category.', 'event_espresso');
2790
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2791
-            return false;
2792
-        }
2793
-        $term_args = array(
2794
-            'name'        => $category_name,
2795
-            'description' => $category_desc,
2796
-            'parent'      => $category_parent,
2797
-        );
2798
-        // was the category_identifier input disabled?
2799
-        if (isset($this->_req_data['category_identifier'])) {
2800
-            $term_args['slug'] = $this->_req_data['category_identifier'];
2801
-        }
2802
-        $insert_ids = $update
2803
-            ? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2804
-            : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2805
-        if (! is_array($insert_ids)) {
2806
-            $msg = esc_html__(
2807
-                'An error occurred and the category has not been saved to the database.',
2808
-                'event_espresso'
2809
-            );
2810
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2811
-        } else {
2812
-            $cat_id = $insert_ids['term_id'];
2813
-            $msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2814
-            EE_Error::add_success($msg);
2815
-        }
2816
-        return $cat_id;
2817
-    }
2818
-
2819
-
2820
-    /**
2821
-     * Gets categories or count of categories matching the arguments in the request.
2822
-     *
2823
-     * @param int  $per_page
2824
-     * @param int  $current_page
2825
-     * @param bool $count
2826
-     * @return EE_Base_Class[]|EE_Term_Taxonomy[]|int
2827
-     * @throws EE_Error
2828
-     * @throws InvalidArgumentException
2829
-     * @throws InvalidDataTypeException
2830
-     * @throws InvalidInterfaceException
2831
-     */
2832
-    public function get_categories($per_page = 10, $current_page = 1, $count = false)
2833
-    {
2834
-        // testing term stuff
2835
-        $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2836
-        $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2837
-        $limit = ($current_page - 1) * $per_page;
2838
-        $where = array('taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2839
-        if (isset($this->_req_data['s'])) {
2840
-            $sstr = '%' . $this->_req_data['s'] . '%';
2841
-            $where['OR'] = array(
2842
-                'Term.name'   => array('LIKE', $sstr),
2843
-                'description' => array('LIKE', $sstr),
2844
-            );
2845
-        }
2846
-        $query_params = array(
2847
-            $where,
2848
-            'order_by'   => array($orderby => $order),
2849
-            'limit'      => $limit . ',' . $per_page,
2850
-            'force_join' => array('Term'),
2851
-        );
2852
-        $categories = $count
2853
-            ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2854
-            : EEM_Term_Taxonomy::instance()->get_all($query_params);
2855
-        return $categories;
2856
-    }
2857
-
2858
-    /* end category stuff */
2859
-    /**************/
2860
-
2861
-
2862
-    /**
2863
-     * Callback for the `ee_save_timezone_setting` ajax action.
2864
-     *
2865
-     * @throws EE_Error
2866
-     * @throws InvalidArgumentException
2867
-     * @throws InvalidDataTypeException
2868
-     * @throws InvalidInterfaceException
2869
-     */
2870
-    public function save_timezonestring_setting()
2871
-    {
2872
-        $timezone_string = isset($this->_req_data['timezone_selected'])
2873
-            ? $this->_req_data['timezone_selected']
2874
-            : '';
2875
-        if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2876
-            EE_Error::add_error(
2877
-                esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2878
-                __FILE__,
2879
-                __FUNCTION__,
2880
-                __LINE__
2881
-            );
2882
-            $this->_template_args['error'] = true;
2883
-            $this->_return_json();
2884
-        }
2885
-
2886
-        update_option('timezone_string', $timezone_string);
2887
-        EE_Error::add_success(
2888
-            esc_html__('Your timezone string was updated.', 'event_espresso')
2889
-        );
2890
-        $this->_template_args['success'] = true;
2891
-        $this->_return_json(true, array('action' => 'create_new'));
2892
-    }
18
+	/**
19
+	 * This will hold the event object for event_details screen.
20
+	 *
21
+	 * @access protected
22
+	 * @var EE_Event $_event
23
+	 */
24
+	protected $_event;
25
+
26
+
27
+	/**
28
+	 * This will hold the category object for category_details screen.
29
+	 *
30
+	 * @var stdClass $_category
31
+	 */
32
+	protected $_category;
33
+
34
+
35
+	/**
36
+	 * This will hold the event model instance
37
+	 *
38
+	 * @var EEM_Event $_event_model
39
+	 */
40
+	protected $_event_model;
41
+
42
+
43
+	/**
44
+	 * @var EE_Event
45
+	 */
46
+	protected $_cpt_model_obj = false;
47
+
48
+
49
+	/**
50
+	 * Initialize page props for this admin page group.
51
+	 */
52
+	protected function _init_page_props()
53
+	{
54
+		$this->page_slug = EVENTS_PG_SLUG;
55
+		$this->page_label = EVENTS_LABEL;
56
+		$this->_admin_base_url = EVENTS_ADMIN_URL;
57
+		$this->_admin_base_path = EVENTS_ADMIN;
58
+		$this->_cpt_model_names = array(
59
+			'create_new' => 'EEM_Event',
60
+			'edit'       => 'EEM_Event',
61
+		);
62
+		$this->_cpt_edit_routes = array(
63
+			'espresso_events' => 'edit',
64
+		);
65
+		add_action(
66
+			'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
67
+			array($this, 'verify_event_edit'),
68
+			10,
69
+			2
70
+		);
71
+	}
72
+
73
+
74
+	/**
75
+	 * Sets the ajax hooks used for this admin page group.
76
+	 */
77
+	protected function _ajax_hooks()
78
+	{
79
+		add_action('wp_ajax_ee_save_timezone_setting', array($this, 'save_timezonestring_setting'));
80
+	}
81
+
82
+
83
+	/**
84
+	 * Sets the page properties for this admin page group.
85
+	 */
86
+	protected function _define_page_props()
87
+	{
88
+		$this->_admin_page_title = EVENTS_LABEL;
89
+		$this->_labels = array(
90
+			'buttons'      => array(
91
+				'add'             => esc_html__('Add New Event', 'event_espresso'),
92
+				'edit'            => esc_html__('Edit Event', 'event_espresso'),
93
+				'delete'          => esc_html__('Delete Event', 'event_espresso'),
94
+				'add_category'    => esc_html__('Add New Category', 'event_espresso'),
95
+				'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
96
+				'delete_category' => esc_html__('Delete Category', 'event_espresso'),
97
+			),
98
+			'editor_title' => array(
99
+				'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
100
+			),
101
+			'publishbox'   => array(
102
+				'create_new'        => esc_html__('Save New Event', 'event_espresso'),
103
+				'edit'              => esc_html__('Update Event', 'event_espresso'),
104
+				'add_category'      => esc_html__('Save New Category', 'event_espresso'),
105
+				'edit_category'     => esc_html__('Update Category', 'event_espresso'),
106
+				'template_settings' => esc_html__('Update Settings', 'event_espresso'),
107
+			),
108
+		);
109
+	}
110
+
111
+
112
+	/**
113
+	 * Sets the page routes property for this admin page group.
114
+	 */
115
+	protected function _set_page_routes()
116
+	{
117
+		// load formatter helper
118
+		// load field generator helper
119
+		// is there a evt_id in the request?
120
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
121
+			? $this->_req_data['EVT_ID']
122
+			: 0;
123
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
124
+		$this->_page_routes = array(
125
+			'default'                       => array(
126
+				'func'       => '_events_overview_list_table',
127
+				'capability' => 'ee_read_events',
128
+			),
129
+			'create_new'                    => array(
130
+				'func'       => '_create_new_cpt_item',
131
+				'capability' => 'ee_edit_events',
132
+			),
133
+			'edit'                          => array(
134
+				'func'       => '_edit_cpt_item',
135
+				'capability' => 'ee_edit_event',
136
+				'obj_id'     => $evt_id,
137
+			),
138
+			'copy_event'                    => array(
139
+				'func'       => '_copy_events',
140
+				'capability' => 'ee_edit_event',
141
+				'obj_id'     => $evt_id,
142
+				'noheader'   => true,
143
+			),
144
+			'trash_event'                   => array(
145
+				'func'       => '_trash_or_restore_event',
146
+				'args'       => array('event_status' => 'trash'),
147
+				'capability' => 'ee_delete_event',
148
+				'obj_id'     => $evt_id,
149
+				'noheader'   => true,
150
+			),
151
+			'trash_events'                  => array(
152
+				'func'       => '_trash_or_restore_events',
153
+				'args'       => array('event_status' => 'trash'),
154
+				'capability' => 'ee_delete_events',
155
+				'noheader'   => true,
156
+			),
157
+			'restore_event'                 => array(
158
+				'func'       => '_trash_or_restore_event',
159
+				'args'       => array('event_status' => 'draft'),
160
+				'capability' => 'ee_delete_event',
161
+				'obj_id'     => $evt_id,
162
+				'noheader'   => true,
163
+			),
164
+			'restore_events'                => array(
165
+				'func'       => '_trash_or_restore_events',
166
+				'args'       => array('event_status' => 'draft'),
167
+				'capability' => 'ee_delete_events',
168
+				'noheader'   => true,
169
+			),
170
+			'delete_event'                  => array(
171
+				'func'       => '_delete_event',
172
+				'capability' => 'ee_delete_event',
173
+				'obj_id'     => $evt_id,
174
+				'noheader'   => true,
175
+			),
176
+			'delete_events'                 => array(
177
+				'func'       => '_delete_events',
178
+				'capability' => 'ee_delete_events',
179
+				'noheader'   => true,
180
+			),
181
+			'view_report'                   => array(
182
+				'func'      => '_view_report',
183
+				'capability' => 'ee_edit_events',
184
+			),
185
+			'default_event_settings'        => array(
186
+				'func'       => '_default_event_settings',
187
+				'capability' => 'manage_options',
188
+			),
189
+			'update_default_event_settings' => array(
190
+				'func'       => '_update_default_event_settings',
191
+				'capability' => 'manage_options',
192
+				'noheader'   => true,
193
+			),
194
+			'template_settings'             => array(
195
+				'func'       => '_template_settings',
196
+				'capability' => 'manage_options',
197
+			),
198
+			// event category tab related
199
+			'add_category'                  => array(
200
+				'func'       => '_category_details',
201
+				'capability' => 'ee_edit_event_category',
202
+				'args'       => array('add'),
203
+			),
204
+			'edit_category'                 => array(
205
+				'func'       => '_category_details',
206
+				'capability' => 'ee_edit_event_category',
207
+				'args'       => array('edit'),
208
+			),
209
+			'delete_categories'             => array(
210
+				'func'       => '_delete_categories',
211
+				'capability' => 'ee_delete_event_category',
212
+				'noheader'   => true,
213
+			),
214
+			'delete_category'               => array(
215
+				'func'       => '_delete_categories',
216
+				'capability' => 'ee_delete_event_category',
217
+				'noheader'   => true,
218
+			),
219
+			'insert_category'               => array(
220
+				'func'       => '_insert_or_update_category',
221
+				'args'       => array('new_category' => true),
222
+				'capability' => 'ee_edit_event_category',
223
+				'noheader'   => true,
224
+			),
225
+			'update_category'               => array(
226
+				'func'       => '_insert_or_update_category',
227
+				'args'       => array('new_category' => false),
228
+				'capability' => 'ee_edit_event_category',
229
+				'noheader'   => true,
230
+			),
231
+			'category_list'                 => array(
232
+				'func'       => '_category_list_table',
233
+				'capability' => 'ee_manage_event_categories',
234
+			),
235
+		);
236
+	}
237
+
238
+
239
+	/**
240
+	 * Set the _page_config property for this admin page group.
241
+	 */
242
+	protected function _set_page_config()
243
+	{
244
+		$this->_page_config = [
245
+			'default'                => [
246
+				'nav'           => [
247
+					'label' => esc_html__('Overview', 'event_espresso'),
248
+					'order' => 10,
249
+				],
250
+				'list_table'    => 'Events_Admin_List_Table',
251
+				'help_tabs'     => [
252
+					'events_overview_help_tab'                       => [
253
+						'title'    => esc_html__('Events Overview', 'event_espresso'),
254
+						'filename' => 'events_overview',
255
+					],
256
+					'events_overview_table_column_headings_help_tab' => [
257
+						'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
258
+						'filename' => 'events_overview_table_column_headings',
259
+					],
260
+					'events_overview_filters_help_tab'               => [
261
+						'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
262
+						'filename' => 'events_overview_filters',
263
+					],
264
+					'events_overview_view_help_tab'                  => [
265
+						'title'    => esc_html__('Events Overview Views', 'event_espresso'),
266
+						'filename' => 'events_overview_views',
267
+					],
268
+					'events_overview_other_help_tab'                 => [
269
+						'title'    => esc_html__('Events Overview Other', 'event_espresso'),
270
+						'filename' => 'events_overview_other',
271
+					],
272
+				],
273
+				'help_tour'     => [
274
+					'Event_Overview_Help_Tour',
275
+					// 'New_Features_Test_Help_Tour' for testing multiple help tour
276
+				],
277
+				'require_nonce' => false,
278
+				'qtips' => ['EE_Event_List_Table_Tips'],
279
+			],
280
+			'create_new'             => [
281
+				'nav'           => [
282
+					'label'      => esc_html__('Add Event', 'event_espresso'),
283
+					'order'      => 5,
284
+					'persistent' => false,
285
+				],
286
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
287
+				'help_tabs'     => [
288
+					'event_editor_help_tab'                            => [
289
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
290
+						'filename' => 'event_editor',
291
+					],
292
+					'event_editor_title_richtexteditor_help_tab'       => [
293
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
294
+						'filename' => 'event_editor_title_richtexteditor',
295
+					],
296
+					'event_editor_venue_details_help_tab'              => [
297
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
298
+						'filename' => 'event_editor_venue_details',
299
+					],
300
+					'event_editor_event_datetimes_help_tab'            => [
301
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
302
+						'filename' => 'event_editor_event_datetimes',
303
+					],
304
+					'event_editor_event_tickets_help_tab'              => [
305
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
306
+						'filename' => 'event_editor_event_tickets',
307
+					],
308
+					'event_editor_event_registration_options_help_tab' => [
309
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
310
+						'filename' => 'event_editor_event_registration_options',
311
+					],
312
+					'event_editor_tags_categories_help_tab'            => [
313
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
314
+						'filename' => 'event_editor_tags_categories',
315
+					],
316
+					'event_editor_questions_registrants_help_tab'      => [
317
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
318
+						'filename' => 'event_editor_questions_registrants',
319
+					],
320
+					'event_editor_save_new_event_help_tab'             => [
321
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
322
+						'filename' => 'event_editor_save_new_event',
323
+					],
324
+					'event_editor_other_help_tab'                      => [
325
+						'title'    => esc_html__('Event Other', 'event_espresso'),
326
+						'filename' => 'event_editor_other',
327
+					],
328
+				],
329
+				'help_tour'     => [
330
+					'Event_Editor_Help_Tour',
331
+				],
332
+				'require_nonce' => false,
333
+			],
334
+			'edit'                   => [
335
+				'nav'           => [
336
+					'label'      => esc_html__('Edit Event', 'event_espresso'),
337
+					'order'      => 5,
338
+					'persistent' => false,
339
+					'url'        => isset($this->_req_data['post'])
340
+						? EE_Admin_Page::add_query_args_and_nonce(
341
+							['post' => $this->_req_data['post'], 'action' => 'edit'],
342
+							$this->_current_page_view_url
343
+						)
344
+						: $this->_admin_base_url,
345
+				],
346
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
347
+				'help_tabs'     => [
348
+					'event_editor_help_tab'                            => [
349
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
350
+						'filename' => 'event_editor',
351
+					],
352
+					'event_editor_title_richtexteditor_help_tab'       => [
353
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
354
+						'filename' => 'event_editor_title_richtexteditor',
355
+					],
356
+					'event_editor_venue_details_help_tab'              => [
357
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
358
+						'filename' => 'event_editor_venue_details',
359
+					],
360
+					'event_editor_event_datetimes_help_tab'            => [
361
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
362
+						'filename' => 'event_editor_event_datetimes',
363
+					],
364
+					'event_editor_event_tickets_help_tab'              => [
365
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
366
+						'filename' => 'event_editor_event_tickets',
367
+					],
368
+					'event_editor_event_registration_options_help_tab' => [
369
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
370
+						'filename' => 'event_editor_event_registration_options',
371
+					],
372
+					'event_editor_tags_categories_help_tab'            => [
373
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
374
+						'filename' => 'event_editor_tags_categories',
375
+					],
376
+					'event_editor_questions_registrants_help_tab'      => [
377
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
378
+						'filename' => 'event_editor_questions_registrants',
379
+					],
380
+					'event_editor_save_new_event_help_tab'             => [
381
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
382
+						'filename' => 'event_editor_save_new_event',
383
+					],
384
+					'event_editor_other_help_tab'                      => [
385
+						'title'    => esc_html__('Event Other', 'event_espresso'),
386
+						'filename' => 'event_editor_other',
387
+					],
388
+				],
389
+				'require_nonce' => false,
390
+			],
391
+			'default_event_settings' => [
392
+				'nav'           => [
393
+					'label' => esc_html__('Default Settings', 'event_espresso'),
394
+					'order' => 40,
395
+				],
396
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
397
+				'labels'        => [
398
+					'publishbox' => esc_html__('Update Settings', 'event_espresso'),
399
+				],
400
+				'help_tabs'     => [
401
+					'default_settings_help_tab'        => [
402
+						'title'    => esc_html__('Default Event Settings', 'event_espresso'),
403
+						'filename' => 'events_default_settings',
404
+					],
405
+					'default_settings_status_help_tab' => [
406
+						'title'    => esc_html__('Default Registration Status', 'event_espresso'),
407
+						'filename' => 'events_default_settings_status',
408
+					],
409
+					'default_maximum_tickets_help_tab' => [
410
+						'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
411
+						'filename' => 'events_default_settings_max_tickets',
412
+					],
413
+				],
414
+				'help_tour'     => ['Event_Default_Settings_Help_Tour'],
415
+				'require_nonce' => false,
416
+			],
417
+			// template settings
418
+			'template_settings'      => [
419
+				'nav'           => [
420
+					'label' => esc_html__('Templates', 'event_espresso'),
421
+					'order' => 30,
422
+				],
423
+				'metaboxes'     => $this->_default_espresso_metaboxes,
424
+				'help_tabs'     => [
425
+					'general_settings_templates_help_tab' => [
426
+						'title'    => esc_html__('Templates', 'event_espresso'),
427
+						'filename' => 'general_settings_templates',
428
+					],
429
+				],
430
+				'help_tour'     => ['Templates_Help_Tour'],
431
+				'require_nonce' => false,
432
+			],
433
+			// event category stuff
434
+			'add_category'           => [
435
+				'nav'           => [
436
+					'label'      => esc_html__('Add Category', 'event_espresso'),
437
+					'order'      => 15,
438
+					'persistent' => false,
439
+				],
440
+				'help_tabs'     => [
441
+					'add_category_help_tab' => [
442
+						'title'    => esc_html__('Add New Event Category', 'event_espresso'),
443
+						'filename' => 'events_add_category',
444
+					],
445
+				],
446
+				'help_tour'     => ['Event_Add_Category_Help_Tour'],
447
+				'metaboxes'     => ['_publish_post_box'],
448
+				'require_nonce' => false,
449
+			],
450
+			'edit_category'          => [
451
+				'nav'           => [
452
+					'label'      => esc_html__('Edit Category', 'event_espresso'),
453
+					'order'      => 15,
454
+					'persistent' => false,
455
+					'url'        => isset($this->_req_data['EVT_CAT_ID'])
456
+						? add_query_arg(
457
+							['EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']],
458
+							$this->_current_page_view_url
459
+						)
460
+						: $this->_admin_base_url,
461
+				],
462
+				'help_tabs'     => [
463
+					'edit_category_help_tab' => [
464
+						'title'    => esc_html__('Edit Event Category', 'event_espresso'),
465
+						'filename' => 'events_edit_category',
466
+					],
467
+				],
468
+				/*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
469
+				'metaboxes'     => ['_publish_post_box'],
470
+				'require_nonce' => false,
471
+			],
472
+			'category_list'          => [
473
+				'nav'           => [
474
+					'label' => esc_html__('Categories', 'event_espresso'),
475
+					'order' => 20,
476
+				],
477
+				'list_table'    => 'Event_Categories_Admin_List_Table',
478
+				'help_tabs'     => [
479
+					'events_categories_help_tab'                       => [
480
+						'title'    => esc_html__('Event Categories', 'event_espresso'),
481
+						'filename' => 'events_categories',
482
+					],
483
+					'events_categories_table_column_headings_help_tab' => [
484
+						'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
485
+						'filename' => 'events_categories_table_column_headings',
486
+					],
487
+					'events_categories_view_help_tab'                  => [
488
+						'title'    => esc_html__('Event Categories Views', 'event_espresso'),
489
+						'filename' => 'events_categories_views',
490
+					],
491
+					'events_categories_other_help_tab'                 => [
492
+						'title'    => esc_html__('Event Categories Other', 'event_espresso'),
493
+						'filename' => 'events_categories_other',
494
+					],
495
+				],
496
+				'help_tour'     => [
497
+					'Event_Categories_Help_Tour',
498
+				],
499
+				'metaboxes'     => $this->_default_espresso_metaboxes,
500
+				'require_nonce' => false,
501
+			],
502
+		];
503
+		// only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
504
+		$domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
505
+		if (! $domain->isCaffeinated()) {
506
+			$this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
507
+			$this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips' ];
508
+		}
509
+	}
510
+
511
+
512
+	/**
513
+	 * Used to register any global screen options if necessary for every route in this admin page group.
514
+	 */
515
+	protected function _add_screen_options()
516
+	{
517
+	}
518
+
519
+
520
+	/**
521
+	 * Implementing the screen options for the 'default' route.
522
+	 *
523
+	 * @throws InvalidArgumentException
524
+	 * @throws InvalidDataTypeException
525
+	 * @throws InvalidInterfaceException
526
+	 */
527
+	protected function _add_screen_options_default()
528
+	{
529
+		$this->_per_page_screen_option();
530
+	}
531
+
532
+
533
+	/**
534
+	 * Implementing screen options for the category list route.
535
+	 *
536
+	 * @throws InvalidArgumentException
537
+	 * @throws InvalidDataTypeException
538
+	 * @throws InvalidInterfaceException
539
+	 */
540
+	protected function _add_screen_options_category_list()
541
+	{
542
+		$page_title = $this->_admin_page_title;
543
+		$this->_admin_page_title = esc_html__('Categories', 'event_espresso');
544
+		$this->_per_page_screen_option();
545
+		$this->_admin_page_title = $page_title;
546
+	}
547
+
548
+
549
+	/**
550
+	 * Used to register any global feature pointers for the admin page group.
551
+	 */
552
+	protected function _add_feature_pointers()
553
+	{
554
+	}
555
+
556
+
557
+	/**
558
+	 * Registers and enqueues any global scripts and styles for the entire admin page group.
559
+	 */
560
+	public function load_scripts_styles()
561
+	{
562
+		wp_register_style(
563
+			'events-admin-css',
564
+			EVENTS_ASSETS_URL . 'events-admin-page.css',
565
+			[],
566
+			EVENT_ESPRESSO_VERSION
567
+		);
568
+		wp_register_style(
569
+			'ee-cat-admin',
570
+			EVENTS_ASSETS_URL . 'ee-cat-admin.css',
571
+			[],
572
+			EVENT_ESPRESSO_VERSION
573
+		);
574
+		wp_enqueue_style('events-admin-css');
575
+		wp_enqueue_style('ee-cat-admin');
576
+		// scripts
577
+		wp_register_script(
578
+			'event_editor_js',
579
+			EVENTS_ASSETS_URL . 'event_editor.js',
580
+			['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
581
+			EVENT_ESPRESSO_VERSION,
582
+			true
583
+		);
584
+	}
585
+
586
+
587
+	/**
588
+	 * Enqueuing scripts and styles specific to this view
589
+	 */
590
+	public function load_scripts_styles_create_new()
591
+	{
592
+		$this->load_scripts_styles_edit();
593
+	}
594
+
595
+
596
+	/**
597
+	 * Enqueuing scripts and styles specific to this view
598
+	 */
599
+	public function load_scripts_styles_edit()
600
+	{
601
+		// styles
602
+		wp_enqueue_style('espresso-ui-theme');
603
+		wp_register_style(
604
+			'event-editor-css',
605
+			EVENTS_ASSETS_URL . 'event-editor.css',
606
+			['ee-admin-css'],
607
+			EVENT_ESPRESSO_VERSION
608
+		);
609
+		wp_enqueue_style('event-editor-css');
610
+		// scripts
611
+		if (! $this->admin_config->useAdvancedEditor()) {
612
+			wp_register_script(
613
+				'event-datetime-metabox',
614
+				EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
615
+				['event_editor_js', 'ee-datepicker'],
616
+				EVENT_ESPRESSO_VERSION
617
+			);
618
+			wp_enqueue_script('event-datetime-metabox');
619
+		}
620
+	}
621
+
622
+
623
+	/**
624
+	 * Populating the _views property for the category list table view.
625
+	 */
626
+	protected function _set_list_table_views_category_list()
627
+	{
628
+		$this->_views = array(
629
+			'all' => array(
630
+				'slug'        => 'all',
631
+				'label'       => esc_html__('All', 'event_espresso'),
632
+				'count'       => 0,
633
+				'bulk_action' => array(
634
+					'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
635
+				),
636
+			),
637
+		);
638
+	}
639
+
640
+
641
+	/**
642
+	 * For adding anything that fires on the admin_init hook for any route within this admin page group.
643
+	 */
644
+	public function admin_init()
645
+	{
646
+		EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
647
+			'Do you really want to delete this image? Please remember to update your event to complete the removal.',
648
+			'event_espresso'
649
+		);
650
+	}
651
+
652
+
653
+	/**
654
+	 * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
655
+	 * group.
656
+	 */
657
+	public function admin_notices()
658
+	{
659
+	}
660
+
661
+
662
+	/**
663
+	 * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
664
+	 * this admin page group.
665
+	 */
666
+	public function admin_footer_scripts()
667
+	{
668
+	}
669
+
670
+
671
+	/**
672
+	 * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
673
+	 * warning (via EE_Error::add_error());
674
+	 *
675
+	 * @param  EE_Event $event Event object
676
+	 * @param string    $req_type
677
+	 * @return void
678
+	 * @throws EE_Error
679
+	 * @access public
680
+	 */
681
+	public function verify_event_edit($event = null, $req_type = '')
682
+	{
683
+		// don't need to do this when processing
684
+		if (! empty($req_type)) {
685
+			return;
686
+		}
687
+		// no event?
688
+		if (! $event instanceof EE_Event) {
689
+			$event = $this->_cpt_model_obj;
690
+		}
691
+		// STILL no event?
692
+		if (! $event instanceof EE_Event) {
693
+			return;
694
+		}
695
+		$orig_status = $event->status();
696
+		// first check if event is active.
697
+		if ($orig_status === EEM_Event::cancelled
698
+			|| $orig_status === EEM_Event::postponed
699
+			|| $event->is_expired()
700
+			|| $event->is_inactive()
701
+		) {
702
+			return;
703
+		}
704
+		// made it here so it IS active... next check that any of the tickets are sold.
705
+		if ($event->is_sold_out(true)) {
706
+			if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
707
+				EE_Error::add_attention(
708
+					sprintf(
709
+						esc_html__(
710
+							'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
711
+							'event_espresso'
712
+						),
713
+						EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
714
+					)
715
+				);
716
+			}
717
+			return;
718
+		}
719
+		if ($orig_status === EEM_Event::sold_out) {
720
+			EE_Error::add_attention(
721
+				sprintf(
722
+					esc_html__(
723
+						'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
724
+						'event_espresso'
725
+					),
726
+					EEH_Template::pretty_status($event->status(), false, 'sentence')
727
+				)
728
+			);
729
+		}
730
+		// now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
731
+		if (! $event->tickets_on_sale()) {
732
+			return;
733
+		}
734
+		// made it here so show warning
735
+		$this->_edit_event_warning();
736
+	}
737
+
738
+
739
+	/**
740
+	 * This is the text used for when an event is being edited that is public and has tickets for sale.
741
+	 * When needed, hook this into a EE_Error::add_error() notice.
742
+	 *
743
+	 * @access protected
744
+	 * @return void
745
+	 */
746
+	protected function _edit_event_warning()
747
+	{
748
+		// we don't want to add warnings during these requests
749
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
750
+			return;
751
+		}
752
+		EE_Error::add_attention(
753
+			sprintf(
754
+				esc_html__(
755
+					'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
756
+					'event_espresso'
757
+				),
758
+				'<a class="espresso-help-tab-lnk">',
759
+				'</a>'
760
+			)
761
+		);
762
+	}
763
+
764
+
765
+	/**
766
+	 * When a user is creating a new event, notify them if they haven't set their timezone.
767
+	 * Otherwise, do the normal logic
768
+	 *
769
+	 * @return string
770
+	 * @throws EE_Error
771
+	 * @throws InvalidArgumentException
772
+	 * @throws InvalidDataTypeException
773
+	 * @throws InvalidInterfaceException
774
+	 */
775
+	protected function _create_new_cpt_item()
776
+	{
777
+		$has_timezone_string = get_option('timezone_string');
778
+		// only nag them about setting their timezone if it's their first event, and they haven't already done it
779
+		if (! $has_timezone_string && ! EEM_Event::instance()->exists(array())) {
780
+			EE_Error::add_attention(
781
+				sprintf(
782
+					__(
783
+						'Your website\'s timezone is currently set to a UTC offset. We recommend updating your timezone to a city or region near you before you create an event. Change your timezone now:%1$s%2$s%3$sChange Timezone%4$s',
784
+						'event_espresso'
785
+					),
786
+					'<br>',
787
+					'<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
788
+					. EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
789
+					. '</select>',
790
+					'<button class="button button-secondary timezone-submit">',
791
+					'</button><span class="spinner"></span>'
792
+				),
793
+				__FILE__,
794
+				__FUNCTION__,
795
+				__LINE__
796
+			);
797
+		}
798
+		parent::_create_new_cpt_item();
799
+	}
800
+
801
+
802
+	/**
803
+	 * Sets the _views property for the default route in this admin page group.
804
+	 */
805
+	protected function _set_list_table_views_default()
806
+	{
807
+		$this->_views = array(
808
+			'all'   => array(
809
+				'slug'        => 'all',
810
+				'label'       => esc_html__('View All Events', 'event_espresso'),
811
+				'count'       => 0,
812
+				'bulk_action' => array(
813
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
814
+				),
815
+			),
816
+			'draft' => array(
817
+				'slug'        => 'draft',
818
+				'label'       => esc_html__('Draft', 'event_espresso'),
819
+				'count'       => 0,
820
+				'bulk_action' => array(
821
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
822
+				),
823
+			),
824
+		);
825
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
826
+			$this->_views['trash'] = array(
827
+				'slug'        => 'trash',
828
+				'label'       => esc_html__('Trash', 'event_espresso'),
829
+				'count'       => 0,
830
+				'bulk_action' => array(
831
+					'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
832
+					'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
833
+				),
834
+			);
835
+		}
836
+	}
837
+
838
+
839
+	/**
840
+	 * Provides the legend item array for the default list table view.
841
+	 *
842
+	 * @return array
843
+	 */
844
+	protected function _event_legend_items()
845
+	{
846
+		$items = array(
847
+			'view_details'   => array(
848
+				'class' => 'dashicons dashicons-search',
849
+				'desc'  => esc_html__('View Event', 'event_espresso'),
850
+			),
851
+			'edit_event'     => array(
852
+				'class' => 'ee-icon ee-icon-calendar-edit',
853
+				'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
854
+			),
855
+			'view_attendees' => array(
856
+				'class' => 'dashicons dashicons-groups',
857
+				'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
858
+			),
859
+		);
860
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
861
+		$statuses = array(
862
+			'sold_out_status'  => array(
863
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
864
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
865
+			),
866
+			'active_status'    => array(
867
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
868
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
869
+			),
870
+			'upcoming_status'  => array(
871
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
872
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
873
+			),
874
+			'postponed_status' => array(
875
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
876
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
877
+			),
878
+			'cancelled_status' => array(
879
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
880
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
881
+			),
882
+			'expired_status'   => array(
883
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
884
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
885
+			),
886
+			'inactive_status'  => array(
887
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
888
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
889
+			),
890
+		);
891
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
892
+		return array_merge($items, $statuses);
893
+	}
894
+
895
+
896
+	/**
897
+	 * @return EEM_Event
898
+	 * @throws EE_Error
899
+	 * @throws InvalidArgumentException
900
+	 * @throws InvalidDataTypeException
901
+	 * @throws InvalidInterfaceException
902
+	 * @throws ReflectionException
903
+	 */
904
+	private function _event_model()
905
+	{
906
+		if (! $this->_event_model instanceof EEM_Event) {
907
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
908
+		}
909
+		return $this->_event_model;
910
+	}
911
+
912
+
913
+	/**
914
+	 * Adds extra buttons to the WP CPT permalink field row.
915
+	 * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
916
+	 *
917
+	 * @param  string $return    the current html
918
+	 * @param  int    $id        the post id for the page
919
+	 * @param  string $new_title What the title is
920
+	 * @param  string $new_slug  what the slug is
921
+	 * @return string            The new html string for the permalink area
922
+	 */
923
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
924
+	{
925
+		// make sure this is only when editing
926
+		if (! empty($id)) {
927
+			$post = get_post($id);
928
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
929
+					   . esc_html__('Shortcode', 'event_espresso')
930
+					   . '</a> ';
931
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
932
+					   . $post->ID
933
+					   . ']">';
934
+		}
935
+		return $return;
936
+	}
937
+
938
+
939
+	/**
940
+	 * _events_overview_list_table
941
+	 * This contains the logic for showing the events_overview list
942
+	 *
943
+	 * @access protected
944
+	 * @return void
945
+	 * @throws DomainException
946
+	 * @throws EE_Error
947
+	 * @throws InvalidArgumentException
948
+	 * @throws InvalidDataTypeException
949
+	 * @throws InvalidInterfaceException
950
+	 */
951
+	protected function _events_overview_list_table()
952
+	{
953
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
954
+		$this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
955
+			? (array) $this->_template_args['after_list_table']
956
+			: array();
957
+		$this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
958
+				. EEH_Template::get_button_or_link(
959
+					get_post_type_archive_link('espresso_events'),
960
+					esc_html__('View Event Archive Page', 'event_espresso'),
961
+					'button'
962
+				);
963
+		$this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
964
+		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
965
+			'create_new',
966
+			'add',
967
+			array(),
968
+			'add-new-h2'
969
+		);
970
+		$this->display_admin_list_table_page_with_no_sidebar();
971
+	}
972
+
973
+
974
+	/**
975
+	 * this allows for extra misc actions in the default WP publish box
976
+	 *
977
+	 * @return void
978
+	 * @throws DomainException
979
+	 * @throws EE_Error
980
+	 * @throws InvalidArgumentException
981
+	 * @throws InvalidDataTypeException
982
+	 * @throws InvalidInterfaceException
983
+	 * @throws ReflectionException
984
+	 */
985
+	public function extra_misc_actions_publish_box()
986
+	{
987
+		$this->_generate_publish_box_extra_content();
988
+	}
989
+
990
+
991
+	/**
992
+	 * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
993
+	 * saved.
994
+	 * Typically you would use this to save any additional data.
995
+	 * Keep in mind also that "save_post" runs on EVERY post update to the database.
996
+	 * ALSO very important.  When a post transitions from scheduled to published,
997
+	 * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
998
+	 * other meta saves. So MAKE sure that you handle this accordingly.
999
+	 *
1000
+	 * @access protected
1001
+	 * @abstract
1002
+	 * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1003
+	 * @param object $post    The post object of the cpt that was saved.
1004
+	 * @return void
1005
+	 * @throws EE_Error
1006
+	 * @throws InvalidArgumentException
1007
+	 * @throws InvalidDataTypeException
1008
+	 * @throws InvalidInterfaceException
1009
+	 * @throws ReflectionException
1010
+	 */
1011
+	protected function _insert_update_cpt_item($post_id, $post)
1012
+	{
1013
+		if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1014
+			// get out we're not processing an event save.
1015
+			return;
1016
+		}
1017
+		$event_values = [
1018
+			'EVT_member_only'     => ! empty($this->_req_data['member_only']) ? 1 : 0,
1019
+			'EVT_allow_overflow'  => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
1020
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string'])
1021
+				? sanitize_text_field($this->_req_data['timezone_string'])
1022
+				: null,
1023
+		];
1024
+		if (! $this->admin_config->useAdvancedEditor()) {
1025
+			$event_values['EVT_display_ticket_selector'] =
1026
+				! empty($this->_req_data['display_ticket_selector'])
1027
+					? 1
1028
+					: 0;
1029
+			$event_values['EVT_additional_limit'] = min(
1030
+				apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1031
+				! empty($this->_req_data['additional_limit'])
1032
+					? absint($this->_req_data['additional_limit'])
1033
+					: null
1034
+			);
1035
+			$event_values['EVT_default_registration_status'] =
1036
+				! empty($this->_req_data['EVT_default_registration_status'])
1037
+					? sanitize_text_field($this->_req_data['EVT_default_registration_status'])
1038
+					: EE_Registry::instance()->CFG->registration->default_STS_ID;
1039
+			$event_values['EVT_external_URL'] = ! empty($this->_req_data['externalURL'])
1040
+				? esc_url_raw($this->_req_data['externalURL'])
1041
+				: null;
1042
+			$event_values['EVT_phone'] = ! empty($this->_req_data['event_phone'])
1043
+				? sanitize_text_field($this->_req_data['event_phone'])
1044
+				: null;
1045
+		}
1046
+		// update event
1047
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
1048
+		// get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
1049
+		$get_one_where = array(
1050
+			$this->_event_model()->primary_key_name() => $post_id,
1051
+			'OR'                                      => array(
1052
+				'status'   => $post->post_status,
1053
+				// if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1054
+				// but the returned object here has a status of "publish", so use the original post status as well
1055
+				'status*1' => $this->_req_data['original_post_status'],
1056
+			),
1057
+		);
1058
+		$event = $this->_event_model()->get_one(array($get_one_where));
1059
+		// the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
1060
+		$event_update_callbacks = apply_filters(
1061
+			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1062
+			array(
1063
+				array($this, '_default_venue_update'),
1064
+				array($this, '_default_tickets_update'),
1065
+			)
1066
+		);
1067
+		$att_success = true;
1068
+		foreach ($event_update_callbacks as $e_callback) {
1069
+			$_success = is_callable($e_callback)
1070
+				? $e_callback($event, $this->_req_data)
1071
+				: false;
1072
+			// if ANY of these updates fail then we want the appropriate global error message
1073
+			$att_success = ! $att_success ? $att_success : $_success;
1074
+		}
1075
+		// any errors?
1076
+		if ($success && false === $att_success) {
1077
+			EE_Error::add_error(
1078
+				esc_html__(
1079
+					'Event Details saved successfully but something went wrong with saving attachments.',
1080
+					'event_espresso'
1081
+				),
1082
+				__FILE__,
1083
+				__FUNCTION__,
1084
+				__LINE__
1085
+			);
1086
+		} elseif ($success === false) {
1087
+			EE_Error::add_error(
1088
+				esc_html__('Event Details did not save successfully.', 'event_espresso'),
1089
+				__FILE__,
1090
+				__FUNCTION__,
1091
+				__LINE__
1092
+			);
1093
+		}
1094
+	}
1095
+
1096
+
1097
+	/**
1098
+	 * @param int $post_id
1099
+	 * @param int $revision_id
1100
+	 * @throws EE_Error
1101
+	 * @throws InvalidArgumentException
1102
+	 * @throws InvalidDataTypeException
1103
+	 * @throws InvalidInterfaceException
1104
+	 * @throws ReflectionException
1105
+	 * @see parent::restore_item()
1106
+	 */
1107
+	protected function _restore_cpt_item($post_id, $revision_id)
1108
+	{
1109
+		// copy existing event meta to new post
1110
+		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
1111
+		if ($post_evt instanceof EE_Event) {
1112
+			// meta revision restore
1113
+			$post_evt->restore_revision($revision_id);
1114
+			// related objs restore
1115
+			$post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
1116
+		}
1117
+	}
1118
+
1119
+
1120
+	/**
1121
+	 * Attach the venue to the Event
1122
+	 *
1123
+	 * @param EE_Event $evtobj Event Object to add the venue to
1124
+	 * @param array    $data   The request data from the form
1125
+	 * @return bool           Success or fail.
1126
+	 * @throws EE_Error
1127
+	 * @throws InvalidArgumentException
1128
+	 * @throws InvalidDataTypeException
1129
+	 * @throws InvalidInterfaceException
1130
+	 * @throws ReflectionException
1131
+	 */
1132
+	protected function _default_venue_update(EE_Event $evtobj, $data)
1133
+	{
1134
+		require_once(EE_MODELS . 'EEM_Venue.model.php');
1135
+		$venue_model = EE_Registry::instance()->load_model('Venue');
1136
+		$rows_affected = null;
1137
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1138
+		// very important.  If we don't have a venue name...
1139
+		// then we'll get out because not necessary to create empty venue
1140
+		if (empty($data['venue_title'])) {
1141
+			return false;
1142
+		}
1143
+		$venue_array = array(
1144
+			'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1145
+			'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1146
+			'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1147
+			'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1148
+			'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1149
+				: null,
1150
+			'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1151
+			'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1152
+			'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1153
+			'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1154
+			'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1155
+			'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1156
+			'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1157
+			'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1158
+			'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1159
+			'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1160
+			'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1161
+			'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1162
+			'status'              => 'publish',
1163
+		);
1164
+		// if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1165
+		if (! empty($venue_id)) {
1166
+			$update_where = array($venue_model->primary_key_name() => $venue_id);
1167
+			$rows_affected = $venue_model->update($venue_array, array($update_where));
1168
+			// we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1169
+			$evtobj->_add_relation_to($venue_id, 'Venue');
1170
+			return $rows_affected > 0;
1171
+		}
1172
+		// we insert the venue
1173
+		$venue_id = $venue_model->insert($venue_array);
1174
+		$evtobj->_add_relation_to($venue_id, 'Venue');
1175
+		return ! empty($venue_id) ? true : false;
1176
+		// when we have the ancestor come in it's already been handled by the revision save.
1177
+	}
1178
+
1179
+
1180
+	/**
1181
+	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
1182
+	 *
1183
+	 * @param EE_Event $evtobj The Event object we're attaching data to
1184
+	 * @param array    $data   The request data from the form
1185
+	 * @return array
1186
+	 * @throws EE_Error
1187
+	 * @throws InvalidArgumentException
1188
+	 * @throws InvalidDataTypeException
1189
+	 * @throws InvalidInterfaceException
1190
+	 * @throws ReflectionException
1191
+	 * @throws Exception
1192
+	 */
1193
+	protected function _default_tickets_update(EE_Event $evtobj, $data)
1194
+	{
1195
+		if ($this->admin_config->useAdvancedEditor()) {
1196
+			return [];
1197
+		}
1198
+		$success = true;
1199
+		$saved_dtt = null;
1200
+		$saved_tickets = array();
1201
+		$incoming_date_formats = array('Y-m-d', 'h:i a');
1202
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1203
+			// trim all values to ensure any excess whitespace is removed.
1204
+			$dtt = array_map('trim', $dtt);
1205
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end']
1206
+				: $dtt['DTT_EVT_start'];
1207
+			$datetime_values = array(
1208
+				'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1209
+				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1210
+				'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1211
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1212
+				'DTT_order'     => $row,
1213
+			);
1214
+			// if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1215
+			if (! empty($dtt['DTT_ID'])) {
1216
+				$DTM = EE_Registry::instance()
1217
+								  ->load_model('Datetime', array($evtobj->get_timezone()))
1218
+								  ->get_one_by_ID($dtt['DTT_ID']);
1219
+				$DTM->set_date_format($incoming_date_formats[0]);
1220
+				$DTM->set_time_format($incoming_date_formats[1]);
1221
+				foreach ($datetime_values as $field => $value) {
1222
+					$DTM->set($field, $value);
1223
+				}
1224
+				// make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1225
+				$saved_dtts[ $DTM->ID() ] = $DTM;
1226
+			} else {
1227
+				$DTM = EE_Registry::instance()->load_class(
1228
+					'Datetime',
1229
+					array($datetime_values, $evtobj->get_timezone(), $incoming_date_formats),
1230
+					false,
1231
+					false
1232
+				);
1233
+				foreach ($datetime_values as $field => $value) {
1234
+					$DTM->set($field, $value);
1235
+				}
1236
+			}
1237
+			$DTM->save();
1238
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
1239
+			// load DTT helper
1240
+			// before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1241
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
1242
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
1243
+				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
1244
+				$DTT->save();
1245
+			}
1246
+			// now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
1247
+			$saved_dtt = $DTT;
1248
+			$success = ! $success ? $success : $DTT;
1249
+			// if ANY of these updates fail then we want the appropriate global error message.
1250
+			// //todo this is actually sucky we need a better error message but this is what it is for now.
1251
+		}
1252
+		// no dtts get deleted so we don't do any of that logic here.
1253
+		// update tickets next
1254
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
1255
+		foreach ($data['edit_tickets'] as $row => $tkt) {
1256
+			$incoming_date_formats = array('Y-m-d', 'h:i a');
1257
+			$update_prices = false;
1258
+			$ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1259
+				? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1260
+			// trim inputs to ensure any excess whitespace is removed.
1261
+			$tkt = array_map('trim', $tkt);
1262
+			if (empty($tkt['TKT_start_date'])) {
1263
+				// let's use now in the set timezone.
1264
+				$now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1265
+				$tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1266
+			}
1267
+			if (empty($tkt['TKT_end_date'])) {
1268
+				// use the start date of the first datetime
1269
+				$dtt = $evtobj->first_datetime();
1270
+				$tkt['TKT_end_date'] = $dtt->start_date_and_time(
1271
+					$incoming_date_formats[0],
1272
+					$incoming_date_formats[1]
1273
+				);
1274
+			}
1275
+			$TKT_values = array(
1276
+				'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1277
+				'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1278
+				'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1279
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1280
+				'TKT_start_date'  => $tkt['TKT_start_date'],
1281
+				'TKT_end_date'    => $tkt['TKT_end_date'],
1282
+				'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1283
+				'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1284
+				'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1285
+				'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1286
+				'TKT_row'         => $row,
1287
+				'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1288
+				'TKT_price'       => $ticket_price,
1289
+			);
1290
+			// if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1291
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1292
+				$TKT_values['TKT_ID'] = 0;
1293
+				$TKT_values['TKT_is_default'] = 0;
1294
+				$TKT_values['TKT_price'] = $ticket_price;
1295
+				$update_prices = true;
1296
+			}
1297
+			// if we have a TKT_ID then we need to get that existing TKT_obj and update it
1298
+			// we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1299
+			// keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1300
+			if (! empty($tkt['TKT_ID'])) {
1301
+				$TKT = EE_Registry::instance()
1302
+								  ->load_model('Ticket', array($evtobj->get_timezone()))
1303
+								  ->get_one_by_ID($tkt['TKT_ID']);
1304
+				if ($TKT instanceof EE_Ticket) {
1305
+					$ticket_sold = $TKT->count_related(
1306
+						'Registration',
1307
+						array(
1308
+							array(
1309
+								'STS_ID' => array(
1310
+									'NOT IN',
1311
+									array(EEM_Registration::status_id_incomplete),
1312
+								),
1313
+							),
1314
+						)
1315
+					) > 0;
1316
+					// let's just check the total price for the existing ticket and determine if it matches the new
1317
+					// total price.  if they are different then we create a new ticket (if tickets sold)
1318
+					// if they aren't different then we go ahead and modify existing ticket.
1319
+					$create_new_TKT = $ticket_sold && ! $TKT->deleted() && EEH_Money::compare_floats(
1320
+						$ticket_price,
1321
+						$TKT->get('TKT_price'),
1322
+						'!=='
1323
+					);
1324
+					$TKT->set_date_format($incoming_date_formats[0]);
1325
+					$TKT->set_time_format($incoming_date_formats[1]);
1326
+					// set new values
1327
+					foreach ($TKT_values as $field => $value) {
1328
+						if ($field === 'TKT_qty') {
1329
+							$TKT->set_qty($value);
1330
+						} else {
1331
+							$TKT->set($field, $value);
1332
+						}
1333
+					}
1334
+					// if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1335
+					if ($create_new_TKT) {
1336
+						// archive the old ticket first
1337
+						$TKT->set('TKT_deleted', 1);
1338
+						$TKT->save();
1339
+						// make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1340
+						$saved_tickets[ $TKT->ID() ] = $TKT;
1341
+						// create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1342
+						$TKT = clone $TKT;
1343
+						$TKT->set('TKT_ID', 0);
1344
+						$TKT->set('TKT_deleted', 0);
1345
+						$TKT->set('TKT_price', $ticket_price);
1346
+						$TKT->set('TKT_sold', 0);
1347
+						// now we need to make sure that $new prices are created as well and attached to new ticket.
1348
+						$update_prices = true;
1349
+					}
1350
+					// make sure price is set if it hasn't been already
1351
+					$TKT->set('TKT_price', $ticket_price);
1352
+				}
1353
+			} else {
1354
+				// no TKT_id so a new TKT
1355
+				$TKT_values['TKT_price'] = $ticket_price;
1356
+				$TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), false, false);
1357
+				if ($TKT instanceof EE_Ticket) {
1358
+					// need to reset values to properly account for the date formats
1359
+					$TKT->set_date_format($incoming_date_formats[0]);
1360
+					$TKT->set_time_format($incoming_date_formats[1]);
1361
+					$TKT->set_timezone($evtobj->get_timezone());
1362
+					// set new values
1363
+					foreach ($TKT_values as $field => $value) {
1364
+						if ($field === 'TKT_qty') {
1365
+							$TKT->set_qty($value);
1366
+						} else {
1367
+							$TKT->set($field, $value);
1368
+						}
1369
+					}
1370
+					$update_prices = true;
1371
+				}
1372
+			}
1373
+			// cap ticket qty by datetime reg limits
1374
+			$TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1375
+			// update ticket.
1376
+			$TKT->save();
1377
+			// before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1378
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1379
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1380
+				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1381
+				$TKT->save();
1382
+			}
1383
+			// initially let's add the ticket to the dtt
1384
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1385
+			$saved_tickets[ $TKT->ID() ] = $TKT;
1386
+			// add prices to ticket
1387
+			$this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1388
+		}
1389
+		// however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1390
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? array() : $old_tickets;
1391
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1392
+		foreach ($tickets_removed as $id) {
1393
+			$id = absint($id);
1394
+			// get the ticket for this id
1395
+			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
1396
+			// need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1397
+			$dtts = $tkt_to_remove->get_many_related('Datetime');
1398
+			foreach ($dtts as $dtt) {
1399
+				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1400
+			}
1401
+			// need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1402
+			$tkt_to_remove->delete_related_permanently('Price');
1403
+			// finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1404
+			$tkt_to_remove->delete_permanently();
1405
+		}
1406
+		return array($saved_dtt, $saved_tickets);
1407
+	}
1408
+
1409
+
1410
+	/**
1411
+	 * This attaches a list of given prices to a ticket.
1412
+	 * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
1413
+	 * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
1414
+	 * price info and prices are automatically "archived" via the ticket.
1415
+	 *
1416
+	 * @access  private
1417
+	 * @param array     $prices     Array of prices from the form.
1418
+	 * @param EE_Ticket $ticket     EE_Ticket object that prices are being attached to.
1419
+	 * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1420
+	 * @return  void
1421
+	 * @throws EE_Error
1422
+	 * @throws InvalidArgumentException
1423
+	 * @throws InvalidDataTypeException
1424
+	 * @throws InvalidInterfaceException
1425
+	 * @throws ReflectionException
1426
+	 */
1427
+	private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false)
1428
+	{
1429
+		foreach ($prices as $row => $prc) {
1430
+			$PRC_values = array(
1431
+				'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1432
+				'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1433
+				'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1434
+				'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1435
+				'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1436
+				'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1437
+				'PRC_order'      => $row,
1438
+			);
1439
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1440
+				$PRC_values['PRC_ID'] = 0;
1441
+				$PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), false, false);
1442
+			} else {
1443
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1444
+				// update this price with new values
1445
+				foreach ($PRC_values as $field => $newprc) {
1446
+					$PRC->set($field, $newprc);
1447
+				}
1448
+				$PRC->save();
1449
+			}
1450
+			$ticket->_add_relation_to($PRC, 'Price');
1451
+		}
1452
+	}
1453
+
1454
+
1455
+	/**
1456
+	 * Add in our autosave ajax handlers
1457
+	 *
1458
+	 */
1459
+	protected function _ee_autosave_create_new()
1460
+	{
1461
+	}
1462
+
1463
+
1464
+	/**
1465
+	 * More autosave handlers.
1466
+	 */
1467
+	protected function _ee_autosave_edit()
1468
+	{
1469
+	}
1470
+
1471
+
1472
+	/**
1473
+	 *    _generate_publish_box_extra_content
1474
+	 *
1475
+	 * @throws DomainException
1476
+	 * @throws EE_Error
1477
+	 * @throws InvalidArgumentException
1478
+	 * @throws InvalidDataTypeException
1479
+	 * @throws InvalidInterfaceException
1480
+	 * @throws ReflectionException
1481
+	 */
1482
+	private function _generate_publish_box_extra_content()
1483
+	{
1484
+		// load formatter helper
1485
+		// args for getting related registrations
1486
+		$approved_query_args = array(
1487
+			array(
1488
+				'REG_deleted' => 0,
1489
+				'STS_ID'      => EEM_Registration::status_id_approved,
1490
+			),
1491
+		);
1492
+		$not_approved_query_args = array(
1493
+			array(
1494
+				'REG_deleted' => 0,
1495
+				'STS_ID'      => EEM_Registration::status_id_not_approved,
1496
+			),
1497
+		);
1498
+		$pending_payment_query_args = array(
1499
+			array(
1500
+				'REG_deleted' => 0,
1501
+				'STS_ID'      => EEM_Registration::status_id_pending_payment,
1502
+			),
1503
+		);
1504
+		// publish box
1505
+		$publish_box_extra_args = array(
1506
+			'view_approved_reg_url'        => add_query_arg(
1507
+				array(
1508
+					'action'      => 'default',
1509
+					'event_id'    => $this->_cpt_model_obj->ID(),
1510
+					'_reg_status' => EEM_Registration::status_id_approved,
1511
+				),
1512
+				REG_ADMIN_URL
1513
+			),
1514
+			'view_not_approved_reg_url'    => add_query_arg(
1515
+				array(
1516
+					'action'      => 'default',
1517
+					'event_id'    => $this->_cpt_model_obj->ID(),
1518
+					'_reg_status' => EEM_Registration::status_id_not_approved,
1519
+				),
1520
+				REG_ADMIN_URL
1521
+			),
1522
+			'view_pending_payment_reg_url' => add_query_arg(
1523
+				array(
1524
+					'action'      => 'default',
1525
+					'event_id'    => $this->_cpt_model_obj->ID(),
1526
+					'_reg_status' => EEM_Registration::status_id_pending_payment,
1527
+				),
1528
+				REG_ADMIN_URL
1529
+			),
1530
+			'approved_regs'                => $this->_cpt_model_obj->count_related(
1531
+				'Registration',
1532
+				$approved_query_args
1533
+			),
1534
+			'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1535
+				'Registration',
1536
+				$not_approved_query_args
1537
+			),
1538
+			'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1539
+				'Registration',
1540
+				$pending_payment_query_args
1541
+			),
1542
+			'misc_pub_section_class'       => apply_filters(
1543
+				'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1544
+				'misc-pub-section'
1545
+			),
1546
+		);
1547
+		ob_start();
1548
+		do_action(
1549
+			'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1550
+			$this->_cpt_model_obj
1551
+		);
1552
+		$publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1553
+		// load template
1554
+		EEH_Template::display_template(
1555
+			EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1556
+			$publish_box_extra_args
1557
+		);
1558
+	}
1559
+
1560
+
1561
+	/**
1562
+	 * @return EE_Event
1563
+	 */
1564
+	public function get_event_object()
1565
+	{
1566
+		return $this->_cpt_model_obj;
1567
+	}
1568
+
1569
+
1570
+
1571
+
1572
+	/** METABOXES * */
1573
+	/**
1574
+	 * _register_event_editor_meta_boxes
1575
+	 * add all metaboxes related to the event_editor
1576
+	 *
1577
+	 * @return void
1578
+	 * @throws EE_Error
1579
+	 * @throws InvalidArgumentException
1580
+	 * @throws InvalidDataTypeException
1581
+	 * @throws InvalidInterfaceException
1582
+	 * @throws ReflectionException
1583
+	 */
1584
+	protected function _register_event_editor_meta_boxes()
1585
+	{
1586
+		$this->verify_cpt_object();
1587
+		if ($this->admin_config->useAdvancedEditor()) {
1588
+			add_action(
1589
+				'add_meta_boxes_espresso_events',
1590
+				function () {
1591
+					global $current_screen;
1592
+					remove_meta_box('authordiv', $current_screen, 'normal');
1593
+				},
1594
+				99
1595
+			);
1596
+			return;
1597
+		}
1598
+		add_meta_box(
1599
+			'espresso_event_editor_tickets',
1600
+			esc_html__('Event Datetime & Ticket', 'event_espresso'),
1601
+			[$this, 'ticket_metabox'],
1602
+			$this->page_slug,
1603
+			'normal',
1604
+			'high'
1605
+		);
1606
+		add_meta_box(
1607
+			'espresso_event_editor_event_options',
1608
+			esc_html__('Event Registration Options', 'event_espresso'),
1609
+			array($this, 'registration_options_meta_box'),
1610
+			$this->page_slug,
1611
+			'side'
1612
+		);
1613
+		// NOTE: if you're looking for other metaboxes in here,
1614
+		// where a metabox has a related management page in the admin
1615
+		// you will find it setup in the related management page's "_Hooks" file.
1616
+		// i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1617
+	}
1618
+
1619
+
1620
+	/**
1621
+	 * @throws DomainException
1622
+	 * @throws EE_Error
1623
+	 * @throws InvalidArgumentException
1624
+	 * @throws InvalidDataTypeException
1625
+	 * @throws InvalidInterfaceException
1626
+	 * @throws ReflectionException
1627
+	 */
1628
+	public function ticket_metabox()
1629
+	{
1630
+		$existing_datetime_ids = $existing_ticket_ids = array();
1631
+		// defaults for template args
1632
+		$template_args = array(
1633
+			'existing_datetime_ids'    => '',
1634
+			'event_datetime_help_link' => '',
1635
+			'ticket_options_help_link' => '',
1636
+			'time'                     => null,
1637
+			'ticket_rows'              => '',
1638
+			'existing_ticket_ids'      => '',
1639
+			'total_ticket_rows'        => 1,
1640
+			'ticket_js_structure'      => '',
1641
+			'trash_icon'               => 'ee-lock-icon',
1642
+			'disabled'                 => '',
1643
+		);
1644
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1645
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1646
+		/**
1647
+		 * 1. Start with retrieving Datetimes
1648
+		 * 2. Fore each datetime get related tickets
1649
+		 * 3. For each ticket get related prices
1650
+		 */
1651
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1652
+		/** @type EE_Datetime $first_datetime */
1653
+		$first_datetime = reset($times);
1654
+		// do we get related tickets?
1655
+		if ($first_datetime instanceof EE_Datetime
1656
+			&& $first_datetime->ID() !== 0
1657
+		) {
1658
+			$existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1659
+			$template_args['time'] = $first_datetime;
1660
+			$related_tickets = $first_datetime->tickets(
1661
+				array(
1662
+					array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)),
1663
+					'default_where_conditions' => 'none',
1664
+				)
1665
+			);
1666
+			if (! empty($related_tickets)) {
1667
+				$template_args['total_ticket_rows'] = count($related_tickets);
1668
+				$row = 0;
1669
+				foreach ($related_tickets as $ticket) {
1670
+					$existing_ticket_ids[] = $ticket->get('TKT_ID');
1671
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1672
+					$row++;
1673
+				}
1674
+			} else {
1675
+				$template_args['total_ticket_rows'] = 1;
1676
+				/** @type EE_Ticket $ticket */
1677
+				$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1678
+				$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1679
+			}
1680
+		} else {
1681
+			$template_args['time'] = $times[0];
1682
+			/** @type EE_Ticket $ticket */
1683
+			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1684
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1685
+			// NOTE: we're just sending the first default row
1686
+			// (decaf can't manage default tickets so this should be sufficient);
1687
+		}
1688
+		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1689
+			'event_editor_event_datetimes_help_tab'
1690
+		);
1691
+		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1692
+		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1693
+		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1694
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(
1695
+			EE_Registry::instance()->load_model('Ticket')->create_default_object(),
1696
+			true
1697
+		);
1698
+		$template = apply_filters(
1699
+			'FHEE__Events_Admin_Page__ticket_metabox__template',
1700
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1701
+		);
1702
+		EEH_Template::display_template($template, $template_args);
1703
+	}
1704
+
1705
+
1706
+	/**
1707
+	 * Setup an individual ticket form for the decaf event editor page
1708
+	 *
1709
+	 * @access private
1710
+	 * @param EE_Ticket $ticket   the ticket object
1711
+	 * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1712
+	 * @param int       $row
1713
+	 * @return string generated html for the ticket row.
1714
+	 * @throws DomainException
1715
+	 * @throws EE_Error
1716
+	 * @throws InvalidArgumentException
1717
+	 * @throws InvalidDataTypeException
1718
+	 * @throws InvalidInterfaceException
1719
+	 * @throws ReflectionException
1720
+	 */
1721
+	private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1722
+	{
1723
+		$template_args = array(
1724
+			'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1725
+			'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1726
+				: '',
1727
+			'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1728
+			'TKT_ID'              => $ticket->get('TKT_ID'),
1729
+			'TKT_name'            => $ticket->get('TKT_name'),
1730
+			'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1731
+			'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1732
+			'TKT_is_default'      => $ticket->get('TKT_is_default'),
1733
+			'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1734
+			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1735
+			'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1736
+			'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1737
+									 && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1738
+				? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1739
+			'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1740
+				: ' disabled=disabled',
1741
+		);
1742
+		$price = $ticket->ID() !== 0
1743
+			? $ticket->get_first_related('Price', array('default_where_conditions' => 'none'))
1744
+			: EE_Registry::instance()->load_model('Price')->create_default_object();
1745
+		$price_args = array(
1746
+			'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1747
+			'PRC_amount'            => $price->get('PRC_amount'),
1748
+			'PRT_ID'                => $price->get('PRT_ID'),
1749
+			'PRC_ID'                => $price->get('PRC_ID'),
1750
+			'PRC_is_default'        => $price->get('PRC_is_default'),
1751
+		);
1752
+		// make sure we have default start and end dates if skeleton
1753
+		// handle rows that should NOT be empty
1754
+		if (empty($template_args['TKT_start_date'])) {
1755
+			// if empty then the start date will be now.
1756
+			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1757
+		}
1758
+		if (empty($template_args['TKT_end_date'])) {
1759
+			// get the earliest datetime (if present);
1760
+			$earliest_dtt = $this->_cpt_model_obj->ID() > 0
1761
+				? $this->_cpt_model_obj->get_first_related(
1762
+					'Datetime',
1763
+					array('order_by' => array('DTT_EVT_start' => 'ASC'))
1764
+				)
1765
+				: null;
1766
+			if (! empty($earliest_dtt)) {
1767
+				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1768
+			} else {
1769
+				$template_args['TKT_end_date'] = date(
1770
+					'Y-m-d h:i a',
1771
+					mktime(0, 0, 0, date('m'), date('d') + 7, date('Y'))
1772
+				);
1773
+			}
1774
+		}
1775
+		$template_args = array_merge($template_args, $price_args);
1776
+		$template = apply_filters(
1777
+			'FHEE__Events_Admin_Page__get_ticket_row__template',
1778
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1779
+			$ticket
1780
+		);
1781
+		return EEH_Template::display_template($template, $template_args, true);
1782
+	}
1783
+
1784
+
1785
+	/**
1786
+	 * @throws DomainException
1787
+	 * @throws EE_Error
1788
+	 */
1789
+	public function registration_options_meta_box()
1790
+	{
1791
+		$yes_no_values = array(
1792
+			array('id' => true, 'text' => esc_html__('Yes', 'event_espresso')),
1793
+			array('id' => false, 'text' => esc_html__('No', 'event_espresso')),
1794
+		);
1795
+		$default_reg_status_values = EEM_Registration::reg_status_array(
1796
+			array(
1797
+				EEM_Registration::status_id_cancelled,
1798
+				EEM_Registration::status_id_declined,
1799
+				EEM_Registration::status_id_incomplete,
1800
+			),
1801
+			true
1802
+		);
1803
+		// $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1804
+		$template_args['_event'] = $this->_cpt_model_obj;
1805
+		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1806
+		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1807
+		$template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1808
+			'default_reg_status',
1809
+			$default_reg_status_values,
1810
+			$this->_cpt_model_obj->default_registration_status()
1811
+		);
1812
+		$template_args['display_description'] = EEH_Form_Fields::select_input(
1813
+			'display_desc',
1814
+			$yes_no_values,
1815
+			$this->_cpt_model_obj->display_description()
1816
+		);
1817
+		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1818
+			'display_ticket_selector',
1819
+			$yes_no_values,
1820
+			$this->_cpt_model_obj->display_ticket_selector(),
1821
+			'',
1822
+			'',
1823
+			false
1824
+		);
1825
+		$template_args['additional_registration_options'] = apply_filters(
1826
+			'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1827
+			'',
1828
+			$template_args,
1829
+			$yes_no_values,
1830
+			$default_reg_status_values
1831
+		);
1832
+		EEH_Template::display_template(
1833
+			EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1834
+			$template_args
1835
+		);
1836
+	}
1837
+
1838
+
1839
+	/**
1840
+	 * _get_events()
1841
+	 * This method simply returns all the events (for the given _view and paging)
1842
+	 *
1843
+	 * @access public
1844
+	 * @param int  $per_page     count of items per page (20 default);
1845
+	 * @param int  $current_page what is the current page being viewed.
1846
+	 * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1847
+	 *                           If FALSE then we return an array of event objects
1848
+	 *                           that match the given _view and paging parameters.
1849
+	 * @return array an array of event objects.
1850
+	 * @throws EE_Error
1851
+	 * @throws InvalidArgumentException
1852
+	 * @throws InvalidDataTypeException
1853
+	 * @throws InvalidInterfaceException
1854
+	 * @throws ReflectionException
1855
+	 * @throws Exception
1856
+	 * @throws Exception
1857
+	 * @throws Exception
1858
+	 */
1859
+	public function get_events($per_page = 10, $current_page = 1, $count = false)
1860
+	{
1861
+		$EEME = $this->_event_model();
1862
+		$offset = ($current_page - 1) * $per_page;
1863
+		$limit = $count ? null : $offset . ',' . $per_page;
1864
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1865
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1866
+		if (isset($this->_req_data['month_range'])) {
1867
+			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1868
+			// simulate the FIRST day of the month, that fixes issues for months like February
1869
+			// where PHP doesn't know what to assume for date.
1870
+			// @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1871
+			$month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1872
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1873
+		}
1874
+		$where = array();
1875
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1876
+		// determine what post_status our condition will have for the query.
1877
+		switch ($status) {
1878
+			case 'month':
1879
+			case 'today':
1880
+			case null:
1881
+			case 'all':
1882
+				break;
1883
+			case 'draft':
1884
+				$where['status'] = array('IN', array('draft', 'auto-draft'));
1885
+				break;
1886
+			default:
1887
+				$where['status'] = $status;
1888
+		}
1889
+		// categories?
1890
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1891
+			? $this->_req_data['EVT_CAT'] : null;
1892
+		if (! empty($category)) {
1893
+			$where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1894
+			$where['Term_Taxonomy.term_id'] = $category;
1895
+		}
1896
+		// date where conditions
1897
+		$start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1898
+		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1899
+			$DateTime = new DateTime(
1900
+				$year_r . '-' . $month_r . '-01 00:00:00',
1901
+				new DateTimeZone('UTC')
1902
+			);
1903
+			$start = $DateTime->getTimestamp();
1904
+			// set the datetime to be the end of the month
1905
+			$DateTime->setDate(
1906
+				$year_r,
1907
+				$month_r,
1908
+				$DateTime->format('t')
1909
+			)->setTime(23, 59, 59);
1910
+			$end = $DateTime->getTimestamp();
1911
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1912
+		} elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'today') {
1913
+			$DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1914
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1915
+			$end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1916
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1917
+		} elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'month') {
1918
+			$now = date('Y-m-01');
1919
+			$DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1920
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1921
+			$end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1922
+							->setTime(23, 59, 59)
1923
+							->format(implode(' ', $start_formats));
1924
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1925
+		}
1926
+		if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1927
+			$where['EVT_wp_user'] = get_current_user_id();
1928
+		} elseif (! isset($where['status'])
1929
+			&& ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1930
+		) {
1931
+			$where['OR'] = array(
1932
+				'status*restrict_private' => array('!=', 'private'),
1933
+				'AND'                     => array(
1934
+					'status*inclusive' => array('=', 'private'),
1935
+					'EVT_wp_user'      => get_current_user_id(),
1936
+				),
1937
+			);
1938
+		}
1939
+
1940
+		if (isset($this->_req_data['EVT_wp_user'])
1941
+			&& (int) $this->_req_data['EVT_wp_user'] !== (int) get_current_user_id()
1942
+			&& EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1943
+		) {
1944
+			$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1945
+		}
1946
+		// search query handling
1947
+		if (isset($this->_req_data['s'])) {
1948
+			$search_string = '%' . $this->_req_data['s'] . '%';
1949
+			$where['OR'] = array(
1950
+				'EVT_name'       => array('LIKE', $search_string),
1951
+				'EVT_desc'       => array('LIKE', $search_string),
1952
+				'EVT_short_desc' => array('LIKE', $search_string),
1953
+			);
1954
+		}
1955
+		// filter events by venue.
1956
+		if (isset($this->_req_data['venue']) && ! empty($this->_req_data['venue'])) {
1957
+			$where['Venue.VNU_ID'] = absint($this->_req_data['venue']);
1958
+		}
1959
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1960
+		$query_params = apply_filters(
1961
+			'FHEE__Events_Admin_Page__get_events__query_params',
1962
+			array(
1963
+				$where,
1964
+				'limit'    => $limit,
1965
+				'order_by' => $orderby,
1966
+				'order'    => $order,
1967
+				'group_by' => 'EVT_ID',
1968
+			),
1969
+			$this->_req_data
1970
+		);
1971
+
1972
+		// let's first check if we have special requests coming in.
1973
+		if (isset($this->_req_data['active_status'])) {
1974
+			switch ($this->_req_data['active_status']) {
1975
+				case 'upcoming':
1976
+					return $EEME->get_upcoming_events($query_params, $count);
1977
+					break;
1978
+				case 'expired':
1979
+					return $EEME->get_expired_events($query_params, $count);
1980
+					break;
1981
+				case 'active':
1982
+					return $EEME->get_active_events($query_params, $count);
1983
+					break;
1984
+				case 'inactive':
1985
+					return $EEME->get_inactive_events($query_params, $count);
1986
+					break;
1987
+			}
1988
+		}
1989
+
1990
+		$events = $count ? $EEME->count(array($where), 'EVT_ID', true) : $EEME->get_all($query_params);
1991
+		return $events;
1992
+	}
1993
+
1994
+
1995
+	/**
1996
+	 * handling for WordPress CPT actions (trash, restore, delete)
1997
+	 *
1998
+	 * @param string $post_id
1999
+	 * @throws EE_Error
2000
+	 * @throws InvalidArgumentException
2001
+	 * @throws InvalidDataTypeException
2002
+	 * @throws InvalidInterfaceException
2003
+	 * @throws ReflectionException
2004
+	 */
2005
+	public function trash_cpt_item($post_id)
2006
+	{
2007
+		$this->_req_data['EVT_ID'] = $post_id;
2008
+		$this->_trash_or_restore_event('trash', false);
2009
+	}
2010
+
2011
+
2012
+	/**
2013
+	 * @param string $post_id
2014
+	 * @throws EE_Error
2015
+	 * @throws InvalidArgumentException
2016
+	 * @throws InvalidDataTypeException
2017
+	 * @throws InvalidInterfaceException
2018
+	 * @throws ReflectionException
2019
+	 */
2020
+	public function restore_cpt_item($post_id)
2021
+	{
2022
+		$this->_req_data['EVT_ID'] = $post_id;
2023
+		$this->_trash_or_restore_event('draft', false);
2024
+	}
2025
+
2026
+
2027
+	/**
2028
+	 * @param string $post_id
2029
+	 * @throws EE_Error
2030
+	 * @throws InvalidArgumentException
2031
+	 * @throws InvalidDataTypeException
2032
+	 * @throws InvalidInterfaceException
2033
+	 * @throws ReflectionException
2034
+	 */
2035
+	public function delete_cpt_item($post_id)
2036
+	{
2037
+		$this->_req_data['EVT_ID'] = $post_id;
2038
+		$this->_delete_event(false);
2039
+	}
2040
+
2041
+
2042
+	/**
2043
+	 * _trash_or_restore_event
2044
+	 *
2045
+	 * @access protected
2046
+	 * @param string $event_status
2047
+	 * @param bool   $redirect_after
2048
+	 * @throws EE_Error
2049
+	 * @throws InvalidArgumentException
2050
+	 * @throws InvalidDataTypeException
2051
+	 * @throws InvalidInterfaceException
2052
+	 * @throws ReflectionException
2053
+	 */
2054
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2055
+	{
2056
+		// determine the event id and set to array.
2057
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
2058
+		// loop thru events
2059
+		if ($EVT_ID) {
2060
+			// clean status
2061
+			$event_status = sanitize_key($event_status);
2062
+			// grab status
2063
+			if (! empty($event_status)) {
2064
+				$success = $this->_change_event_status($EVT_ID, $event_status);
2065
+			} else {
2066
+				$success = false;
2067
+				$msg = esc_html__(
2068
+					'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2069
+					'event_espresso'
2070
+				);
2071
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2072
+			}
2073
+		} else {
2074
+			$success = false;
2075
+			$msg = esc_html__(
2076
+				'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2077
+				'event_espresso'
2078
+			);
2079
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2080
+		}
2081
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2082
+		if ($redirect_after) {
2083
+			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
2084
+		}
2085
+	}
2086
+
2087
+
2088
+	/**
2089
+	 * _trash_or_restore_events
2090
+	 *
2091
+	 * @access protected
2092
+	 * @param string $event_status
2093
+	 * @return void
2094
+	 * @throws EE_Error
2095
+	 * @throws InvalidArgumentException
2096
+	 * @throws InvalidDataTypeException
2097
+	 * @throws InvalidInterfaceException
2098
+	 * @throws ReflectionException
2099
+	 */
2100
+	protected function _trash_or_restore_events($event_status = 'trash')
2101
+	{
2102
+		// clean status
2103
+		$event_status = sanitize_key($event_status);
2104
+		// grab status
2105
+		if (! empty($event_status)) {
2106
+			$success = true;
2107
+			// determine the event id and set to array.
2108
+			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
2109
+			// loop thru events
2110
+			foreach ($EVT_IDs as $EVT_ID) {
2111
+				if ($EVT_ID = absint($EVT_ID)) {
2112
+					$results = $this->_change_event_status($EVT_ID, $event_status);
2113
+					$success = $results !== false ? $success : false;
2114
+				} else {
2115
+					$msg = sprintf(
2116
+						esc_html__(
2117
+							'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2118
+							'event_espresso'
2119
+						),
2120
+						$EVT_ID
2121
+					);
2122
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2123
+					$success = false;
2124
+				}
2125
+			}
2126
+		} else {
2127
+			$success = false;
2128
+			$msg = esc_html__(
2129
+				'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2130
+				'event_espresso'
2131
+			);
2132
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2133
+		}
2134
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2135
+		$success = $success ? 2 : false;
2136
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2137
+		$this->_redirect_after_action($success, 'Events', $action, array('action' => 'default'));
2138
+	}
2139
+
2140
+
2141
+	/**
2142
+	 * _trash_or_restore_events
2143
+	 *
2144
+	 * @access  private
2145
+	 * @param int    $EVT_ID
2146
+	 * @param string $event_status
2147
+	 * @return bool
2148
+	 * @throws EE_Error
2149
+	 * @throws InvalidArgumentException
2150
+	 * @throws InvalidDataTypeException
2151
+	 * @throws InvalidInterfaceException
2152
+	 * @throws ReflectionException
2153
+	 */
2154
+	private function _change_event_status($EVT_ID = 0, $event_status = '')
2155
+	{
2156
+		// grab event id
2157
+		if (! $EVT_ID) {
2158
+			$msg = esc_html__(
2159
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2160
+				'event_espresso'
2161
+			);
2162
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2163
+			return false;
2164
+		}
2165
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2166
+		// clean status
2167
+		$event_status = sanitize_key($event_status);
2168
+		// grab status
2169
+		if (empty($event_status)) {
2170
+			$msg = esc_html__(
2171
+				'An error occurred. No Event Status or an invalid Event Status was received.',
2172
+				'event_espresso'
2173
+			);
2174
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2175
+			return false;
2176
+		}
2177
+		// was event trashed or restored ?
2178
+		switch ($event_status) {
2179
+			case 'draft':
2180
+				$action = 'restored from the trash';
2181
+				$hook = 'AHEE_event_restored_from_trash';
2182
+				break;
2183
+			case 'trash':
2184
+				$action = 'moved to the trash';
2185
+				$hook = 'AHEE_event_moved_to_trash';
2186
+				break;
2187
+			default:
2188
+				$action = 'updated';
2189
+				$hook = false;
2190
+		}
2191
+		// use class to change status
2192
+		$this->_cpt_model_obj->set_status($event_status);
2193
+		$success = $this->_cpt_model_obj->save();
2194
+		if ($success === false) {
2195
+			$msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2196
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2197
+			return false;
2198
+		}
2199
+		if ($hook) {
2200
+			do_action($hook);
2201
+		}
2202
+		return true;
2203
+	}
2204
+
2205
+
2206
+	/**
2207
+	 * _delete_event
2208
+	 *
2209
+	 * @access protected
2210
+	 * @param bool $redirect_after
2211
+	 * @throws EE_Error
2212
+	 * @throws InvalidArgumentException
2213
+	 * @throws InvalidDataTypeException
2214
+	 * @throws InvalidInterfaceException
2215
+	 * @throws ReflectionException
2216
+	 */
2217
+	protected function _delete_event($redirect_after = true)
2218
+	{
2219
+		// determine the event id and set to array.
2220
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
2221
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
2222
+		// loop thru events
2223
+		if ($EVT_ID) {
2224
+			$success = $this->_permanently_delete_event($EVT_ID);
2225
+			// get list of events with no prices
2226
+			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2227
+			// remove this event from the list of events with no prices
2228
+			if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2229
+				unset($espresso_no_ticket_prices[ $EVT_ID ]);
2230
+			}
2231
+			update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2232
+		} else {
2233
+			$success = false;
2234
+			$msg = esc_html__(
2235
+				'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2236
+				'event_espresso'
2237
+			);
2238
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2239
+		}
2240
+		if ($redirect_after) {
2241
+			$this->_redirect_after_action(
2242
+				$success,
2243
+				'Event',
2244
+				'deleted',
2245
+				array('action' => 'default', 'status' => 'trash')
2246
+			);
2247
+		}
2248
+	}
2249
+
2250
+
2251
+	/**
2252
+	 * _delete_events
2253
+	 *
2254
+	 * @access protected
2255
+	 * @return void
2256
+	 * @throws EE_Error
2257
+	 * @throws InvalidArgumentException
2258
+	 * @throws InvalidDataTypeException
2259
+	 * @throws InvalidInterfaceException
2260
+	 * @throws ReflectionException
2261
+	 */
2262
+	protected function _delete_events()
2263
+	{
2264
+		$success = true;
2265
+		// get list of events with no prices
2266
+		$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2267
+		// determine the event id and set to array.
2268
+		$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
2269
+		// loop thru events
2270
+		foreach ($EVT_IDs as $EVT_ID) {
2271
+			$EVT_ID = absint($EVT_ID);
2272
+			if ($EVT_ID) {
2273
+				$results = $this->_permanently_delete_event($EVT_ID);
2274
+				$success = $results !== false ? $success : false;
2275
+				// remove this event from the list of events with no prices
2276
+				unset($espresso_no_ticket_prices[ $EVT_ID ]);
2277
+			} else {
2278
+				$success = false;
2279
+				$msg = esc_html__(
2280
+					'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2281
+					'event_espresso'
2282
+				);
2283
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2284
+			}
2285
+		}
2286
+		update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2287
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2288
+		$success = $success ? 2 : false;
2289
+		$this->_redirect_after_action($success, 'Events', 'deleted', array('action' => 'default'));
2290
+	}
2291
+
2292
+
2293
+	/**
2294
+	 * _permanently_delete_event
2295
+	 *
2296
+	 * @access  private
2297
+	 * @param int $EVT_ID
2298
+	 * @return bool
2299
+	 * @throws EE_Error
2300
+	 * @throws InvalidArgumentException
2301
+	 * @throws InvalidDataTypeException
2302
+	 * @throws InvalidInterfaceException
2303
+	 * @throws ReflectionException
2304
+	 */
2305
+	private function _permanently_delete_event($EVT_ID = 0)
2306
+	{
2307
+		// grab event id
2308
+		if (! $EVT_ID) {
2309
+			$msg = esc_html__(
2310
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2311
+				'event_espresso'
2312
+			);
2313
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2314
+			return false;
2315
+		}
2316
+		if (! $this->_cpt_model_obj instanceof EE_Event
2317
+			|| $this->_cpt_model_obj->ID() !== $EVT_ID
2318
+		) {
2319
+			$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2320
+		}
2321
+		if (! $this->_cpt_model_obj instanceof EE_Event) {
2322
+			return false;
2323
+		}
2324
+		// need to delete related tickets and prices first.
2325
+		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2326
+		foreach ($datetimes as $datetime) {
2327
+			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2328
+			$tickets = $datetime->get_many_related('Ticket');
2329
+			foreach ($tickets as $ticket) {
2330
+				$ticket->_remove_relation_to($datetime, 'Datetime');
2331
+				$ticket->delete_related_permanently('Price');
2332
+				$ticket->delete_permanently();
2333
+			}
2334
+			$datetime->delete();
2335
+		}
2336
+		// what about related venues or terms?
2337
+		$venues = $this->_cpt_model_obj->get_many_related('Venue');
2338
+		foreach ($venues as $venue) {
2339
+			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2340
+		}
2341
+		// any attached question groups?
2342
+		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2343
+		if (! empty($question_groups)) {
2344
+			foreach ($question_groups as $question_group) {
2345
+				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2346
+			}
2347
+		}
2348
+		// Message Template Groups
2349
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2350
+		/** @type EE_Term_Taxonomy[] $term_taxonomies */
2351
+		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2352
+		foreach ($term_taxonomies as $term_taxonomy) {
2353
+			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2354
+		}
2355
+		$success = $this->_cpt_model_obj->delete_permanently();
2356
+		// did it all go as planned ?
2357
+		if ($success) {
2358
+			$msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2359
+			EE_Error::add_success($msg);
2360
+		} else {
2361
+			$msg = sprintf(
2362
+				esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2363
+				$EVT_ID
2364
+			);
2365
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2366
+			return false;
2367
+		}
2368
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2369
+		return true;
2370
+	}
2371
+
2372
+
2373
+	/**
2374
+	 * get total number of events
2375
+	 *
2376
+	 * @access public
2377
+	 * @return int
2378
+	 * @throws EE_Error
2379
+	 * @throws InvalidArgumentException
2380
+	 * @throws InvalidDataTypeException
2381
+	 * @throws InvalidInterfaceException
2382
+	 */
2383
+	public function total_events()
2384
+	{
2385
+		$count = EEM_Event::instance()->count(array('caps' => 'read_admin'), 'EVT_ID', true);
2386
+		return $count;
2387
+	}
2388
+
2389
+
2390
+	/**
2391
+	 * get total number of draft events
2392
+	 *
2393
+	 * @access public
2394
+	 * @return int
2395
+	 * @throws EE_Error
2396
+	 * @throws InvalidArgumentException
2397
+	 * @throws InvalidDataTypeException
2398
+	 * @throws InvalidInterfaceException
2399
+	 */
2400
+	public function total_events_draft()
2401
+	{
2402
+		$where = array(
2403
+			'status' => array('IN', array('draft', 'auto-draft')),
2404
+		);
2405
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
2406
+		return $count;
2407
+	}
2408
+
2409
+
2410
+	/**
2411
+	 * get total number of trashed events
2412
+	 *
2413
+	 * @access public
2414
+	 * @return int
2415
+	 * @throws EE_Error
2416
+	 * @throws InvalidArgumentException
2417
+	 * @throws InvalidDataTypeException
2418
+	 * @throws InvalidInterfaceException
2419
+	 */
2420
+	public function total_trashed_events()
2421
+	{
2422
+		$where = array(
2423
+			'status' => 'trash',
2424
+		);
2425
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
2426
+		return $count;
2427
+	}
2428
+
2429
+
2430
+	/**
2431
+	 *    _default_event_settings
2432
+	 *    This generates the Default Settings Tab
2433
+	 *
2434
+	 * @return void
2435
+	 * @throws DomainException
2436
+	 * @throws EE_Error
2437
+	 * @throws InvalidArgumentException
2438
+	 * @throws InvalidDataTypeException
2439
+	 * @throws InvalidInterfaceException
2440
+	 */
2441
+	protected function _default_event_settings()
2442
+	{
2443
+		$this->_set_add_edit_form_tags('update_default_event_settings');
2444
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
2445
+		$this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2446
+		$this->display_admin_page_with_sidebar();
2447
+	}
2448
+
2449
+
2450
+	/**
2451
+	 * Return the form for event settings.
2452
+	 *
2453
+	 * @return EE_Form_Section_Proper
2454
+	 * @throws EE_Error
2455
+	 */
2456
+	protected function _default_event_settings_form()
2457
+	{
2458
+		$registration_config = EE_Registry::instance()->CFG->registration;
2459
+		$registration_stati_for_selection = EEM_Registration::reg_status_array(
2460
+			// exclude
2461
+			array(
2462
+				EEM_Registration::status_id_cancelled,
2463
+				EEM_Registration::status_id_declined,
2464
+				EEM_Registration::status_id_incomplete,
2465
+				EEM_Registration::status_id_wait_list,
2466
+			),
2467
+			true
2468
+		);
2469
+		return new EE_Form_Section_Proper(
2470
+			array(
2471
+				'name'            => 'update_default_event_settings',
2472
+				'html_id'         => 'update_default_event_settings',
2473
+				'html_class'      => 'form-table',
2474
+				'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2475
+				'subsections'     => apply_filters(
2476
+					'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2477
+					array(
2478
+						'default_reg_status'  => new EE_Select_Input(
2479
+							$registration_stati_for_selection,
2480
+							array(
2481
+								'default'         => isset($registration_config->default_STS_ID)
2482
+													 && array_key_exists(
2483
+														 $registration_config->default_STS_ID,
2484
+														 $registration_stati_for_selection
2485
+													 )
2486
+									? sanitize_text_field($registration_config->default_STS_ID)
2487
+									: EEM_Registration::status_id_pending_payment,
2488
+								'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2489
+													 . EEH_Template::get_help_tab_link(
2490
+														 'default_settings_status_help_tab'
2491
+													 ),
2492
+								'html_help_text'  => esc_html__(
2493
+									'This setting allows you to preselect what the default registration status setting is when creating an event.  Note that changing this setting does NOT retroactively apply it to existing events.',
2494
+									'event_espresso'
2495
+								),
2496
+							)
2497
+						),
2498
+						'default_max_tickets' => new EE_Integer_Input(
2499
+							array(
2500
+								'default'         => isset($registration_config->default_maximum_number_of_tickets)
2501
+									? $registration_config->default_maximum_number_of_tickets
2502
+									: EEM_Event::get_default_additional_limit(),
2503
+								'html_label_text' => esc_html__(
2504
+									'Default Maximum Tickets Allowed Per Order:',
2505
+									'event_espresso'
2506
+								)
2507
+													 . EEH_Template::get_help_tab_link(
2508
+														 'default_maximum_tickets_help_tab"'
2509
+													 ),
2510
+								'html_help_text'  => esc_html__(
2511
+									'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2512
+									'event_espresso'
2513
+								),
2514
+							)
2515
+						),
2516
+					)
2517
+				),
2518
+			)
2519
+		);
2520
+	}
2521
+
2522
+
2523
+	/**
2524
+	 * @return void
2525
+	 * @throws EE_Error
2526
+	 * @throws InvalidArgumentException
2527
+	 * @throws InvalidDataTypeException
2528
+	 * @throws InvalidInterfaceException
2529
+	 */
2530
+	protected function _update_default_event_settings()
2531
+	{
2532
+		$form = $this->_default_event_settings_form();
2533
+		if ($form->was_submitted()) {
2534
+			$form->receive_form_submission();
2535
+			if ($form->is_valid()) {
2536
+				$registration_config = EE_Registry::instance()->CFG->registration;
2537
+				$valid_data = $form->valid_data();
2538
+				if (isset($valid_data['default_reg_status'])) {
2539
+					$registration_config->default_STS_ID = $valid_data['default_reg_status'];
2540
+				}
2541
+				if (isset($valid_data['default_max_tickets'])) {
2542
+					$registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2543
+				}
2544
+				do_action(
2545
+					'AHEE__Events_Admin_Page___update_default_event_settings',
2546
+					$valid_data,
2547
+					EE_Registry::instance()->CFG,
2548
+					$this
2549
+				);
2550
+				// update because data was valid!
2551
+				EE_Registry::instance()->CFG->update_espresso_config();
2552
+				EE_Error::overwrite_success();
2553
+				EE_Error::add_success(
2554
+					__('Default Event Settings were updated', 'event_espresso')
2555
+				);
2556
+			}
2557
+		}
2558
+		$this->_redirect_after_action(0, '', '', array('action' => 'default_event_settings'), true);
2559
+	}
2560
+
2561
+
2562
+	/*************        Templates        *************/
2563
+	protected function _template_settings()
2564
+	{
2565
+		$this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2566
+		$this->_template_args['preview_img'] = '<img src="'
2567
+											   . EVENTS_ASSETS_URL
2568
+											   . '/images/'
2569
+											   . 'caffeinated_template_features.jpg" alt="'
2570
+											   . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2571
+											   . '" />';
2572
+		$this->_template_args['preview_text'] = '<strong>'
2573
+												. esc_html__(
2574
+													'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2575
+													'event_espresso'
2576
+												) . '</strong>';
2577
+		$this->display_admin_caf_preview_page('template_settings_tab');
2578
+	}
2579
+
2580
+
2581
+	/** Event Category Stuff **/
2582
+	/**
2583
+	 * set the _category property with the category object for the loaded page.
2584
+	 *
2585
+	 * @access private
2586
+	 * @return void
2587
+	 */
2588
+	private function _set_category_object()
2589
+	{
2590
+		if (isset($this->_category->id) && ! empty($this->_category->id)) {
2591
+			return;
2592
+		} //already have the category object so get out.
2593
+		// set default category object
2594
+		$this->_set_empty_category_object();
2595
+		// only set if we've got an id
2596
+		if (! isset($this->_req_data['EVT_CAT_ID'])) {
2597
+			return;
2598
+		}
2599
+		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2600
+		$term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2601
+		if (! empty($term)) {
2602
+			$this->_category->category_name = $term->name;
2603
+			$this->_category->category_identifier = $term->slug;
2604
+			$this->_category->category_desc = $term->description;
2605
+			$this->_category->id = $term->term_id;
2606
+			$this->_category->parent = $term->parent;
2607
+		}
2608
+	}
2609
+
2610
+
2611
+	/**
2612
+	 * Clears out category properties.
2613
+	 */
2614
+	private function _set_empty_category_object()
2615
+	{
2616
+		$this->_category = new stdClass();
2617
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2618
+		$this->_category->id = $this->_category->parent = 0;
2619
+	}
2620
+
2621
+
2622
+	/**
2623
+	 * @throws DomainException
2624
+	 * @throws EE_Error
2625
+	 * @throws InvalidArgumentException
2626
+	 * @throws InvalidDataTypeException
2627
+	 * @throws InvalidInterfaceException
2628
+	 */
2629
+	protected function _category_list_table()
2630
+	{
2631
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2632
+		$this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2633
+		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2634
+			'add_category',
2635
+			'add_category',
2636
+			array(),
2637
+			'add-new-h2'
2638
+		);
2639
+		$this->display_admin_list_table_page_with_sidebar();
2640
+	}
2641
+
2642
+
2643
+	/**
2644
+	 * Output category details view.
2645
+	 *
2646
+	 * @param string $view
2647
+	 * @throws DomainException
2648
+	 * @throws EE_Error
2649
+	 * @throws InvalidArgumentException
2650
+	 * @throws InvalidDataTypeException
2651
+	 * @throws InvalidInterfaceException
2652
+	 */
2653
+	protected function _category_details($view)
2654
+	{
2655
+		// load formatter helper
2656
+		// load field generator helper
2657
+		$route = $view === 'edit' ? 'update_category' : 'insert_category';
2658
+		$this->_set_add_edit_form_tags($route);
2659
+		$this->_set_category_object();
2660
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2661
+		$delete_action = 'delete_category';
2662
+		// custom redirect
2663
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(
2664
+			array('action' => 'category_list'),
2665
+			$this->_admin_base_url
2666
+		);
2667
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2668
+		// take care of contents
2669
+		$this->_template_args['admin_page_content'] = $this->_category_details_content();
2670
+		$this->display_admin_page_with_sidebar();
2671
+	}
2672
+
2673
+
2674
+	/**
2675
+	 * Output category details content.
2676
+	 *
2677
+	 * @throws DomainException
2678
+	 */
2679
+	protected function _category_details_content()
2680
+	{
2681
+		$editor_args['category_desc'] = array(
2682
+			'type'          => 'wp_editor',
2683
+			'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2684
+			'class'         => 'my_editor_custom',
2685
+			'wpeditor_args' => array('media_buttons' => false),
2686
+		);
2687
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2688
+		$all_terms = get_terms(
2689
+			array(EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY),
2690
+			array('hide_empty' => 0, 'exclude' => array($this->_category->id))
2691
+		);
2692
+		// setup category select for term parents.
2693
+		$category_select_values[] = array(
2694
+			'text' => esc_html__('No Parent', 'event_espresso'),
2695
+			'id'   => 0,
2696
+		);
2697
+		foreach ($all_terms as $term) {
2698
+			$category_select_values[] = array(
2699
+				'text' => $term->name,
2700
+				'id'   => $term->term_id,
2701
+			);
2702
+		}
2703
+		$category_select = EEH_Form_Fields::select_input(
2704
+			'category_parent',
2705
+			$category_select_values,
2706
+			$this->_category->parent
2707
+		);
2708
+		$template_args = array(
2709
+			'category'                 => $this->_category,
2710
+			'category_select'          => $category_select,
2711
+			'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2712
+			'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2713
+			'disable'                  => '',
2714
+			'disabled_message'         => false,
2715
+		);
2716
+		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2717
+		return EEH_Template::display_template($template, $template_args, true);
2718
+	}
2719
+
2720
+
2721
+	/**
2722
+	 * Handles deleting categories.
2723
+	 */
2724
+	protected function _delete_categories()
2725
+	{
2726
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2727
+			: (array) $this->_req_data['category_id'];
2728
+		foreach ($cat_ids as $cat_id) {
2729
+			$this->_delete_category($cat_id);
2730
+		}
2731
+		// doesn't matter what page we're coming from... we're going to the same place after delete.
2732
+		$query_args = array(
2733
+			'action' => 'category_list',
2734
+		);
2735
+		$this->_redirect_after_action(0, '', '', $query_args);
2736
+	}
2737
+
2738
+
2739
+	/**
2740
+	 * Handles deleting specific category.
2741
+	 *
2742
+	 * @param int $cat_id
2743
+	 */
2744
+	protected function _delete_category($cat_id)
2745
+	{
2746
+		$cat_id = absint($cat_id);
2747
+		wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2748
+	}
2749
+
2750
+
2751
+	/**
2752
+	 * Handles triggering the update or insertion of a new category.
2753
+	 *
2754
+	 * @param bool $new_category true means we're triggering the insert of a new category.
2755
+	 * @throws EE_Error
2756
+	 * @throws InvalidArgumentException
2757
+	 * @throws InvalidDataTypeException
2758
+	 * @throws InvalidInterfaceException
2759
+	 */
2760
+	protected function _insert_or_update_category($new_category)
2761
+	{
2762
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2763
+		$success = 0; // we already have a success message so lets not send another.
2764
+		if ($cat_id) {
2765
+			$query_args = array(
2766
+				'action'     => 'edit_category',
2767
+				'EVT_CAT_ID' => $cat_id,
2768
+			);
2769
+		} else {
2770
+			$query_args = array('action' => 'add_category');
2771
+		}
2772
+		$this->_redirect_after_action($success, '', '', $query_args, true);
2773
+	}
2774
+
2775
+
2776
+	/**
2777
+	 * Inserts or updates category
2778
+	 *
2779
+	 * @param bool $update (true indicates we're updating a category).
2780
+	 * @return bool|mixed|string
2781
+	 */
2782
+	private function _insert_category($update = false)
2783
+	{
2784
+		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2785
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2786
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2787
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2788
+		if (empty($category_name)) {
2789
+			$msg = esc_html__('You must add a name for the category.', 'event_espresso');
2790
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2791
+			return false;
2792
+		}
2793
+		$term_args = array(
2794
+			'name'        => $category_name,
2795
+			'description' => $category_desc,
2796
+			'parent'      => $category_parent,
2797
+		);
2798
+		// was the category_identifier input disabled?
2799
+		if (isset($this->_req_data['category_identifier'])) {
2800
+			$term_args['slug'] = $this->_req_data['category_identifier'];
2801
+		}
2802
+		$insert_ids = $update
2803
+			? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2804
+			: wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2805
+		if (! is_array($insert_ids)) {
2806
+			$msg = esc_html__(
2807
+				'An error occurred and the category has not been saved to the database.',
2808
+				'event_espresso'
2809
+			);
2810
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2811
+		} else {
2812
+			$cat_id = $insert_ids['term_id'];
2813
+			$msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2814
+			EE_Error::add_success($msg);
2815
+		}
2816
+		return $cat_id;
2817
+	}
2818
+
2819
+
2820
+	/**
2821
+	 * Gets categories or count of categories matching the arguments in the request.
2822
+	 *
2823
+	 * @param int  $per_page
2824
+	 * @param int  $current_page
2825
+	 * @param bool $count
2826
+	 * @return EE_Base_Class[]|EE_Term_Taxonomy[]|int
2827
+	 * @throws EE_Error
2828
+	 * @throws InvalidArgumentException
2829
+	 * @throws InvalidDataTypeException
2830
+	 * @throws InvalidInterfaceException
2831
+	 */
2832
+	public function get_categories($per_page = 10, $current_page = 1, $count = false)
2833
+	{
2834
+		// testing term stuff
2835
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2836
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2837
+		$limit = ($current_page - 1) * $per_page;
2838
+		$where = array('taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2839
+		if (isset($this->_req_data['s'])) {
2840
+			$sstr = '%' . $this->_req_data['s'] . '%';
2841
+			$where['OR'] = array(
2842
+				'Term.name'   => array('LIKE', $sstr),
2843
+				'description' => array('LIKE', $sstr),
2844
+			);
2845
+		}
2846
+		$query_params = array(
2847
+			$where,
2848
+			'order_by'   => array($orderby => $order),
2849
+			'limit'      => $limit . ',' . $per_page,
2850
+			'force_join' => array('Term'),
2851
+		);
2852
+		$categories = $count
2853
+			? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2854
+			: EEM_Term_Taxonomy::instance()->get_all($query_params);
2855
+		return $categories;
2856
+	}
2857
+
2858
+	/* end category stuff */
2859
+	/**************/
2860
+
2861
+
2862
+	/**
2863
+	 * Callback for the `ee_save_timezone_setting` ajax action.
2864
+	 *
2865
+	 * @throws EE_Error
2866
+	 * @throws InvalidArgumentException
2867
+	 * @throws InvalidDataTypeException
2868
+	 * @throws InvalidInterfaceException
2869
+	 */
2870
+	public function save_timezonestring_setting()
2871
+	{
2872
+		$timezone_string = isset($this->_req_data['timezone_selected'])
2873
+			? $this->_req_data['timezone_selected']
2874
+			: '';
2875
+		if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2876
+			EE_Error::add_error(
2877
+				esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2878
+				__FILE__,
2879
+				__FUNCTION__,
2880
+				__LINE__
2881
+			);
2882
+			$this->_template_args['error'] = true;
2883
+			$this->_return_json();
2884
+		}
2885
+
2886
+		update_option('timezone_string', $timezone_string);
2887
+		EE_Error::add_success(
2888
+			esc_html__('Your timezone string was updated.', 'event_espresso')
2889
+		);
2890
+		$this->_template_args['success'] = true;
2891
+		$this->_return_json(true, array('action' => 'create_new'));
2892
+	}
2893 2893
 }
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -502,9 +502,9 @@  discard block
 block discarded – undo
502 502
         ];
503 503
         // only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
504 504
         $domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
505
-        if (! $domain->isCaffeinated()) {
505
+        if ( ! $domain->isCaffeinated()) {
506 506
             $this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
507
-            $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips' ];
507
+            $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
508 508
         }
509 509
     }
510 510
 
@@ -561,13 +561,13 @@  discard block
 block discarded – undo
561 561
     {
562 562
         wp_register_style(
563 563
             'events-admin-css',
564
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
564
+            EVENTS_ASSETS_URL.'events-admin-page.css',
565 565
             [],
566 566
             EVENT_ESPRESSO_VERSION
567 567
         );
568 568
         wp_register_style(
569 569
             'ee-cat-admin',
570
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
570
+            EVENTS_ASSETS_URL.'ee-cat-admin.css',
571 571
             [],
572 572
             EVENT_ESPRESSO_VERSION
573 573
         );
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
         // scripts
577 577
         wp_register_script(
578 578
             'event_editor_js',
579
-            EVENTS_ASSETS_URL . 'event_editor.js',
579
+            EVENTS_ASSETS_URL.'event_editor.js',
580 580
             ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
581 581
             EVENT_ESPRESSO_VERSION,
582 582
             true
@@ -602,16 +602,16 @@  discard block
 block discarded – undo
602 602
         wp_enqueue_style('espresso-ui-theme');
603 603
         wp_register_style(
604 604
             'event-editor-css',
605
-            EVENTS_ASSETS_URL . 'event-editor.css',
605
+            EVENTS_ASSETS_URL.'event-editor.css',
606 606
             ['ee-admin-css'],
607 607
             EVENT_ESPRESSO_VERSION
608 608
         );
609 609
         wp_enqueue_style('event-editor-css');
610 610
         // scripts
611
-        if (! $this->admin_config->useAdvancedEditor()) {
611
+        if ( ! $this->admin_config->useAdvancedEditor()) {
612 612
             wp_register_script(
613 613
                 'event-datetime-metabox',
614
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
614
+                EVENTS_ASSETS_URL.'event-datetime-metabox.js',
615 615
                 ['event_editor_js', 'ee-datepicker'],
616 616
                 EVENT_ESPRESSO_VERSION
617 617
             );
@@ -681,15 +681,15 @@  discard block
 block discarded – undo
681 681
     public function verify_event_edit($event = null, $req_type = '')
682 682
     {
683 683
         // don't need to do this when processing
684
-        if (! empty($req_type)) {
684
+        if ( ! empty($req_type)) {
685 685
             return;
686 686
         }
687 687
         // no event?
688
-        if (! $event instanceof EE_Event) {
688
+        if ( ! $event instanceof EE_Event) {
689 689
             $event = $this->_cpt_model_obj;
690 690
         }
691 691
         // STILL no event?
692
-        if (! $event instanceof EE_Event) {
692
+        if ( ! $event instanceof EE_Event) {
693 693
             return;
694 694
         }
695 695
         $orig_status = $event->status();
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
             );
729 729
         }
730 730
         // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
731
-        if (! $event->tickets_on_sale()) {
731
+        if ( ! $event->tickets_on_sale()) {
732 732
             return;
733 733
         }
734 734
         // made it here so show warning
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
     {
777 777
         $has_timezone_string = get_option('timezone_string');
778 778
         // only nag them about setting their timezone if it's their first event, and they haven't already done it
779
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists(array())) {
779
+        if ( ! $has_timezone_string && ! EEM_Event::instance()->exists(array())) {
780 780
             EE_Error::add_attention(
781 781
                 sprintf(
782 782
                     __(
@@ -860,31 +860,31 @@  discard block
 block discarded – undo
860 860
         $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
861 861
         $statuses = array(
862 862
             'sold_out_status'  => array(
863
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
863
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
864 864
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
865 865
             ),
866 866
             'active_status'    => array(
867
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
867
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
868 868
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
869 869
             ),
870 870
             'upcoming_status'  => array(
871
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
871
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
872 872
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
873 873
             ),
874 874
             'postponed_status' => array(
875
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
875
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
876 876
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
877 877
             ),
878 878
             'cancelled_status' => array(
879
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
879
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
880 880
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
881 881
             ),
882 882
             'expired_status'   => array(
883
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
883
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
884 884
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
885 885
             ),
886 886
             'inactive_status'  => array(
887
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
887
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
888 888
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
889 889
             ),
890 890
         );
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
      */
904 904
     private function _event_model()
905 905
     {
906
-        if (! $this->_event_model instanceof EEM_Event) {
906
+        if ( ! $this->_event_model instanceof EEM_Event) {
907 907
             $this->_event_model = EE_Registry::instance()->load_model('Event');
908 908
         }
909 909
         return $this->_event_model;
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
     public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
924 924
     {
925 925
         // make sure this is only when editing
926
-        if (! empty($id)) {
926
+        if ( ! empty($id)) {
927 927
             $post = get_post($id);
928 928
             $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
929 929
                        . esc_html__('Shortcode', 'event_espresso')
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
                     'button'
962 962
                 );
963 963
         $this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
964
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
964
+        $this->_admin_page_title .= ' '.$this->get_action_link_or_button(
965 965
             'create_new',
966 966
             'add',
967 967
             array(),
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
                 ? sanitize_text_field($this->_req_data['timezone_string'])
1022 1022
                 : null,
1023 1023
         ];
1024
-        if (! $this->admin_config->useAdvancedEditor()) {
1024
+        if ( ! $this->admin_config->useAdvancedEditor()) {
1025 1025
             $event_values['EVT_display_ticket_selector'] =
1026 1026
                 ! empty($this->_req_data['display_ticket_selector'])
1027 1027
                     ? 1
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
      */
1132 1132
     protected function _default_venue_update(EE_Event $evtobj, $data)
1133 1133
     {
1134
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1134
+        require_once(EE_MODELS.'EEM_Venue.model.php');
1135 1135
         $venue_model = EE_Registry::instance()->load_model('Venue');
1136 1136
         $rows_affected = null;
1137 1137
         $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
             'status'              => 'publish',
1163 1163
         );
1164 1164
         // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1165
-        if (! empty($venue_id)) {
1165
+        if ( ! empty($venue_id)) {
1166 1166
             $update_where = array($venue_model->primary_key_name() => $venue_id);
1167 1167
             $rows_affected = $venue_model->update($venue_array, array($update_where));
1168 1168
             // we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
                 'DTT_order'     => $row,
1213 1213
             );
1214 1214
             // if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1215
-            if (! empty($dtt['DTT_ID'])) {
1215
+            if ( ! empty($dtt['DTT_ID'])) {
1216 1216
                 $DTM = EE_Registry::instance()
1217 1217
                                   ->load_model('Datetime', array($evtobj->get_timezone()))
1218 1218
                                   ->get_one_by_ID($dtt['DTT_ID']);
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
                     $DTM->set($field, $value);
1223 1223
                 }
1224 1224
                 // make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1225
-                $saved_dtts[ $DTM->ID() ] = $DTM;
1225
+                $saved_dtts[$DTM->ID()] = $DTM;
1226 1226
             } else {
1227 1227
                 $DTM = EE_Registry::instance()->load_class(
1228 1228
                     'Datetime',
@@ -1255,14 +1255,14 @@  discard block
 block discarded – undo
1255 1255
         foreach ($data['edit_tickets'] as $row => $tkt) {
1256 1256
             $incoming_date_formats = array('Y-m-d', 'h:i a');
1257 1257
             $update_prices = false;
1258
-            $ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1259
-                ? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1258
+            $ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount'])
1259
+                ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
1260 1260
             // trim inputs to ensure any excess whitespace is removed.
1261 1261
             $tkt = array_map('trim', $tkt);
1262 1262
             if (empty($tkt['TKT_start_date'])) {
1263 1263
                 // let's use now in the set timezone.
1264 1264
                 $now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1265
-                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1265
+                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0].' '.$incoming_date_formats[1]);
1266 1266
             }
1267 1267
             if (empty($tkt['TKT_end_date'])) {
1268 1268
                 // use the start date of the first datetime
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
             // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1298 1298
             // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1299 1299
             // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1300
-            if (! empty($tkt['TKT_ID'])) {
1300
+            if ( ! empty($tkt['TKT_ID'])) {
1301 1301
                 $TKT = EE_Registry::instance()
1302 1302
                                   ->load_model('Ticket', array($evtobj->get_timezone()))
1303 1303
                                   ->get_one_by_ID($tkt['TKT_ID']);
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
                         $TKT->set('TKT_deleted', 1);
1338 1338
                         $TKT->save();
1339 1339
                         // make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1340
-                        $saved_tickets[ $TKT->ID() ] = $TKT;
1340
+                        $saved_tickets[$TKT->ID()] = $TKT;
1341 1341
                         // create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1342 1342
                         $TKT = clone $TKT;
1343 1343
                         $TKT->set('TKT_ID', 0);
@@ -1382,9 +1382,9 @@  discard block
 block discarded – undo
1382 1382
             }
1383 1383
             // initially let's add the ticket to the dtt
1384 1384
             $saved_dtt->_add_relation_to($TKT, 'Ticket');
1385
-            $saved_tickets[ $TKT->ID() ] = $TKT;
1385
+            $saved_tickets[$TKT->ID()] = $TKT;
1386 1386
             // add prices to ticket
1387
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1387
+            $this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1388 1388
         }
1389 1389
         // however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1390 1390
         $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? array() : $old_tickets;
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
         $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1553 1553
         // load template
1554 1554
         EEH_Template::display_template(
1555
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1555
+            EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php',
1556 1556
             $publish_box_extra_args
1557 1557
         );
1558 1558
     }
@@ -1587,7 +1587,7 @@  discard block
 block discarded – undo
1587 1587
         if ($this->admin_config->useAdvancedEditor()) {
1588 1588
             add_action(
1589 1589
                 'add_meta_boxes_espresso_events',
1590
-                function () {
1590
+                function() {
1591 1591
                     global $current_screen;
1592 1592
                     remove_meta_box('authordiv', $current_screen, 'normal');
1593 1593
                 },
@@ -1663,7 +1663,7 @@  discard block
 block discarded – undo
1663 1663
                     'default_where_conditions' => 'none',
1664 1664
                 )
1665 1665
             );
1666
-            if (! empty($related_tickets)) {
1666
+            if ( ! empty($related_tickets)) {
1667 1667
                 $template_args['total_ticket_rows'] = count($related_tickets);
1668 1668
                 $row = 0;
1669 1669
                 foreach ($related_tickets as $ticket) {
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
         );
1698 1698
         $template = apply_filters(
1699 1699
             'FHEE__Events_Admin_Page__ticket_metabox__template',
1700
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1700
+            EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php'
1701 1701
         );
1702 1702
         EEH_Template::display_template($template, $template_args);
1703 1703
     }
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
     private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1722 1722
     {
1723 1723
         $template_args = array(
1724
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1724
+            'tkt_status_class'    => ' tkt-status-'.$ticket->ticket_status(),
1725 1725
             'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1726 1726
                 : '',
1727 1727
             'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
@@ -1733,10 +1733,10 @@  discard block
 block discarded – undo
1733 1733
             'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1734 1734
             'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1735 1735
             'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1736
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1737
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1736
+            'trash_icon'          => ($skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')))
1737
+                                     && ( ! empty($ticket) && $ticket->get('TKT_sold') === 0)
1738 1738
                 ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1739
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1739
+            'disabled'            => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1740 1740
                 : ' disabled=disabled',
1741 1741
         );
1742 1742
         $price = $ticket->ID() !== 0
@@ -1763,7 +1763,7 @@  discard block
 block discarded – undo
1763 1763
                     array('order_by' => array('DTT_EVT_start' => 'ASC'))
1764 1764
                 )
1765 1765
                 : null;
1766
-            if (! empty($earliest_dtt)) {
1766
+            if ( ! empty($earliest_dtt)) {
1767 1767
                 $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1768 1768
             } else {
1769 1769
                 $template_args['TKT_end_date'] = date(
@@ -1775,7 +1775,7 @@  discard block
 block discarded – undo
1775 1775
         $template_args = array_merge($template_args, $price_args);
1776 1776
         $template = apply_filters(
1777 1777
             'FHEE__Events_Admin_Page__get_ticket_row__template',
1778
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1778
+            EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php',
1779 1779
             $ticket
1780 1780
         );
1781 1781
         return EEH_Template::display_template($template, $template_args, true);
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
             $default_reg_status_values
1831 1831
         );
1832 1832
         EEH_Template::display_template(
1833
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1833
+            EVENTS_TEMPLATE_PATH.'event_registration_options.template.php',
1834 1834
             $template_args
1835 1835
         );
1836 1836
     }
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
     {
1861 1861
         $EEME = $this->_event_model();
1862 1862
         $offset = ($current_page - 1) * $per_page;
1863
-        $limit = $count ? null : $offset . ',' . $per_page;
1863
+        $limit = $count ? null : $offset.','.$per_page;
1864 1864
         $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1865 1865
         $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1866 1866
         if (isset($this->_req_data['month_range'])) {
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
         // categories?
1890 1890
         $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1891 1891
             ? $this->_req_data['EVT_CAT'] : null;
1892
-        if (! empty($category)) {
1892
+        if ( ! empty($category)) {
1893 1893
             $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1894 1894
             $where['Term_Taxonomy.term_id'] = $category;
1895 1895
         }
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
         $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1898 1898
         if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1899 1899
             $DateTime = new DateTime(
1900
-                $year_r . '-' . $month_r . '-01 00:00:00',
1900
+                $year_r.'-'.$month_r.'-01 00:00:00',
1901 1901
                 new DateTimeZone('UTC')
1902 1902
             );
1903 1903
             $start = $DateTime->getTimestamp();
@@ -1923,9 +1923,9 @@  discard block
 block discarded – undo
1923 1923
                             ->format(implode(' ', $start_formats));
1924 1924
             $where['Datetime.DTT_EVT_start'] = array('BETWEEN', array($start, $end));
1925 1925
         }
1926
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1926
+        if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1927 1927
             $where['EVT_wp_user'] = get_current_user_id();
1928
-        } elseif (! isset($where['status'])
1928
+        } elseif ( ! isset($where['status'])
1929 1929
             && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1930 1930
         ) {
1931 1931
             $where['OR'] = array(
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
         }
1946 1946
         // search query handling
1947 1947
         if (isset($this->_req_data['s'])) {
1948
-            $search_string = '%' . $this->_req_data['s'] . '%';
1948
+            $search_string = '%'.$this->_req_data['s'].'%';
1949 1949
             $where['OR'] = array(
1950 1950
                 'EVT_name'       => array('LIKE', $search_string),
1951 1951
                 'EVT_desc'       => array('LIKE', $search_string),
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
             // clean status
2061 2061
             $event_status = sanitize_key($event_status);
2062 2062
             // grab status
2063
-            if (! empty($event_status)) {
2063
+            if ( ! empty($event_status)) {
2064 2064
                 $success = $this->_change_event_status($EVT_ID, $event_status);
2065 2065
             } else {
2066 2066
                 $success = false;
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
         // clean status
2103 2103
         $event_status = sanitize_key($event_status);
2104 2104
         // grab status
2105
-        if (! empty($event_status)) {
2105
+        if ( ! empty($event_status)) {
2106 2106
             $success = true;
2107 2107
             // determine the event id and set to array.
2108 2108
             $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
     private function _change_event_status($EVT_ID = 0, $event_status = '')
2155 2155
     {
2156 2156
         // grab event id
2157
-        if (! $EVT_ID) {
2157
+        if ( ! $EVT_ID) {
2158 2158
             $msg = esc_html__(
2159 2159
                 'An error occurred. No Event ID or an invalid Event ID was received.',
2160 2160
                 'event_espresso'
@@ -2225,8 +2225,8 @@  discard block
 block discarded – undo
2225 2225
             // get list of events with no prices
2226 2226
             $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
2227 2227
             // remove this event from the list of events with no prices
2228
-            if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2229
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2228
+            if (isset($espresso_no_ticket_prices[$EVT_ID])) {
2229
+                unset($espresso_no_ticket_prices[$EVT_ID]);
2230 2230
             }
2231 2231
             update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2232 2232
         } else {
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
                 $results = $this->_permanently_delete_event($EVT_ID);
2274 2274
                 $success = $results !== false ? $success : false;
2275 2275
                 // remove this event from the list of events with no prices
2276
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2276
+                unset($espresso_no_ticket_prices[$EVT_ID]);
2277 2277
             } else {
2278 2278
                 $success = false;
2279 2279
                 $msg = esc_html__(
@@ -2305,7 +2305,7 @@  discard block
 block discarded – undo
2305 2305
     private function _permanently_delete_event($EVT_ID = 0)
2306 2306
     {
2307 2307
         // grab event id
2308
-        if (! $EVT_ID) {
2308
+        if ( ! $EVT_ID) {
2309 2309
             $msg = esc_html__(
2310 2310
                 'An error occurred. No Event ID or an invalid Event ID was received.',
2311 2311
                 'event_espresso'
@@ -2313,12 +2313,12 @@  discard block
 block discarded – undo
2313 2313
             EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2314 2314
             return false;
2315 2315
         }
2316
-        if (! $this->_cpt_model_obj instanceof EE_Event
2316
+        if ( ! $this->_cpt_model_obj instanceof EE_Event
2317 2317
             || $this->_cpt_model_obj->ID() !== $EVT_ID
2318 2318
         ) {
2319 2319
             $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2320 2320
         }
2321
-        if (! $this->_cpt_model_obj instanceof EE_Event) {
2321
+        if ( ! $this->_cpt_model_obj instanceof EE_Event) {
2322 2322
             return false;
2323 2323
         }
2324 2324
         // need to delete related tickets and prices first.
@@ -2340,7 +2340,7 @@  discard block
 block discarded – undo
2340 2340
         }
2341 2341
         // any attached question groups?
2342 2342
         $question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2343
-        if (! empty($question_groups)) {
2343
+        if ( ! empty($question_groups)) {
2344 2344
             foreach ($question_groups as $question_group) {
2345 2345
                 $this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2346 2346
             }
@@ -2573,7 +2573,7 @@  discard block
 block discarded – undo
2573 2573
                                                 . esc_html__(
2574 2574
                                                     'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2575 2575
                                                     'event_espresso'
2576
-                                                ) . '</strong>';
2576
+                                                ).'</strong>';
2577 2577
         $this->display_admin_caf_preview_page('template_settings_tab');
2578 2578
     }
2579 2579
 
@@ -2593,12 +2593,12 @@  discard block
 block discarded – undo
2593 2593
         // set default category object
2594 2594
         $this->_set_empty_category_object();
2595 2595
         // only set if we've got an id
2596
-        if (! isset($this->_req_data['EVT_CAT_ID'])) {
2596
+        if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
2597 2597
             return;
2598 2598
         }
2599 2599
         $category_id = absint($this->_req_data['EVT_CAT_ID']);
2600 2600
         $term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2601
-        if (! empty($term)) {
2601
+        if ( ! empty($term)) {
2602 2602
             $this->_category->category_name = $term->name;
2603 2603
             $this->_category->category_identifier = $term->slug;
2604 2604
             $this->_category->category_desc = $term->description;
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
     {
2631 2631
         do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2632 2632
         $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2633
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2633
+        $this->_admin_page_title .= ' '.$this->get_action_link_or_button(
2634 2634
             'add_category',
2635 2635
             'add_category',
2636 2636
             array(),
@@ -2713,7 +2713,7 @@  discard block
 block discarded – undo
2713 2713
             'disable'                  => '',
2714 2714
             'disabled_message'         => false,
2715 2715
         );
2716
-        $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2716
+        $template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2717 2717
         return EEH_Template::display_template($template, $template_args, true);
2718 2718
     }
2719 2719
 
@@ -2802,7 +2802,7 @@  discard block
 block discarded – undo
2802 2802
         $insert_ids = $update
2803 2803
             ? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2804 2804
             : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2805
-        if (! is_array($insert_ids)) {
2805
+        if ( ! is_array($insert_ids)) {
2806 2806
             $msg = esc_html__(
2807 2807
                 'An error occurred and the category has not been saved to the database.',
2808 2808
                 'event_espresso'
@@ -2837,7 +2837,7 @@  discard block
 block discarded – undo
2837 2837
         $limit = ($current_page - 1) * $per_page;
2838 2838
         $where = array('taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2839 2839
         if (isset($this->_req_data['s'])) {
2840
-            $sstr = '%' . $this->_req_data['s'] . '%';
2840
+            $sstr = '%'.$this->_req_data['s'].'%';
2841 2841
             $where['OR'] = array(
2842 2842
                 'Term.name'   => array('LIKE', $sstr),
2843 2843
                 'description' => array('LIKE', $sstr),
@@ -2846,7 +2846,7 @@  discard block
 block discarded – undo
2846 2846
         $query_params = array(
2847 2847
             $where,
2848 2848
             'order_by'   => array($orderby => $order),
2849
-            'limit'      => $limit . ',' . $per_page,
2849
+            'limit'      => $limit.','.$per_page,
2850 2850
             'force_join' => array('Term'),
2851 2851
         );
2852 2852
         $categories = $count
Please login to merge, or discard this patch.
core/domain/services/admin/events/editor/EventManagers.php 2 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -16,108 +16,108 @@
 block discarded – undo
16 16
 class EventManagers implements EventEditorDataInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @var Utilities
21
-     */
22
-    private $utilities;
19
+	/**
20
+	 * @var Utilities
21
+	 */
22
+	private $utilities;
23 23
 
24 24
 
25
-    /**
26
-     * EventManagers constructor.
27
-     *
28
-     * @param Utilities $utilities
29
-     */
30
-    public function __construct(Utilities $utilities)
31
-    {
32
-        $this->utilities = $utilities;
33
-    }
25
+	/**
26
+	 * EventManagers constructor.
27
+	 *
28
+	 * @param Utilities $utilities
29
+	 */
30
+	public function __construct(Utilities $utilities)
31
+	{
32
+		$this->utilities = $utilities;
33
+	}
34 34
 
35 35
 
36
-    /**
37
-     * @param int $eventId
38
-     * @return array
39
-     */
40
-    public function getData(int $eventId)
41
-    {
42
-        // first get a list of WP_Roles that have "event manager" capabilities
43
-        $event_manager_roles = $this->getEventManagerRoles();
44
-        // then get a list of WP Users that have any of those roles
45
-        $event_manager_users = $this->getEventManagerUsers($event_manager_roles);
46
-        // now convert to a format that's usable by GQL
47
-        $event_managers = [];
48
-        foreach ($event_manager_users as $user) {
49
-            $GUID             = $this->utilities->convertToGlobalId('User', $user->ID);
50
-            $event_managers[] = [
51
-                'id'   => $GUID,
52
-                'name' => $user->display_name,
53
-            ];
54
-        }
55
-        return $event_managers;
56
-    }
36
+	/**
37
+	 * @param int $eventId
38
+	 * @return array
39
+	 */
40
+	public function getData(int $eventId)
41
+	{
42
+		// first get a list of WP_Roles that have "event manager" capabilities
43
+		$event_manager_roles = $this->getEventManagerRoles();
44
+		// then get a list of WP Users that have any of those roles
45
+		$event_manager_users = $this->getEventManagerUsers($event_manager_roles);
46
+		// now convert to a format that's usable by GQL
47
+		$event_managers = [];
48
+		foreach ($event_manager_users as $user) {
49
+			$GUID             = $this->utilities->convertToGlobalId('User', $user->ID);
50
+			$event_managers[] = [
51
+				'id'   => $GUID,
52
+				'name' => $user->display_name,
53
+			];
54
+		}
55
+		return $event_managers;
56
+	}
57 57
 
58 58
 
59
-    /**
60
-     * Returns a list of WP_Role that have "event manager" capabilities
61
-     * The list of "event manager" capabilities is filtered but defaults to:
62
-     *      - 'ee_edit_events'
63
-     *      - 'ee_edit_event'
64
-     *
65
-     * @return WP_Role[]
66
-     */
67
-    private function getEventManagerRoles()
68
-    {
69
-        global $wp_roles;
70
-        // first let's grab all of the WP_Role objects
71
-        $roles = $wp_roles->role_objects;
72
-        // then filter a list of capabilities we want to use to define an event manager
73
-        $capabilities = (array) apply_filters(
74
-            'FHEE__EventEspresso_core_domain_services_admin_events_editor_EventManagers__getData__capabilities',
75
-            ['ee_edit_events', 'ee_edit_event'],
76
-            $roles
77
-        );
78
-        // we'll use this array to capture all of the WP_Role objects that have any of the caps we are targeting
79
-        $event_manager_roles = [];
80
-        foreach ($roles as $role) {
81
-            foreach ($capabilities as $capability) {
82
-                // we're using the role name as the array index to prevent duplicates
83
-                if (! isset($event_manager_roles[ $role->name ]) && $role->has_cap($capability)) {
84
-                    $event_manager_roles[ $role->name ] = $role;
85
-                }
86
-            }
87
-        }
88
-        return $event_manager_roles;
89
-    }
59
+	/**
60
+	 * Returns a list of WP_Role that have "event manager" capabilities
61
+	 * The list of "event manager" capabilities is filtered but defaults to:
62
+	 *      - 'ee_edit_events'
63
+	 *      - 'ee_edit_event'
64
+	 *
65
+	 * @return WP_Role[]
66
+	 */
67
+	private function getEventManagerRoles()
68
+	{
69
+		global $wp_roles;
70
+		// first let's grab all of the WP_Role objects
71
+		$roles = $wp_roles->role_objects;
72
+		// then filter a list of capabilities we want to use to define an event manager
73
+		$capabilities = (array) apply_filters(
74
+			'FHEE__EventEspresso_core_domain_services_admin_events_editor_EventManagers__getData__capabilities',
75
+			['ee_edit_events', 'ee_edit_event'],
76
+			$roles
77
+		);
78
+		// we'll use this array to capture all of the WP_Role objects that have any of the caps we are targeting
79
+		$event_manager_roles = [];
80
+		foreach ($roles as $role) {
81
+			foreach ($capabilities as $capability) {
82
+				// we're using the role name as the array index to prevent duplicates
83
+				if (! isset($event_manager_roles[ $role->name ]) && $role->has_cap($capability)) {
84
+					$event_manager_roles[ $role->name ] = $role;
85
+				}
86
+			}
87
+		}
88
+		return $event_manager_roles;
89
+	}
90 90
 
91 91
 
92
-    /**
93
-     * Returns a list of users that have any of the supplied roles
94
-     *
95
-     * @param WP_Role[] $event_manager_roles
96
-     * @return stdClass[]
97
-     */
98
-    private function getEventManagerUsers(array $event_manager_roles)
99
-    {
100
-        global $wpdb;
101
-        // no roles ?!!? then nothing to query for
102
-        if (empty($event_manager_roles)) {
103
-            return [];
104
-        }
105
-        // begin to build our query
106
-        $SQL = "SELECT u1.ID, u1.display_name FROM {$wpdb->users} AS u1 "
107
-             . "INNER JOIN {$wpdb->usermeta} AS u2 ON u1.ID = u2.user_id "
108
-             . "AND u2.meta_key='{$wpdb->prefix}capabilities' "
109
-             . 'WHERE';
110
-        $operator = '';
111
-        foreach ($event_manager_roles as $role) {
112
-            // for each role, add a WHERE clause
113
-            if ($role instanceof WP_Role) {
114
-                $SQL     .= $operator . ' u2.meta_value LIKE \'%"' . $role->name . '"%\' ';
115
-                // subsequent clauses will use OR so that any role is accepted
116
-                $operator = 'OR';
117
-            }
118
-        }
119
-        $SQL  .= "ORDER BY user_id ASC";
120
-        $users = $wpdb->get_results($SQL);
121
-        return ! empty($users) ? $users : [];
122
-    }
92
+	/**
93
+	 * Returns a list of users that have any of the supplied roles
94
+	 *
95
+	 * @param WP_Role[] $event_manager_roles
96
+	 * @return stdClass[]
97
+	 */
98
+	private function getEventManagerUsers(array $event_manager_roles)
99
+	{
100
+		global $wpdb;
101
+		// no roles ?!!? then nothing to query for
102
+		if (empty($event_manager_roles)) {
103
+			return [];
104
+		}
105
+		// begin to build our query
106
+		$SQL = "SELECT u1.ID, u1.display_name FROM {$wpdb->users} AS u1 "
107
+			 . "INNER JOIN {$wpdb->usermeta} AS u2 ON u1.ID = u2.user_id "
108
+			 . "AND u2.meta_key='{$wpdb->prefix}capabilities' "
109
+			 . 'WHERE';
110
+		$operator = '';
111
+		foreach ($event_manager_roles as $role) {
112
+			// for each role, add a WHERE clause
113
+			if ($role instanceof WP_Role) {
114
+				$SQL     .= $operator . ' u2.meta_value LIKE \'%"' . $role->name . '"%\' ';
115
+				// subsequent clauses will use OR so that any role is accepted
116
+				$operator = 'OR';
117
+			}
118
+		}
119
+		$SQL  .= "ORDER BY user_id ASC";
120
+		$users = $wpdb->get_results($SQL);
121
+		return ! empty($users) ? $users : [];
122
+	}
123 123
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         foreach ($roles as $role) {
81 81
             foreach ($capabilities as $capability) {
82 82
                 // we're using the role name as the array index to prevent duplicates
83
-                if (! isset($event_manager_roles[ $role->name ]) && $role->has_cap($capability)) {
84
-                    $event_manager_roles[ $role->name ] = $role;
83
+                if ( ! isset($event_manager_roles[$role->name]) && $role->has_cap($capability)) {
84
+                    $event_manager_roles[$role->name] = $role;
85 85
                 }
86 86
             }
87 87
         }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         foreach ($event_manager_roles as $role) {
112 112
             // for each role, add a WHERE clause
113 113
             if ($role instanceof WP_Role) {
114
-                $SQL     .= $operator . ' u2.meta_value LIKE \'%"' . $role->name . '"%\' ';
114
+                $SQL     .= $operator.' u2.meta_value LIKE \'%"'.$role->name.'"%\' ';
115 115
                 // subsequent clauses will use OR so that any role is accepted
116 116
                 $operator = 'OR';
117 117
             }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/Event.php 1 patch
Indentation   +200 added lines, -200 removed lines patch added patch discarded remove patch
@@ -21,209 +21,209 @@
 block discarded – undo
21 21
 class Event extends TypeBase
22 22
 {
23 23
 
24
-    /**
25
-     * Event constructor.
26
-     *
27
-     * @param EEM_Event $event_model
28
-     */
29
-    public function __construct(EEM_Event $event_model)
30
-    {
31
-        $this->model = $event_model;
32
-        $this->setName($this->namespace . 'Event');
33
-        $this->setIsCustomPostType(true);
34
-        parent::__construct();
35
-    }
24
+	/**
25
+	 * Event constructor.
26
+	 *
27
+	 * @param EEM_Event $event_model
28
+	 */
29
+	public function __construct(EEM_Event $event_model)
30
+	{
31
+		$this->model = $event_model;
32
+		$this->setName($this->namespace . 'Event');
33
+		$this->setIsCustomPostType(true);
34
+		parent::__construct();
35
+	}
36 36
 
37 37
 
38
-    /**
39
-     * @return GraphQLFieldInterface[]
40
-     * @since $VID:$
41
-     */
42
-    public function getFields()
43
-    {
44
-        $fields = [
45
-            new GraphQLOutputField(
46
-                'dbId',
47
-                ['non_null' => 'Int'],
48
-                'ID',
49
-                esc_html__('The event ID.', 'event_espresso')
50
-            ),
51
-            new GraphQLOutputField(
52
-                'cacheId',
53
-                ['non_null' => 'String'],
54
-                null,
55
-                esc_html__('The cache ID of the object.', 'event_espresso')
56
-            ),
57
-            new GraphQLField(
58
-                'name',
59
-                'String',
60
-                'name',
61
-                esc_html__('Event Name', 'event_espresso')
62
-            ),
63
-            new GraphQLField(
64
-                'description',
65
-                'String',
66
-                'description',
67
-                esc_html__('Event Description', 'event_espresso')
68
-            ),
69
-            new GraphQLField(
70
-                'shortDescription',
71
-                'String',
72
-                'short_description',
73
-                esc_html__('Event Short Description', 'event_espresso')
74
-            ),
75
-            new GraphQLField(
76
-                'created',
77
-                'String',
78
-                'created',
79
-                esc_html__('Date/Time Event Created', 'event_espresso')
80
-            ),
81
-            new GraphQLOutputField(
82
-                'manager',
83
-                'User',
84
-                null,
85
-                esc_html__('Event Manager', 'event_espresso')
86
-            ),
87
-            new GraphQLInputField(
88
-                'manager',
89
-                'String',
90
-                null,
91
-                esc_html__('Globally unique event ID for the event manager', 'event_espresso')
92
-            ),
93
-            new GraphQLField(
94
-                'order',
95
-                'Int',
96
-                'order',
97
-                esc_html__('Event Menu Order', 'event_espresso')
98
-            ),
99
-            new GraphQLField(
100
-                'displayDescription',
101
-                'Boolean',
102
-                'display_description',
103
-                esc_html__('Display Description Flag', 'event_espresso')
104
-            ),
105
-            new GraphQLField(
106
-                'displayTicketSelector',
107
-                'Boolean',
108
-                'display_ticket_selector',
109
-                esc_html__('Display Ticket Selector Flag', 'event_espresso')
110
-            ),
111
-            new GraphQLField(
112
-                'visibleOn',
113
-                'String',
114
-                'visible_on',
115
-                esc_html__('Event Visible Date', 'event_espresso')
116
-            ),
117
-            new GraphQLField(
118
-                'maxRegistrations',
119
-                'Int',
120
-                'additional_limit',
121
-                esc_html__('Limit of Additional Registrations on Same Transaction', 'event_espresso')
122
-            ),
123
-            new GraphQLField(
124
-                'phoneNumber',
125
-                'String',
126
-                'phone',
127
-                esc_html__('Event Phone Number', 'event_espresso')
128
-            ),
129
-            new GraphQLField(
130
-                'memberOnly',
131
-                'Boolean',
132
-                'member_only',
133
-                esc_html__('Member-Only Event Flag', 'event_espresso')
134
-            ),
135
-            new GraphQLField(
136
-                'allowOverflow',
137
-                'Boolean',
138
-                'allow_overflow',
139
-                esc_html__('Allow Overflow on Event', 'event_espresso')
140
-            ),
141
-            new GraphQLField(
142
-                'timezoneString',
143
-                'String',
144
-                'timezone_string',
145
-                esc_html__('Timezone (name) for Event times', 'event_espresso')
146
-            ),
147
-            new GraphQLField(
148
-                'altRegPage',
149
-                'String',
150
-                'external_url',
151
-                esc_html__('URL of Event Page if hosted elsewhere', 'event_espresso')
152
-            ),
153
-            new GraphQLField(
154
-                'allowDonations',
155
-                'Boolean',
156
-                'donations',
157
-                esc_html__('Accept Donations?', 'event_espresso')
158
-            ),
159
-            new GraphQLField(
160
-                'isSoldOut',
161
-                'Boolean',
162
-                'is_sold_out',
163
-                esc_html__(
164
-                    'Flag indicating whether the tickets sold for the event, met or exceed the registration limit',
165
-                    'event_espresso'
166
-                )
167
-            ),
168
-            new GraphQLField(
169
-                'isPostponed',
170
-                'Boolean',
171
-                'is_postponed',
172
-                esc_html__('Flag indicating whether the event is marked as postponed', 'event_espresso')
173
-            ),
174
-            new GraphQLField(
175
-                'isCancelled',
176
-                'Boolean',
177
-                'is_cancelled',
178
-                esc_html__('Flag indicating whether the event is marked as cancelled', 'event_espresso')
179
-            ),
180
-            new GraphQLOutputField(
181
-                'isUpcoming',
182
-                'Boolean',
183
-                'is_upcoming',
184
-                esc_html__('Whether the event is upcoming', 'event_espresso')
185
-            ),
186
-            new GraphQLOutputField(
187
-                'isActive',
188
-                'Boolean',
189
-                'is_active',
190
-                esc_html__('Flag indicating event is active', 'event_espresso')
191
-            ),
192
-            new GraphQLOutputField(
193
-                'isInactive',
194
-                'Boolean',
195
-                'is_inactive',
196
-                esc_html__('Flag indicating event is inactive', 'event_espresso')
197
-            ),
198
-            new GraphQLOutputField(
199
-                'isExpired',
200
-                'Boolean',
201
-                'is_expired',
202
-                esc_html__('Flag indicating event is expired or not', 'event_espresso')
203
-            ),
204
-        ];
38
+	/**
39
+	 * @return GraphQLFieldInterface[]
40
+	 * @since $VID:$
41
+	 */
42
+	public function getFields()
43
+	{
44
+		$fields = [
45
+			new GraphQLOutputField(
46
+				'dbId',
47
+				['non_null' => 'Int'],
48
+				'ID',
49
+				esc_html__('The event ID.', 'event_espresso')
50
+			),
51
+			new GraphQLOutputField(
52
+				'cacheId',
53
+				['non_null' => 'String'],
54
+				null,
55
+				esc_html__('The cache ID of the object.', 'event_espresso')
56
+			),
57
+			new GraphQLField(
58
+				'name',
59
+				'String',
60
+				'name',
61
+				esc_html__('Event Name', 'event_espresso')
62
+			),
63
+			new GraphQLField(
64
+				'description',
65
+				'String',
66
+				'description',
67
+				esc_html__('Event Description', 'event_espresso')
68
+			),
69
+			new GraphQLField(
70
+				'shortDescription',
71
+				'String',
72
+				'short_description',
73
+				esc_html__('Event Short Description', 'event_espresso')
74
+			),
75
+			new GraphQLField(
76
+				'created',
77
+				'String',
78
+				'created',
79
+				esc_html__('Date/Time Event Created', 'event_espresso')
80
+			),
81
+			new GraphQLOutputField(
82
+				'manager',
83
+				'User',
84
+				null,
85
+				esc_html__('Event Manager', 'event_espresso')
86
+			),
87
+			new GraphQLInputField(
88
+				'manager',
89
+				'String',
90
+				null,
91
+				esc_html__('Globally unique event ID for the event manager', 'event_espresso')
92
+			),
93
+			new GraphQLField(
94
+				'order',
95
+				'Int',
96
+				'order',
97
+				esc_html__('Event Menu Order', 'event_espresso')
98
+			),
99
+			new GraphQLField(
100
+				'displayDescription',
101
+				'Boolean',
102
+				'display_description',
103
+				esc_html__('Display Description Flag', 'event_espresso')
104
+			),
105
+			new GraphQLField(
106
+				'displayTicketSelector',
107
+				'Boolean',
108
+				'display_ticket_selector',
109
+				esc_html__('Display Ticket Selector Flag', 'event_espresso')
110
+			),
111
+			new GraphQLField(
112
+				'visibleOn',
113
+				'String',
114
+				'visible_on',
115
+				esc_html__('Event Visible Date', 'event_espresso')
116
+			),
117
+			new GraphQLField(
118
+				'maxRegistrations',
119
+				'Int',
120
+				'additional_limit',
121
+				esc_html__('Limit of Additional Registrations on Same Transaction', 'event_espresso')
122
+			),
123
+			new GraphQLField(
124
+				'phoneNumber',
125
+				'String',
126
+				'phone',
127
+				esc_html__('Event Phone Number', 'event_espresso')
128
+			),
129
+			new GraphQLField(
130
+				'memberOnly',
131
+				'Boolean',
132
+				'member_only',
133
+				esc_html__('Member-Only Event Flag', 'event_espresso')
134
+			),
135
+			new GraphQLField(
136
+				'allowOverflow',
137
+				'Boolean',
138
+				'allow_overflow',
139
+				esc_html__('Allow Overflow on Event', 'event_espresso')
140
+			),
141
+			new GraphQLField(
142
+				'timezoneString',
143
+				'String',
144
+				'timezone_string',
145
+				esc_html__('Timezone (name) for Event times', 'event_espresso')
146
+			),
147
+			new GraphQLField(
148
+				'altRegPage',
149
+				'String',
150
+				'external_url',
151
+				esc_html__('URL of Event Page if hosted elsewhere', 'event_espresso')
152
+			),
153
+			new GraphQLField(
154
+				'allowDonations',
155
+				'Boolean',
156
+				'donations',
157
+				esc_html__('Accept Donations?', 'event_espresso')
158
+			),
159
+			new GraphQLField(
160
+				'isSoldOut',
161
+				'Boolean',
162
+				'is_sold_out',
163
+				esc_html__(
164
+					'Flag indicating whether the tickets sold for the event, met or exceed the registration limit',
165
+					'event_espresso'
166
+				)
167
+			),
168
+			new GraphQLField(
169
+				'isPostponed',
170
+				'Boolean',
171
+				'is_postponed',
172
+				esc_html__('Flag indicating whether the event is marked as postponed', 'event_espresso')
173
+			),
174
+			new GraphQLField(
175
+				'isCancelled',
176
+				'Boolean',
177
+				'is_cancelled',
178
+				esc_html__('Flag indicating whether the event is marked as cancelled', 'event_espresso')
179
+			),
180
+			new GraphQLOutputField(
181
+				'isUpcoming',
182
+				'Boolean',
183
+				'is_upcoming',
184
+				esc_html__('Whether the event is upcoming', 'event_espresso')
185
+			),
186
+			new GraphQLOutputField(
187
+				'isActive',
188
+				'Boolean',
189
+				'is_active',
190
+				esc_html__('Flag indicating event is active', 'event_espresso')
191
+			),
192
+			new GraphQLOutputField(
193
+				'isInactive',
194
+				'Boolean',
195
+				'is_inactive',
196
+				esc_html__('Flag indicating event is inactive', 'event_espresso')
197
+			),
198
+			new GraphQLOutputField(
199
+				'isExpired',
200
+				'Boolean',
201
+				'is_expired',
202
+				esc_html__('Flag indicating event is expired or not', 'event_espresso')
203
+			),
204
+		];
205 205
 
206
-        return apply_filters(
207
-            'FHEE__EventEspresso_core_domain_services_graphql_types__event_fields',
208
-            $fields,
209
-            $this->name,
210
-            $this->model
211
-        );
212
-    }
206
+		return apply_filters(
207
+			'FHEE__EventEspresso_core_domain_services_graphql_types__event_fields',
208
+			$fields,
209
+			$this->name,
210
+			$this->model
211
+		);
212
+	}
213 213
 
214 214
 
215
-    /**
216
-     * Extends the existing WP GraphQL mutations.
217
-     *
218
-     * @since $VID:$
219
-     */
220
-    public function extendMutations()
221
-    {
222
-        add_action(
223
-            'graphql_post_object_mutation_update_additional_data',
224
-            EventUpdate::mutateFields($this->model, $this),
225
-            10,
226
-            6
227
-        );
228
-    }
215
+	/**
216
+	 * Extends the existing WP GraphQL mutations.
217
+	 *
218
+	 * @since $VID:$
219
+	 */
220
+	public function extendMutations()
221
+	{
222
+		add_action(
223
+			'graphql_post_object_mutation_update_additional_data',
224
+			EventUpdate::mutateFields($this->model, $this),
225
+			10,
226
+			6
227
+		);
228
+	}
229 229
 }
Please login to merge, or discard this patch.
languages/event_espresso-translations-js.php 1 patch
Spacing   +413 added lines, -413 removed lines patch added patch discarded remove patch
@@ -2,235 +2,235 @@  discard block
 block discarded – undo
2 2
 /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
3 3
 $generated_i18n_strings = array(
4 4
 	// Reference: packages/components/src/Pagination/constants.ts:6
5
-	__( '2', 'event_espresso' ),
5
+	__('2', 'event_espresso'),
6 6
 
7 7
 	// Reference: packages/components/src/Pagination/constants.ts:7
8
-	__( '6', 'event_espresso' ),
8
+	__('6', 'event_espresso'),
9 9
 
10 10
 	// Reference: packages/components/src/Pagination/constants.ts:8
11
-	__( '12', 'event_espresso' ),
11
+	__('12', 'event_espresso'),
12 12
 
13 13
 	// Reference: packages/components/src/Pagination/constants.ts:9
14
-	__( '24', 'event_espresso' ),
14
+	__('24', 'event_espresso'),
15 15
 
16 16
 	// Reference: packages/components/src/Pagination/constants.ts:10
17
-	__( '48', 'event_espresso' ),
17
+	__('48', 'event_espresso'),
18 18
 
19 19
 	// Reference: domains/blocks/src/components/AvatarImage.tsx:27
20
-	__( 'contact avatar', 'event_espresso' ),
20
+	__('contact avatar', 'event_espresso'),
21 21
 
22 22
 	// Reference: domains/blocks/src/components/OrderByControl.tsx:13
23
-	__( 'Order by', 'event_espresso' ),
23
+	__('Order by', 'event_espresso'),
24 24
 
25 25
 	// Reference: domains/blocks/src/components/RegStatusControl.tsx:18
26 26
 	// Reference: domains/blocks/src/event-attendees/controls/SelectStatus.tsx:12
27
-	__( 'Select Registration Status', 'event_espresso' ),
27
+	__('Select Registration Status', 'event_espresso'),
28 28
 
29 29
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:15
30
-	__( 'Ascending', 'event_espresso' ),
30
+	__('Ascending', 'event_espresso'),
31 31
 
32 32
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:19
33
-	__( 'Descending', 'event_espresso' ),
33
+	__('Descending', 'event_espresso'),
34 34
 
35 35
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:25
36
-	__( 'Sort order:', 'event_espresso' ),
36
+	__('Sort order:', 'event_espresso'),
37 37
 
38 38
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:40
39
-	__( 'There was some error fetching attendees list', 'event_espresso' ),
39
+	__('There was some error fetching attendees list', 'event_espresso'),
40 40
 
41 41
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:46
42
-	__( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ),
42
+	__('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'),
43 43
 
44 44
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:52
45
-	__( 'There are no attendees for selected options.', 'event_espresso' ),
45
+	__('There are no attendees for selected options.', 'event_espresso'),
46 46
 
47 47
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:11
48
-	__( 'Display on Archives', 'event_espresso' ),
48
+	__('Display on Archives', 'event_espresso'),
49 49
 
50 50
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:16
51
-	__( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ),
51
+	__('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'),
52 52
 
53 53
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17
54
-	__( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ),
54
+	__('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'),
55 55
 
56 56
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:28
57
-	__( 'Number of Attendees to Display:', 'event_espresso' ),
57
+	__('Number of Attendees to Display:', 'event_espresso'),
58 58
 
59 59
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:33
60 60
 	/* translators: %d attendees count */
61
-	_n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ),
61
+	_n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'),
62 62
 
63 63
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:26
64
-	__( 'Display Gravatar', 'event_espresso' ),
64
+	__('Display Gravatar', 'event_espresso'),
65 65
 
66 66
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:31
67
-	__( 'Gravatar images are shown for each attendee.', 'event_espresso' ),
67
+	__('Gravatar images are shown for each attendee.', 'event_espresso'),
68 68
 
69 69
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:32
70
-	__( 'No gravatar images are shown for each attendee.', 'event_espresso' ),
70
+	__('No gravatar images are shown for each attendee.', 'event_espresso'),
71 71
 
72 72
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:37
73
-	__( 'Size of Gravatar', 'event_espresso' ),
73
+	__('Size of Gravatar', 'event_espresso'),
74 74
 
75 75
 	// Reference: domains/blocks/src/event-attendees/controls/SelectDatetime.tsx:21
76
-	__( 'Select Datetime', 'event_espresso' ),
76
+	__('Select Datetime', 'event_espresso'),
77 77
 
78 78
 	// Reference: domains/blocks/src/event-attendees/controls/SelectEvent.tsx:21
79
-	__( 'Select Event', 'event_espresso' ),
79
+	__('Select Event', 'event_espresso'),
80 80
 
81 81
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:10
82
-	__( 'Attendee id', 'event_espresso' ),
82
+	__('Attendee id', 'event_espresso'),
83 83
 
84 84
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:14
85
-	__( 'Last name only', 'event_espresso' ),
85
+	__('Last name only', 'event_espresso'),
86 86
 
87 87
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:18
88
-	__( 'First name only', 'event_espresso' ),
88
+	__('First name only', 'event_espresso'),
89 89
 
90 90
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:22
91
-	__( 'First, then Last name', 'event_espresso' ),
91
+	__('First, then Last name', 'event_espresso'),
92 92
 
93 93
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:26
94
-	__( 'Last, then First name', 'event_espresso' ),
94
+	__('Last, then First name', 'event_espresso'),
95 95
 
96 96
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:40
97
-	__( 'Order Attendees by:', 'event_espresso' ),
97
+	__('Order Attendees by:', 'event_espresso'),
98 98
 
99 99
 	// Reference: domains/blocks/src/event-attendees/controls/SelectTicket.tsx:21
100
-	__( 'Select Ticket', 'event_espresso' ),
100
+	__('Select Ticket', 'event_espresso'),
101 101
 
102 102
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:22
103
-	__( 'Filter By Settings', 'event_espresso' ),
103
+	__('Filter By Settings', 'event_espresso'),
104 104
 
105 105
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:37
106
-	__( 'Gravatar Setttings', 'event_espresso' ),
106
+	__('Gravatar Setttings', 'event_espresso'),
107 107
 
108 108
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:40
109
-	__( 'Archive Settings', 'event_espresso' ),
109
+	__('Archive Settings', 'event_espresso'),
110 110
 
111 111
 	// Reference: domains/blocks/src/event-attendees/index.tsx:10
112
-	__( 'Event Attendees', 'event_espresso' ),
112
+	__('Event Attendees', 'event_espresso'),
113 113
 
114 114
 	// Reference: domains/blocks/src/event-attendees/index.tsx:11
115
-	__( 'Displays a list of people that have registered for the specified event', 'event_espresso' ),
115
+	__('Displays a list of people that have registered for the specified event', 'event_espresso'),
116 116
 
117 117
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
118
-	__( 'event', 'event_espresso' ),
118
+	__('event', 'event_espresso'),
119 119
 
120 120
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
121
-	__( 'attendees', 'event_espresso' ),
121
+	__('attendees', 'event_espresso'),
122 122
 
123 123
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
124
-	__( 'list', 'event_espresso' ),
124
+	__('list', 'event_espresso'),
125 125
 
126 126
 	// Reference: domains/blocks/src/services/utils.ts:11
127
-	__( 'Loading…', 'event_espresso' ),
127
+	__('Loading…', 'event_espresso'),
128 128
 
129 129
 	// Reference: domains/blocks/src/services/utils.ts:19
130 130
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32
131
-	__( 'Error', 'event_espresso' ),
131
+	__('Error', 'event_espresso'),
132 132
 
133 133
 	// Reference: domains/blocks/src/services/utils.ts:26
134
-	__( 'Select…', 'event_espresso' ),
134
+	__('Select…', 'event_espresso'),
135 135
 
136 136
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:30
137
-	__( 'Active Status', 'event_espresso' ),
137
+	__('Active Status', 'event_espresso'),
138 138
 
139 139
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:36
140
-	__( 'Alternative Registration Page', 'event_espresso' ),
140
+	__('Alternative Registration Page', 'event_espresso'),
141 141
 
142 142
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:18
143
-	__( 'Default Registration Status', 'event_espresso' ),
143
+	__('Default Registration Status', 'event_espresso'),
144 144
 
145 145
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:21
146
-	__( 'Disable Donations', 'event_espresso' ),
146
+	__('Disable Donations', 'event_espresso'),
147 147
 
148 148
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:21
149
-	__( 'Enable Donations', 'event_espresso' ),
149
+	__('Enable Donations', 'event_espresso'),
150 150
 
151 151
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:51
152
-	__( 'Event Manager', 'event_espresso' ),
152
+	__('Event Manager', 'event_espresso'),
153 153
 
154 154
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:28
155
-	__( 'Event Phone Number', 'event_espresso' ),
155
+	__('Event Phone Number', 'event_espresso'),
156 156
 
157 157
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:30
158
-	__( 'Maximum Number of Registrations Allowed per Transaction', 'event_espresso' ),
158
+	__('Maximum Number of Registrations Allowed per Transaction', 'event_espresso'),
159 159
 
160 160
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:22
161
-	__( 'hide ticket selector', 'event_espresso' ),
161
+	__('hide ticket selector', 'event_espresso'),
162 162
 
163 163
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:22
164
-	__( 'show ticket selector', 'event_espresso' ),
164
+	__('show ticket selector', 'event_espresso'),
165 165
 
166 166
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:28
167
-	__( 'Display Ticket Selector', 'event_espresso' ),
167
+	__('Display Ticket Selector', 'event_espresso'),
168 168
 
169 169
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/index.tsx:21
170
-	__( 'Registration Options', 'event_espresso' ),
170
+	__('Registration Options', 'event_espresso'),
171 171
 
172 172
 	// Reference: domains/eventEditor/src/ui/datetimes/DateRegistrationsLink.tsx:17
173
-	__( 'view ALL registrations for this date.', 'event_espresso' ),
173
+	__('view ALL registrations for this date.', 'event_espresso'),
174 174
 
175 175
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/formValidation.ts:15
176 176
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/formValidation.ts:15
177
-	__( 'Name is required', 'event_espresso' ),
177
+	__('Name is required', 'event_espresso'),
178 178
 
179 179
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/formValidation.ts:16
180 180
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12
181 181
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/formValidation.ts:16
182 182
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12
183
-	__( 'Name must be at least three characters', 'event_espresso' ),
183
+	__('Name must be at least three characters', 'event_espresso'),
184 184
 
185 185
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Container.tsx:22
186 186
 	/* translators: %s datetime id */
187
-	__( 'Edit datetime %s', 'event_espresso' ),
187
+	__('Edit datetime %s', 'event_espresso'),
188 188
 
189 189
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Container.tsx:25
190
-	__( 'New Datetime', 'event_espresso' ),
190
+	__('New Datetime', 'event_espresso'),
191 191
 
192 192
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/ContentBody.tsx:40
193
-	__( 'Save and assign tickets', 'event_espresso' ),
193
+	__('Save and assign tickets', 'event_espresso'),
194 194
 
195 195
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
196
-	__( 'primary information about the date', 'event_espresso' ),
196
+	__('primary information about the date', 'event_espresso'),
197 197
 
198 198
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
199
-	__( 'Date Details', 'event_espresso' ),
199
+	__('Date Details', 'event_espresso'),
200 200
 
201 201
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:12
202 202
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:17
203
-	__( 'relations between tickets and dates', 'event_espresso' ),
203
+	__('relations between tickets and dates', 'event_espresso'),
204 204
 
205 205
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:12
206
-	__( 'Assign Tickets', 'event_espresso' ),
206
+	__('Assign Tickets', 'event_espresso'),
207 207
 
208 208
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:107
209 209
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108
210 210
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:119
211 211
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108
212
-	__( 'Details', 'event_espresso' ),
212
+	__('Details', 'event_espresso'),
213 213
 
214 214
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:111
215 215
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112
216 216
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:75
217
-	__( 'Capacity', 'event_espresso' ),
217
+	__('Capacity', 'event_espresso'),
218 218
 
219 219
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:116
220
-	__( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ),
220
+	__('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'),
221 221
 
222 222
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:120
223
-	__( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ),
223
+	__('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'),
224 224
 
225 225
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:125
226 226
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:198
227
-	__( 'Trash', 'event_espresso' ),
227
+	__('Trash', 'event_espresso'),
228 228
 
229 229
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:69
230 230
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45
231 231
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:81
232 232
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45
233
-	__( 'Basics', 'event_espresso' ),
233
+	__('Basics', 'event_espresso'),
234 234
 
235 235
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:73
236 236
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:49
@@ -238,222 +238,222 @@  discard block
 block discarded – undo
238 238
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:85
239 239
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49
240 240
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:42
241
-	__( 'Name', 'event_espresso' ),
241
+	__('Name', 'event_espresso'),
242 242
 
243 243
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:80
244 244
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:55
245 245
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:92
246 246
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55
247 247
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41
248
-	__( 'Description', 'event_espresso' ),
248
+	__('Description', 'event_espresso'),
249 249
 
250 250
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88
251 251
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63
252 252
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63
253
-	__( 'Dates', 'event_espresso' ),
253
+	__('Dates', 'event_espresso'),
254 254
 
255 255
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:92
256 256
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52
257 257
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:104
258
-	__( 'Start Date', 'event_espresso' ),
258
+	__('Start Date', 'event_espresso'),
259 259
 
260 260
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:98
261 261
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:63
262 262
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:110
263
-	__( 'End Date', 'event_espresso' ),
263
+	__('End Date', 'event_espresso'),
264 264
 
265 265
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:34
266 266
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:42
267
-	__( 'Event Dates', 'event_espresso' ),
267
+	__('Event Dates', 'event_espresso'),
268 268
 
269 269
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:37
270
-	__( 'loading event dates…', 'event_espresso' ),
270
+	__('loading event dates…', 'event_espresso'),
271 271
 
272 272
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:22
273
-	__( 'Ticket Assignments', 'event_espresso' ),
273
+	__('Ticket Assignments', 'event_espresso'),
274 274
 
275 275
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:27
276
-	__( 'Number of related tickets', 'event_espresso' ),
276
+	__('Number of related tickets', 'event_espresso'),
277 277
 
278 278
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:28
279
-	__( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ),
279
+	__('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'),
280 280
 
281 281
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:42
282
-	__( 'assign tickets', 'event_espresso' ),
282
+	__('assign tickets', 'event_espresso'),
283 283
 
284 284
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:18
285
-	__( 'Permanently delete Datetime?', 'event_espresso' ),
285
+	__('Permanently delete Datetime?', 'event_espresso'),
286 286
 
287 287
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:18
288
-	__( 'Move Datetime to Trash?', 'event_espresso' ),
288
+	__('Move Datetime to Trash?', 'event_espresso'),
289 289
 
290 290
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:20
291
-	__( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ),
291
+	__('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'),
292 292
 
293 293
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:23
294
-	__( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ),
294
+	__('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'),
295 295
 
296 296
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:33
297
-	__( 'event date main menu', 'event_espresso' ),
297
+	__('event date main menu', 'event_espresso'),
298 298
 
299 299
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:37
300 300
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:35
301
-	__( 'delete permanently', 'event_espresso' ),
301
+	__('delete permanently', 'event_espresso'),
302 302
 
303 303
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:37
304
-	__( 'trash datetime', 'event_espresso' ),
304
+	__('trash datetime', 'event_espresso'),
305 305
 
306 306
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:46
307
-	__( 'edit datetime', 'event_espresso' ),
307
+	__('edit datetime', 'event_espresso'),
308 308
 
309 309
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:47
310
-	__( 'copy datetime', 'event_espresso' ),
310
+	__('copy datetime', 'event_espresso'),
311 311
 
312 312
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:30
313
-	__( 'edit datetime details', 'event_espresso' ),
313
+	__('edit datetime details', 'event_espresso'),
314 314
 
315 315
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34
316
-	__( 'delete datetimes', 'event_espresso' ),
316
+	__('delete datetimes', 'event_espresso'),
317 317
 
318 318
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34
319
-	__( 'trash datetimes', 'event_espresso' ),
319
+	__('trash datetimes', 'event_espresso'),
320 320
 
321 321
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:13
322
-	__( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ),
322
+	__('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'),
323 323
 
324 324
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14
325
-	__( 'Are you sure you want to trash these datetimes?', 'event_espresso' ),
325
+	__('Are you sure you want to trash these datetimes?', 'event_espresso'),
326 326
 
327 327
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
328
-	__( 'Delete datetimes permanently', 'event_espresso' ),
328
+	__('Delete datetimes permanently', 'event_espresso'),
329 329
 
330 330
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
331
-	__( 'Trash datetimes', 'event_espresso' ),
331
+	__('Trash datetimes', 'event_espresso'),
332 332
 
333 333
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22
334
-	__( 'Bulk edit date details', 'event_espresso' ),
334
+	__('Bulk edit date details', 'event_espresso'),
335 335
 
336 336
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:23
337
-	__( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ),
337
+	__('any changes will be applied to ALL of the selected dates.', 'event_espresso'),
338 338
 
339 339
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67
340 340
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67
341
-	__( 'Shift dates', 'event_espresso' ),
341
+	__('Shift dates', 'event_espresso'),
342 342
 
343 343
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92
344 344
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92
345
-	__( 'earlier', 'event_espresso' ),
345
+	__('earlier', 'event_espresso'),
346 346
 
347 347
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96
348 348
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96
349
-	__( 'later', 'event_espresso' ),
349
+	__('later', 'event_espresso'),
350 350
 
351 351
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:35
352
-	__( 'edit capacity (registration limit)…', 'event_espresso' ),
352
+	__('edit capacity (registration limit)…', 'event_espresso'),
353 353
 
354 354
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:37
355
-	__( 'Edit Event Date', 'event_espresso' ),
355
+	__('Edit Event Date', 'event_espresso'),
356 356
 
357 357
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:40
358
-	__( 'edit start and end dates', 'event_espresso' ),
358
+	__('edit start and end dates', 'event_espresso'),
359 359
 
360 360
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:14
361 361
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:14
362
-	__( 'sold', 'event_espresso' ),
362
+	__('sold', 'event_espresso'),
363 363
 
364 364
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:27
365
-	__( 'capacity', 'event_espresso' ),
365
+	__('capacity', 'event_espresso'),
366 366
 
367 367
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:33
368 368
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:32
369
-	__( 'reg list', 'event_espresso' ),
369
+	__('reg list', 'event_espresso'),
370 370
 
371 371
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:44
372 372
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:40
373
-	__( 'Edit description', 'event_espresso' ),
373
+	__('Edit description', 'event_espresso'),
374 374
 
375 375
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:45
376 376
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:41
377
-	__( 'edit description…', 'event_espresso' ),
377
+	__('edit description…', 'event_espresso'),
378 378
 
379 379
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:13
380
-	__( 'Active', 'event_espresso' ),
380
+	__('Active', 'event_espresso'),
381 381
 
382 382
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:14
383 383
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:13
384
-	__( 'Trashed', 'event_espresso' ),
384
+	__('Trashed', 'event_espresso'),
385 385
 
386 386
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:15
387 387
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:14
388
-	__( 'Expired', 'event_espresso' ),
388
+	__('Expired', 'event_espresso'),
389 389
 
390 390
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:16
391 391
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:16
392
-	__( 'Sold Out', 'event_espresso' ),
392
+	__('Sold Out', 'event_espresso'),
393 393
 
394 394
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:17
395
-	__( 'Upcoming', 'event_espresso' ),
395
+	__('Upcoming', 'event_espresso'),
396 396
 
397 397
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:17
398 398
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:27
399
-	__( 'edit title…', 'event_espresso' ),
399
+	__('edit title…', 'event_espresso'),
400 400
 
401 401
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:25
402 402
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:25
403
-	__( 'ON', 'event_espresso' ),
403
+	__('ON', 'event_espresso'),
404 404
 
405 405
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10
406
-	__( 'end dates only', 'event_espresso' ),
406
+	__('end dates only', 'event_espresso'),
407 407
 
408 408
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11
409
-	__( 'start and end dates', 'event_espresso' ),
409
+	__('start and end dates', 'event_espresso'),
410 410
 
411 411
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16
412
-	__( 'dates above 90% capacity', 'event_espresso' ),
412
+	__('dates above 90% capacity', 'event_espresso'),
413 413
 
414 414
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17
415
-	__( 'dates above 75% capacity', 'event_espresso' ),
415
+	__('dates above 75% capacity', 'event_espresso'),
416 416
 
417 417
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18
418
-	__( 'dates above 50% capacity', 'event_espresso' ),
418
+	__('dates above 50% capacity', 'event_espresso'),
419 419
 
420 420
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19
421
-	__( 'dates below 50% capacity', 'event_espresso' ),
421
+	__('dates below 50% capacity', 'event_espresso'),
422 422
 
423 423
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23
424
-	__( 'all dates', 'event_espresso' ),
424
+	__('all dates', 'event_espresso'),
425 425
 
426 426
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24
427
-	__( 'all active and upcoming', 'event_espresso' ),
427
+	__('all active and upcoming', 'event_espresso'),
428 428
 
429 429
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25
430
-	__( 'active dates only', 'event_espresso' ),
430
+	__('active dates only', 'event_espresso'),
431 431
 
432 432
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26
433
-	__( 'upcoming dates only', 'event_espresso' ),
433
+	__('upcoming dates only', 'event_espresso'),
434 434
 
435 435
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27
436
-	__( 'next active or upcoming only', 'event_espresso' ),
436
+	__('next active or upcoming only', 'event_espresso'),
437 437
 
438 438
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28
439
-	__( 'sold out dates only', 'event_espresso' ),
439
+	__('sold out dates only', 'event_espresso'),
440 440
 
441 441
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29
442
-	__( 'recently expired dates', 'event_espresso' ),
442
+	__('recently expired dates', 'event_espresso'),
443 443
 
444 444
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30
445
-	__( 'all expired dates', 'event_espresso' ),
445
+	__('all expired dates', 'event_espresso'),
446 446
 
447 447
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31
448
-	__( 'trashed dates only', 'event_espresso' ),
448
+	__('trashed dates only', 'event_espresso'),
449 449
 
450 450
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35
451 451
 	// Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:10
452 452
 	// Reference: packages/dates/src/DateRangePicker/index.tsx:41
453
-	__( 'start date', 'event_espresso' ),
453
+	__('start date', 'event_espresso'),
454 454
 
455 455
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36
456
-	__( 'name', 'event_espresso' ),
456
+	__('name', 'event_espresso'),
457 457
 
458 458
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37
459 459
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:38
@@ -461,96 +461,96 @@  discard block
 block discarded – undo
461 461
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:20
462 462
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:36
463 463
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23
464
-	__( 'ID', 'event_espresso' ),
464
+	__('ID', 'event_espresso'),
465 465
 
466 466
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38
467 467
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47
468
-	__( 'custom order', 'event_espresso' ),
468
+	__('custom order', 'event_espresso'),
469 469
 
470 470
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42
471 471
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52
472
-	__( 'display', 'event_espresso' ),
472
+	__('display', 'event_espresso'),
473 473
 
474 474
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43
475
-	__( 'recurrence', 'event_espresso' ),
475
+	__('recurrence', 'event_espresso'),
476 476
 
477 477
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44
478 478
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54
479
-	__( 'sales', 'event_espresso' ),
479
+	__('sales', 'event_espresso'),
480 480
 
481 481
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45
482 482
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56
483
-	__( 'sort by', 'event_espresso' ),
483
+	__('sort by', 'event_espresso'),
484 484
 
485 485
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46
486 486
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55
487 487
 	// Reference: packages/components/src/EntityList/filterBar/EntityListFilterBar.tsx:73
488
-	__( 'search', 'event_espresso' ),
488
+	__('search', 'event_espresso'),
489 489
 
490 490
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47
491 491
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:57
492
-	__( 'status', 'event_espresso' ),
492
+	__('status', 'event_espresso'),
493 493
 
494 494
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9
495
-	__( 'start dates only', 'event_espresso' ),
495
+	__('start dates only', 'event_espresso'),
496 496
 
497 497
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:20
498 498
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsPopover.tsx:14
499 499
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsPopoverButton.tsx:11
500
-	__( 'Add New Date', 'event_espresso' ),
500
+	__('Add New Date', 'event_espresso'),
501 501
 
502 502
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:20
503
-	__( 'Add Single Date', 'event_espresso' ),
503
+	__('Add Single Date', 'event_espresso'),
504 504
 
505 505
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:34
506
-	__( 'Add a single date that only occurs once', 'event_espresso' ),
506
+	__('Add a single date that only occurs once', 'event_espresso'),
507 507
 
508 508
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:36
509
-	__( 'Single Date', 'event_espresso' ),
509
+	__('Single Date', 'event_espresso'),
510 510
 
511 511
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:105
512 512
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:103
513 513
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53
514
-	__( 'Actions', 'event_espresso' ),
514
+	__('Actions', 'event_espresso'),
515 515
 
516 516
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:53
517
-	__( 'Start', 'event_espresso' ),
517
+	__('Start', 'event_espresso'),
518 518
 
519 519
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:64
520
-	__( 'End', 'event_espresso' ),
520
+	__('End', 'event_espresso'),
521 521
 
522 522
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:76
523
-	__( 'Cap', 'event_espresso' ),
523
+	__('Cap', 'event_espresso'),
524 524
 
525 525
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:84
526 526
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:85
527
-	__( 'Sold', 'event_espresso' ),
527
+	__('Sold', 'event_espresso'),
528 528
 
529 529
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:93
530
-	__( 'Reg list', 'event_espresso' ),
530
+	__('Reg list', 'event_espresso'),
531 531
 
532 532
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94
533 533
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:95
534
-	__( 'Regs', 'event_espresso' ),
534
+	__('Regs', 'event_espresso'),
535 535
 
536 536
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18
537
-	__( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso' ),
537
+	__('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso'),
538 538
 
539 539
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22
540
-	__( 'Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso' ),
540
+	__('Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso'),
541 541
 
542 542
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:25
543 543
 	/* translators: %d entity id, %s entity name */
544
-	__( 'Ticket Assignment Manager for Datetime: %1$d - %2$s', 'event_espresso' ),
544
+	__('Ticket Assignment Manager for Datetime: %1$d - %2$s', 'event_espresso'),
545 545
 
546 546
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:32
547 547
 	/* translators: %d entity id, %s entity name */
548
-	__( 'Ticket Assignment Manager for Ticket: %1$d - %2$s', 'event_espresso' ),
548
+	__('Ticket Assignment Manager for Ticket: %1$d - %2$s', 'event_espresso'),
549 549
 
550 550
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/buttons/useCancelButtonProps.tsx:18
551 551
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16
552 552
 	// Reference: packages/components/src/Modal/useCancelButtonProps.tsx:10
553
-	__( 'Cancel', 'event_espresso' ),
553
+	__('Cancel', 'event_espresso'),
554 554
 
555 555
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/buttons/useSubmitButtonProps.tsx:25
556 556
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:17
@@ -559,788 +559,788 @@  discard block
 block discarded – undo
559 559
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:38
560 560
 	// Reference: packages/form/src/Submit.tsx:26
561 561
 	// Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:25
562
-	__( 'Submit', 'event_espresso' ),
562
+	__('Submit', 'event_espresso'),
563 563
 
564 564
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/index.tsx:32
565 565
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:14
566
-	__( 'Ticket Assignment Manager', 'event_espresso' ),
566
+	__('Ticket Assignment Manager', 'event_espresso'),
567 567
 
568 568
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:24
569
-	__( 'assign ticket', 'event_espresso' ),
569
+	__('assign ticket', 'event_espresso'),
570 570
 
571 571
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:19
572
-	__( 'All Dates', 'event_espresso' ),
572
+	__('All Dates', 'event_espresso'),
573 573
 
574 574
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:26
575
-	__( 'dates by month', 'event_espresso' ),
575
+	__('dates by month', 'event_espresso'),
576 576
 
577 577
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:15
578
-	__( 'show expired tickets', 'event_espresso' ),
578
+	__('show expired tickets', 'event_espresso'),
579 579
 
580 580
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:12
581
-	__( 'show trashed dates', 'event_espresso' ),
581
+	__('show trashed dates', 'event_espresso'),
582 582
 
583 583
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:15
584
-	__( 'show trashed tickets', 'event_espresso' ),
584
+	__('show trashed tickets', 'event_espresso'),
585 585
 
586 586
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:17
587
-	__( 'total registrations.', 'event_espresso' ),
587
+	__('total registrations.', 'event_espresso'),
588 588
 
589 589
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:18
590
-	__( 'view ALL registrations for this ticket.', 'event_espresso' ),
590
+	__('view ALL registrations for this ticket.', 'event_espresso'),
591 591
 
592 592
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Container.tsx:21
593 593
 	/* translators: %d ticket id */
594
-	__( 'Edit ticket %d', 'event_espresso' ),
594
+	__('Edit ticket %d', 'event_espresso'),
595 595
 
596 596
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Container.tsx:24
597
-	__( 'New Ticket Details', 'event_espresso' ),
597
+	__('New Ticket Details', 'event_espresso'),
598 598
 
599 599
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:47
600
-	__( 'Set ticket prices', 'event_espresso' ),
600
+	__('Set ticket prices', 'event_espresso'),
601 601
 
602 602
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:54
603
-	__( 'Skip prices - assign dates', 'event_espresso' ),
603
+	__('Skip prices - assign dates', 'event_espresso'),
604 604
 
605 605
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:70
606
-	__( 'Save and assign dates', 'event_espresso' ),
606
+	__('Save and assign dates', 'event_espresso'),
607 607
 
608 608
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:83
609
-	__( 'Ticket details', 'event_espresso' ),
609
+	__('Ticket details', 'event_espresso'),
610 610
 
611 611
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:11
612
-	__( 'primary information about the ticket', 'event_espresso' ),
612
+	__('primary information about the ticket', 'event_espresso'),
613 613
 
614 614
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:11
615
-	__( 'Ticket Details', 'event_espresso' ),
615
+	__('Ticket Details', 'event_espresso'),
616 616
 
617 617
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:13
618
-	__( 'apply ticket price modifiers and taxes', 'event_espresso' ),
618
+	__('apply ticket price modifiers and taxes', 'event_espresso'),
619 619
 
620 620
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:15
621
-	__( 'Price Calculator', 'event_espresso' ),
621
+	__('Price Calculator', 'event_espresso'),
622 622
 
623 623
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:17
624
-	__( 'Assign Dates', 'event_espresso' ),
624
+	__('Assign Dates', 'event_espresso'),
625 625
 
626 626
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:100
627
-	__( 'Ticket Sales', 'event_espresso' ),
627
+	__('Ticket Sales', 'event_espresso'),
628 628
 
629 629
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:123
630 630
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112
631
-	__( 'Quantity For Sale', 'event_espresso' ),
631
+	__('Quantity For Sale', 'event_espresso'),
632 632
 
633 633
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:129
634
-	__( 'The maximum number of this ticket available for sale.', 'event_espresso' ),
634
+	__('The maximum number of this ticket available for sale.', 'event_espresso'),
635 635
 
636 636
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:131
637
-	__( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ),
637
+	__('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'),
638 638
 
639 639
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:136
640 640
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121
641
-	__( 'Number of Uses', 'event_espresso' ),
641
+	__('Number of Uses', 'event_espresso'),
642 642
 
643 643
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:142
644
-	__( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ),
644
+	__('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'),
645 645
 
646 646
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:146
647
-	__( 'Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso' ),
647
+	__('Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso'),
648 648
 
649 649
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:153
650 650
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129
651
-	__( 'Minimum Quantity', 'event_espresso' ),
651
+	__('Minimum Quantity', 'event_espresso'),
652 652
 
653 653
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:158
654
-	__( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
654
+	__('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
655 655
 
656 656
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:162
657
-	__( 'Leave blank for no minimum.', 'event_espresso' ),
657
+	__('Leave blank for no minimum.', 'event_espresso'),
658 658
 
659 659
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:167
660 660
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137
661
-	__( 'Maximum Quantity', 'event_espresso' ),
661
+	__('Maximum Quantity', 'event_espresso'),
662 662
 
663 663
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:173
664
-	__( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
664
+	__('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
665 665
 
666 666
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:177
667
-	__( 'Leave blank for no maximum.', 'event_espresso' ),
667
+	__('Leave blank for no maximum.', 'event_espresso'),
668 668
 
669 669
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:182
670 670
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146
671
-	__( 'Required Ticket', 'event_espresso' ),
671
+	__('Required Ticket', 'event_espresso'),
672 672
 
673 673
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:184
674
-	__( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ),
674
+	__('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'),
675 675
 
676 676
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:191
677
-	__( 'Default Ticket', 'event_espresso' ),
677
+	__('Default Ticket', 'event_espresso'),
678 678
 
679 679
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:193
680
-	__( 'If enabled, the ticket will appear on all new events.', 'event_espresso' ),
680
+	__('If enabled, the ticket will appear on all new events.', 'event_espresso'),
681 681
 
682 682
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:35
683
-	__( 'Available Tickets', 'event_espresso' ),
683
+	__('Available Tickets', 'event_espresso'),
684 684
 
685 685
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:38
686
-	__( 'loading tickets…', 'event_espresso' ),
686
+	__('loading tickets…', 'event_espresso'),
687 687
 
688 688
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27
689
-	__( 'Number of related dates', 'event_espresso' ),
689
+	__('Number of related dates', 'event_espresso'),
690 690
 
691 691
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:28
692
-	__( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ),
692
+	__('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'),
693 693
 
694 694
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:44
695
-	__( 'assign dates', 'event_espresso' ),
695
+	__('assign dates', 'event_espresso'),
696 696
 
697 697
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:17
698
-	__( 'Permanently delete Ticket?', 'event_espresso' ),
698
+	__('Permanently delete Ticket?', 'event_espresso'),
699 699
 
700 700
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:17
701
-	__( 'Move Ticket to Trash?', 'event_espresso' ),
701
+	__('Move Ticket to Trash?', 'event_espresso'),
702 702
 
703 703
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:19
704
-	__( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ),
704
+	__('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'),
705 705
 
706 706
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:20
707
-	__( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ),
707
+	__('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'),
708 708
 
709 709
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:31
710
-	__( 'ticket main menu', 'event_espresso' ),
710
+	__('ticket main menu', 'event_espresso'),
711 711
 
712 712
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:35
713
-	__( 'trash ticket', 'event_espresso' ),
713
+	__('trash ticket', 'event_espresso'),
714 714
 
715 715
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:44
716
-	__( 'edit ticket', 'event_espresso' ),
716
+	__('edit ticket', 'event_espresso'),
717 717
 
718 718
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:45
719
-	__( 'copy ticket', 'event_espresso' ),
719
+	__('copy ticket', 'event_espresso'),
720 720
 
721 721
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:39
722 722
 	// Reference: packages/components/src/bulkEdit/BulkActions.tsx:44
723
-	__( 'bulk actions', 'event_espresso' ),
723
+	__('bulk actions', 'event_espresso'),
724 724
 
725 725
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:43
726
-	__( 'edit ticket details', 'event_espresso' ),
726
+	__('edit ticket details', 'event_espresso'),
727 727
 
728 728
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
729
-	__( 'delete tickets', 'event_espresso' ),
729
+	__('delete tickets', 'event_espresso'),
730 730
 
731 731
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
732
-	__( 'trash tickets', 'event_espresso' ),
732
+	__('trash tickets', 'event_espresso'),
733 733
 
734 734
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:51
735
-	__( 'edit ticket prices', 'event_espresso' ),
735
+	__('edit ticket prices', 'event_espresso'),
736 736
 
737 737
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:13
738
-	__( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ),
738
+	__('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'),
739 739
 
740 740
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14
741
-	__( 'Are you sure you want to trash these tickets?', 'event_espresso' ),
741
+	__('Are you sure you want to trash these tickets?', 'event_espresso'),
742 742
 
743 743
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
744
-	__( 'Delete tickets permanently', 'event_espresso' ),
744
+	__('Delete tickets permanently', 'event_espresso'),
745 745
 
746 746
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
747
-	__( 'Trash tickets', 'event_espresso' ),
747
+	__('Trash tickets', 'event_espresso'),
748 748
 
749 749
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22
750
-	__( 'Bulk edit ticket details', 'event_espresso' ),
750
+	__('Bulk edit ticket details', 'event_espresso'),
751 751
 
752 752
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:23
753
-	__( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ),
753
+	__('any changes will be applied to ALL of the selected tickets.', 'event_espresso'),
754 754
 
755 755
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:18
756
-	__( 'Bulk edit ticket prices', 'event_espresso' ),
756
+	__('Bulk edit ticket prices', 'event_espresso'),
757 757
 
758 758
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:19
759
-	__( 'Edit all prices together', 'event_espresso' ),
759
+	__('Edit all prices together', 'event_espresso'),
760 760
 
761 761
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20
762
-	__( 'Edit all the selected ticket prices dynamically', 'event_espresso' ),
762
+	__('Edit all the selected ticket prices dynamically', 'event_espresso'),
763 763
 
764 764
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:24
765
-	__( 'Edit prices individually', 'event_espresso' ),
765
+	__('Edit prices individually', 'event_espresso'),
766 766
 
767 767
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25
768
-	__( 'Edit prices for each ticket individually', 'event_espresso' ),
768
+	__('Edit prices for each ticket individually', 'event_espresso'),
769 769
 
770 770
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15
771 771
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:45
772 772
 	// Reference: packages/form/src/ResetButton.tsx:17
773 773
 	// Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12
774
-	__( 'Reset', 'event_espresso' ),
774
+	__('Reset', 'event_espresso'),
775 775
 
776 776
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:25
777 777
 	/* translators: %s ticket name */
778
-	__( 'Edit prices for Ticket: %s', 'event_espresso' ),
778
+	__('Edit prices for Ticket: %s', 'event_espresso'),
779 779
 
780 780
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:36
781
-	__( 'Edit Ticket Sale Dates', 'event_espresso' ),
781
+	__('Edit Ticket Sale Dates', 'event_espresso'),
782 782
 
783 783
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:38
784
-	__( 'edit ticket sales start and end dates', 'event_espresso' ),
784
+	__('edit ticket sales start and end dates', 'event_espresso'),
785 785
 
786 786
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:27
787
-	__( 'quantity', 'event_espresso' ),
787
+	__('quantity', 'event_espresso'),
788 788
 
789 789
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:26
790
-	__( 'edit quantity of tickets available…', 'event_espresso' ),
790
+	__('edit quantity of tickets available…', 'event_espresso'),
791 791
 
792 792
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:15
793 793
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51
794
-	__( 'On Sale', 'event_espresso' ),
794
+	__('On Sale', 'event_espresso'),
795 795
 
796 796
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:17
797
-	__( 'Pending', 'event_espresso' ),
797
+	__('Pending', 'event_espresso'),
798 798
 
799 799
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:30
800
-	__( 'edit ticket total…', 'event_espresso' ),
800
+	__('edit ticket total…', 'event_espresso'),
801 801
 
802 802
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:37
803
-	__( 'set price…', 'event_espresso' ),
803
+	__('set price…', 'event_espresso'),
804 804
 
805 805
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24
806
-	__( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ),
806
+	__('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'),
807 807
 
808 808
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:25
809
-	__( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ),
809
+	__('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'),
810 810
 
811 811
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10
812
-	__( 'ticket sales start and end dates', 'event_espresso' ),
812
+	__('ticket sales start and end dates', 'event_espresso'),
813 813
 
814 814
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15
815
-	__( 'tickets with 90% or more sold', 'event_espresso' ),
815
+	__('tickets with 90% or more sold', 'event_espresso'),
816 816
 
817 817
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16
818
-	__( 'tickets with 75% or more sold', 'event_espresso' ),
818
+	__('tickets with 75% or more sold', 'event_espresso'),
819 819
 
820 820
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17
821
-	__( 'tickets with 50% or more sold', 'event_espresso' ),
821
+	__('tickets with 50% or more sold', 'event_espresso'),
822 822
 
823 823
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19
824
-	__( 'tickets with less than 50% sold', 'event_espresso' ),
824
+	__('tickets with less than 50% sold', 'event_espresso'),
825 825
 
826 826
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28
827
-	__( 'all tickets for all dates', 'event_espresso' ),
827
+	__('all tickets for all dates', 'event_espresso'),
828 828
 
829 829
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29
830
-	__( 'all on sale and sale pending', 'event_espresso' ),
830
+	__('all on sale and sale pending', 'event_espresso'),
831 831
 
832 832
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30
833
-	__( 'on sale tickets only', 'event_espresso' ),
833
+	__('on sale tickets only', 'event_espresso'),
834 834
 
835 835
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31
836
-	__( 'sale pending tickets only', 'event_espresso' ),
836
+	__('sale pending tickets only', 'event_espresso'),
837 837
 
838 838
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32
839
-	__( 'next on sale or sale pending only', 'event_espresso' ),
839
+	__('next on sale or sale pending only', 'event_espresso'),
840 840
 
841 841
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33
842
-	__( 'sold out tickets only', 'event_espresso' ),
842
+	__('sold out tickets only', 'event_espresso'),
843 843
 
844 844
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34
845
-	__( 'expired tickets only', 'event_espresso' ),
845
+	__('expired tickets only', 'event_espresso'),
846 846
 
847 847
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35
848
-	__( 'trashed tickets only', 'event_espresso' ),
848
+	__('trashed tickets only', 'event_espresso'),
849 849
 
850 850
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40
851
-	__( 'all tickets for above dates', 'event_espresso' ),
851
+	__('all tickets for above dates', 'event_espresso'),
852 852
 
853 853
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44
854
-	__( 'ticket sale date', 'event_espresso' ),
854
+	__('ticket sale date', 'event_espresso'),
855 855
 
856 856
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45
857
-	__( 'ticket name', 'event_espresso' ),
857
+	__('ticket name', 'event_espresso'),
858 858
 
859 859
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46
860
-	__( 'ticket ID', 'event_espresso' ),
860
+	__('ticket ID', 'event_espresso'),
861 861
 
862 862
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53
863
-	__( 'link', 'event_espresso' ),
863
+	__('link', 'event_espresso'),
864 864
 
865 865
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8
866
-	__( 'ticket sales start date only', 'event_espresso' ),
866
+	__('ticket sales start date only', 'event_espresso'),
867 867
 
868 868
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9
869
-	__( 'ticket sales end date only', 'event_espresso' ),
869
+	__('ticket sales end date only', 'event_espresso'),
870 870
 
871 871
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:19
872
-	__( 'Add New Ticket', 'event_espresso' ),
872
+	__('Add New Ticket', 'event_espresso'),
873 873
 
874 874
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:31
875
-	__( 'Single Ticket', 'event_espresso' ),
875
+	__('Single Ticket', 'event_espresso'),
876 876
 
877 877
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:33
878
-	__( 'Add a single ticket and assign the dates to it', 'event_espresso' ),
878
+	__('Add a single ticket and assign the dates to it', 'event_espresso'),
879 879
 
880 880
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:40
881
-	__( 'Tickets', 'event_espresso' ),
881
+	__('Tickets', 'event_espresso'),
882 882
 
883 883
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:50
884
-	__( 'Goes on Sale', 'event_espresso' ),
884
+	__('Goes on Sale', 'event_espresso'),
885 885
 
886 886
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:61
887
-	__( 'Sale Ends', 'event_espresso' ),
887
+	__('Sale Ends', 'event_espresso'),
888 888
 
889 889
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:62
890
-	__( 'Ends', 'event_espresso' ),
890
+	__('Ends', 'event_espresso'),
891 891
 
892 892
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:71
893
-	__( 'Price', 'event_espresso' ),
893
+	__('Price', 'event_espresso'),
894 894
 
895 895
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78
896
-	__( 'Quantity', 'event_espresso' ),
896
+	__('Quantity', 'event_espresso'),
897 897
 
898 898
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:94
899
-	__( 'Registrations', 'event_espresso' ),
899
+	__('Registrations', 'event_espresso'),
900 900
 
901 901
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:28
902
-	__( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ),
902
+	__('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'),
903 903
 
904 904
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:39
905
-	__( 'Skip', 'event_espresso' ),
905
+	__('Skip', 'event_espresso'),
906 906
 
907 907
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:41
908
-	__( 'Sure I\'ll help', 'event_espresso' ),
908
+	__('Sure I\'ll help', 'event_espresso'),
909 909
 
910 910
 	// Reference: packages/adapters/src/Pagination/Pagination.tsx:24
911
-	__( 'pagination', 'event_espresso' ),
911
+	__('pagination', 'event_espresso'),
912 912
 
913 913
 	// Reference: packages/components/src/ActiveFilters/ActiveFilters.tsx:9
914
-	__( 'active filters:', 'event_espresso' ),
914
+	__('active filters:', 'event_espresso'),
915 915
 
916 916
 	// Reference: packages/components/src/ActiveFilters/FilterTag.tsx:11
917 917
 	/* translators: %s filter name */
918
-	__( 'remove filter - %s', 'event_espresso' ),
918
+	__('remove filter - %s', 'event_espresso'),
919 919
 
920 920
 	// Reference: packages/components/src/CalendarDateRange/CalendarDateRange.tsx:39
921
-	__( 'to', 'event_espresso' ),
921
+	__('to', 'event_espresso'),
922 922
 
923 923
 	// Reference: packages/components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:33
924
-	__( 'starts', 'event_espresso' ),
924
+	__('starts', 'event_espresso'),
925 925
 
926 926
 	// Reference: packages/components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:45
927
-	__( 'ends', 'event_espresso' ),
927
+	__('ends', 'event_espresso'),
928 928
 
929 929
 	// Reference: packages/components/src/CalendarPageDate/CalendarPageDate.tsx:57
930
-	__( 'TO', 'event_espresso' ),
930
+	__('TO', 'event_espresso'),
931 931
 
932 932
 	// Reference: packages/components/src/Confirm/ConfirmClose.tsx:8
933 933
 	// Reference: packages/components/src/Modal/ModalWithAlert.tsx:22
934
-	__( 'Are you sure you want to close this?', 'event_espresso' ),
934
+	__('Are you sure you want to close this?', 'event_espresso'),
935 935
 
936 936
 	// Reference: packages/components/src/Confirm/ConfirmDelete.tsx:8
937
-	__( 'Are you sure you want to delete this?', 'event_espresso' ),
937
+	__('Are you sure you want to delete this?', 'event_espresso'),
938 938
 
939 939
 	// Reference: packages/components/src/Confirm/useConfirmWithButton.tsx:11
940
-	__( 'Please confirm this action.', 'event_espresso' ),
940
+	__('Please confirm this action.', 'event_espresso'),
941 941
 
942 942
 	// Reference: packages/components/src/Confirm/useConfirmationDialog.tsx:35
943
-	__( 'No', 'event_espresso' ),
943
+	__('No', 'event_espresso'),
944 944
 
945 945
 	// Reference: packages/components/src/Confirm/useConfirmationDialog.tsx:36
946
-	__( 'Yes', 'event_espresso' ),
946
+	__('Yes', 'event_espresso'),
947 947
 
948 948
 	// Reference: packages/components/src/DateTimeRangePicker/index.tsx:73
949 949
 	// Reference: packages/components/src/PopoverForm/PopoverForm.tsx:42
950
-	__( 'save', 'event_espresso' ),
950
+	__('save', 'event_espresso'),
951 951
 
952 952
 	// Reference: packages/components/src/DebugInfo/DebugInfo.tsx:38
953
-	__( 'Hide Debug Info', 'event_espresso' ),
953
+	__('Hide Debug Info', 'event_espresso'),
954 954
 
955 955
 	// Reference: packages/components/src/DebugInfo/DebugInfo.tsx:38
956
-	__( 'Show Debug Info', 'event_espresso' ),
956
+	__('Show Debug Info', 'event_espresso'),
957 957
 
958 958
 	// Reference: packages/components/src/EditDateRangeButton/index.tsx:41
959
-	__( 'Edit Start and End Dates and Times', 'event_espresso' ),
959
+	__('Edit Start and End Dates and Times', 'event_espresso'),
960 960
 
961 961
 	// Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:9
962
-	__( 'copy', 'event_espresso' ),
962
+	__('copy', 'event_espresso'),
963 963
 
964 964
 	// Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:9
965
-	__( 'edit', 'event_espresso' ),
965
+	__('edit', 'event_espresso'),
966 966
 
967 967
 	// Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:9
968
-	__( 'trash', 'event_espresso' ),
968
+	__('trash', 'event_espresso'),
969 969
 
970 970
 	// Reference: packages/components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:36
971
-	__( 'view approved registrations for this date.', 'event_espresso' ),
971
+	__('view approved registrations for this date.', 'event_espresso'),
972 972
 
973 973
 	// Reference: packages/components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:37
974
-	__( 'view approved registrations for this ticket.', 'event_espresso' ),
974
+	__('view approved registrations for this ticket.', 'event_espresso'),
975 975
 
976 976
 	// Reference: packages/components/src/EntityList/EntityList.tsx:36
977
-	__( 'no results found', 'event_espresso' ),
977
+	__('no results found', 'event_espresso'),
978 978
 
979 979
 	// Reference: packages/components/src/EntityList/EntityList.tsx:37
980
-	__( 'try changing filter settings', 'event_espresso' ),
980
+	__('try changing filter settings', 'event_espresso'),
981 981
 
982 982
 	// Reference: packages/components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:22
983
-	__( 'card view', 'event_espresso' ),
983
+	__('card view', 'event_espresso'),
984 984
 
985 985
 	// Reference: packages/components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:22
986
-	__( 'table view', 'event_espresso' ),
986
+	__('table view', 'event_espresso'),
987 987
 
988 988
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:11
989
-	__( 'hide filters', 'event_espresso' ),
989
+	__('hide filters', 'event_espresso'),
990 990
 
991 991
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:11
992
-	__( 'show filters', 'event_espresso' ),
992
+	__('show filters', 'event_espresso'),
993 993
 
994 994
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleSortingButton.tsx:28
995
-	__( 'disable sorting', 'event_espresso' ),
995
+	__('disable sorting', 'event_espresso'),
996 996
 
997 997
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleSortingButton.tsx:28
998
-	__( 'enable sorting', 'event_espresso' ),
998
+	__('enable sorting', 'event_espresso'),
999 999
 
1000 1000
 	// Reference: packages/components/src/Legend/ToggleLegendButton.tsx:27
1001
-	__( 'hide legend', 'event_espresso' ),
1001
+	__('hide legend', 'event_espresso'),
1002 1002
 
1003 1003
 	// Reference: packages/components/src/Legend/ToggleLegendButton.tsx:27
1004
-	__( 'show legend', 'event_espresso' ),
1004
+	__('show legend', 'event_espresso'),
1005 1005
 
1006 1006
 	// Reference: packages/components/src/LoadingIndicator/LoadingIndicator.tsx:7
1007
-	__( 'loading …', 'event_espresso' ),
1007
+	__('loading …', 'event_espresso'),
1008 1008
 
1009 1009
 	// Reference: packages/components/src/LoadingNotice/LoadingNotice.tsx:16
1010
-	__( 'loading…', 'event_espresso' ),
1010
+	__('loading…', 'event_espresso'),
1011 1011
 
1012 1012
 	// Reference: packages/components/src/Modal/modalCloseButtonProps/index.ts:8
1013
-	__( 'close modal', 'event_espresso' ),
1013
+	__('close modal', 'event_espresso'),
1014 1014
 
1015 1015
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:10
1016
-	__( 'next', 'event_espresso' ),
1016
+	__('next', 'event_espresso'),
1017 1017
 
1018 1018
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:11
1019
-	__( 'jump to previous', 'event_espresso' ),
1019
+	__('jump to previous', 'event_espresso'),
1020 1020
 
1021 1021
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:12
1022
-	__( 'jump to next', 'event_espresso' ),
1022
+	__('jump to next', 'event_espresso'),
1023 1023
 
1024 1024
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:13
1025
-	__( 'page', 'event_espresso' ),
1025
+	__('page', 'event_espresso'),
1026 1026
 
1027 1027
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:9
1028
-	__( 'previous', 'event_espresso' ),
1028
+	__('previous', 'event_espresso'),
1029 1029
 
1030 1030
 	// Reference: packages/components/src/Pagination/PerPage.tsx:37
1031
-	__( 'items per page', 'event_espresso' ),
1031
+	__('items per page', 'event_espresso'),
1032 1032
 
1033 1033
 	// Reference: packages/components/src/Pagination/constants.ts:10
1034 1034
 	/* translators: %s is per page value */
1035
-	__( '%s / page', 'event_espresso' ),
1035
+	__('%s / page', 'event_espresso'),
1036 1036
 
1037 1037
 	// Reference: packages/components/src/Pagination/constants.ts:13
1038
-	__( 'Next Page', 'event_espresso' ),
1038
+	__('Next Page', 'event_espresso'),
1039 1039
 
1040 1040
 	// Reference: packages/components/src/Pagination/constants.ts:14
1041
-	__( 'Previous Page', 'event_espresso' ),
1041
+	__('Previous Page', 'event_espresso'),
1042 1042
 
1043 1043
 	// Reference: packages/components/src/PercentSign/index.tsx:11
1044
-	__( '%', 'event_espresso' ),
1044
+	__('%', 'event_espresso'),
1045 1045
 
1046 1046
 	// Reference: packages/components/src/Stepper/buttons/Next.tsx:12
1047
-	__( 'Next', 'event_espresso' ),
1047
+	__('Next', 'event_espresso'),
1048 1048
 
1049 1049
 	// Reference: packages/components/src/Stepper/buttons/Previous.tsx:12
1050
-	__( 'Previous', 'event_espresso' ),
1050
+	__('Previous', 'event_espresso'),
1051 1051
 
1052 1052
 	// Reference: packages/components/src/Steps/Steps.tsx:30
1053
-	__( 'Steps', 'event_espresso' ),
1053
+	__('Steps', 'event_espresso'),
1054 1054
 
1055 1055
 	// Reference: packages/components/src/TabbableText/index.tsx:19
1056
-	__( 'Click to edit…', 'event_espresso' ),
1056
+	__('Click to edit…', 'event_espresso'),
1057 1057
 
1058 1058
 	// Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:16
1059
-	__( 'Your Local Time Zone', 'event_espresso' ),
1059
+	__('Your Local Time Zone', 'event_espresso'),
1060 1060
 
1061 1061
 	// Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:21
1062
-	__( 'The Website\'s Time Zone', 'event_espresso' ),
1062
+	__('The Website\'s Time Zone', 'event_espresso'),
1063 1063
 
1064 1064
 	// Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:26
1065
-	__( 'UTC (Greenwich Mean Time)', 'event_espresso' ),
1065
+	__('UTC (Greenwich Mean Time)', 'event_espresso'),
1066 1066
 
1067 1067
 	// Reference: packages/components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:23
1068
-	__( 'This Date Converted To:', 'event_espresso' ),
1068
+	__('This Date Converted To:', 'event_espresso'),
1069 1069
 
1070 1070
 	// Reference: packages/components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:24
1071
-	__( 'click for timezone information', 'event_espresso' ),
1071
+	__('click for timezone information', 'event_espresso'),
1072 1072
 
1073 1073
 	// Reference: packages/components/src/bulkEdit/ActionCheckbox.tsx:38
1074 1074
 	/* translators: %d entity id */
1075
-	__( 'select entity with id %d', 'event_espresso' ),
1075
+	__('select entity with id %d', 'event_espresso'),
1076 1076
 
1077 1077
 	// Reference: packages/components/src/bulkEdit/ActionCheckbox.tsx:41
1078
-	__( 'select all entities', 'event_espresso' ),
1078
+	__('select all entities', 'event_espresso'),
1079 1079
 
1080 1080
 	// Reference: packages/components/src/bulkEdit/BulkActions.tsx:52
1081
-	__( 'select all', 'event_espresso' ),
1081
+	__('select all', 'event_espresso'),
1082 1082
 
1083 1083
 	// Reference: packages/components/src/bulkEdit/BulkActions.tsx:54
1084
-	__( 'apply', 'event_espresso' ),
1084
+	__('apply', 'event_espresso'),
1085 1085
 
1086 1086
 	// Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:20
1087
-	__( 'Note: ', 'event_espresso' ),
1087
+	__('Note: ', 'event_espresso'),
1088 1088
 
1089 1089
 	// Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:20
1090
-	__( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ),
1090
+	__('any changes will be applied to ALL of the selected entities.', 'event_espresso'),
1091 1091
 
1092 1092
 	// Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:26
1093
-	__( 'Bulk edit details', 'event_espresso' ),
1093
+	__('Bulk edit details', 'event_espresso'),
1094 1094
 
1095 1095
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:28
1096
-	__( 'Are you sure you want to bulk update the details?', 'event_espresso' ),
1096
+	__('Are you sure you want to bulk update the details?', 'event_espresso'),
1097 1097
 
1098 1098
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:29
1099
-	__( 'Bulk update details', 'event_espresso' ),
1099
+	__('Bulk update details', 'event_espresso'),
1100 1100
 
1101 1101
 	// Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:14
1102
-	__( 'day in range', 'event_espresso' ),
1102
+	__('day in range', 'event_espresso'),
1103 1103
 
1104 1104
 	// Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:18
1105 1105
 	// Reference: packages/dates/src/DateRangePicker/index.tsx:59
1106
-	__( 'end date', 'event_espresso' ),
1106
+	__('end date', 'event_espresso'),
1107 1107
 
1108 1108
 	// Reference: packages/dates/src/DateTimePicker.tsx:13
1109 1109
 	// Reference: packages/dates/src/TimePicker.tsx:14
1110
-	__( 'time', 'event_espresso' ),
1110
+	__('time', 'event_espresso'),
1111 1111
 
1112 1112
 	// Reference: packages/dates/src/constants.ts:7
1113
-	__( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ),
1113
+	__('End Date & Time must be set later than the Start Date & Time', 'event_espresso'),
1114 1114
 
1115 1115
 	// Reference: packages/dates/src/constants.ts:9
1116
-	__( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ),
1116
+	__('Start Date & Time must be set before the End Date & Time', 'event_espresso'),
1117 1117
 
1118 1118
 	// Reference: packages/dates/src/utils/misc.ts:13
1119
-	__( 'month(s)', 'event_espresso' ),
1119
+	__('month(s)', 'event_espresso'),
1120 1120
 
1121 1121
 	// Reference: packages/dates/src/utils/misc.ts:14
1122
-	__( 'week(s)', 'event_espresso' ),
1122
+	__('week(s)', 'event_espresso'),
1123 1123
 
1124 1124
 	// Reference: packages/dates/src/utils/misc.ts:15
1125
-	__( 'day(s)', 'event_espresso' ),
1125
+	__('day(s)', 'event_espresso'),
1126 1126
 
1127 1127
 	// Reference: packages/dates/src/utils/misc.ts:16
1128
-	__( 'hour(s)', 'event_espresso' ),
1128
+	__('hour(s)', 'event_espresso'),
1129 1129
 
1130 1130
 	// Reference: packages/dates/src/utils/misc.ts:17
1131
-	__( 'minute(s)', 'event_espresso' ),
1131
+	__('minute(s)', 'event_espresso'),
1132 1132
 
1133 1133
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:104
1134
-	__( 'price types initialized', 'event_espresso' ),
1134
+	__('price types initialized', 'event_espresso'),
1135 1135
 
1136 1136
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:114
1137
-	__( 'datetimes initialized', 'event_espresso' ),
1137
+	__('datetimes initialized', 'event_espresso'),
1138 1138
 
1139 1139
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:124
1140
-	__( 'tickets initialized', 'event_espresso' ),
1140
+	__('tickets initialized', 'event_espresso'),
1141 1141
 
1142 1142
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:134
1143
-	__( 'prices initialized', 'event_espresso' ),
1143
+	__('prices initialized', 'event_espresso'),
1144 1144
 
1145 1145
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:12
1146
-	__( 'Start Date is required', 'event_espresso' ),
1146
+	__('Start Date is required', 'event_espresso'),
1147 1147
 
1148 1148
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:16
1149
-	__( 'End Date is required', 'event_espresso' ),
1149
+	__('End Date is required', 'event_espresso'),
1150 1150
 
1151 1151
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:7
1152
-	__( 'Required', 'event_espresso' ),
1152
+	__('Required', 'event_espresso'),
1153 1153
 
1154 1154
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:35
1155 1155
 	/* translators: %d the entry number */
1156
-	__( 'Entry %d', 'event_espresso' ),
1156
+	__('Entry %d', 'event_espresso'),
1157 1157
 
1158 1158
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:51
1159
-	__( 'Add', 'event_espresso' ),
1159
+	__('Add', 'event_espresso'),
1160 1160
 
1161 1161
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11
1162 1162
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17
1163
-	__( 'sold out', 'event_espresso' ),
1163
+	__('sold out', 'event_espresso'),
1164 1164
 
1165 1165
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14
1166 1166
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14
1167
-	__( 'expired', 'event_espresso' ),
1167
+	__('expired', 'event_espresso'),
1168 1168
 
1169 1169
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17
1170
-	__( 'upcoming', 'event_espresso' ),
1170
+	__('upcoming', 'event_espresso'),
1171 1171
 
1172 1172
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20
1173
-	__( 'active', 'event_espresso' ),
1173
+	__('active', 'event_espresso'),
1174 1174
 
1175 1175
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23
1176 1176
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11
1177
-	__( 'trashed', 'event_espresso' ),
1177
+	__('trashed', 'event_espresso'),
1178 1178
 
1179 1179
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26
1180
-	__( 'cancelled', 'event_espresso' ),
1180
+	__('cancelled', 'event_espresso'),
1181 1181
 
1182 1182
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29
1183
-	__( 'postponed', 'event_espresso' ),
1183
+	__('postponed', 'event_espresso'),
1184 1184
 
1185 1185
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33
1186
-	__( 'inactive', 'event_espresso' ),
1186
+	__('inactive', 'event_espresso'),
1187 1187
 
1188 1188
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20
1189
-	__( 'pending', 'event_espresso' ),
1189
+	__('pending', 'event_espresso'),
1190 1190
 
1191 1191
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23
1192
-	__( 'on sale', 'event_espresso' ),
1192
+	__('on sale', 'event_espresso'),
1193 1193
 
1194 1194
 	// Reference: packages/predicates/src/registration/statusOptions.ts:10
1195
-	__( 'Cancelled', 'event_espresso' ),
1195
+	__('Cancelled', 'event_espresso'),
1196 1196
 
1197 1197
 	// Reference: packages/predicates/src/registration/statusOptions.ts:14
1198
-	__( 'Declined', 'event_espresso' ),
1198
+	__('Declined', 'event_espresso'),
1199 1199
 
1200 1200
 	// Reference: packages/predicates/src/registration/statusOptions.ts:18
1201
-	__( 'Incomplete', 'event_espresso' ),
1201
+	__('Incomplete', 'event_espresso'),
1202 1202
 
1203 1203
 	// Reference: packages/predicates/src/registration/statusOptions.ts:22
1204
-	__( 'Not Approved', 'event_espresso' ),
1204
+	__('Not Approved', 'event_espresso'),
1205 1205
 
1206 1206
 	// Reference: packages/predicates/src/registration/statusOptions.ts:26
1207
-	__( 'Pending Payment', 'event_espresso' ),
1207
+	__('Pending Payment', 'event_espresso'),
1208 1208
 
1209 1209
 	// Reference: packages/predicates/src/registration/statusOptions.ts:30
1210
-	__( 'Wait List', 'event_espresso' ),
1210
+	__('Wait List', 'event_espresso'),
1211 1211
 
1212 1212
 	// Reference: packages/predicates/src/registration/statusOptions.ts:6
1213
-	__( 'Approved', 'event_espresso' ),
1213
+	__('Approved', 'event_espresso'),
1214 1214
 
1215 1215
 	// Reference: packages/rich-text-editor/src/components/ToolbarControls/HeadingControls.tsx:23
1216
-	__( 'heading selector', 'event_espresso' ),
1216
+	__('heading selector', 'event_espresso'),
1217 1217
 
1218 1218
 	// Reference: packages/rich-text-editor/src/components/constants.ts:12
1219
-	__( 'blockquote', 'event_espresso' ),
1219
+	__('blockquote', 'event_espresso'),
1220 1220
 
1221 1221
 	// Reference: packages/rich-text-editor/src/components/constants.ts:13
1222
-	__( 'unordered list', 'event_espresso' ),
1222
+	__('unordered list', 'event_espresso'),
1223 1223
 
1224 1224
 	// Reference: packages/rich-text-editor/src/components/constants.ts:14
1225
-	__( 'ordered list', 'event_espresso' ),
1225
+	__('ordered list', 'event_espresso'),
1226 1226
 
1227 1227
 	// Reference: packages/rich-text-editor/src/components/constants.ts:27
1228
-	__( 'bold', 'event_espresso' ),
1228
+	__('bold', 'event_espresso'),
1229 1229
 
1230 1230
 	// Reference: packages/rich-text-editor/src/components/constants.ts:28
1231
-	__( 'italic', 'event_espresso' ),
1231
+	__('italic', 'event_espresso'),
1232 1232
 
1233 1233
 	// Reference: packages/rich-text-editor/src/components/constants.ts:29
1234
-	__( 'underline', 'event_espresso' ),
1234
+	__('underline', 'event_espresso'),
1235 1235
 
1236 1236
 	// Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:15
1237
-	__( 'add new price modifier after this row', 'event_espresso' ),
1237
+	__('add new price modifier after this row', 'event_espresso'),
1238 1238
 
1239 1239
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:13
1240
-	__( 'Delete all prices', 'event_espresso' ),
1240
+	__('Delete all prices', 'event_espresso'),
1241 1241
 
1242 1242
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:26
1243
-	__( 'Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso' ),
1243
+	__('Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso'),
1244 1244
 
1245 1245
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:30
1246
-	__( 'Delete all prices?', 'event_espresso' ),
1246
+	__('Delete all prices?', 'event_espresso'),
1247 1247
 
1248 1248
 	// Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12
1249
-	__( 'delete price modifier', 'event_espresso' ),
1249
+	__('delete price modifier', 'event_espresso'),
1250 1250
 
1251 1251
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:15
1252
-	__( 'Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso' ),
1252
+	__('Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso'),
1253 1253
 
1254 1254
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:18
1255
-	__( 'Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso' ),
1255
+	__('Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso'),
1256 1256
 
1257 1257
 	// Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:29
1258
-	__( 'ticket price calculator', 'event_espresso' ),
1258
+	__('ticket price calculator', 'event_espresso'),
1259 1259
 
1260 1260
 	// Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:10
1261
-	__( 'Add default taxes', 'event_espresso' ),
1261
+	__('Add default taxes', 'event_espresso'),
1262 1262
 
1263 1263
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:11
1264
-	__( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ),
1264
+	__('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'),
1265 1265
 
1266 1266
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:15
1267
-	__( 'Remove all taxes?', 'event_espresso' ),
1267
+	__('Remove all taxes?', 'event_espresso'),
1268 1268
 
1269 1269
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:8
1270
-	__( 'Remove taxes', 'event_espresso' ),
1270
+	__('Remove taxes', 'event_espresso'),
1271 1271
 
1272 1272
 	// Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:28
1273
-	__( 'Modify default prices.', 'event_espresso' ),
1273
+	__('Modify default prices.', 'event_espresso'),
1274 1274
 
1275 1275
 	// Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:28
1276
-	__( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ),
1276
+	__('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'),
1277 1277
 
1278 1278
 	// Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:10
1279
-	__( 'Add default prices', 'event_espresso' ),
1279
+	__('Add default prices', 'event_espresso'),
1280 1280
 
1281 1281
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:14
1282
-	__( 'This Ticket is Currently Free', 'event_espresso' ),
1282
+	__('This Ticket is Currently Free', 'event_espresso'),
1283 1283
 
1284 1284
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22
1285 1285
 	/* translators: %s default prices */
1286
-	__( 'Click the button below to load your %s into the calculator.', 'event_espresso' ),
1286
+	__('Click the button below to load your %s into the calculator.', 'event_espresso'),
1287 1287
 
1288 1288
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:23
1289
-	__( 'default prices', 'event_espresso' ),
1289
+	__('default prices', 'event_espresso'),
1290 1290
 
1291 1291
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:30
1292
-	__( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ),
1292
+	__('Additional ticket price modifiers can be added or removed.', 'event_espresso'),
1293 1293
 
1294 1294
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:33
1295
-	__( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ),
1295
+	__('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'),
1296 1296
 
1297 1297
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:32
1298 1298
 	/* translators: %s ticket name */
1299
-	__( 'Price Calculator for Ticket: %s', 'event_espresso' ),
1299
+	__('Price Calculator for Ticket: %s', 'event_espresso'),
1300 1300
 
1301 1301
 	// Reference: packages/tpc/src/components/table/Table.tsx:43
1302
-	__( 'Ticket Price Calculator', 'event_espresso' ),
1302
+	__('Ticket Price Calculator', 'event_espresso'),
1303 1303
 
1304 1304
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:41
1305
-	__( 'Total', 'event_espresso' ),
1305
+	__('Total', 'event_espresso'),
1306 1306
 
1307 1307
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:50
1308
-	__( 'ticket total', 'event_espresso' ),
1308
+	__('ticket total', 'event_espresso'),
1309 1309
 
1310 1310
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29
1311
-	__( 'Price Type', 'event_espresso' ),
1311
+	__('Price Type', 'event_espresso'),
1312 1312
 
1313 1313
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35
1314
-	__( 'Label', 'event_espresso' ),
1314
+	__('Label', 'event_espresso'),
1315 1315
 
1316 1316
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47
1317
-	__( 'Amount', 'event_espresso' ),
1317
+	__('Amount', 'event_espresso'),
1318 1318
 
1319 1319
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:34
1320
-	__( 'amount', 'event_espresso' ),
1320
+	__('amount', 'event_espresso'),
1321 1321
 
1322 1322
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:45
1323
-	__( 'amount…', 'event_espresso' ),
1323
+	__('amount…', 'event_espresso'),
1324 1324
 
1325 1325
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:10
1326
-	__( 'price description', 'event_espresso' ),
1326
+	__('price description', 'event_espresso'),
1327 1327
 
1328 1328
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:15
1329
-	__( 'description…', 'event_espresso' ),
1329
+	__('description…', 'event_espresso'),
1330 1330
 
1331 1331
 	// Reference: packages/tpc/src/inputs/PriceIdInput.tsx:9
1332
-	__( 'price id', 'event_espresso' ),
1332
+	__('price id', 'event_espresso'),
1333 1333
 
1334 1334
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:10
1335
-	__( 'price name', 'event_espresso' ),
1335
+	__('price name', 'event_espresso'),
1336 1336
 
1337 1337
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:15
1338
-	__( 'label…', 'event_espresso' ),
1338
+	__('label…', 'event_espresso'),
1339 1339
 
1340 1340
 	// Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:16
1341
-	__( 'price type', 'event_espresso' ),
1341
+	__('price type', 'event_espresso'),
1342 1342
 
1343 1343
 	// Reference: packages/tpc/src/utils/constants.ts:13
1344
-	__( 'Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then archive the old tickets.', 'event_espresso' )
1344
+	__('Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then archive the old tickets.', 'event_espresso')
1345 1345
 );
1346 1346
 /* THIS IS THE END OF THE GENERATED FILE */
Please login to merge, or discard this patch.