Completed
Branch master (3457d3)
by
unknown
25:39 queued 23:21
created
caffeinated/admin/extend/events/Tickets_List_Table.class.php 2 patches
Indentation   +147 added lines, -147 removed lines patch added patch discarded remove patch
@@ -15,151 +15,151 @@
 block discarded – undo
15 15
  */
16 16
 class Tickets_List_Table extends EE_Admin_List_Table
17 17
 {
18
-    protected function _setup_data()
19
-    {
20
-        $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
21
-        $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
22
-        $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
23
-        $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
24
-    }
25
-
26
-
27
-    protected function _set_properties()
28
-    {
29
-        $this->_wp_list_args = array(
30
-            'singular' => esc_html__('ticket', 'event_espresso'),
31
-            'plural'   => esc_html__('tickets', 'event_espresso'),
32
-            'ajax'     => true,
33
-            'screen'   => $this->_admin_page->get_current_screen()->id,
34
-        );
35
-
36
-        $this->_columns = array(
37
-            'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
38
-            'TKT_name'        => esc_html__('Name', 'event_espresso'),
39
-            'TKT_description' => esc_html__('Description', 'event_espresso'),
40
-            'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
41
-            'TKT_uses'        => esc_html__('Datetimes', 'event_espresso'),
42
-            'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
43
-            'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
44
-            'TKT_price'       => esc_html__('Price', 'event_espresso'),
45
-            'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
46
-        );
47
-
48
-        $this->_sortable_columns = array(
49
-            // TRUE means its already sorted
50
-            'TKT_name'        => array('TKT_name' => true),
51
-            'TKT_description' => array('TKT_description' => false),
52
-            'TKT_qty'         => array('TKT_qty' => false),
53
-            'TKT_uses'        => array('TKT_uses' => false),
54
-            'TKT_min'         => array('TKT_min' => false),
55
-            'TKT_max'         => array('TKT_max' => false),
56
-            'TKT_price'       => array('TKT_price' => false),
57
-        );
58
-
59
-        $this->_hidden_columns = array();
60
-    }
61
-
62
-
63
-    protected function _get_table_filters()
64
-    {
65
-    }
66
-
67
-
68
-    protected function _add_view_counts()
69
-    {
70
-        $this->_views['all']['count'] = $this->_all_data_count;
71
-        $this->_views['trashed']['count'] = $this->_trashed_count;
72
-    }
73
-
74
-
75
-    public function column_cb($item)
76
-    {
77
-        return $item->ID() === 1
78
-            ? '<span class="ee-lock-icon"></span>'
79
-            : sprintf(
80
-                '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
81
-                $item->ID()
82
-            );
83
-    }
84
-
85
-
86
-    public function column_TKT_name($item)
87
-    {
88
-        // build row actions
89
-        $actions = array();
90
-
91
-        // trash links
92
-        if ($item->ID() !== 1) {
93
-            if ($this->_view == 'all') {
94
-                $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
95
-                    'action' => 'trash_ticket',
96
-                    'TKT_ID' => $item->ID(),
97
-                ), EVENTS_ADMIN_URL);
98
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
99
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
100
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
101
-            } else {
102
-                // restore price link
103
-                $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
104
-                    'action' => 'restore_ticket',
105
-                    'TKT_ID' => $item->ID(),
106
-                ), EVENTS_ADMIN_URL);
107
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
108
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
109
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
110
-                // delete price link
111
-                $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
112
-                    'action' => 'delete_ticket',
113
-                    'TKT_ID' => $item->ID(),
114
-                ), EVENTS_ADMIN_URL);
115
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
116
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
117
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
118
-            }
119
-        }
120
-
121
-        return $item->get('TKT_name') . $this->row_actions($actions);
122
-    }
123
-
124
-
125
-    public function column_TKT_description($item)
126
-    {
127
-        return $item->get('TKT_description');
128
-    }
129
-
130
-
131
-    public function column_TKT_qty($item)
132
-    {
133
-        return $item->get_pretty('TKT_qty', 'text');
134
-    }
135
-
136
-
137
-    public function column_TKT_uses($item)
138
-    {
139
-        return $item->get_pretty('TKT_uses', 'text');
140
-    }
141
-
142
-
143
-    public function column_TKT_min($item)
144
-    {
145
-        return $item->get('TKT_min');
146
-    }
147
-
148
-
149
-    public function column_TKT_max($item)
150
-    {
151
-        return $item->get_pretty('TKT_max', 'text');
152
-    }
153
-
154
-
155
-    public function column_TKT_price($item)
156
-    {
157
-        return EEH_Template::format_currency($item->get('TKT_price'));
158
-    }
159
-
160
-
161
-    public function column_TKT_taxable($item)
162
-    {
163
-        return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
164
-    }
18
+	protected function _setup_data()
19
+	{
20
+		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
21
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
22
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
23
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
24
+	}
25
+
26
+
27
+	protected function _set_properties()
28
+	{
29
+		$this->_wp_list_args = array(
30
+			'singular' => esc_html__('ticket', 'event_espresso'),
31
+			'plural'   => esc_html__('tickets', 'event_espresso'),
32
+			'ajax'     => true,
33
+			'screen'   => $this->_admin_page->get_current_screen()->id,
34
+		);
35
+
36
+		$this->_columns = array(
37
+			'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
38
+			'TKT_name'        => esc_html__('Name', 'event_espresso'),
39
+			'TKT_description' => esc_html__('Description', 'event_espresso'),
40
+			'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
41
+			'TKT_uses'        => esc_html__('Datetimes', 'event_espresso'),
42
+			'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
43
+			'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
44
+			'TKT_price'       => esc_html__('Price', 'event_espresso'),
45
+			'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
46
+		);
47
+
48
+		$this->_sortable_columns = array(
49
+			// TRUE means its already sorted
50
+			'TKT_name'        => array('TKT_name' => true),
51
+			'TKT_description' => array('TKT_description' => false),
52
+			'TKT_qty'         => array('TKT_qty' => false),
53
+			'TKT_uses'        => array('TKT_uses' => false),
54
+			'TKT_min'         => array('TKT_min' => false),
55
+			'TKT_max'         => array('TKT_max' => false),
56
+			'TKT_price'       => array('TKT_price' => false),
57
+		);
58
+
59
+		$this->_hidden_columns = array();
60
+	}
61
+
62
+
63
+	protected function _get_table_filters()
64
+	{
65
+	}
66
+
67
+
68
+	protected function _add_view_counts()
69
+	{
70
+		$this->_views['all']['count'] = $this->_all_data_count;
71
+		$this->_views['trashed']['count'] = $this->_trashed_count;
72
+	}
73
+
74
+
75
+	public function column_cb($item)
76
+	{
77
+		return $item->ID() === 1
78
+			? '<span class="ee-lock-icon"></span>'
79
+			: sprintf(
80
+				'<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
81
+				$item->ID()
82
+			);
83
+	}
84
+
85
+
86
+	public function column_TKT_name($item)
87
+	{
88
+		// build row actions
89
+		$actions = array();
90
+
91
+		// trash links
92
+		if ($item->ID() !== 1) {
93
+			if ($this->_view == 'all') {
94
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
95
+					'action' => 'trash_ticket',
96
+					'TKT_ID' => $item->ID(),
97
+				), EVENTS_ADMIN_URL);
98
+				$actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
99
+									. esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
100
+									. esc_html__('Trash', 'event_espresso') . '</a>';
101
+			} else {
102
+				// restore price link
103
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
104
+					'action' => 'restore_ticket',
105
+					'TKT_ID' => $item->ID(),
106
+				), EVENTS_ADMIN_URL);
107
+				$actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
108
+									  . esc_attr__('Restore Ticket', 'event_espresso') . '">'
109
+									  . esc_html__('Restore', 'event_espresso') . '</a>';
110
+				// delete price link
111
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
112
+					'action' => 'delete_ticket',
113
+					'TKT_ID' => $item->ID(),
114
+				), EVENTS_ADMIN_URL);
115
+				$actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
116
+									 . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
117
+									 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
118
+			}
119
+		}
120
+
121
+		return $item->get('TKT_name') . $this->row_actions($actions);
122
+	}
123
+
124
+
125
+	public function column_TKT_description($item)
126
+	{
127
+		return $item->get('TKT_description');
128
+	}
129
+
130
+
131
+	public function column_TKT_qty($item)
132
+	{
133
+		return $item->get_pretty('TKT_qty', 'text');
134
+	}
135
+
136
+
137
+	public function column_TKT_uses($item)
138
+	{
139
+		return $item->get_pretty('TKT_uses', 'text');
140
+	}
141
+
142
+
143
+	public function column_TKT_min($item)
144
+	{
145
+		return $item->get('TKT_min');
146
+	}
147
+
148
+
149
+	public function column_TKT_max($item)
150
+	{
151
+		return $item->get_pretty('TKT_max', 'text');
152
+	}
153
+
154
+
155
+	public function column_TKT_price($item)
156
+	{
157
+		return EEH_Template::format_currency($item->get('TKT_price'));
158
+	}
159
+
160
+
161
+	public function column_TKT_taxable($item)
162
+	{
163
+		return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
164
+	}
165 165
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -95,30 +95,30 @@
 block discarded – undo
95 95
                     'action' => 'trash_ticket',
96 96
                     'TKT_ID' => $item->ID(),
97 97
                 ), EVENTS_ADMIN_URL);
98
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
99
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
100
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
98
+                $actions['trash'] = '<a href="'.$trash_lnk_url.'" aria-label="'
99
+                                    . esc_attr__('Move Ticket to trash', 'event_espresso').'">'
100
+                                    . esc_html__('Trash', 'event_espresso').'</a>';
101 101
             } else {
102 102
                 // restore price link
103 103
                 $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
104 104
                     'action' => 'restore_ticket',
105 105
                     'TKT_ID' => $item->ID(),
106 106
                 ), EVENTS_ADMIN_URL);
107
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
108
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
109
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
107
+                $actions['restore'] = '<a href="'.$restore_lnk_url.'" aria-label="'
108
+                                      . esc_attr__('Restore Ticket', 'event_espresso').'">'
109
+                                      . esc_html__('Restore', 'event_espresso').'</a>';
110 110
                 // delete price link
111 111
                 $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
112 112
                     'action' => 'delete_ticket',
113 113
                     'TKT_ID' => $item->ID(),
114 114
                 ), EVENTS_ADMIN_URL);
115
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
116
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
117
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
115
+                $actions['delete'] = '<a href="'.$delete_lnk_url.'" aria-label="'
116
+                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'
117
+                                     . esc_html__('Delete Permanently', 'event_espresso').'</a>';
118 118
             }
119 119
         }
120 120
 
121
-        return $item->get('TKT_name') . $this->row_actions($actions);
121
+        return $item->get('TKT_name').$this->row_actions($actions);
122 122
     }
123 123
 
124 124
 
Please login to merge, or discard this patch.
admin/extend/messages/Custom_Messages_Template_List_Table.class.php 2 patches
Indentation   +215 added lines, -215 removed lines patch added patch discarded remove patch
@@ -11,257 +11,257 @@
 block discarded – undo
11 11
  */
12 12
 class Custom_Messages_Template_List_Table extends Messages_Template_List_Table
13 13
 {
14
-    /**
15
-     * Setup initial data.
16
-     */
17
-    protected function _setup_data()
18
-    {
19
-        $this->_data = $this->get_admin_page()->get_message_templates(
20
-            $this->_per_page,
21
-            $this->_view,
22
-            false,
23
-            false,
24
-            false
25
-        );
26
-        $this->_all_data_count = $this->get_admin_page()->get_message_templates(
27
-            $this->_per_page,
28
-            $this->_view,
29
-            true,
30
-            true,
31
-            false
32
-        );
33
-    }
14
+	/**
15
+	 * Setup initial data.
16
+	 */
17
+	protected function _setup_data()
18
+	{
19
+		$this->_data = $this->get_admin_page()->get_message_templates(
20
+			$this->_per_page,
21
+			$this->_view,
22
+			false,
23
+			false,
24
+			false
25
+		);
26
+		$this->_all_data_count = $this->get_admin_page()->get_message_templates(
27
+			$this->_per_page,
28
+			$this->_view,
29
+			true,
30
+			true,
31
+			false
32
+		);
33
+	}
34 34
 
35 35
 
36
-    /**
37
-     * Set initial properties
38
-     */
39
-    protected function _set_properties()
40
-    {
41
-        parent::_set_properties();
42
-        $this->_wp_list_args = array(
43
-            'singular' => esc_html__('Message Template Group', 'event_espresso'),
44
-            'plural'   => esc_html__('Message Template', 'event_espresso'),
45
-            'ajax'     => true, // for now,
46
-            'screen'   => $this->get_admin_page()->get_current_screen()->id,
47
-        );
36
+	/**
37
+	 * Set initial properties
38
+	 */
39
+	protected function _set_properties()
40
+	{
41
+		parent::_set_properties();
42
+		$this->_wp_list_args = array(
43
+			'singular' => esc_html__('Message Template Group', 'event_espresso'),
44
+			'plural'   => esc_html__('Message Template', 'event_espresso'),
45
+			'ajax'     => true, // for now,
46
+			'screen'   => $this->get_admin_page()->get_current_screen()->id,
47
+		);
48 48
 
49
-        $this->_columns = array_merge(
50
-            array(
51
-                'cb'   => '<input type="checkbox" />',
52
-                'name' => esc_html__('Template Name', 'event_espresso'),
53
-            ),
54
-            $this->_columns,
55
-            array(
56
-                'events'  => esc_html__('Events', 'event_espresso'),
57
-                'actions' => '',
58
-            )
59
-        );
60
-    }
49
+		$this->_columns = array_merge(
50
+			array(
51
+				'cb'   => '<input type="checkbox" />',
52
+				'name' => esc_html__('Template Name', 'event_espresso'),
53
+			),
54
+			$this->_columns,
55
+			array(
56
+				'events'  => esc_html__('Events', 'event_espresso'),
57
+				'actions' => '',
58
+			)
59
+		);
60
+	}
61 61
 
62 62
 
63
-    /**
64
-     * Custom message for when there are no items found.
65
-     *
66
-     * @since 4.3.0
67
-     */
68
-    public function no_items()
69
-    {
70
-        if ($this->_view !== 'trashed') {
71
-            printf(
72
-                esc_html__(
73
-                    '%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.',
74
-                    'event_espresso'
75
-                ),
76
-                '<strong>',
77
-                '</strong>'
78
-            );
79
-        } else {
80
-            parent::no_items();
81
-        }
82
-    }
63
+	/**
64
+	 * Custom message for when there are no items found.
65
+	 *
66
+	 * @since 4.3.0
67
+	 */
68
+	public function no_items()
69
+	{
70
+		if ($this->_view !== 'trashed') {
71
+			printf(
72
+				esc_html__(
73
+					'%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.',
74
+					'event_espresso'
75
+				),
76
+				'<strong>',
77
+				'</strong>'
78
+			);
79
+		} else {
80
+			parent::no_items();
81
+		}
82
+	}
83 83
 
84 84
 
85
-    /**
86
-     * @param EE_Message_Template_Group $item
87
-     * @return string
88
-     */
89
-    public function column_cb($item)
90
-    {
91
-        return sprintf('<input type="checkbox" name="checkbox[%s]" value="1" />', $item->GRP_ID());
92
-    }
85
+	/**
86
+	 * @param EE_Message_Template_Group $item
87
+	 * @return string
88
+	 */
89
+	public function column_cb($item)
90
+	{
91
+		return sprintf('<input type="checkbox" name="checkbox[%s]" value="1" />', $item->GRP_ID());
92
+	}
93 93
 
94 94
 
95
-    /**
96
-     * @param EE_Message_Template_Group $item
97
-     * @return string
98
-     */
99
-    public function column_name($item)
100
-    {
101
-        return '<p>' . $item->name() . '</p>';
102
-    }
95
+	/**
96
+	 * @param EE_Message_Template_Group $item
97
+	 * @return string
98
+	 */
99
+	public function column_name($item)
100
+	{
101
+		return '<p>' . $item->name() . '</p>';
102
+	}
103 103
 
104 104
 
105
-    /**
106
-     * @param EE_Message_Template_Group $item
107
-     * @return string
108
-     */
109
-    public function column_actions($item)
110
-    {
111
-        if (
112
-            EE_Registry::instance()->CAP->current_user_can(
113
-                'ee_edit_messages',
114
-                'espresso_messages_add_new_message_template'
115
-            )
116
-        ) {
117
-            $create_args = array(
118
-                'GRP_ID'       => $item->ID(),
119
-                'messenger'    => $item->messenger(),
120
-                'message_type' => $item->message_type(),
121
-                'action'       => 'add_new_message_template',
122
-            );
123
-            $create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
124
-            return sprintf(
125
-                '<p><a href="%s" class="button button-small">%s</a></p>',
126
-                $create_link,
127
-                esc_html__('Create Custom', 'event_espresso')
128
-            );
129
-        }
130
-        return '';
131
-    }
105
+	/**
106
+	 * @param EE_Message_Template_Group $item
107
+	 * @return string
108
+	 */
109
+	public function column_actions($item)
110
+	{
111
+		if (
112
+			EE_Registry::instance()->CAP->current_user_can(
113
+				'ee_edit_messages',
114
+				'espresso_messages_add_new_message_template'
115
+			)
116
+		) {
117
+			$create_args = array(
118
+				'GRP_ID'       => $item->ID(),
119
+				'messenger'    => $item->messenger(),
120
+				'message_type' => $item->message_type(),
121
+				'action'       => 'add_new_message_template',
122
+			);
123
+			$create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
124
+			return sprintf(
125
+				'<p><a href="%s" class="button button-small">%s</a></p>',
126
+				$create_link,
127
+				esc_html__('Create Custom', 'event_espresso')
128
+			);
129
+		}
130
+		return '';
131
+	}
132 132
 
133
-    /**
134
-     * Set the view counts on the _views property
135
-     */
136
-    protected function _add_view_counts()
137
-    {
138
-        foreach ($this->_views as $view => $args) {
139
-            $this->_views[ $view ]['count'] = $this->get_admin_page()->get_message_templates(
140
-                $this->_per_page,
141
-                $view,
142
-                true,
143
-                true,
144
-                false
145
-            );
146
-        }
147
-    }
133
+	/**
134
+	 * Set the view counts on the _views property
135
+	 */
136
+	protected function _add_view_counts()
137
+	{
138
+		foreach ($this->_views as $view => $args) {
139
+			$this->_views[ $view ]['count'] = $this->get_admin_page()->get_message_templates(
140
+				$this->_per_page,
141
+				$view,
142
+				true,
143
+				true,
144
+				false
145
+			);
146
+		}
147
+	}
148 148
 
149 149
 
150
-    /**
151
-     * column_events
152
-     * This provides a count of events using this custom template
153
-     *
154
-     * @param  EE_Message_Template_Group $item message_template group data
155
-     * @return string column output
156
-     */
157
-    public function column_events($item)
158
-    {
159
-        return $item->count_events();
160
-    }
150
+	/**
151
+	 * column_events
152
+	 * This provides a count of events using this custom template
153
+	 *
154
+	 * @param  EE_Message_Template_Group $item message_template group data
155
+	 * @return string column output
156
+	 */
157
+	public function column_events($item)
158
+	{
159
+		return $item->count_events();
160
+	}
161 161
 
162 162
 
163
-    /**
164
-     * Add additional actions for custom message template list view.
165
-     *
166
-     * @param EE_Message_Template_Group $item
167
-     * @return array
168
-     * @throws EE_Error
169
-     */
170
-    protected function _get_actions_for_messenger_column(EE_Message_Template_Group $item)
171
-    {
172
-        $actions = parent::_get_actions_for_messenger_column($item);
163
+	/**
164
+	 * Add additional actions for custom message template list view.
165
+	 *
166
+	 * @param EE_Message_Template_Group $item
167
+	 * @return array
168
+	 * @throws EE_Error
169
+	 */
170
+	protected function _get_actions_for_messenger_column(EE_Message_Template_Group $item)
171
+	{
172
+		$actions = parent::_get_actions_for_messenger_column($item);
173 173
 
174
-        // add additional actions for trash/restore etc.
175
-        $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
176
-            'action'   => 'trash_message_template',
177
-            'id'       => $item->GRP_ID(),
178
-            'noheader' => true,
179
-        ), EE_MSG_ADMIN_URL);
180
-        // restore link
181
-        $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
182
-            'action'   => 'restore_message_template',
183
-            'id'       => $item->GRP_ID(),
184
-            'noheader' => true,
185
-        ), EE_MSG_ADMIN_URL);
186
-        // delete price link
187
-        $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
188
-            'action'   => 'delete_message_template',
189
-            'id'       => $item->GRP_ID(),
190
-            'noheader' => true,
191
-        ), EE_MSG_ADMIN_URL);
174
+		// add additional actions for trash/restore etc.
175
+		$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
176
+			'action'   => 'trash_message_template',
177
+			'id'       => $item->GRP_ID(),
178
+			'noheader' => true,
179
+		), EE_MSG_ADMIN_URL);
180
+		// restore link
181
+		$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
182
+			'action'   => 'restore_message_template',
183
+			'id'       => $item->GRP_ID(),
184
+			'noheader' => true,
185
+		), EE_MSG_ADMIN_URL);
186
+		// delete price link
187
+		$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
188
+			'action'   => 'delete_message_template',
189
+			'id'       => $item->GRP_ID(),
190
+			'noheader' => true,
191
+		), EE_MSG_ADMIN_URL);
192 192
 
193
-        if (
194
-            ! $item->get('MTP_deleted')
195
-            && EE_Registry::instance()->CAP->current_user_can(
196
-                'ee_delete_message',
197
-                'espresso_messages_trash_message_template',
198
-                $item->ID()
199
-            )
200
-        ) {
201
-            $actions['trash'] = '
193
+		if (
194
+			! $item->get('MTP_deleted')
195
+			&& EE_Registry::instance()->CAP->current_user_can(
196
+				'ee_delete_message',
197
+				'espresso_messages_trash_message_template',
198
+				$item->ID()
199
+			)
200
+		) {
201
+			$actions['trash'] = '
202 202
                 <a href="' . $trash_lnk_url . '" 
203 203
                    aria-label="' . esc_attr__('Move Template Group to Trash', 'event_espresso') . '"
204 204
                 >
205 205
                     ' . esc_html__('Move to Trash', 'event_espresso') . '
206 206
                 </a>';
207
-        } else {
208
-            if (
209
-                EE_Registry::instance()->CAP->current_user_can(
210
-                    'ee_delete_message',
211
-                    'espresso_messages_restore_message_template',
212
-                    $item->ID()
213
-                )
214
-            ) {
215
-                $actions['restore'] = '
207
+		} else {
208
+			if (
209
+				EE_Registry::instance()->CAP->current_user_can(
210
+					'ee_delete_message',
211
+					'espresso_messages_restore_message_template',
212
+					$item->ID()
213
+				)
214
+			) {
215
+				$actions['restore'] = '
216 216
                     <a href="' . $restore_lnk_url . '" 
217 217
                        aria-label="' . esc_attr__('Restore Message Template', 'event_espresso') . '"
218 218
                     >
219 219
                         ' . esc_html__('Restore', 'event_espresso') . '
220 220
                     </a>';
221
-            }
221
+			}
222 222
 
223
-            if (
224
-                $this->_view === 'trashed'
225
-                && EE_Registry::instance()->CAP->current_user_can(
226
-                    'ee_delete_message',
227
-                    'espresso_messages_delete_message_template',
228
-                    $item->ID()
229
-                )
230
-            ) {
231
-                $actions['delete'] = '
223
+			if (
224
+				$this->_view === 'trashed'
225
+				&& EE_Registry::instance()->CAP->current_user_can(
226
+					'ee_delete_message',
227
+					'espresso_messages_delete_message_template',
228
+					$item->ID()
229
+				)
230
+			) {
231
+				$actions['delete'] = '
232 232
                     <a href="' . $delete_lnk_url . '" 
233 233
                        aria-label="' . esc_attr__('Delete Template Group Permanently', 'event_espresso') . '"
234 234
                     >
235 235
                         ' . esc_html__('Delete Permanently', 'event_espresso') . '
236 236
                     </a>';
237
-            }
238
-        }
239
-        return $actions;
240
-    }
237
+			}
238
+		}
239
+		return $actions;
240
+	}
241 241
 
242 242
 
243
-    /**
244
-     * Generate dropdown filter select input for messengers
245
-     *
246
-     * @param bool $global
247
-     * @return string
248
-     * @throws EE_Error
249
-     */
250
-    protected function _get_messengers_dropdown_filter($global = true)
251
-    {
252
-        return parent::_get_messengers_dropdown_filter(false);
253
-    }
243
+	/**
244
+	 * Generate dropdown filter select input for messengers
245
+	 *
246
+	 * @param bool $global
247
+	 * @return string
248
+	 * @throws EE_Error
249
+	 */
250
+	protected function _get_messengers_dropdown_filter($global = true)
251
+	{
252
+		return parent::_get_messengers_dropdown_filter(false);
253
+	}
254 254
 
255 255
 
256
-    /**
257
-     * Generate dropdown filter select input for message types
258
-     *
259
-     * @param bool $global
260
-     * @return string
261
-     * @throws EE_Error
262
-     */
263
-    protected function _get_message_types_dropdown_filter($global = true)
264
-    {
265
-        return parent::_get_message_types_dropdown_filter(false);
266
-    }
256
+	/**
257
+	 * Generate dropdown filter select input for message types
258
+	 *
259
+	 * @param bool $global
260
+	 * @return string
261
+	 * @throws EE_Error
262
+	 */
263
+	protected function _get_message_types_dropdown_filter($global = true)
264
+	{
265
+		return parent::_get_message_types_dropdown_filter(false);
266
+	}
267 267
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function column_name($item)
100 100
     {
101
-        return '<p>' . $item->name() . '</p>';
101
+        return '<p>'.$item->name().'</p>';
102 102
     }
103 103
 
104 104
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     protected function _add_view_counts()
137 137
     {
138 138
         foreach ($this->_views as $view => $args) {
139
-            $this->_views[ $view ]['count'] = $this->get_admin_page()->get_message_templates(
139
+            $this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates(
140 140
                 $this->_per_page,
141 141
                 $view,
142 142
                 true,
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
             )
200 200
         ) {
201 201
             $actions['trash'] = '
202
-                <a href="' . $trash_lnk_url . '" 
203
-                   aria-label="' . esc_attr__('Move Template Group to Trash', 'event_espresso') . '"
202
+                <a href="' . $trash_lnk_url.'" 
203
+                   aria-label="' . esc_attr__('Move Template Group to Trash', 'event_espresso').'"
204 204
                 >
205
-                    ' . esc_html__('Move to Trash', 'event_espresso') . '
205
+                    ' . esc_html__('Move to Trash', 'event_espresso').'
206 206
                 </a>';
207 207
         } else {
208 208
             if (
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
                 )
214 214
             ) {
215 215
                 $actions['restore'] = '
216
-                    <a href="' . $restore_lnk_url . '" 
217
-                       aria-label="' . esc_attr__('Restore Message Template', 'event_espresso') . '"
216
+                    <a href="' . $restore_lnk_url.'" 
217
+                       aria-label="' . esc_attr__('Restore Message Template', 'event_espresso').'"
218 218
                     >
219
-                        ' . esc_html__('Restore', 'event_espresso') . '
219
+                        ' . esc_html__('Restore', 'event_espresso').'
220 220
                     </a>';
221 221
             }
222 222
 
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
                 )
230 230
             ) {
231 231
                 $actions['delete'] = '
232
-                    <a href="' . $delete_lnk_url . '" 
233
-                       aria-label="' . esc_attr__('Delete Template Group Permanently', 'event_espresso') . '"
232
+                    <a href="' . $delete_lnk_url.'" 
233
+                       aria-label="' . esc_attr__('Delete Template Group Permanently', 'event_espresso').'"
234 234
                     >
235
-                        ' . esc_html__('Delete Permanently', 'event_espresso') . '
235
+                        ' . esc_html__('Delete Permanently', 'event_espresso').'
236 236
                     </a>';
237 237
             }
238 238
         }
Please login to merge, or discard this patch.
admin/extend/registrations/Extend_EE_Registrations_List_Table.class.php 2 patches
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -12,117 +12,117 @@
 block discarded – undo
12 12
  */
13 13
 class Extend_EE_Registrations_List_Table extends EE_Registrations_List_Table
14 14
 {
15
-    /**
16
-     * @param EE_Registration $item
17
-     * @return string
18
-     * @throws EE_Error
19
-     * @throws InvalidArgumentException
20
-     * @throws ReflectionException
21
-     * @throws InvalidDataTypeException
22
-     * @throws InvalidInterfaceException
23
-     */
24
-    public function column__REG_date(EE_Registration $item)
25
-    {
26
-        $date_linked = parent::column__REG_date($item);
27
-        $actions = array();
28
-        // Build row actions
29
-        $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array(
30
-            'action'   => 'event_registrations',
31
-            'event_id' => $item->event_ID(),
32
-        ), REG_ADMIN_URL);
33
-        $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can(
34
-            'ee_read_registration',
35
-            'espresso_registrations_registration_checkins',
36
-            $item->ID()
37
-        ) && EE_Registry::instance()->CAP->current_user_can(
38
-            'ee_read_checkins',
39
-            'espresso_registrations_registration_checkins'
40
-        )
41
-            ? '<a href="' . $check_in_url . '"'
42
-              . ' aria-label="' . esc_attr__(
43
-                  'The Check-In List allows you to easily toggle check-in status for this event',
44
-                  'event_espresso'
45
-              )
46
-              . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>'
47
-            : esc_html__('View Check-ins', 'event_espresso');
15
+	/**
16
+	 * @param EE_Registration $item
17
+	 * @return string
18
+	 * @throws EE_Error
19
+	 * @throws InvalidArgumentException
20
+	 * @throws ReflectionException
21
+	 * @throws InvalidDataTypeException
22
+	 * @throws InvalidInterfaceException
23
+	 */
24
+	public function column__REG_date(EE_Registration $item)
25
+	{
26
+		$date_linked = parent::column__REG_date($item);
27
+		$actions = array();
28
+		// Build row actions
29
+		$check_in_url = EE_Admin_Page::add_query_args_and_nonce(array(
30
+			'action'   => 'event_registrations',
31
+			'event_id' => $item->event_ID(),
32
+		), REG_ADMIN_URL);
33
+		$actions['check_in'] = EE_Registry::instance()->CAP->current_user_can(
34
+			'ee_read_registration',
35
+			'espresso_registrations_registration_checkins',
36
+			$item->ID()
37
+		) && EE_Registry::instance()->CAP->current_user_can(
38
+			'ee_read_checkins',
39
+			'espresso_registrations_registration_checkins'
40
+		)
41
+			? '<a href="' . $check_in_url . '"'
42
+			  . ' aria-label="' . esc_attr__(
43
+				  'The Check-In List allows you to easily toggle check-in status for this event',
44
+				  'event_espresso'
45
+			  )
46
+			  . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>'
47
+			: esc_html__('View Check-ins', 'event_espresso');
48 48
 
49
-        return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions));
50
-    }
49
+		return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions));
50
+	}
51 51
 
52 52
 
53
-    /**
54
-     *        column_default
55
-     *
56
-     * @param \EE_Registration $item
57
-     * @return string
58
-     * @throws EE_Error
59
-     * @throws InvalidArgumentException
60
-     * @throws InvalidDataTypeException
61
-     * @throws InvalidInterfaceException
62
-     * @throws ReflectionException
63
-     */
64
-    public function column_DTT_EVT_start(EE_Registration $item)
65
-    {
66
-        $remove_defaults = array('default_where_conditions' => 'none');
67
-        $ticket = $item->ticket();
68
-        $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array();
69
-        $EVT_ID = $item->event_ID();
70
-        $datetimes_for_display = array();
71
-        foreach ($datetimes as $datetime) {
72
-            $datetime_string = '';
73
-            if (
74
-                EE_Registry::instance()->CAP->current_user_can(
75
-                    'ee_read_checkin',
76
-                    'espresso_registrations_registration_checkins',
77
-                    $item->ID()
78
-                )
79
-            ) {
80
-                // open "a" tag and "href"
81
-                $datetime_string .= '<a href="';
82
-                // checkin URL
83
-                $datetime_string .= EE_Admin_Page::add_query_args_and_nonce(
84
-                    array(
85
-                        'action'   => 'event_registrations',
86
-                        'event_id' => $EVT_ID,
87
-                        'DTT_ID'   => $datetime->ID(),
88
-                    ),
89
-                    REG_ADMIN_URL
90
-                );
91
-                // close "href"
92
-                $datetime_string .= '"';
93
-                // open "title" tag
94
-                $datetime_string .= ' aria-label="';
95
-                // link title text
96
-                $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso');
97
-                // close "title" tag and end of "a" tag opening
98
-                $datetime_string .= '">';
99
-                // link text
100
-                $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start');
101
-                // close "a" tag
102
-                $datetime_string .= '</a>';
103
-            } else {
104
-                $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start');
105
-            }
106
-            // add a "View Registrations" link that filters list by event AND datetime
107
-            $datetime_string .= $this->row_actions(
108
-                array(
109
-                    'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce(
110
-                        array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()),
111
-                        REG_ADMIN_URL
112
-                    )
113
-                                               . '" aria-label="' . sprintf(
114
-                                                   esc_attr__(
115
-                                                       'Filter this list to only show registrations for this datetime %s',
116
-                                                       'event_espresso'
117
-                                                   ),
118
-                                                   $datetime->name()
119
-                                               ) . '">'
120
-                                               . esc_html__('View Registrations', 'event_espresso')
121
-                                               . '</a>',
122
-                )
123
-            );
124
-            $datetimes_for_display[] = $datetime_string;
125
-        }
126
-        return $this->generateDisplayForDateTimes($datetimes_for_display);
127
-    }
53
+	/**
54
+	 *        column_default
55
+	 *
56
+	 * @param \EE_Registration $item
57
+	 * @return string
58
+	 * @throws EE_Error
59
+	 * @throws InvalidArgumentException
60
+	 * @throws InvalidDataTypeException
61
+	 * @throws InvalidInterfaceException
62
+	 * @throws ReflectionException
63
+	 */
64
+	public function column_DTT_EVT_start(EE_Registration $item)
65
+	{
66
+		$remove_defaults = array('default_where_conditions' => 'none');
67
+		$ticket = $item->ticket();
68
+		$datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array();
69
+		$EVT_ID = $item->event_ID();
70
+		$datetimes_for_display = array();
71
+		foreach ($datetimes as $datetime) {
72
+			$datetime_string = '';
73
+			if (
74
+				EE_Registry::instance()->CAP->current_user_can(
75
+					'ee_read_checkin',
76
+					'espresso_registrations_registration_checkins',
77
+					$item->ID()
78
+				)
79
+			) {
80
+				// open "a" tag and "href"
81
+				$datetime_string .= '<a href="';
82
+				// checkin URL
83
+				$datetime_string .= EE_Admin_Page::add_query_args_and_nonce(
84
+					array(
85
+						'action'   => 'event_registrations',
86
+						'event_id' => $EVT_ID,
87
+						'DTT_ID'   => $datetime->ID(),
88
+					),
89
+					REG_ADMIN_URL
90
+				);
91
+				// close "href"
92
+				$datetime_string .= '"';
93
+				// open "title" tag
94
+				$datetime_string .= ' aria-label="';
95
+				// link title text
96
+				$datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso');
97
+				// close "title" tag and end of "a" tag opening
98
+				$datetime_string .= '">';
99
+				// link text
100
+				$datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start');
101
+				// close "a" tag
102
+				$datetime_string .= '</a>';
103
+			} else {
104
+				$datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start');
105
+			}
106
+			// add a "View Registrations" link that filters list by event AND datetime
107
+			$datetime_string .= $this->row_actions(
108
+				array(
109
+					'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce(
110
+						array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()),
111
+						REG_ADMIN_URL
112
+					)
113
+											   . '" aria-label="' . sprintf(
114
+												   esc_attr__(
115
+													   'Filter this list to only show registrations for this datetime %s',
116
+													   'event_espresso'
117
+												   ),
118
+												   $datetime->name()
119
+											   ) . '">'
120
+											   . esc_html__('View Registrations', 'event_espresso')
121
+											   . '</a>',
122
+				)
123
+			);
124
+			$datetimes_for_display[] = $datetime_string;
125
+		}
126
+		return $this->generateDisplayForDateTimes($datetimes_for_display);
127
+	}
128 128
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
             'ee_read_checkins',
39 39
             'espresso_registrations_registration_checkins'
40 40
         )
41
-            ? '<a href="' . $check_in_url . '"'
42
-              . ' aria-label="' . esc_attr__(
41
+            ? '<a href="'.$check_in_url.'"'
42
+              . ' aria-label="'.esc_attr__(
43 43
                   'The Check-In List allows you to easily toggle check-in status for this event',
44 44
                   'event_espresso'
45 45
               )
46
-              . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>'
46
+              . '">'.esc_html__('View Check-ins', 'event_espresso').'</a>'
47 47
             : esc_html__('View Check-ins', 'event_espresso');
48 48
 
49 49
         return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions));
@@ -106,17 +106,17 @@  discard block
 block discarded – undo
106 106
             // add a "View Registrations" link that filters list by event AND datetime
107 107
             $datetime_string .= $this->row_actions(
108 108
                 array(
109
-                    'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce(
109
+                    'event_datetime_filter' => '<a href="'.EE_Admin_Page::add_query_args_and_nonce(
110 110
                         array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()),
111 111
                         REG_ADMIN_URL
112 112
                     )
113
-                                               . '" aria-label="' . sprintf(
113
+                                               . '" aria-label="'.sprintf(
114 114
                                                    esc_attr__(
115 115
                                                        'Filter this list to only show registrations for this datetime %s',
116 116
                                                        'event_espresso'
117 117
                                                    ),
118 118
                                                    $datetime->name()
119
-                                               ) . '">'
119
+                                               ).'">'
120 120
                                                . esc_html__('View Registrations', 'event_espresso')
121 121
                                                . '</a>',
122 122
                 )
Please login to merge, or discard this patch.
admin/extend/registrations/EE_Event_Registrations_List_Table.class.php 2 patches
Indentation   +571 added lines, -571 removed lines patch added patch discarded remove patch
@@ -13,580 +13,580 @@
 block discarded – undo
13 13
  */
14 14
 class EE_Event_Registrations_List_Table extends EE_Admin_List_Table
15 15
 {
16
-    /**
17
-     * @var Extend_Registrations_Admin_Page
18
-     */
19
-    protected $_admin_page;
20
-
21
-    /**
22
-     * This property will hold the related Datetimes on an event IF the event id is included in the request.
23
-     *
24
-     * @var EE_Datetime[]
25
-     */
26
-    protected $_dtts_for_event = [];
27
-
28
-
29
-    /**
30
-     * The event if one is specified in the request
31
-     *
32
-     * @var EE_Event
33
-     */
34
-    protected $_evt = null;
35
-
36
-
37
-    /**
38
-     * The DTT_ID if the current view has a specified datetime.
39
-     *
40
-     * @var int $_cur_dtt_id
41
-     */
42
-    protected $_cur_dtt_id = 0;
43
-
44
-    /**
45
-     * @var   array
46
-     * @since 4.10.31.p
47
-     */
48
-    protected $_status;
49
-
50
-
51
-    /**
52
-     * EE_Event_Registrations_List_Table constructor.
53
-     *
54
-     * @param Registrations_Admin_Page $admin_page
55
-     */
56
-    public function __construct($admin_page)
57
-    {
58
-        parent::__construct($admin_page);
59
-        $this->_status = $this->_admin_page->get_registration_status_array();
60
-    }
61
-
62
-
63
-    /**
64
-     * @throws EE_Error
65
-     */
66
-    protected function _setup_data()
67
-    {
68
-        $this->_data           = $this->_view !== 'trash'
69
-            ? $this->_admin_page->get_event_attendees($this->_per_page)
70
-            : $this->_admin_page->get_event_attendees($this->_per_page, false, true);
71
-        $this->_all_data_count = $this->_view !== 'trash'
72
-            ? $this->_admin_page->get_event_attendees($this->_per_page, true)
73
-            : $this->_admin_page->get_event_attendees($this->_per_page, true, true);
74
-    }
75
-
76
-
77
-    /**
78
-     * @throws ReflectionException
79
-     * @throws EE_Error
80
-     */
81
-    protected function _set_properties()
82
-    {
83
-        $return_url = $this->getReturnUrl();
84
-
85
-        $EVT_ID = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : 0;
86
-        $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
87
-
88
-        $this->_wp_list_args = [
89
-            'singular' => esc_html__('registrant', 'event_espresso'),
90
-            'plural'   => esc_html__('registrants', 'event_espresso'),
91
-            'ajax'     => true,
92
-            'screen'   => $this->_admin_page->get_current_screen()->id,
93
-        ];
94
-        $columns             = [];
95
-        // $columns['_Reg_Status'] = '';
96
-        $this->_columns = [
97
-            '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
98
-            'ATT_name'            => esc_html__('Registrant', 'event_espresso'),
99
-            'ATT_email'           => esc_html__('Email Address', 'event_espresso'),
100
-            'Event'               => esc_html__('Event', 'event_espresso'),
101
-            'PRC_name'            => esc_html__('TKT Option', 'event_espresso'),
102
-            '_REG_final_price'    => esc_html__('Price', 'event_espresso'),
103
-            'TXN_paid'            => esc_html__('Paid', 'event_espresso'),
104
-            'TXN_total'           => esc_html__('Total', 'event_espresso'),
105
-        ];
106
-        // Add/remove columns when an event has been selected
107
-        if (! empty($EVT_ID)) {
108
-            // Render a checkbox column
109
-            $columns['cb']              = '<input type="checkbox" />';
110
-            $this->_has_checkbox_column = true;
111
-            // Remove the 'Event' column
112
-            unset($this->_columns['Event']);
113
-        }
114
-        $this->_columns        = array_merge($columns, $this->_columns);
115
-        $this->_primary_column = '_REG_att_checked_in';
116
-
117
-        $csv_report = RegistrationsCsvReportParams::getRequestParams($return_url, $this->_req_data, $EVT_ID, $DTT_ID);
118
-        if (! empty($csv_report)) {
119
-            $this->_bottom_buttons['csv_reg_report'] = $csv_report;
120
-        }
121
-
122
-        $this->_sortable_columns = [
123
-            /**
124
-             * Allows users to change the default sort if they wish.
125
-             * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name.
126
-             *
127
-             * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to
128
-             * change the sorts on any list table involving registration contacts.  If you want to only change the filter
129
-             * for a specific list table you can use the provided reference to this object instance.
130
-             */
131
-            'ATT_name' => [
132
-                'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name',
133
-                true,
134
-                $this,
135
-            ]
136
-                ? ['ATT_lname' => true]
137
-                : ['ATT_fname' => true],
138
-            'Event'    => ['Event.EVT_name' => false],
139
-        ];
140
-        $this->_hidden_columns   = [];
141
-        $this->_evt              = EEM_Event::instance()->get_one_by_ID($EVT_ID);
142
-        $this->_dtts_for_event   = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : [];
143
-    }
144
-
145
-
146
-    /**
147
-     * @param EE_Registration $item
148
-     * @return string
149
-     */
150
-    protected function _get_row_class($item)
151
-    {
152
-        $class = parent::_get_row_class($item);
153
-        // add status class
154
-        $class .= ' ee-status-strip reg-status-' . $item->status_ID();
155
-        if ($this->_has_checkbox_column) {
156
-            $class .= ' has-checkbox-column';
157
-        }
158
-        return $class;
159
-    }
160
-
161
-
162
-    /**
163
-     * @return array
164
-     * @throws EE_Error
165
-     * @throws ReflectionException
166
-     */
167
-    protected function _get_table_filters()
168
-    {
169
-        $filters        = $where = [];
170
-        $current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0;
171
-        if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) {
172
-            // this means we don't have an event so let's setup a filter dropdown for all the events to select
173
-            // note possible capability restrictions
174
-            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
175
-                $where['status**'] = ['!=', 'private'];
176
-            }
177
-            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
178
-                $where['EVT_wp_user'] = get_current_user_id();
179
-            }
180
-            $events          = EEM_Event::instance()->get_all(
181
-                [
182
-                    $where,
183
-                    'order_by' => ['Datetime.DTT_EVT_start' => 'DESC'],
184
-                ]
185
-            );
186
-            $event_options[] = [
187
-                'id'   => 0,
188
-                'text' => esc_html__('To toggle Check-in status, select an event', 'event_espresso'),
189
-            ];
190
-            $checked         = 'checked';
191
-            /** @var EE_Event $event */
192
-            foreach ($events as $event) {
193
-                // any registrations for this event?
194
-                if (! $event->get_count_of_all_registrations()) {
195
-                    continue;
196
-                }
197
-                $event_options[] = [
198
-                    'id'    => $event->ID(),
199
-                    'text'  => apply_filters(
200
-                        'FHEE__EE_Event_Registrations___get_table_filters__event_name',
201
-                        $event->get('EVT_name'),
202
-                        $event
203
-                    ),
204
-                    'class' => $event->is_expired() ? 'ee-expired-event' : '',
205
-                ];
206
-                if ($event->ID() === $current_EVT_ID && $event->is_expired()) {
207
-                    $checked = '';
208
-                }
209
-            }
210
-            $event_filter = '<div class="ee-event-filter">';
211
-            $event_filter .= EEH_Form_Fields::select_input('event_id', $event_options, $current_EVT_ID);
212
-            $event_filter .= '<span class="ee-event-filter-toggle">';
213
-            $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> ';
214
-            $event_filter .= esc_html__('Hide Expired Events', 'event_espresso');
215
-            $event_filter .= '</span>';
216
-            $event_filter .= '</div>';
217
-            $filters[]    = $event_filter;
218
-        }
219
-        if (! empty($this->_dtts_for_event)) {
220
-            // DTT datetimes filter
221
-            $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
222
-            if (count($this->_dtts_for_event) > 1) {
223
-                $datetimes[0] = esc_html__('To toggle check-in status, select a datetime.', 'event_espresso');
224
-                foreach ($this->_dtts_for_event as $datetime) {
225
-                    $datetime_string              = $datetime->name();
226
-                    $datetime_string              = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
227
-                    $datetime_string              =
228
-                        $datetime->start_date_and_time() . ' - ' . $datetime->end_date_and_time() . $datetime_string;
229
-                    $datetimes[ $datetime->ID() ] = $datetime_string;
230
-                }
231
-                $input     = new EE_Select_Input(
232
-                    $datetimes,
233
-                    [
234
-                        'html_name' => 'DTT_ID',
235
-                        'html_id'   => 'DTT_ID',
236
-                        'default'   => $this->_cur_dtt_id,
237
-                    ]
238
-                );
239
-                $filters[] = $input->get_html_for_input();
240
-                $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">';
241
-            }
242
-        }
243
-        return $filters;
244
-    }
245
-
246
-
247
-    /**
248
-     * @throws EE_Error
249
-     */
250
-    protected function _add_view_counts()
251
-    {
252
-        $this->_views['all']['count'] = $this->_get_total_event_attendees();
253
-    }
254
-
255
-
256
-    /**
257
-     * @return int
258
-     * @throws EE_Error
259
-     */
260
-    protected function _get_total_event_attendees()
261
-    {
262
-        $EVT_ID       = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false;
263
-        $DTT_ID       = $this->_cur_dtt_id;
264
-        $query_params = [];
265
-        if ($EVT_ID) {
266
-            $query_params[0]['EVT_ID'] = $EVT_ID;
267
-        }
268
-        // if DTT is included we only show for that datetime.  Otherwise we're showing for all datetimes (the event).
269
-        if ($DTT_ID) {
270
-            $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
271
-        }
272
-        $status_ids_array          = apply_filters(
273
-            'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
274
-            [EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved]
275
-        );
276
-        $query_params[0]['STS_ID'] = ['IN', $status_ids_array];
277
-        return EEM_Registration::instance()->count($query_params);
278
-    }
279
-
280
-
281
-    /**
282
-     * @param EE_Registration $item
283
-     * @return string
284
-     */
285
-    public function column__Reg_Status(EE_Registration $item)
286
-    {
287
-        return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>';
288
-    }
289
-
290
-
291
-    /**
292
-     * @param EE_Registration $item
293
-     * @return string
294
-     * @throws EE_Error
295
-     * @throws ReflectionException
296
-     */
297
-    public function column_cb($item)
298
-    {
299
-        return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
300
-    }
301
-
302
-
303
-    /**
304
-     * column_REG_att_checked_in
305
-     *
306
-     * @param EE_Registration $item
307
-     * @return string
308
-     * @throws EE_Error
309
-     * @throws InvalidArgumentException
310
-     * @throws InvalidDataTypeException
311
-     * @throws InvalidInterfaceException
312
-     * @throws ReflectionException
313
-     */
314
-    public function column__REG_att_checked_in(EE_Registration $item)
315
-    {
316
-        $attendee      = $item->attendee();
317
-        $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
318
-
319
-        if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) {
320
-            $latest_related_datetime = $item->get_latest_related_datetime();
321
-            if ($latest_related_datetime instanceof EE_Datetime) {
322
-                $this->_cur_dtt_id = $latest_related_datetime->ID();
323
-            }
324
-        }
325
-        $checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId(
326
-            $item,
327
-            $this->_cur_dtt_id
328
-        );
329
-        $nonce         = wp_create_nonce('checkin_nonce');
330
-        $toggle_active = ! empty($this->_cur_dtt_id) && EE_Registry::instance()->CAP->current_user_can(
331
-            'ee_edit_checkin',
332
-            'espresso_registrations_toggle_checkin_status',
333
-            $item->ID()
334
-        )
335
-            ? ' clickable trigger-checkin'
336
-            : '';
337
-        $mobile_view_content     = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>';
338
-        return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"'
339
-               . ' data-_regid="' . $item->ID() . '"'
340
-               . ' data-dttid="' . $this->_cur_dtt_id . '"'
341
-               . ' data-nonce="' . $nonce . '">'
342
-               . '</span>'
343
-               . $mobile_view_content;
344
-    }
345
-
346
-
347
-    /**
348
-     * @param EE_Registration $item
349
-     * @return string
350
-     * @throws EE_Error
351
-     * @throws ReflectionException
352
-     */
353
-    public function column_ATT_name(EE_Registration $item)
354
-    {
355
-        $attendee = $item->attendee();
356
-        if (! $attendee instanceof EE_Attendee) {
357
-            return esc_html__('No contact record for this registration.', 'event_espresso');
358
-        }
359
-        // edit attendee link
360
-        $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
361
-            ['action' => 'view_registration', '_REG_ID' => $item->ID()],
362
-            REG_ADMIN_URL
363
-        );
364
-        $name_link    = EE_Registry::instance()->CAP->current_user_can(
365
-            'ee_edit_contacts',
366
-            'espresso_registrations_edit_attendee'
367
-        )
368
-            ? '<a href="'
369
-              . $edit_lnk_url
370
-              . '" aria-label="'
371
-              . esc_attr__('View Registration Details', 'event_espresso')
372
-              . '">'
373
-              . $item->attendee()->full_name()
374
-              . '</a>'
375
-            : $item->attendee()->full_name();
376
-        $name_link    .= $item->count() === 1
377
-            ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>	'
378
-            : '';
379
-        // add group details
380
-        $name_link .= '&nbsp;' . sprintf(
381
-            esc_html__('(%s of %s)', 'event_espresso'),
382
-            $item->count(),
383
-            $item->group_size()
384
-        );
385
-        // add regcode
386
-        $link      = EE_Admin_Page::add_query_args_and_nonce(
387
-            ['action' => 'view_registration', '_REG_ID' => $item->ID()],
388
-            REG_ADMIN_URL
389
-        );
390
-        $name_link .= '<br>';
391
-        $name_link .= EE_Registry::instance()->instance()->CAP->current_user_can(
392
-            'ee_read_registration',
393
-            'view_registration',
394
-            $item->ID()
395
-        )
396
-            ? '<a href="' . $link . '" aria-label="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
397
-              . $item->reg_code()
398
-              . '</a>'
399
-            : $item->reg_code();
400
-        // status
401
-        $name_link               .= '<br><span class="ee-status-text-small">';
402
-        $name_link               .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence');
403
-        $name_link               .= '</span>';
404
-        $actions                 = [];
405
-        $DTT_ID                  = $this->_cur_dtt_id;
406
-        $latest_related_datetime =
407
-            empty($DTT_ID) && ! empty($this->_req_data['event_id'])
408
-                ? $item->get_latest_related_datetime()
409
-                : null;
410
-        $DTT_ID                  = $latest_related_datetime instanceof EE_Datetime
411
-            ? $latest_related_datetime->ID()
412
-            : $DTT_ID;
413
-        if (
414
-            ! empty($DTT_ID)
415
-            && EE_Registry::instance()->CAP->current_user_can(
416
-                'ee_read_checkins',
417
-                'espresso_registrations_registration_checkins'
418
-            )
419
-        ) {
420
-            $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(
421
-                ['action' => 'registration_checkins', '_REG_ID' => $item->ID(), 'DTT_ID' => $DTT_ID],
422
-                REG_ADMIN_URL
423
-            );
424
-            // get the timestamps for this registration's checkins, related to the selected datetime
425
-            $timestamps = $item->get_many_related('Checkin', [['DTT_ID' => $DTT_ID]]);
426
-            if (! empty($timestamps)) {
427
-                // get the last timestamp
428
-                $last_timestamp = end($timestamps);
429
-                // checked in or checked out?
430
-                $checkin_status = $last_timestamp->get('CHK_in')
431
-                    ? esc_html__('Checked In', 'event_espresso')
432
-                    : esc_html__('Checked Out', 'event_espresso');
433
-                // get timestamp string
434
-                $timestamp_string   = $last_timestamp->get_datetime('CHK_timestamp');
435
-                $actions['checkin'] = '<a href="' . $checkin_list_url . '" aria-label="'
436
-                                      . esc_attr__(
437
-                                          'View this registrant\'s check-ins/checkouts for the datetime',
438
-                                          'event_espresso'
439
-                                      ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>';
440
-            }
441
-        }
442
-        return (! empty($DTT_ID) && ! empty($timestamps))
443
-            ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
444
-            : $name_link;
445
-    }
446
-
447
-
448
-    /**
449
-     * @param EE_Registration $item
450
-     * @return string
451
-     * @throws EE_Error
452
-     * @throws EE_Error
453
-     */
454
-    public function column_ATT_email(EE_Registration $item)
455
-    {
456
-        $attendee = $item->attendee();
457
-        return $attendee instanceof EE_Attendee ? $attendee->email() : '';
458
-    }
459
-
460
-
461
-    /**
462
-     * @param EE_Registration $item
463
-     * @return bool|string
464
-     * @throws EE_Error
465
-     * @throws ReflectionException
466
-     */
467
-    public function column_Event(EE_Registration $item)
468
-    {
469
-        try {
470
-            $event         = $this->_evt instanceof EE_Event ? $this->_evt : $item->event();
471
-            $chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
472
-                ['action' => 'event_registrations', 'event_id' => $event->ID()],
473
-                REG_ADMIN_URL
474
-            );
475
-            $event_label   = EE_Registry::instance()->CAP->current_user_can(
476
-                'ee_read_checkins',
477
-                'espresso_registrations_registration_checkins'
478
-            ) ? '<a href="' . $chkin_lnk_url . '" aria-label="'
479
-                . esc_attr__(
480
-                    'View Checkins for this Event',
481
-                    'event_espresso'
482
-                ) . '">' . $event->name() . '</a>' : $event->name();
483
-        } catch (EntityNotFoundException $e) {
484
-            $event_label = esc_html__('Unknown', 'event_espresso');
485
-        }
486
-        return $event_label;
487
-    }
488
-
489
-
490
-    /**
491
-     * @param EE_Registration $item
492
-     * @return string
493
-     * @throws EE_Error
494
-     * @throws ReflectionException
495
-     */
496
-    public function column_PRC_name(EE_Registration $item)
497
-    {
498
-        return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : esc_html__("Unknown", "event_espresso");
499
-    }
500
-
501
-
502
-    /**
503
-     * column_REG_final_price
504
-     *
505
-     * @param EE_Registration $item
506
-     * @return string
507
-     * @throws EE_Error
508
-     * @throws EE_Error
509
-     */
510
-    public function column__REG_final_price(EE_Registration $item)
511
-    {
512
-        return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>';
513
-    }
514
-
515
-
516
-    /**
517
-     * column_TXN_paid
518
-     *
519
-     * @param EE_Registration $item
520
-     * @return string
521
-     * @throws EE_Error
522
-     * @throws ReflectionException
523
-     */
524
-    public function column_TXN_paid(EE_Registration $item)
525
-    {
526
-        if ($item->count() === 1) {
527
-            if ($item->transaction()->paid() >= $item->transaction()->total()) {
528
-                return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
529
-            } else {
530
-                $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
531
-                    ['action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()],
532
-                    TXN_ADMIN_URL
533
-                );
534
-                return EE_Registry::instance()->CAP->current_user_can(
535
-                    'ee_read_transaction',
536
-                    'espresso_transactions_view_transaction'
537
-                ) ? '
16
+	/**
17
+	 * @var Extend_Registrations_Admin_Page
18
+	 */
19
+	protected $_admin_page;
20
+
21
+	/**
22
+	 * This property will hold the related Datetimes on an event IF the event id is included in the request.
23
+	 *
24
+	 * @var EE_Datetime[]
25
+	 */
26
+	protected $_dtts_for_event = [];
27
+
28
+
29
+	/**
30
+	 * The event if one is specified in the request
31
+	 *
32
+	 * @var EE_Event
33
+	 */
34
+	protected $_evt = null;
35
+
36
+
37
+	/**
38
+	 * The DTT_ID if the current view has a specified datetime.
39
+	 *
40
+	 * @var int $_cur_dtt_id
41
+	 */
42
+	protected $_cur_dtt_id = 0;
43
+
44
+	/**
45
+	 * @var   array
46
+	 * @since 4.10.31.p
47
+	 */
48
+	protected $_status;
49
+
50
+
51
+	/**
52
+	 * EE_Event_Registrations_List_Table constructor.
53
+	 *
54
+	 * @param Registrations_Admin_Page $admin_page
55
+	 */
56
+	public function __construct($admin_page)
57
+	{
58
+		parent::__construct($admin_page);
59
+		$this->_status = $this->_admin_page->get_registration_status_array();
60
+	}
61
+
62
+
63
+	/**
64
+	 * @throws EE_Error
65
+	 */
66
+	protected function _setup_data()
67
+	{
68
+		$this->_data           = $this->_view !== 'trash'
69
+			? $this->_admin_page->get_event_attendees($this->_per_page)
70
+			: $this->_admin_page->get_event_attendees($this->_per_page, false, true);
71
+		$this->_all_data_count = $this->_view !== 'trash'
72
+			? $this->_admin_page->get_event_attendees($this->_per_page, true)
73
+			: $this->_admin_page->get_event_attendees($this->_per_page, true, true);
74
+	}
75
+
76
+
77
+	/**
78
+	 * @throws ReflectionException
79
+	 * @throws EE_Error
80
+	 */
81
+	protected function _set_properties()
82
+	{
83
+		$return_url = $this->getReturnUrl();
84
+
85
+		$EVT_ID = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : 0;
86
+		$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
87
+
88
+		$this->_wp_list_args = [
89
+			'singular' => esc_html__('registrant', 'event_espresso'),
90
+			'plural'   => esc_html__('registrants', 'event_espresso'),
91
+			'ajax'     => true,
92
+			'screen'   => $this->_admin_page->get_current_screen()->id,
93
+		];
94
+		$columns             = [];
95
+		// $columns['_Reg_Status'] = '';
96
+		$this->_columns = [
97
+			'_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
98
+			'ATT_name'            => esc_html__('Registrant', 'event_espresso'),
99
+			'ATT_email'           => esc_html__('Email Address', 'event_espresso'),
100
+			'Event'               => esc_html__('Event', 'event_espresso'),
101
+			'PRC_name'            => esc_html__('TKT Option', 'event_espresso'),
102
+			'_REG_final_price'    => esc_html__('Price', 'event_espresso'),
103
+			'TXN_paid'            => esc_html__('Paid', 'event_espresso'),
104
+			'TXN_total'           => esc_html__('Total', 'event_espresso'),
105
+		];
106
+		// Add/remove columns when an event has been selected
107
+		if (! empty($EVT_ID)) {
108
+			// Render a checkbox column
109
+			$columns['cb']              = '<input type="checkbox" />';
110
+			$this->_has_checkbox_column = true;
111
+			// Remove the 'Event' column
112
+			unset($this->_columns['Event']);
113
+		}
114
+		$this->_columns        = array_merge($columns, $this->_columns);
115
+		$this->_primary_column = '_REG_att_checked_in';
116
+
117
+		$csv_report = RegistrationsCsvReportParams::getRequestParams($return_url, $this->_req_data, $EVT_ID, $DTT_ID);
118
+		if (! empty($csv_report)) {
119
+			$this->_bottom_buttons['csv_reg_report'] = $csv_report;
120
+		}
121
+
122
+		$this->_sortable_columns = [
123
+			/**
124
+			 * Allows users to change the default sort if they wish.
125
+			 * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name.
126
+			 *
127
+			 * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to
128
+			 * change the sorts on any list table involving registration contacts.  If you want to only change the filter
129
+			 * for a specific list table you can use the provided reference to this object instance.
130
+			 */
131
+			'ATT_name' => [
132
+				'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name',
133
+				true,
134
+				$this,
135
+			]
136
+				? ['ATT_lname' => true]
137
+				: ['ATT_fname' => true],
138
+			'Event'    => ['Event.EVT_name' => false],
139
+		];
140
+		$this->_hidden_columns   = [];
141
+		$this->_evt              = EEM_Event::instance()->get_one_by_ID($EVT_ID);
142
+		$this->_dtts_for_event   = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : [];
143
+	}
144
+
145
+
146
+	/**
147
+	 * @param EE_Registration $item
148
+	 * @return string
149
+	 */
150
+	protected function _get_row_class($item)
151
+	{
152
+		$class = parent::_get_row_class($item);
153
+		// add status class
154
+		$class .= ' ee-status-strip reg-status-' . $item->status_ID();
155
+		if ($this->_has_checkbox_column) {
156
+			$class .= ' has-checkbox-column';
157
+		}
158
+		return $class;
159
+	}
160
+
161
+
162
+	/**
163
+	 * @return array
164
+	 * @throws EE_Error
165
+	 * @throws ReflectionException
166
+	 */
167
+	protected function _get_table_filters()
168
+	{
169
+		$filters        = $where = [];
170
+		$current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0;
171
+		if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) {
172
+			// this means we don't have an event so let's setup a filter dropdown for all the events to select
173
+			// note possible capability restrictions
174
+			if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
175
+				$where['status**'] = ['!=', 'private'];
176
+			}
177
+			if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
178
+				$where['EVT_wp_user'] = get_current_user_id();
179
+			}
180
+			$events          = EEM_Event::instance()->get_all(
181
+				[
182
+					$where,
183
+					'order_by' => ['Datetime.DTT_EVT_start' => 'DESC'],
184
+				]
185
+			);
186
+			$event_options[] = [
187
+				'id'   => 0,
188
+				'text' => esc_html__('To toggle Check-in status, select an event', 'event_espresso'),
189
+			];
190
+			$checked         = 'checked';
191
+			/** @var EE_Event $event */
192
+			foreach ($events as $event) {
193
+				// any registrations for this event?
194
+				if (! $event->get_count_of_all_registrations()) {
195
+					continue;
196
+				}
197
+				$event_options[] = [
198
+					'id'    => $event->ID(),
199
+					'text'  => apply_filters(
200
+						'FHEE__EE_Event_Registrations___get_table_filters__event_name',
201
+						$event->get('EVT_name'),
202
+						$event
203
+					),
204
+					'class' => $event->is_expired() ? 'ee-expired-event' : '',
205
+				];
206
+				if ($event->ID() === $current_EVT_ID && $event->is_expired()) {
207
+					$checked = '';
208
+				}
209
+			}
210
+			$event_filter = '<div class="ee-event-filter">';
211
+			$event_filter .= EEH_Form_Fields::select_input('event_id', $event_options, $current_EVT_ID);
212
+			$event_filter .= '<span class="ee-event-filter-toggle">';
213
+			$event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> ';
214
+			$event_filter .= esc_html__('Hide Expired Events', 'event_espresso');
215
+			$event_filter .= '</span>';
216
+			$event_filter .= '</div>';
217
+			$filters[]    = $event_filter;
218
+		}
219
+		if (! empty($this->_dtts_for_event)) {
220
+			// DTT datetimes filter
221
+			$this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
222
+			if (count($this->_dtts_for_event) > 1) {
223
+				$datetimes[0] = esc_html__('To toggle check-in status, select a datetime.', 'event_espresso');
224
+				foreach ($this->_dtts_for_event as $datetime) {
225
+					$datetime_string              = $datetime->name();
226
+					$datetime_string              = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
227
+					$datetime_string              =
228
+						$datetime->start_date_and_time() . ' - ' . $datetime->end_date_and_time() . $datetime_string;
229
+					$datetimes[ $datetime->ID() ] = $datetime_string;
230
+				}
231
+				$input     = new EE_Select_Input(
232
+					$datetimes,
233
+					[
234
+						'html_name' => 'DTT_ID',
235
+						'html_id'   => 'DTT_ID',
236
+						'default'   => $this->_cur_dtt_id,
237
+					]
238
+				);
239
+				$filters[] = $input->get_html_for_input();
240
+				$filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">';
241
+			}
242
+		}
243
+		return $filters;
244
+	}
245
+
246
+
247
+	/**
248
+	 * @throws EE_Error
249
+	 */
250
+	protected function _add_view_counts()
251
+	{
252
+		$this->_views['all']['count'] = $this->_get_total_event_attendees();
253
+	}
254
+
255
+
256
+	/**
257
+	 * @return int
258
+	 * @throws EE_Error
259
+	 */
260
+	protected function _get_total_event_attendees()
261
+	{
262
+		$EVT_ID       = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false;
263
+		$DTT_ID       = $this->_cur_dtt_id;
264
+		$query_params = [];
265
+		if ($EVT_ID) {
266
+			$query_params[0]['EVT_ID'] = $EVT_ID;
267
+		}
268
+		// if DTT is included we only show for that datetime.  Otherwise we're showing for all datetimes (the event).
269
+		if ($DTT_ID) {
270
+			$query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
271
+		}
272
+		$status_ids_array          = apply_filters(
273
+			'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
274
+			[EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved]
275
+		);
276
+		$query_params[0]['STS_ID'] = ['IN', $status_ids_array];
277
+		return EEM_Registration::instance()->count($query_params);
278
+	}
279
+
280
+
281
+	/**
282
+	 * @param EE_Registration $item
283
+	 * @return string
284
+	 */
285
+	public function column__Reg_Status(EE_Registration $item)
286
+	{
287
+		return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>';
288
+	}
289
+
290
+
291
+	/**
292
+	 * @param EE_Registration $item
293
+	 * @return string
294
+	 * @throws EE_Error
295
+	 * @throws ReflectionException
296
+	 */
297
+	public function column_cb($item)
298
+	{
299
+		return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
300
+	}
301
+
302
+
303
+	/**
304
+	 * column_REG_att_checked_in
305
+	 *
306
+	 * @param EE_Registration $item
307
+	 * @return string
308
+	 * @throws EE_Error
309
+	 * @throws InvalidArgumentException
310
+	 * @throws InvalidDataTypeException
311
+	 * @throws InvalidInterfaceException
312
+	 * @throws ReflectionException
313
+	 */
314
+	public function column__REG_att_checked_in(EE_Registration $item)
315
+	{
316
+		$attendee      = $item->attendee();
317
+		$attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
318
+
319
+		if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) {
320
+			$latest_related_datetime = $item->get_latest_related_datetime();
321
+			if ($latest_related_datetime instanceof EE_Datetime) {
322
+				$this->_cur_dtt_id = $latest_related_datetime->ID();
323
+			}
324
+		}
325
+		$checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId(
326
+			$item,
327
+			$this->_cur_dtt_id
328
+		);
329
+		$nonce         = wp_create_nonce('checkin_nonce');
330
+		$toggle_active = ! empty($this->_cur_dtt_id) && EE_Registry::instance()->CAP->current_user_can(
331
+			'ee_edit_checkin',
332
+			'espresso_registrations_toggle_checkin_status',
333
+			$item->ID()
334
+		)
335
+			? ' clickable trigger-checkin'
336
+			: '';
337
+		$mobile_view_content     = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>';
338
+		return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"'
339
+			   . ' data-_regid="' . $item->ID() . '"'
340
+			   . ' data-dttid="' . $this->_cur_dtt_id . '"'
341
+			   . ' data-nonce="' . $nonce . '">'
342
+			   . '</span>'
343
+			   . $mobile_view_content;
344
+	}
345
+
346
+
347
+	/**
348
+	 * @param EE_Registration $item
349
+	 * @return string
350
+	 * @throws EE_Error
351
+	 * @throws ReflectionException
352
+	 */
353
+	public function column_ATT_name(EE_Registration $item)
354
+	{
355
+		$attendee = $item->attendee();
356
+		if (! $attendee instanceof EE_Attendee) {
357
+			return esc_html__('No contact record for this registration.', 'event_espresso');
358
+		}
359
+		// edit attendee link
360
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
361
+			['action' => 'view_registration', '_REG_ID' => $item->ID()],
362
+			REG_ADMIN_URL
363
+		);
364
+		$name_link    = EE_Registry::instance()->CAP->current_user_can(
365
+			'ee_edit_contacts',
366
+			'espresso_registrations_edit_attendee'
367
+		)
368
+			? '<a href="'
369
+			  . $edit_lnk_url
370
+			  . '" aria-label="'
371
+			  . esc_attr__('View Registration Details', 'event_espresso')
372
+			  . '">'
373
+			  . $item->attendee()->full_name()
374
+			  . '</a>'
375
+			: $item->attendee()->full_name();
376
+		$name_link    .= $item->count() === 1
377
+			? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>	'
378
+			: '';
379
+		// add group details
380
+		$name_link .= '&nbsp;' . sprintf(
381
+			esc_html__('(%s of %s)', 'event_espresso'),
382
+			$item->count(),
383
+			$item->group_size()
384
+		);
385
+		// add regcode
386
+		$link      = EE_Admin_Page::add_query_args_and_nonce(
387
+			['action' => 'view_registration', '_REG_ID' => $item->ID()],
388
+			REG_ADMIN_URL
389
+		);
390
+		$name_link .= '<br>';
391
+		$name_link .= EE_Registry::instance()->instance()->CAP->current_user_can(
392
+			'ee_read_registration',
393
+			'view_registration',
394
+			$item->ID()
395
+		)
396
+			? '<a href="' . $link . '" aria-label="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
397
+			  . $item->reg_code()
398
+			  . '</a>'
399
+			: $item->reg_code();
400
+		// status
401
+		$name_link               .= '<br><span class="ee-status-text-small">';
402
+		$name_link               .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence');
403
+		$name_link               .= '</span>';
404
+		$actions                 = [];
405
+		$DTT_ID                  = $this->_cur_dtt_id;
406
+		$latest_related_datetime =
407
+			empty($DTT_ID) && ! empty($this->_req_data['event_id'])
408
+				? $item->get_latest_related_datetime()
409
+				: null;
410
+		$DTT_ID                  = $latest_related_datetime instanceof EE_Datetime
411
+			? $latest_related_datetime->ID()
412
+			: $DTT_ID;
413
+		if (
414
+			! empty($DTT_ID)
415
+			&& EE_Registry::instance()->CAP->current_user_can(
416
+				'ee_read_checkins',
417
+				'espresso_registrations_registration_checkins'
418
+			)
419
+		) {
420
+			$checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(
421
+				['action' => 'registration_checkins', '_REG_ID' => $item->ID(), 'DTT_ID' => $DTT_ID],
422
+				REG_ADMIN_URL
423
+			);
424
+			// get the timestamps for this registration's checkins, related to the selected datetime
425
+			$timestamps = $item->get_many_related('Checkin', [['DTT_ID' => $DTT_ID]]);
426
+			if (! empty($timestamps)) {
427
+				// get the last timestamp
428
+				$last_timestamp = end($timestamps);
429
+				// checked in or checked out?
430
+				$checkin_status = $last_timestamp->get('CHK_in')
431
+					? esc_html__('Checked In', 'event_espresso')
432
+					: esc_html__('Checked Out', 'event_espresso');
433
+				// get timestamp string
434
+				$timestamp_string   = $last_timestamp->get_datetime('CHK_timestamp');
435
+				$actions['checkin'] = '<a href="' . $checkin_list_url . '" aria-label="'
436
+									  . esc_attr__(
437
+										  'View this registrant\'s check-ins/checkouts for the datetime',
438
+										  'event_espresso'
439
+									  ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>';
440
+			}
441
+		}
442
+		return (! empty($DTT_ID) && ! empty($timestamps))
443
+			? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
444
+			: $name_link;
445
+	}
446
+
447
+
448
+	/**
449
+	 * @param EE_Registration $item
450
+	 * @return string
451
+	 * @throws EE_Error
452
+	 * @throws EE_Error
453
+	 */
454
+	public function column_ATT_email(EE_Registration $item)
455
+	{
456
+		$attendee = $item->attendee();
457
+		return $attendee instanceof EE_Attendee ? $attendee->email() : '';
458
+	}
459
+
460
+
461
+	/**
462
+	 * @param EE_Registration $item
463
+	 * @return bool|string
464
+	 * @throws EE_Error
465
+	 * @throws ReflectionException
466
+	 */
467
+	public function column_Event(EE_Registration $item)
468
+	{
469
+		try {
470
+			$event         = $this->_evt instanceof EE_Event ? $this->_evt : $item->event();
471
+			$chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
472
+				['action' => 'event_registrations', 'event_id' => $event->ID()],
473
+				REG_ADMIN_URL
474
+			);
475
+			$event_label   = EE_Registry::instance()->CAP->current_user_can(
476
+				'ee_read_checkins',
477
+				'espresso_registrations_registration_checkins'
478
+			) ? '<a href="' . $chkin_lnk_url . '" aria-label="'
479
+				. esc_attr__(
480
+					'View Checkins for this Event',
481
+					'event_espresso'
482
+				) . '">' . $event->name() . '</a>' : $event->name();
483
+		} catch (EntityNotFoundException $e) {
484
+			$event_label = esc_html__('Unknown', 'event_espresso');
485
+		}
486
+		return $event_label;
487
+	}
488
+
489
+
490
+	/**
491
+	 * @param EE_Registration $item
492
+	 * @return string
493
+	 * @throws EE_Error
494
+	 * @throws ReflectionException
495
+	 */
496
+	public function column_PRC_name(EE_Registration $item)
497
+	{
498
+		return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : esc_html__("Unknown", "event_espresso");
499
+	}
500
+
501
+
502
+	/**
503
+	 * column_REG_final_price
504
+	 *
505
+	 * @param EE_Registration $item
506
+	 * @return string
507
+	 * @throws EE_Error
508
+	 * @throws EE_Error
509
+	 */
510
+	public function column__REG_final_price(EE_Registration $item)
511
+	{
512
+		return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>';
513
+	}
514
+
515
+
516
+	/**
517
+	 * column_TXN_paid
518
+	 *
519
+	 * @param EE_Registration $item
520
+	 * @return string
521
+	 * @throws EE_Error
522
+	 * @throws ReflectionException
523
+	 */
524
+	public function column_TXN_paid(EE_Registration $item)
525
+	{
526
+		if ($item->count() === 1) {
527
+			if ($item->transaction()->paid() >= $item->transaction()->total()) {
528
+				return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
529
+			} else {
530
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
531
+					['action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()],
532
+					TXN_ADMIN_URL
533
+				);
534
+				return EE_Registry::instance()->CAP->current_user_can(
535
+					'ee_read_transaction',
536
+					'espresso_transactions_view_transaction'
537
+				) ? '
538 538
 				<span class="reg-pad-rght">
539 539
 					<a class="status-'
540
-                    . $item->transaction()->status_ID()
541
-                    . '" href="'
542
-                    . $view_txn_lnk_url
543
-                    . '"  aria-label="'
544
-                    . esc_attr__('View Transaction', 'event_espresso')
545
-                    . '">
540
+					. $item->transaction()->status_ID()
541
+					. '" href="'
542
+					. $view_txn_lnk_url
543
+					. '"  aria-label="'
544
+					. esc_attr__('View Transaction', 'event_espresso')
545
+					. '">
546 546
 						'
547
-                    . $item->transaction()->pretty_paid()
548
-                    . '
547
+					. $item->transaction()->pretty_paid()
548
+					. '
549 549
 					</a>
550 550
 				<span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
551
-            }
552
-        } else {
553
-            return '<span class="reg-pad-rght"></span>';
554
-        }
555
-    }
556
-
557
-
558
-    /**
559
-     *        column_TXN_total
560
-     *
561
-     * @param EE_Registration $item
562
-     * @return string
563
-     * @throws EE_Error
564
-     * @throws ReflectionException
565
-     */
566
-    public function column_TXN_total(EE_Registration $item)
567
-    {
568
-        $txn          = $item->transaction();
569
-        $view_txn_url = add_query_arg(['action' => 'view_transaction', 'TXN_ID' => $txn->ID()], TXN_ADMIN_URL);
570
-        if ($item->get('REG_count') === 1) {
571
-            $line_total_obj = $txn->total_line_item();
572
-            $txn_total      = $line_total_obj instanceof EE_Line_Item
573
-                ? $line_total_obj->get_pretty('LIN_total')
574
-                : esc_html__(
575
-                    'View Transaction',
576
-                    'event_espresso'
577
-                );
578
-            return EE_Registry::instance()->CAP->current_user_can(
579
-                'ee_read_transaction',
580
-                'espresso_transactions_view_transaction'
581
-            ) ? '<a href="'
582
-                . $view_txn_url
583
-                . '" aria-label="'
584
-                . esc_attr__('View Transaction', 'event_espresso')
585
-                . '"><span class="reg-pad-rght">'
586
-                . $txn_total
587
-                . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>';
588
-        } else {
589
-            return '<span class="reg-pad-rght"></span>';
590
-        }
591
-    }
551
+			}
552
+		} else {
553
+			return '<span class="reg-pad-rght"></span>';
554
+		}
555
+	}
556
+
557
+
558
+	/**
559
+	 *        column_TXN_total
560
+	 *
561
+	 * @param EE_Registration $item
562
+	 * @return string
563
+	 * @throws EE_Error
564
+	 * @throws ReflectionException
565
+	 */
566
+	public function column_TXN_total(EE_Registration $item)
567
+	{
568
+		$txn          = $item->transaction();
569
+		$view_txn_url = add_query_arg(['action' => 'view_transaction', 'TXN_ID' => $txn->ID()], TXN_ADMIN_URL);
570
+		if ($item->get('REG_count') === 1) {
571
+			$line_total_obj = $txn->total_line_item();
572
+			$txn_total      = $line_total_obj instanceof EE_Line_Item
573
+				? $line_total_obj->get_pretty('LIN_total')
574
+				: esc_html__(
575
+					'View Transaction',
576
+					'event_espresso'
577
+				);
578
+			return EE_Registry::instance()->CAP->current_user_can(
579
+				'ee_read_transaction',
580
+				'espresso_transactions_view_transaction'
581
+			) ? '<a href="'
582
+				. $view_txn_url
583
+				. '" aria-label="'
584
+				. esc_attr__('View Transaction', 'event_espresso')
585
+				. '"><span class="reg-pad-rght">'
586
+				. $txn_total
587
+				. '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>';
588
+		} else {
589
+			return '<span class="reg-pad-rght"></span>';
590
+		}
591
+	}
592 592
 }
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             'ajax'     => true,
92 92
             'screen'   => $this->_admin_page->get_current_screen()->id,
93 93
         ];
94
-        $columns             = [];
94
+        $columns = [];
95 95
         // $columns['_Reg_Status'] = '';
96 96
         $this->_columns = [
97 97
             '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             'TXN_total'           => esc_html__('Total', 'event_espresso'),
105 105
         ];
106 106
         // Add/remove columns when an event has been selected
107
-        if (! empty($EVT_ID)) {
107
+        if ( ! empty($EVT_ID)) {
108 108
             // Render a checkbox column
109 109
             $columns['cb']              = '<input type="checkbox" />';
110 110
             $this->_has_checkbox_column = true;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $this->_primary_column = '_REG_att_checked_in';
116 116
 
117 117
         $csv_report = RegistrationsCsvReportParams::getRequestParams($return_url, $this->_req_data, $EVT_ID, $DTT_ID);
118
-        if (! empty($csv_report)) {
118
+        if ( ! empty($csv_report)) {
119 119
             $this->_bottom_buttons['csv_reg_report'] = $csv_report;
120 120
         }
121 121
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         $class = parent::_get_row_class($item);
153 153
         // add status class
154
-        $class .= ' ee-status-strip reg-status-' . $item->status_ID();
154
+        $class .= ' ee-status-strip reg-status-'.$item->status_ID();
155 155
         if ($this->_has_checkbox_column) {
156 156
             $class .= ' has-checkbox-column';
157 157
         }
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
         if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) {
172 172
             // this means we don't have an event so let's setup a filter dropdown for all the events to select
173 173
             // note possible capability restrictions
174
-            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
174
+            if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
175 175
                 $where['status**'] = ['!=', 'private'];
176 176
             }
177
-            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
177
+            if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
178 178
                 $where['EVT_wp_user'] = get_current_user_id();
179 179
             }
180
-            $events          = EEM_Event::instance()->get_all(
180
+            $events = EEM_Event::instance()->get_all(
181 181
                 [
182 182
                     $where,
183 183
                     'order_by' => ['Datetime.DTT_EVT_start' => 'DESC'],
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
                 'id'   => 0,
188 188
                 'text' => esc_html__('To toggle Check-in status, select an event', 'event_espresso'),
189 189
             ];
190
-            $checked         = 'checked';
190
+            $checked = 'checked';
191 191
             /** @var EE_Event $event */
192 192
             foreach ($events as $event) {
193 193
                 // any registrations for this event?
194
-                if (! $event->get_count_of_all_registrations()) {
194
+                if ( ! $event->get_count_of_all_registrations()) {
195 195
                     continue;
196 196
                 }
197 197
                 $event_options[] = [
@@ -210,25 +210,25 @@  discard block
 block discarded – undo
210 210
             $event_filter = '<div class="ee-event-filter">';
211 211
             $event_filter .= EEH_Form_Fields::select_input('event_id', $event_options, $current_EVT_ID);
212 212
             $event_filter .= '<span class="ee-event-filter-toggle">';
213
-            $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> ';
213
+            $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" '.$checked.'> ';
214 214
             $event_filter .= esc_html__('Hide Expired Events', 'event_espresso');
215 215
             $event_filter .= '</span>';
216 216
             $event_filter .= '</div>';
217
-            $filters[]    = $event_filter;
217
+            $filters[] = $event_filter;
218 218
         }
219
-        if (! empty($this->_dtts_for_event)) {
219
+        if ( ! empty($this->_dtts_for_event)) {
220 220
             // DTT datetimes filter
221 221
             $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
222 222
             if (count($this->_dtts_for_event) > 1) {
223 223
                 $datetimes[0] = esc_html__('To toggle check-in status, select a datetime.', 'event_espresso');
224 224
                 foreach ($this->_dtts_for_event as $datetime) {
225 225
                     $datetime_string              = $datetime->name();
226
-                    $datetime_string              = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
226
+                    $datetime_string              = ! empty($datetime_string) ? ' ('.$datetime_string.')' : '';
227 227
                     $datetime_string              =
228
-                        $datetime->start_date_and_time() . ' - ' . $datetime->end_date_and_time() . $datetime_string;
229
-                    $datetimes[ $datetime->ID() ] = $datetime_string;
228
+                        $datetime->start_date_and_time().' - '.$datetime->end_date_and_time().$datetime_string;
229
+                    $datetimes[$datetime->ID()] = $datetime_string;
230 230
                 }
231
-                $input     = new EE_Select_Input(
231
+                $input = new EE_Select_Input(
232 232
                     $datetimes,
233 233
                     [
234 234
                         'html_name' => 'DTT_ID',
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                     ]
238 238
                 );
239 239
                 $filters[] = $input->get_html_for_input();
240
-                $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">';
240
+                $filters[] = '<input type="hidden" name="event_id" value="'.$current_EVT_ID.'">';
241 241
             }
242 242
         }
243 243
         return $filters;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         if ($DTT_ID) {
270 270
             $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
271 271
         }
272
-        $status_ids_array          = apply_filters(
272
+        $status_ids_array = apply_filters(
273 273
             'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
274 274
             [EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved]
275 275
         );
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      */
285 285
     public function column__Reg_Status(EE_Registration $item)
286 286
     {
287
-        return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>';
287
+        return '<span class="ee-status-strip ee-status-strip-td reg-status-'.$item->status_ID().'"></span>';
288 288
     }
289 289
 
290 290
 
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
         )
335 335
             ? ' clickable trigger-checkin'
336 336
             : '';
337
-        $mobile_view_content     = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>';
338
-        return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"'
339
-               . ' data-_regid="' . $item->ID() . '"'
340
-               . ' data-dttid="' . $this->_cur_dtt_id . '"'
341
-               . ' data-nonce="' . $nonce . '">'
337
+        $mobile_view_content = ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>';
338
+        return '<span class="'.$checkin_status_dashicon->cssClasses().$toggle_active.'"'
339
+               . ' data-_regid="'.$item->ID().'"'
340
+               . ' data-dttid="'.$this->_cur_dtt_id.'"'
341
+               . ' data-nonce="'.$nonce.'">'
342 342
                . '</span>'
343 343
                . $mobile_view_content;
344 344
     }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     public function column_ATT_name(EE_Registration $item)
354 354
     {
355 355
         $attendee = $item->attendee();
356
-        if (! $attendee instanceof EE_Attendee) {
356
+        if ( ! $attendee instanceof EE_Attendee) {
357 357
             return esc_html__('No contact record for this registration.', 'event_espresso');
358 358
         }
359 359
         // edit attendee link
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
             ['action' => 'view_registration', '_REG_ID' => $item->ID()],
362 362
             REG_ADMIN_URL
363 363
         );
364
-        $name_link    = EE_Registry::instance()->CAP->current_user_can(
364
+        $name_link = EE_Registry::instance()->CAP->current_user_can(
365 365
             'ee_edit_contacts',
366 366
             'espresso_registrations_edit_attendee'
367 367
         )
@@ -373,17 +373,17 @@  discard block
 block discarded – undo
373 373
               . $item->attendee()->full_name()
374 374
               . '</a>'
375 375
             : $item->attendee()->full_name();
376
-        $name_link    .= $item->count() === 1
376
+        $name_link .= $item->count() === 1
377 377
             ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>	'
378 378
             : '';
379 379
         // add group details
380
-        $name_link .= '&nbsp;' . sprintf(
380
+        $name_link .= '&nbsp;'.sprintf(
381 381
             esc_html__('(%s of %s)', 'event_espresso'),
382 382
             $item->count(),
383 383
             $item->group_size()
384 384
         );
385 385
         // add regcode
386
-        $link      = EE_Admin_Page::add_query_args_and_nonce(
386
+        $link = EE_Admin_Page::add_query_args_and_nonce(
387 387
             ['action' => 'view_registration', '_REG_ID' => $item->ID()],
388 388
             REG_ADMIN_URL
389 389
         );
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
             'view_registration',
394 394
             $item->ID()
395 395
         )
396
-            ? '<a href="' . $link . '" aria-label="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
396
+            ? '<a href="'.$link.'" aria-label="'.esc_attr__('View Registration Details', 'event_espresso').'">'
397 397
               . $item->reg_code()
398 398
               . '</a>'
399 399
             : $item->reg_code();
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             empty($DTT_ID) && ! empty($this->_req_data['event_id'])
408 408
                 ? $item->get_latest_related_datetime()
409 409
                 : null;
410
-        $DTT_ID                  = $latest_related_datetime instanceof EE_Datetime
410
+        $DTT_ID = $latest_related_datetime instanceof EE_Datetime
411 411
             ? $latest_related_datetime->ID()
412 412
             : $DTT_ID;
413 413
         if (
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
             );
424 424
             // get the timestamps for this registration's checkins, related to the selected datetime
425 425
             $timestamps = $item->get_many_related('Checkin', [['DTT_ID' => $DTT_ID]]);
426
-            if (! empty($timestamps)) {
426
+            if ( ! empty($timestamps)) {
427 427
                 // get the last timestamp
428 428
                 $last_timestamp = end($timestamps);
429 429
                 // checked in or checked out?
@@ -432,14 +432,14 @@  discard block
 block discarded – undo
432 432
                     : esc_html__('Checked Out', 'event_espresso');
433 433
                 // get timestamp string
434 434
                 $timestamp_string   = $last_timestamp->get_datetime('CHK_timestamp');
435
-                $actions['checkin'] = '<a href="' . $checkin_list_url . '" aria-label="'
435
+                $actions['checkin'] = '<a href="'.$checkin_list_url.'" aria-label="'
436 436
                                       . esc_attr__(
437 437
                                           'View this registrant\'s check-ins/checkouts for the datetime',
438 438
                                           'event_espresso'
439
-                                      ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>';
439
+                                      ).'">'.$checkin_status.': '.$timestamp_string.'</a>';
440 440
             }
441 441
         }
442
-        return (! empty($DTT_ID) && ! empty($timestamps))
442
+        return ( ! empty($DTT_ID) && ! empty($timestamps))
443 443
             ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
444 444
             : $name_link;
445 445
     }
@@ -472,14 +472,14 @@  discard block
 block discarded – undo
472 472
                 ['action' => 'event_registrations', 'event_id' => $event->ID()],
473 473
                 REG_ADMIN_URL
474 474
             );
475
-            $event_label   = EE_Registry::instance()->CAP->current_user_can(
475
+            $event_label = EE_Registry::instance()->CAP->current_user_can(
476 476
                 'ee_read_checkins',
477 477
                 'espresso_registrations_registration_checkins'
478
-            ) ? '<a href="' . $chkin_lnk_url . '" aria-label="'
478
+            ) ? '<a href="'.$chkin_lnk_url.'" aria-label="'
479 479
                 . esc_attr__(
480 480
                     'View Checkins for this Event',
481 481
                     'event_espresso'
482
-                ) . '">' . $event->name() . '</a>' : $event->name();
482
+                ).'">'.$event->name().'</a>' : $event->name();
483 483
         } catch (EntityNotFoundException $e) {
484 484
             $event_label = esc_html__('Unknown', 'event_espresso');
485 485
         }
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
      */
510 510
     public function column__REG_final_price(EE_Registration $item)
511 511
     {
512
-        return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>';
512
+        return '<span class="reg-pad-rght">'.' '.$item->pretty_final_price().'</span>';
513 513
     }
514 514
 
515 515
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
                     . $item->transaction()->pretty_paid()
548 548
                     . '
549 549
 					</a>
550
-				<span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
550
+				<span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>';
551 551
             }
552 552
         } else {
553 553
             return '<span class="reg-pad-rght"></span>';
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
                 . esc_attr__('View Transaction', 'event_espresso')
585 585
                 . '"><span class="reg-pad-rght">'
586 586
                 . $txn_total
587
-                . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>';
587
+                . '</span></a>' : '<span class="reg-pad-rght">'.$txn_total.'</span>';
588 588
         } else {
589 589
             return '<span class="reg-pad-rght"></span>';
590 590
         }
Please login to merge, or discard this patch.
admin/extend/registrations/EE_Registration_CheckIn_List_Table.class.php 2 patches
Indentation   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -17,228 +17,228 @@
 block discarded – undo
17 17
  */
18 18
 class EE_Registration_CheckIn_List_Table extends EE_Admin_List_Table
19 19
 {
20
-    /**
21
-     * EE_Registration_CheckIn_List_Table constructor.
22
-     *
23
-     * @param EE_Admin_Page $admin_page
24
-     */
25
-    public function __construct($admin_page)
26
-    {
27
-        parent::__construct($admin_page);
28
-    }
29
-
30
-
31
-    /**
32
-     * @throws EE_Error
33
-     */
34
-    protected function _setup_data()
35
-    {
36
-        $this->_data = $this->_get_checkins($this->_per_page);
37
-        $this->_all_data_count = $this->_get_checkins($this->_per_page, true);
38
-    }
39
-
40
-
41
-    /**
42
-     * Sets up the properties for the list table.
43
-     */
44
-    protected function _set_properties()
45
-    {
46
-        $this->_wp_list_args = array(
47
-            'singular' => esc_html__('check-in', 'event_espresso'),
48
-            'plural'   => esc_html__('check-ins', 'event_espresso'),
49
-            'ajax'     => true,
50
-            'screen'   => $this->_admin_page->get_current_screen()->id,
51
-        );
52
-
53
-        $this->_columns = array(
54
-            'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text
55
-            'CHK_in'        => esc_html__('Check-In', 'event_espresso'),
56
-            'CHK_timestamp' => esc_html__('Timestamp', 'event_espresso'),
57
-        );
58
-
59
-        $this->_sortable_columns = array(
60
-            'CHK_timestamp' => array('CHK_timestamp' => true),
61
-        );
62
-
63
-        $this->_primary_column = 'CHK_in';
64
-
65
-        $this->_hidden_columns = array();
66
-    }
67
-
68
-
69
-    /**
70
-     * @return array
71
-     */
72
-    protected function _get_table_filters()
73
-    {
74
-        return [];
75
-    }
76
-
77
-
78
-    /**
79
-     * Returning an empty string to remove the search box for this view.
80
-     *
81
-     * @param string $text
82
-     * @param string $input_id
83
-     * @return string
84
-     */
85
-    public function search_box($text, $input_id)
86
-    {
87
-        return '';
88
-    }
89
-
90
-
91
-    /**
92
-     * @throws EE_Error
93
-     */
94
-    protected function _add_view_counts()
95
-    {
96
-        $this->_views['all']['count'] = $this->_get_checkins(null, true);
97
-    }
98
-
99
-
100
-    /**
101
-     * @param EE_Checkin $item
102
-     * @return string
103
-     * @throws EE_Error
104
-     * @throws InvalidArgumentException
105
-     * @throws ReflectionException
106
-     * @throws InvalidDataTypeException
107
-     * @throws InvalidInterfaceException
108
-     */
109
-    public function column_cb($item)
110
-    {
111
-        return sprintf('<input type="checkbox" name="checkbox[%1$s]" />', $item->ID());
112
-    }
113
-
114
-
115
-    /**
116
-     * @param EE_Checkin $item
117
-     * @return string
118
-     * @throws EE_Error
119
-     * @throws InvalidArgumentException
120
-     * @throws InvalidDataTypeException
121
-     * @throws InvalidInterfaceException
122
-     * @throws ReflectionException
123
-     */
124
-    public function column_CHK_in(EE_Checkin $item)
125
-    {
126
-        $checkin_status_dashicon = CheckinStatusDashicon::fromCheckin($item);
127
-        return '<span class="'
128
-               . $checkin_status_dashicon->cssClasses()
129
-               . '"></span><span class="show-on-mobile-view-only">'
130
-               . $item->get_datetime('CHK_timestamp')
131
-               . '</span>';
132
-    }
133
-
134
-
135
-    /**
136
-     * @param EE_Checkin $item
137
-     * @return string
138
-     * @throws EE_Error
139
-     * @throws InvalidArgumentException
140
-     * @throws InvalidDataTypeException
141
-     * @throws InvalidInterfaceException
142
-     * @throws ReflectionException
143
-     */
144
-    public function column_CHK_timestamp(EE_Checkin $item)
145
-    {
146
-        $actions = array();
147
-        $delete_url = EE_Admin_Page::add_query_args_and_nonce(
148
-            array(
149
-                'action'  => 'delete_checkin_row',
150
-                'DTT_ID'  => $this->_req_data['DTT_ID'],
151
-                '_REG_ID' => $this->_req_data['_REG_ID'],
152
-                'CHK_ID'  => $item->ID(),
153
-            )
154
-        );
155
-        $actions['delete_checkin'] = EE_Registry::instance()->CAP->current_user_can(
156
-            'ee_delete_checkins',
157
-            'espresso_registrations_delete_checkin_row'
158
-        )
159
-            ? '<a href="' . $delete_url . '" aria-label="'
160
-              . esc_attr__('Click here to delete this check-in record', 'event_espresso') . '">'
161
-              . esc_html__('Delete', 'event_espresso') . '</a>'
162
-            : '';
163
-
164
-        return sprintf(
165
-            '%1$s %2$s',
166
-            $item->get_datetime('CHK_timestamp', '', 'H:i:s a'),
167
-            $this->row_actions($actions)
168
-        );
169
-    }
170
-
171
-
172
-    /**
173
-     * This retrieves all the Check-ins for the given parameters.
174
-     * experimenting with having the query for the table values within the list table.
175
-     *
176
-     * @param int  $per_page How many to retrieve per page
177
-     * @param bool $count    Whether to return a count or not
178
-     * @return EE_Checkin[]|int
179
-     * @throws EE_Error
180
-     * @throws InvalidArgumentException
181
-     * @throws InvalidDataTypeException
182
-     * @throws InvalidInterfaceException
183
-     */
184
-    protected function _get_checkins($per_page = 10, $count = false)
185
-    {
186
-        $REG_ID = isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : false;
187
-        $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : false;
188
-
189
-        // if user does not have the capability for the checkins for this registration then get out!
190
-        if (
191
-            ! EE_Registry::instance()->CAP->current_user_can(
192
-                'ee_read_checkin',
193
-                'espresso_registrations_registration_checkins',
194
-                $REG_ID
195
-            )
196
-        ) {
197
-            return $count ? 0 : array();
198
-        }
199
-
200
-        // if no reg id then get out cause need a reg id
201
-        if (empty($REG_ID) || empty($DTT_ID)) {
202
-            throw new EE_Error(
203
-                esc_html__(
204
-                    'This route cannot be viewed unless registration and datetime IDs are included in the request (via REG_ID and DTT_ID parameters)',
205
-                    'event_espresso'
206
-                )
207
-            );
208
-        }
209
-
210
-        // set orderby
211
-        // note that with this table we're only providing the option to orderby the timestamp value.
212
-        $orderby = 'CHK_timestamp';
213
-
214
-        $order = ! empty($this->_req_data['order']) ? $this->_req_data['order'] : 'ASC';
215
-
216
-        $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged'])
217
-            ? $this->_req_data['paged']
218
-            : 1;
219
-        $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage'])
220
-            ? $this->_req_data['perpage']
221
-            : $per_page;
222
-        $limit = null;
223
-        if (! $count) {
224
-            $offset = ($current_page - 1) * $per_page;
225
-            $limit = array($offset, $per_page);
226
-        }
227
-
228
-        $_where = array(
229
-            'REG_ID' => $REG_ID,
230
-            'DTT_ID' => $DTT_ID,
231
-        );
232
-
233
-        $query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit);
234
-
235
-        // if no per_page value then we just want to return a count of all Check-ins
236
-        if ($count) {
237
-            return EEM_Checkin::instance()->count(array($_where));
238
-        }
239
-
240
-        return $count
241
-            ? EEM_Checkin::instance()->count(array($_where))
242
-            : EEM_Checkin::instance()->get_all($query_params);
243
-    }
20
+	/**
21
+	 * EE_Registration_CheckIn_List_Table constructor.
22
+	 *
23
+	 * @param EE_Admin_Page $admin_page
24
+	 */
25
+	public function __construct($admin_page)
26
+	{
27
+		parent::__construct($admin_page);
28
+	}
29
+
30
+
31
+	/**
32
+	 * @throws EE_Error
33
+	 */
34
+	protected function _setup_data()
35
+	{
36
+		$this->_data = $this->_get_checkins($this->_per_page);
37
+		$this->_all_data_count = $this->_get_checkins($this->_per_page, true);
38
+	}
39
+
40
+
41
+	/**
42
+	 * Sets up the properties for the list table.
43
+	 */
44
+	protected function _set_properties()
45
+	{
46
+		$this->_wp_list_args = array(
47
+			'singular' => esc_html__('check-in', 'event_espresso'),
48
+			'plural'   => esc_html__('check-ins', 'event_espresso'),
49
+			'ajax'     => true,
50
+			'screen'   => $this->_admin_page->get_current_screen()->id,
51
+		);
52
+
53
+		$this->_columns = array(
54
+			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text
55
+			'CHK_in'        => esc_html__('Check-In', 'event_espresso'),
56
+			'CHK_timestamp' => esc_html__('Timestamp', 'event_espresso'),
57
+		);
58
+
59
+		$this->_sortable_columns = array(
60
+			'CHK_timestamp' => array('CHK_timestamp' => true),
61
+		);
62
+
63
+		$this->_primary_column = 'CHK_in';
64
+
65
+		$this->_hidden_columns = array();
66
+	}
67
+
68
+
69
+	/**
70
+	 * @return array
71
+	 */
72
+	protected function _get_table_filters()
73
+	{
74
+		return [];
75
+	}
76
+
77
+
78
+	/**
79
+	 * Returning an empty string to remove the search box for this view.
80
+	 *
81
+	 * @param string $text
82
+	 * @param string $input_id
83
+	 * @return string
84
+	 */
85
+	public function search_box($text, $input_id)
86
+	{
87
+		return '';
88
+	}
89
+
90
+
91
+	/**
92
+	 * @throws EE_Error
93
+	 */
94
+	protected function _add_view_counts()
95
+	{
96
+		$this->_views['all']['count'] = $this->_get_checkins(null, true);
97
+	}
98
+
99
+
100
+	/**
101
+	 * @param EE_Checkin $item
102
+	 * @return string
103
+	 * @throws EE_Error
104
+	 * @throws InvalidArgumentException
105
+	 * @throws ReflectionException
106
+	 * @throws InvalidDataTypeException
107
+	 * @throws InvalidInterfaceException
108
+	 */
109
+	public function column_cb($item)
110
+	{
111
+		return sprintf('<input type="checkbox" name="checkbox[%1$s]" />', $item->ID());
112
+	}
113
+
114
+
115
+	/**
116
+	 * @param EE_Checkin $item
117
+	 * @return string
118
+	 * @throws EE_Error
119
+	 * @throws InvalidArgumentException
120
+	 * @throws InvalidDataTypeException
121
+	 * @throws InvalidInterfaceException
122
+	 * @throws ReflectionException
123
+	 */
124
+	public function column_CHK_in(EE_Checkin $item)
125
+	{
126
+		$checkin_status_dashicon = CheckinStatusDashicon::fromCheckin($item);
127
+		return '<span class="'
128
+			   . $checkin_status_dashicon->cssClasses()
129
+			   . '"></span><span class="show-on-mobile-view-only">'
130
+			   . $item->get_datetime('CHK_timestamp')
131
+			   . '</span>';
132
+	}
133
+
134
+
135
+	/**
136
+	 * @param EE_Checkin $item
137
+	 * @return string
138
+	 * @throws EE_Error
139
+	 * @throws InvalidArgumentException
140
+	 * @throws InvalidDataTypeException
141
+	 * @throws InvalidInterfaceException
142
+	 * @throws ReflectionException
143
+	 */
144
+	public function column_CHK_timestamp(EE_Checkin $item)
145
+	{
146
+		$actions = array();
147
+		$delete_url = EE_Admin_Page::add_query_args_and_nonce(
148
+			array(
149
+				'action'  => 'delete_checkin_row',
150
+				'DTT_ID'  => $this->_req_data['DTT_ID'],
151
+				'_REG_ID' => $this->_req_data['_REG_ID'],
152
+				'CHK_ID'  => $item->ID(),
153
+			)
154
+		);
155
+		$actions['delete_checkin'] = EE_Registry::instance()->CAP->current_user_can(
156
+			'ee_delete_checkins',
157
+			'espresso_registrations_delete_checkin_row'
158
+		)
159
+			? '<a href="' . $delete_url . '" aria-label="'
160
+			  . esc_attr__('Click here to delete this check-in record', 'event_espresso') . '">'
161
+			  . esc_html__('Delete', 'event_espresso') . '</a>'
162
+			: '';
163
+
164
+		return sprintf(
165
+			'%1$s %2$s',
166
+			$item->get_datetime('CHK_timestamp', '', 'H:i:s a'),
167
+			$this->row_actions($actions)
168
+		);
169
+	}
170
+
171
+
172
+	/**
173
+	 * This retrieves all the Check-ins for the given parameters.
174
+	 * experimenting with having the query for the table values within the list table.
175
+	 *
176
+	 * @param int  $per_page How many to retrieve per page
177
+	 * @param bool $count    Whether to return a count or not
178
+	 * @return EE_Checkin[]|int
179
+	 * @throws EE_Error
180
+	 * @throws InvalidArgumentException
181
+	 * @throws InvalidDataTypeException
182
+	 * @throws InvalidInterfaceException
183
+	 */
184
+	protected function _get_checkins($per_page = 10, $count = false)
185
+	{
186
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : false;
187
+		$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : false;
188
+
189
+		// if user does not have the capability for the checkins for this registration then get out!
190
+		if (
191
+			! EE_Registry::instance()->CAP->current_user_can(
192
+				'ee_read_checkin',
193
+				'espresso_registrations_registration_checkins',
194
+				$REG_ID
195
+			)
196
+		) {
197
+			return $count ? 0 : array();
198
+		}
199
+
200
+		// if no reg id then get out cause need a reg id
201
+		if (empty($REG_ID) || empty($DTT_ID)) {
202
+			throw new EE_Error(
203
+				esc_html__(
204
+					'This route cannot be viewed unless registration and datetime IDs are included in the request (via REG_ID and DTT_ID parameters)',
205
+					'event_espresso'
206
+				)
207
+			);
208
+		}
209
+
210
+		// set orderby
211
+		// note that with this table we're only providing the option to orderby the timestamp value.
212
+		$orderby = 'CHK_timestamp';
213
+
214
+		$order = ! empty($this->_req_data['order']) ? $this->_req_data['order'] : 'ASC';
215
+
216
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged'])
217
+			? $this->_req_data['paged']
218
+			: 1;
219
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage'])
220
+			? $this->_req_data['perpage']
221
+			: $per_page;
222
+		$limit = null;
223
+		if (! $count) {
224
+			$offset = ($current_page - 1) * $per_page;
225
+			$limit = array($offset, $per_page);
226
+		}
227
+
228
+		$_where = array(
229
+			'REG_ID' => $REG_ID,
230
+			'DTT_ID' => $DTT_ID,
231
+		);
232
+
233
+		$query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit);
234
+
235
+		// if no per_page value then we just want to return a count of all Check-ins
236
+		if ($count) {
237
+			return EEM_Checkin::instance()->count(array($_where));
238
+		}
239
+
240
+		return $count
241
+			? EEM_Checkin::instance()->count(array($_where))
242
+			: EEM_Checkin::instance()->get_all($query_params);
243
+	}
244 244
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
             'ee_delete_checkins',
157 157
             'espresso_registrations_delete_checkin_row'
158 158
         )
159
-            ? '<a href="' . $delete_url . '" aria-label="'
160
-              . esc_attr__('Click here to delete this check-in record', 'event_espresso') . '">'
161
-              . esc_html__('Delete', 'event_espresso') . '</a>'
159
+            ? '<a href="'.$delete_url.'" aria-label="'
160
+              . esc_attr__('Click here to delete this check-in record', 'event_espresso').'">'
161
+              . esc_html__('Delete', 'event_espresso').'</a>'
162 162
             : '';
163 163
 
164 164
         return sprintf(
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             ? $this->_req_data['perpage']
221 221
             : $per_page;
222 222
         $limit = null;
223
-        if (! $count) {
223
+        if ( ! $count) {
224 224
             $offset = ($current_page - 1) * $per_page;
225 225
             $limit = array($offset, $per_page);
226 226
         }
Please login to merge, or discard this patch.
admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 2 patches
Indentation   +1218 added lines, -1218 removed lines patch added patch discarded remove patch
@@ -14,1276 +14,1276 @@
 block discarded – undo
14 14
  */
15 15
 class Extend_Registrations_Admin_Page extends Registrations_Admin_Page
16 16
 {
17
-    /**
18
-     * This is used to hold the reports template data which is setup early in the request.
19
-     *
20
-     * @type array
21
-     */
22
-    protected $_reports_template_data = array();
17
+	/**
18
+	 * This is used to hold the reports template data which is setup early in the request.
19
+	 *
20
+	 * @type array
21
+	 */
22
+	protected $_reports_template_data = array();
23 23
 
24 24
 
25
-    /**
26
-     * Extend_Registrations_Admin_Page constructor.
27
-     *
28
-     * @param bool $routing
29
-     */
30
-    public function __construct($routing = true)
31
-    {
32
-        parent::__construct($routing);
33
-        if (! defined('REG_CAF_TEMPLATE_PATH')) {
34
-            define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
35
-            define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
36
-            define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
37
-        }
38
-    }
25
+	/**
26
+	 * Extend_Registrations_Admin_Page constructor.
27
+	 *
28
+	 * @param bool $routing
29
+	 */
30
+	public function __construct($routing = true)
31
+	{
32
+		parent::__construct($routing);
33
+		if (! defined('REG_CAF_TEMPLATE_PATH')) {
34
+			define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
35
+			define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
36
+			define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
37
+		}
38
+	}
39 39
 
40 40
 
41
-    /**
42
-     * Extending page configuration.
43
-     */
44
-    protected function _extend_page_config()
45
-    {
46
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
47
-        $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID'])
48
-            ? $this->_req_data['_REG_ID']
49
-            : 0;
50
-        $new_page_routes = array(
51
-            'reports'                      => array(
52
-                'func'       => '_registration_reports',
53
-                'capability' => 'ee_read_registrations',
54
-            ),
55
-            'registration_checkins'        => array(
56
-                'func'       => '_registration_checkin_list_table',
57
-                'capability' => 'ee_read_checkins',
58
-            ),
59
-            'newsletter_selected_send'     => array(
60
-                'func'       => '_newsletter_selected_send',
61
-                'noheader'   => true,
62
-                'capability' => 'ee_send_message',
63
-            ),
64
-            'delete_checkin_rows'          => array(
65
-                'func'       => '_delete_checkin_rows',
66
-                'noheader'   => true,
67
-                'capability' => 'ee_delete_checkins',
68
-            ),
69
-            'delete_checkin_row'           => array(
70
-                'func'       => '_delete_checkin_row',
71
-                'noheader'   => true,
72
-                'capability' => 'ee_delete_checkin',
73
-                'obj_id'     => $reg_id,
74
-            ),
75
-            'toggle_checkin_status'        => array(
76
-                'func'       => '_toggle_checkin_status',
77
-                'noheader'   => true,
78
-                'capability' => 'ee_edit_checkin',
79
-                'obj_id'     => $reg_id,
80
-            ),
81
-            'toggle_checkin_status_bulk'   => array(
82
-                'func'       => '_toggle_checkin_status',
83
-                'noheader'   => true,
84
-                'capability' => 'ee_edit_checkins',
85
-            ),
86
-            'event_registrations'          => array(
87
-                'func'       => '_event_registrations_list_table',
88
-                'capability' => 'ee_read_checkins',
89
-            ),
90
-            'registrations_checkin_report' => array(
91
-                'func'       => '_registrations_checkin_report',
92
-                'noheader'   => true,
93
-                'capability' => 'ee_read_registrations',
94
-            ),
95
-        );
96
-        $this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
97
-        $new_page_config = array(
98
-            'reports'               => array(
99
-                'nav'           => array(
100
-                    'label' => esc_html__('Reports', 'event_espresso'),
101
-                    'order' => 30,
102
-                ),
103
-                'help_tabs'     => array(
104
-                    'registrations_reports_help_tab' => array(
105
-                        'title'    => esc_html__('Registration Reports', 'event_espresso'),
106
-                        'filename' => 'registrations_reports',
107
-                    ),
108
-                ),
109
-                'require_nonce' => false,
110
-            ),
111
-            'event_registrations'   => array(
112
-                'nav'           => array(
113
-                    'label'      => esc_html__('Event Check-In', 'event_espresso'),
114
-                    'order'      => 10,
115
-                    'persistent' => true,
116
-                ),
117
-                'help_tabs'     => array(
118
-                    'registrations_event_checkin_help_tab'                       => array(
119
-                        'title'    => esc_html__('Registrations Event Check-In', 'event_espresso'),
120
-                        'filename' => 'registrations_event_checkin',
121
-                    ),
122
-                    'registrations_event_checkin_table_column_headings_help_tab' => array(
123
-                        'title'    => esc_html__('Event Check-In Table Column Headings', 'event_espresso'),
124
-                        'filename' => 'registrations_event_checkin_table_column_headings',
125
-                    ),
126
-                    'registrations_event_checkin_filters_help_tab'               => array(
127
-                        'title'    => esc_html__('Event Check-In Filters', 'event_espresso'),
128
-                        'filename' => 'registrations_event_checkin_filters',
129
-                    ),
130
-                    'registrations_event_checkin_views_help_tab'                 => array(
131
-                        'title'    => esc_html__('Event Check-In Views', 'event_espresso'),
132
-                        'filename' => 'registrations_event_checkin_views',
133
-                    ),
134
-                    'registrations_event_checkin_other_help_tab'                 => array(
135
-                        'title'    => esc_html__('Event Check-In Other', 'event_espresso'),
136
-                        'filename' => 'registrations_event_checkin_other',
137
-                    ),
138
-                ),
139
-                'qtips'         => array('Registration_List_Table_Tips'),
140
-                'list_table'    => 'EE_Event_Registrations_List_Table',
141
-                'metaboxes'     => array(),
142
-                'require_nonce' => false,
143
-            ),
144
-            'registration_checkins' => array(
145
-                'nav'           => array(
146
-                    'label'      => esc_html__('Check-In Records', 'event_espresso'),
147
-                    'order'      => 15,
148
-                    'persistent' => false,
149
-                    'url'        => '',
150
-                ),
151
-                'list_table'    => 'EE_Registration_CheckIn_List_Table',
152
-                'metaboxes'     => array(),
153
-                'require_nonce' => false,
154
-            ),
155
-        );
156
-        $this->_page_config = array_merge($this->_page_config, $new_page_config);
157
-        $this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table';
158
-        $this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table';
159
-    }
41
+	/**
42
+	 * Extending page configuration.
43
+	 */
44
+	protected function _extend_page_config()
45
+	{
46
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
47
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID'])
48
+			? $this->_req_data['_REG_ID']
49
+			: 0;
50
+		$new_page_routes = array(
51
+			'reports'                      => array(
52
+				'func'       => '_registration_reports',
53
+				'capability' => 'ee_read_registrations',
54
+			),
55
+			'registration_checkins'        => array(
56
+				'func'       => '_registration_checkin_list_table',
57
+				'capability' => 'ee_read_checkins',
58
+			),
59
+			'newsletter_selected_send'     => array(
60
+				'func'       => '_newsletter_selected_send',
61
+				'noheader'   => true,
62
+				'capability' => 'ee_send_message',
63
+			),
64
+			'delete_checkin_rows'          => array(
65
+				'func'       => '_delete_checkin_rows',
66
+				'noheader'   => true,
67
+				'capability' => 'ee_delete_checkins',
68
+			),
69
+			'delete_checkin_row'           => array(
70
+				'func'       => '_delete_checkin_row',
71
+				'noheader'   => true,
72
+				'capability' => 'ee_delete_checkin',
73
+				'obj_id'     => $reg_id,
74
+			),
75
+			'toggle_checkin_status'        => array(
76
+				'func'       => '_toggle_checkin_status',
77
+				'noheader'   => true,
78
+				'capability' => 'ee_edit_checkin',
79
+				'obj_id'     => $reg_id,
80
+			),
81
+			'toggle_checkin_status_bulk'   => array(
82
+				'func'       => '_toggle_checkin_status',
83
+				'noheader'   => true,
84
+				'capability' => 'ee_edit_checkins',
85
+			),
86
+			'event_registrations'          => array(
87
+				'func'       => '_event_registrations_list_table',
88
+				'capability' => 'ee_read_checkins',
89
+			),
90
+			'registrations_checkin_report' => array(
91
+				'func'       => '_registrations_checkin_report',
92
+				'noheader'   => true,
93
+				'capability' => 'ee_read_registrations',
94
+			),
95
+		);
96
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
97
+		$new_page_config = array(
98
+			'reports'               => array(
99
+				'nav'           => array(
100
+					'label' => esc_html__('Reports', 'event_espresso'),
101
+					'order' => 30,
102
+				),
103
+				'help_tabs'     => array(
104
+					'registrations_reports_help_tab' => array(
105
+						'title'    => esc_html__('Registration Reports', 'event_espresso'),
106
+						'filename' => 'registrations_reports',
107
+					),
108
+				),
109
+				'require_nonce' => false,
110
+			),
111
+			'event_registrations'   => array(
112
+				'nav'           => array(
113
+					'label'      => esc_html__('Event Check-In', 'event_espresso'),
114
+					'order'      => 10,
115
+					'persistent' => true,
116
+				),
117
+				'help_tabs'     => array(
118
+					'registrations_event_checkin_help_tab'                       => array(
119
+						'title'    => esc_html__('Registrations Event Check-In', 'event_espresso'),
120
+						'filename' => 'registrations_event_checkin',
121
+					),
122
+					'registrations_event_checkin_table_column_headings_help_tab' => array(
123
+						'title'    => esc_html__('Event Check-In Table Column Headings', 'event_espresso'),
124
+						'filename' => 'registrations_event_checkin_table_column_headings',
125
+					),
126
+					'registrations_event_checkin_filters_help_tab'               => array(
127
+						'title'    => esc_html__('Event Check-In Filters', 'event_espresso'),
128
+						'filename' => 'registrations_event_checkin_filters',
129
+					),
130
+					'registrations_event_checkin_views_help_tab'                 => array(
131
+						'title'    => esc_html__('Event Check-In Views', 'event_espresso'),
132
+						'filename' => 'registrations_event_checkin_views',
133
+					),
134
+					'registrations_event_checkin_other_help_tab'                 => array(
135
+						'title'    => esc_html__('Event Check-In Other', 'event_espresso'),
136
+						'filename' => 'registrations_event_checkin_other',
137
+					),
138
+				),
139
+				'qtips'         => array('Registration_List_Table_Tips'),
140
+				'list_table'    => 'EE_Event_Registrations_List_Table',
141
+				'metaboxes'     => array(),
142
+				'require_nonce' => false,
143
+			),
144
+			'registration_checkins' => array(
145
+				'nav'           => array(
146
+					'label'      => esc_html__('Check-In Records', 'event_espresso'),
147
+					'order'      => 15,
148
+					'persistent' => false,
149
+					'url'        => '',
150
+				),
151
+				'list_table'    => 'EE_Registration_CheckIn_List_Table',
152
+				'metaboxes'     => array(),
153
+				'require_nonce' => false,
154
+			),
155
+		);
156
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
157
+		$this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table';
158
+		$this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table';
159
+	}
160 160
 
161 161
 
162
-    /**
163
-     * Ajax hooks for all routes in this page.
164
-     */
165
-    protected function _ajax_hooks()
166
-    {
167
-        parent::_ajax_hooks();
168
-        add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content'));
169
-    }
162
+	/**
163
+	 * Ajax hooks for all routes in this page.
164
+	 */
165
+	protected function _ajax_hooks()
166
+	{
167
+		parent::_ajax_hooks();
168
+		add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content'));
169
+	}
170 170
 
171 171
 
172
-    /**
173
-     * Global scripts for all routes in this page.
174
-     */
175
-    public function load_scripts_styles()
176
-    {
177
-        parent::load_scripts_styles();
178
-        // if newsletter message type is active then let's add filter and load js for it.
179
-        if (EEH_MSG_Template::is_mt_active('newsletter')) {
180
-            // enqueue newsletter js
181
-            wp_enqueue_script(
182
-                'ee-newsletter-trigger',
183
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js',
184
-                array('ee-dialog'),
185
-                EVENT_ESPRESSO_VERSION,
186
-                true
187
-            );
188
-            wp_enqueue_style(
189
-                'ee-newsletter-trigger-css',
190
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css',
191
-                array(),
192
-                EVENT_ESPRESSO_VERSION
193
-            );
194
-            // hook in buttons for newsletter message type trigger.
195
-            add_action(
196
-                'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons',
197
-                array($this, 'add_newsletter_action_buttons'),
198
-                10
199
-            );
200
-        }
201
-    }
172
+	/**
173
+	 * Global scripts for all routes in this page.
174
+	 */
175
+	public function load_scripts_styles()
176
+	{
177
+		parent::load_scripts_styles();
178
+		// if newsletter message type is active then let's add filter and load js for it.
179
+		if (EEH_MSG_Template::is_mt_active('newsletter')) {
180
+			// enqueue newsletter js
181
+			wp_enqueue_script(
182
+				'ee-newsletter-trigger',
183
+				REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js',
184
+				array('ee-dialog'),
185
+				EVENT_ESPRESSO_VERSION,
186
+				true
187
+			);
188
+			wp_enqueue_style(
189
+				'ee-newsletter-trigger-css',
190
+				REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css',
191
+				array(),
192
+				EVENT_ESPRESSO_VERSION
193
+			);
194
+			// hook in buttons for newsletter message type trigger.
195
+			add_action(
196
+				'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons',
197
+				array($this, 'add_newsletter_action_buttons'),
198
+				10
199
+			);
200
+		}
201
+	}
202 202
 
203 203
 
204
-    /**
205
-     * Scripts and styles for just the reports route.
206
-     */
207
-    public function load_scripts_styles_reports()
208
-    {
209
-        wp_register_script(
210
-            'ee-reg-reports-js',
211
-            REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js',
212
-            array('google-charts'),
213
-            EVENT_ESPRESSO_VERSION,
214
-            true
215
-        );
216
-        wp_enqueue_script('ee-reg-reports-js');
217
-        $this->_registration_reports_js_setup();
218
-    }
204
+	/**
205
+	 * Scripts and styles for just the reports route.
206
+	 */
207
+	public function load_scripts_styles_reports()
208
+	{
209
+		wp_register_script(
210
+			'ee-reg-reports-js',
211
+			REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js',
212
+			array('google-charts'),
213
+			EVENT_ESPRESSO_VERSION,
214
+			true
215
+		);
216
+		wp_enqueue_script('ee-reg-reports-js');
217
+		$this->_registration_reports_js_setup();
218
+	}
219 219
 
220 220
 
221
-    /**
222
-     * Register screen options for event_registrations route.
223
-     */
224
-    protected function _add_screen_options_event_registrations()
225
-    {
226
-        $this->_per_page_screen_option();
227
-    }
221
+	/**
222
+	 * Register screen options for event_registrations route.
223
+	 */
224
+	protected function _add_screen_options_event_registrations()
225
+	{
226
+		$this->_per_page_screen_option();
227
+	}
228 228
 
229 229
 
230
-    /**
231
-     * Register screen options for registration_checkins route
232
-     */
233
-    protected function _add_screen_options_registration_checkins()
234
-    {
235
-        $page_title = $this->_admin_page_title;
236
-        $this->_admin_page_title = esc_html__('Check-In Records', 'event_espresso');
237
-        $this->_per_page_screen_option();
238
-        $this->_admin_page_title = $page_title;
239
-    }
230
+	/**
231
+	 * Register screen options for registration_checkins route
232
+	 */
233
+	protected function _add_screen_options_registration_checkins()
234
+	{
235
+		$page_title = $this->_admin_page_title;
236
+		$this->_admin_page_title = esc_html__('Check-In Records', 'event_espresso');
237
+		$this->_per_page_screen_option();
238
+		$this->_admin_page_title = $page_title;
239
+	}
240 240
 
241 241
 
242
-    /**
243
-     * Set views property for event_registrations route.
244
-     */
245
-    protected function _set_list_table_views_event_registrations()
246
-    {
247
-        $this->_views = array(
248
-            'all' => array(
249
-                'slug'        => 'all',
250
-                'label'       => esc_html__('All', 'event_espresso'),
251
-                'count'       => 0,
252
-                'bulk_action' => ! isset($this->_req_data['event_id'])
253
-                    ? array()
254
-                    : array(
255
-                        'toggle_checkin_status_bulk' => esc_html__('Toggle Check-In', 'event_espresso'),
256
-                    ),
257
-            ),
258
-        );
259
-    }
242
+	/**
243
+	 * Set views property for event_registrations route.
244
+	 */
245
+	protected function _set_list_table_views_event_registrations()
246
+	{
247
+		$this->_views = array(
248
+			'all' => array(
249
+				'slug'        => 'all',
250
+				'label'       => esc_html__('All', 'event_espresso'),
251
+				'count'       => 0,
252
+				'bulk_action' => ! isset($this->_req_data['event_id'])
253
+					? array()
254
+					: array(
255
+						'toggle_checkin_status_bulk' => esc_html__('Toggle Check-In', 'event_espresso'),
256
+					),
257
+			),
258
+		);
259
+	}
260 260
 
261 261
 
262
-    /**
263
-     * Set views property for registration_checkins route.
264
-     */
265
-    protected function _set_list_table_views_registration_checkins()
266
-    {
267
-        $this->_views = array(
268
-            'all' => array(
269
-                'slug'        => 'all',
270
-                'label'       => esc_html__('All', 'event_espresso'),
271
-                'count'       => 0,
272
-                'bulk_action' => array('delete_checkin_rows' => esc_html__('Delete Check-In Rows', 'event_espresso')),
273
-            ),
274
-        );
275
-    }
262
+	/**
263
+	 * Set views property for registration_checkins route.
264
+	 */
265
+	protected function _set_list_table_views_registration_checkins()
266
+	{
267
+		$this->_views = array(
268
+			'all' => array(
269
+				'slug'        => 'all',
270
+				'label'       => esc_html__('All', 'event_espresso'),
271
+				'count'       => 0,
272
+				'bulk_action' => array('delete_checkin_rows' => esc_html__('Delete Check-In Rows', 'event_espresso')),
273
+			),
274
+		);
275
+	}
276 276
 
277 277
 
278
-    /**
279
-     * callback for ajax action.
280
-     *
281
-     * @since 4.3.0
282
-     * @return void (JSON)
283
-     * @throws EE_Error
284
-     * @throws InvalidArgumentException
285
-     * @throws InvalidDataTypeException
286
-     * @throws InvalidInterfaceException
287
-     */
288
-    public function get_newsletter_form_content()
289
-    {
290
-        // do a nonce check cause we're not coming in from an normal route here.
291
-        $nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field(
292
-            $this->_req_data['get_newsletter_form_content_nonce']
293
-        ) : '';
294
-        $nonce_ref = 'get_newsletter_form_content_nonce';
295
-        $this->_verify_nonce($nonce, $nonce_ref);
296
-        // let's get the mtp for the incoming MTP_ ID
297
-        if (! isset($this->_req_data['GRP_ID'])) {
298
-            EE_Error::add_error(
299
-                esc_html__(
300
-                    'There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).',
301
-                    'event_espresso'
302
-                ),
303
-                __FILE__,
304
-                __FUNCTION__,
305
-                __LINE__
306
-            );
307
-            $this->_template_args['success'] = false;
308
-            $this->_template_args['error'] = true;
309
-            $this->_return_json();
310
-        }
311
-        $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
312
-        if (! $MTPG instanceof EE_Message_Template_Group) {
313
-            EE_Error::add_error(
314
-                sprintf(
315
-                    esc_html__(
316
-                        'The GRP_ID given (%d) does not appear to have a corresponding row in the database.',
317
-                        'event_espresso'
318
-                    ),
319
-                    $this->_req_data['GRP_ID']
320
-                ),
321
-                __FILE__,
322
-                __FUNCTION__,
323
-                __LINE__
324
-            );
325
-            $this->_template_args['success'] = false;
326
-            $this->_template_args['error'] = true;
327
-            $this->_return_json();
328
-        }
329
-        $MTPs = $MTPG->context_templates();
330
-        $MTPs = $MTPs['attendee'];
331
-        $template_fields = array();
332
-        /** @var EE_Message_Template $MTP */
333
-        foreach ($MTPs as $MTP) {
334
-            $field = $MTP->get('MTP_template_field');
335
-            if ($field === 'content') {
336
-                $content = $MTP->get('MTP_content');
337
-                if (! empty($content['newsletter_content'])) {
338
-                    $template_fields['newsletter_content'] = $content['newsletter_content'];
339
-                }
340
-                continue;
341
-            }
342
-            $template_fields[ $MTP->get('MTP_template_field') ] = $MTP->get('MTP_content');
343
-        }
344
-        $this->_template_args['success'] = true;
345
-        $this->_template_args['error'] = false;
346
-        $this->_template_args['data'] = array(
347
-            'batch_message_from'    => isset($template_fields['from'])
348
-                ? $template_fields['from']
349
-                : '',
350
-            'batch_message_subject' => isset($template_fields['subject'])
351
-                ? $template_fields['subject']
352
-                : '',
353
-            'batch_message_content' => isset($template_fields['newsletter_content'])
354
-                ? $template_fields['newsletter_content']
355
-                : '',
356
-        );
357
-        $this->_return_json();
358
-    }
278
+	/**
279
+	 * callback for ajax action.
280
+	 *
281
+	 * @since 4.3.0
282
+	 * @return void (JSON)
283
+	 * @throws EE_Error
284
+	 * @throws InvalidArgumentException
285
+	 * @throws InvalidDataTypeException
286
+	 * @throws InvalidInterfaceException
287
+	 */
288
+	public function get_newsletter_form_content()
289
+	{
290
+		// do a nonce check cause we're not coming in from an normal route here.
291
+		$nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field(
292
+			$this->_req_data['get_newsletter_form_content_nonce']
293
+		) : '';
294
+		$nonce_ref = 'get_newsletter_form_content_nonce';
295
+		$this->_verify_nonce($nonce, $nonce_ref);
296
+		// let's get the mtp for the incoming MTP_ ID
297
+		if (! isset($this->_req_data['GRP_ID'])) {
298
+			EE_Error::add_error(
299
+				esc_html__(
300
+					'There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).',
301
+					'event_espresso'
302
+				),
303
+				__FILE__,
304
+				__FUNCTION__,
305
+				__LINE__
306
+			);
307
+			$this->_template_args['success'] = false;
308
+			$this->_template_args['error'] = true;
309
+			$this->_return_json();
310
+		}
311
+		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
312
+		if (! $MTPG instanceof EE_Message_Template_Group) {
313
+			EE_Error::add_error(
314
+				sprintf(
315
+					esc_html__(
316
+						'The GRP_ID given (%d) does not appear to have a corresponding row in the database.',
317
+						'event_espresso'
318
+					),
319
+					$this->_req_data['GRP_ID']
320
+				),
321
+				__FILE__,
322
+				__FUNCTION__,
323
+				__LINE__
324
+			);
325
+			$this->_template_args['success'] = false;
326
+			$this->_template_args['error'] = true;
327
+			$this->_return_json();
328
+		}
329
+		$MTPs = $MTPG->context_templates();
330
+		$MTPs = $MTPs['attendee'];
331
+		$template_fields = array();
332
+		/** @var EE_Message_Template $MTP */
333
+		foreach ($MTPs as $MTP) {
334
+			$field = $MTP->get('MTP_template_field');
335
+			if ($field === 'content') {
336
+				$content = $MTP->get('MTP_content');
337
+				if (! empty($content['newsletter_content'])) {
338
+					$template_fields['newsletter_content'] = $content['newsletter_content'];
339
+				}
340
+				continue;
341
+			}
342
+			$template_fields[ $MTP->get('MTP_template_field') ] = $MTP->get('MTP_content');
343
+		}
344
+		$this->_template_args['success'] = true;
345
+		$this->_template_args['error'] = false;
346
+		$this->_template_args['data'] = array(
347
+			'batch_message_from'    => isset($template_fields['from'])
348
+				? $template_fields['from']
349
+				: '',
350
+			'batch_message_subject' => isset($template_fields['subject'])
351
+				? $template_fields['subject']
352
+				: '',
353
+			'batch_message_content' => isset($template_fields['newsletter_content'])
354
+				? $template_fields['newsletter_content']
355
+				: '',
356
+		);
357
+		$this->_return_json();
358
+	}
359 359
 
360 360
 
361
-    /**
362
-     * callback for AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons action
363
-     *
364
-     * @since 4.3.0
365
-     * @param EE_Admin_List_Table $list_table
366
-     * @return void
367
-     * @throws InvalidArgumentException
368
-     * @throws InvalidDataTypeException
369
-     * @throws InvalidInterfaceException
370
-     */
371
-    public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table)
372
-    {
373
-        if (
374
-            ! EE_Registry::instance()->CAP->current_user_can(
375
-                'ee_send_message',
376
-                'espresso_registrations_newsletter_selected_send'
377
-            )
378
-        ) {
379
-            return;
380
-        }
381
-        $routes_to_add_to = array(
382
-            'contact_list',
383
-            'event_registrations',
384
-            'default',
385
-        );
386
-        if ($this->_current_page === 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) {
387
-            if (
388
-                ($this->_req_action === 'event_registrations' && empty($this->_req_data['event_id']))
389
-                || (isset($this->_req_data['status']) && $this->_req_data['status'] === 'trash')
390
-            ) {
391
-                echo '';
392
-            } else {
393
-                $button_text = sprintf(
394
-                    esc_html__('Send Batch Message (%s selected)', 'event_espresso'),
395
-                    '<span class="send-selected-newsletter-count">0</span>'
396
-                );
397
-                echo '<button id="selected-batch-send-trigger" class="button secondary-button">'
398
-                     . '<span class="dashicons dashicons-email "></span>'
399
-                     . $button_text
400
-                     . '</button>';
401
-                add_action('admin_footer', array($this, 'newsletter_send_form_skeleton'));
402
-            }
403
-        }
404
-    }
361
+	/**
362
+	 * callback for AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons action
363
+	 *
364
+	 * @since 4.3.0
365
+	 * @param EE_Admin_List_Table $list_table
366
+	 * @return void
367
+	 * @throws InvalidArgumentException
368
+	 * @throws InvalidDataTypeException
369
+	 * @throws InvalidInterfaceException
370
+	 */
371
+	public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table)
372
+	{
373
+		if (
374
+			! EE_Registry::instance()->CAP->current_user_can(
375
+				'ee_send_message',
376
+				'espresso_registrations_newsletter_selected_send'
377
+			)
378
+		) {
379
+			return;
380
+		}
381
+		$routes_to_add_to = array(
382
+			'contact_list',
383
+			'event_registrations',
384
+			'default',
385
+		);
386
+		if ($this->_current_page === 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) {
387
+			if (
388
+				($this->_req_action === 'event_registrations' && empty($this->_req_data['event_id']))
389
+				|| (isset($this->_req_data['status']) && $this->_req_data['status'] === 'trash')
390
+			) {
391
+				echo '';
392
+			} else {
393
+				$button_text = sprintf(
394
+					esc_html__('Send Batch Message (%s selected)', 'event_espresso'),
395
+					'<span class="send-selected-newsletter-count">0</span>'
396
+				);
397
+				echo '<button id="selected-batch-send-trigger" class="button secondary-button">'
398
+					 . '<span class="dashicons dashicons-email "></span>'
399
+					 . $button_text
400
+					 . '</button>';
401
+				add_action('admin_footer', array($this, 'newsletter_send_form_skeleton'));
402
+			}
403
+		}
404
+	}
405 405
 
406 406
 
407
-    /**
408
-     * @throws DomainException
409
-     * @throws EE_Error
410
-     * @throws InvalidArgumentException
411
-     * @throws InvalidDataTypeException
412
-     * @throws InvalidInterfaceException
413
-     */
414
-    public function newsletter_send_form_skeleton()
415
-    {
416
-        $list_table = $this->_list_table_object;
417
-        $codes = array();
418
-        // need to templates for the newsletter message type for the template selector.
419
-        $values[] = array('text' => esc_html__('Select Template to Use', 'event_espresso'), 'id' => 0);
420
-        $mtps = EEM_Message_Template_Group::instance()->get_all(
421
-            array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email'))
422
-        );
423
-        foreach ($mtps as $mtp) {
424
-            $name = $mtp->name();
425
-            $values[] = array(
426
-                'text' => empty($name) ? esc_html__('Global', 'event_espresso') : $name,
427
-                'id'   => $mtp->ID(),
428
-            );
429
-        }
430
-        // need to get a list of shortcodes that are available for the newsletter message type.
431
-        $shortcodes = EEH_MSG_Template::get_shortcodes(
432
-            'newsletter',
433
-            'email',
434
-            array(),
435
-            'attendee',
436
-            false
437
-        );
438
-        foreach ($shortcodes as $field => $shortcode_array) {
439
-            $available_shortcodes = array();
440
-            foreach ($shortcode_array as $shortcode => $shortcode_details) {
441
-                $field_id = $field === '[NEWSLETTER_CONTENT]'
442
-                    ? 'content'
443
-                    : $field;
444
-                $field_id = 'batch-message-' . strtolower($field_id);
445
-                $available_shortcodes[] = '<span class="js-shortcode-selection" data-value="'
446
-                                          . $shortcode
447
-                                          . '" data-linked-input-id="' . $field_id . '">'
448
-                                          . $shortcode
449
-                                          . '</span>';
450
-            }
451
-            $codes[ $field ] = implode(', ', $available_shortcodes);
452
-        }
453
-        $shortcodes = $codes;
454
-        $form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
455
-        $form_template_args = array(
456
-            'form_action'       => admin_url('admin.php?page=espresso_registrations'),
457
-            'form_route'        => 'newsletter_selected_send',
458
-            'form_nonce_name'   => 'newsletter_selected_send_nonce',
459
-            'form_nonce'        => wp_create_nonce('newsletter_selected_send_nonce'),
460
-            'redirect_back_to'  => $this->_req_action,
461
-            'ajax_nonce'        => wp_create_nonce('get_newsletter_form_content_nonce'),
462
-            'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values),
463
-            'shortcodes'        => $shortcodes,
464
-            'id_type'           => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration',
465
-        );
466
-        EEH_Template::display_template($form_template, $form_template_args);
467
-    }
407
+	/**
408
+	 * @throws DomainException
409
+	 * @throws EE_Error
410
+	 * @throws InvalidArgumentException
411
+	 * @throws InvalidDataTypeException
412
+	 * @throws InvalidInterfaceException
413
+	 */
414
+	public function newsletter_send_form_skeleton()
415
+	{
416
+		$list_table = $this->_list_table_object;
417
+		$codes = array();
418
+		// need to templates for the newsletter message type for the template selector.
419
+		$values[] = array('text' => esc_html__('Select Template to Use', 'event_espresso'), 'id' => 0);
420
+		$mtps = EEM_Message_Template_Group::instance()->get_all(
421
+			array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email'))
422
+		);
423
+		foreach ($mtps as $mtp) {
424
+			$name = $mtp->name();
425
+			$values[] = array(
426
+				'text' => empty($name) ? esc_html__('Global', 'event_espresso') : $name,
427
+				'id'   => $mtp->ID(),
428
+			);
429
+		}
430
+		// need to get a list of shortcodes that are available for the newsletter message type.
431
+		$shortcodes = EEH_MSG_Template::get_shortcodes(
432
+			'newsletter',
433
+			'email',
434
+			array(),
435
+			'attendee',
436
+			false
437
+		);
438
+		foreach ($shortcodes as $field => $shortcode_array) {
439
+			$available_shortcodes = array();
440
+			foreach ($shortcode_array as $shortcode => $shortcode_details) {
441
+				$field_id = $field === '[NEWSLETTER_CONTENT]'
442
+					? 'content'
443
+					: $field;
444
+				$field_id = 'batch-message-' . strtolower($field_id);
445
+				$available_shortcodes[] = '<span class="js-shortcode-selection" data-value="'
446
+										  . $shortcode
447
+										  . '" data-linked-input-id="' . $field_id . '">'
448
+										  . $shortcode
449
+										  . '</span>';
450
+			}
451
+			$codes[ $field ] = implode(', ', $available_shortcodes);
452
+		}
453
+		$shortcodes = $codes;
454
+		$form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
455
+		$form_template_args = array(
456
+			'form_action'       => admin_url('admin.php?page=espresso_registrations'),
457
+			'form_route'        => 'newsletter_selected_send',
458
+			'form_nonce_name'   => 'newsletter_selected_send_nonce',
459
+			'form_nonce'        => wp_create_nonce('newsletter_selected_send_nonce'),
460
+			'redirect_back_to'  => $this->_req_action,
461
+			'ajax_nonce'        => wp_create_nonce('get_newsletter_form_content_nonce'),
462
+			'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values),
463
+			'shortcodes'        => $shortcodes,
464
+			'id_type'           => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration',
465
+		);
466
+		EEH_Template::display_template($form_template, $form_template_args);
467
+	}
468 468
 
469 469
 
470
-    /**
471
-     * Handles sending selected registrations/contacts a newsletter.
472
-     *
473
-     * @since  4.3.0
474
-     * @return void
475
-     * @throws EE_Error
476
-     * @throws InvalidArgumentException
477
-     * @throws InvalidDataTypeException
478
-     * @throws InvalidInterfaceException
479
-     */
480
-    protected function _newsletter_selected_send()
481
-    {
482
-        $success = true;
483
-        // first we need to make sure we have a GRP_ID so we know what template we're sending and updating!
484
-        if (empty($this->_req_data['newsletter_mtp_selected'])) {
485
-            EE_Error::add_error(
486
-                esc_html__(
487
-                    'In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.',
488
-                    'event_espresso'
489
-                ),
490
-                __FILE__,
491
-                __FUNCTION__,
492
-                __LINE__
493
-            );
494
-            $success = false;
495
-        }
496
-        if ($success) {
497
-            // update Message template in case there are any changes
498
-            $Message_Template_Group = EEM_Message_Template_Group::instance()->get_one_by_ID(
499
-                $this->_req_data['newsletter_mtp_selected']
500
-            );
501
-            $Message_Templates = $Message_Template_Group instanceof EE_Message_Template_Group
502
-                ? $Message_Template_Group->context_templates()
503
-                : array();
504
-            if (empty($Message_Templates)) {
505
-                EE_Error::add_error(
506
-                    esc_html__(
507
-                        'Unable to retrieve message template fields from the db. Messages not sent.',
508
-                        'event_espresso'
509
-                    ),
510
-                    __FILE__,
511
-                    __FUNCTION__,
512
-                    __LINE__
513
-                );
514
-            }
515
-            // let's just update the specific fields
516
-            foreach ($Message_Templates['attendee'] as $Message_Template) {
517
-                if ($Message_Template instanceof EE_Message_Template) {
518
-                    $field = $Message_Template->get('MTP_template_field');
519
-                    $content = $Message_Template->get('MTP_content');
520
-                    $new_content = $content;
521
-                    switch ($field) {
522
-                        case 'from':
523
-                            $new_content = ! empty($this->_req_data['batch_message']['from'])
524
-                                ? $this->_req_data['batch_message']['from']
525
-                                : $content;
526
-                            break;
527
-                        case 'subject':
528
-                            $new_content = ! empty($this->_req_data['batch_message']['subject'])
529
-                                ? $this->_req_data['batch_message']['subject']
530
-                                : $content;
531
-                            break;
532
-                        case 'content':
533
-                            $new_content = $content;
534
-                            $new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content'])
535
-                                ? $this->_req_data['batch_message']['content']
536
-                                : $content['newsletter_content'];
537
-                            break;
538
-                        default:
539
-                            // continue the foreach loop, we don't want to set $new_content nor save.
540
-                            continue 2;
541
-                    }
542
-                    $Message_Template->set('MTP_content', $new_content);
543
-                    $Message_Template->save();
544
-                }
545
-            }
546
-            // great fields are updated!  now let's make sure we just have contact objects (EE_Attendee).
547
-            $id_type = ! empty($this->_req_data['batch_message']['id_type'])
548
-                ? $this->_req_data['batch_message']['id_type']
549
-                : 'registration';
550
-            // id_type will affect how we assemble the ids.
551
-            $ids = ! empty($this->_req_data['batch_message']['ids'])
552
-                ? json_decode(stripslashes($this->_req_data['batch_message']['ids']))
553
-                : array();
554
-            $registrations_used_for_contact_data = array();
555
-            // using switch because eventually we'll have other contexts that will be used for generating messages.
556
-            switch ($id_type) {
557
-                case 'registration':
558
-                    $registrations_used_for_contact_data = EEM_Registration::instance()->get_all(
559
-                        array(
560
-                            array(
561
-                                'REG_ID' => array('IN', $ids),
562
-                            ),
563
-                        )
564
-                    );
565
-                    break;
566
-                case 'contact':
567
-                    $registrations_used_for_contact_data = EEM_Registration::instance()
568
-                                                                           ->get_latest_registration_for_each_of_given_contacts(
569
-                                                                               $ids
570
-                                                                           );
571
-                    break;
572
-            }
573
-            do_action_ref_array(
574
-                'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send__with_registrations',
575
-                array(
576
-                    $registrations_used_for_contact_data,
577
-                    $Message_Template_Group->ID(),
578
-                )
579
-            );
580
-            // kept for backward compat, internally we no longer use this action.
581
-            // @deprecated 4.8.36.rc.002
582
-            $contacts = $id_type === 'registration'
583
-                ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids)
584
-                : EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids))));
585
-            do_action_ref_array(
586
-                'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send',
587
-                array(
588
-                    $contacts,
589
-                    $Message_Template_Group->ID(),
590
-                )
591
-            );
592
-        }
593
-        $query_args = array(
594
-            'action' => ! empty($this->_req_data['redirect_back_to'])
595
-                ? $this->_req_data['redirect_back_to']
596
-                : 'default',
597
-        );
598
-        $this->_redirect_after_action(false, '', '', $query_args, true);
599
-    }
470
+	/**
471
+	 * Handles sending selected registrations/contacts a newsletter.
472
+	 *
473
+	 * @since  4.3.0
474
+	 * @return void
475
+	 * @throws EE_Error
476
+	 * @throws InvalidArgumentException
477
+	 * @throws InvalidDataTypeException
478
+	 * @throws InvalidInterfaceException
479
+	 */
480
+	protected function _newsletter_selected_send()
481
+	{
482
+		$success = true;
483
+		// first we need to make sure we have a GRP_ID so we know what template we're sending and updating!
484
+		if (empty($this->_req_data['newsletter_mtp_selected'])) {
485
+			EE_Error::add_error(
486
+				esc_html__(
487
+					'In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.',
488
+					'event_espresso'
489
+				),
490
+				__FILE__,
491
+				__FUNCTION__,
492
+				__LINE__
493
+			);
494
+			$success = false;
495
+		}
496
+		if ($success) {
497
+			// update Message template in case there are any changes
498
+			$Message_Template_Group = EEM_Message_Template_Group::instance()->get_one_by_ID(
499
+				$this->_req_data['newsletter_mtp_selected']
500
+			);
501
+			$Message_Templates = $Message_Template_Group instanceof EE_Message_Template_Group
502
+				? $Message_Template_Group->context_templates()
503
+				: array();
504
+			if (empty($Message_Templates)) {
505
+				EE_Error::add_error(
506
+					esc_html__(
507
+						'Unable to retrieve message template fields from the db. Messages not sent.',
508
+						'event_espresso'
509
+					),
510
+					__FILE__,
511
+					__FUNCTION__,
512
+					__LINE__
513
+				);
514
+			}
515
+			// let's just update the specific fields
516
+			foreach ($Message_Templates['attendee'] as $Message_Template) {
517
+				if ($Message_Template instanceof EE_Message_Template) {
518
+					$field = $Message_Template->get('MTP_template_field');
519
+					$content = $Message_Template->get('MTP_content');
520
+					$new_content = $content;
521
+					switch ($field) {
522
+						case 'from':
523
+							$new_content = ! empty($this->_req_data['batch_message']['from'])
524
+								? $this->_req_data['batch_message']['from']
525
+								: $content;
526
+							break;
527
+						case 'subject':
528
+							$new_content = ! empty($this->_req_data['batch_message']['subject'])
529
+								? $this->_req_data['batch_message']['subject']
530
+								: $content;
531
+							break;
532
+						case 'content':
533
+							$new_content = $content;
534
+							$new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content'])
535
+								? $this->_req_data['batch_message']['content']
536
+								: $content['newsletter_content'];
537
+							break;
538
+						default:
539
+							// continue the foreach loop, we don't want to set $new_content nor save.
540
+							continue 2;
541
+					}
542
+					$Message_Template->set('MTP_content', $new_content);
543
+					$Message_Template->save();
544
+				}
545
+			}
546
+			// great fields are updated!  now let's make sure we just have contact objects (EE_Attendee).
547
+			$id_type = ! empty($this->_req_data['batch_message']['id_type'])
548
+				? $this->_req_data['batch_message']['id_type']
549
+				: 'registration';
550
+			// id_type will affect how we assemble the ids.
551
+			$ids = ! empty($this->_req_data['batch_message']['ids'])
552
+				? json_decode(stripslashes($this->_req_data['batch_message']['ids']))
553
+				: array();
554
+			$registrations_used_for_contact_data = array();
555
+			// using switch because eventually we'll have other contexts that will be used for generating messages.
556
+			switch ($id_type) {
557
+				case 'registration':
558
+					$registrations_used_for_contact_data = EEM_Registration::instance()->get_all(
559
+						array(
560
+							array(
561
+								'REG_ID' => array('IN', $ids),
562
+							),
563
+						)
564
+					);
565
+					break;
566
+				case 'contact':
567
+					$registrations_used_for_contact_data = EEM_Registration::instance()
568
+																		   ->get_latest_registration_for_each_of_given_contacts(
569
+																			   $ids
570
+																		   );
571
+					break;
572
+			}
573
+			do_action_ref_array(
574
+				'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send__with_registrations',
575
+				array(
576
+					$registrations_used_for_contact_data,
577
+					$Message_Template_Group->ID(),
578
+				)
579
+			);
580
+			// kept for backward compat, internally we no longer use this action.
581
+			// @deprecated 4.8.36.rc.002
582
+			$contacts = $id_type === 'registration'
583
+				? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids)
584
+				: EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids))));
585
+			do_action_ref_array(
586
+				'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send',
587
+				array(
588
+					$contacts,
589
+					$Message_Template_Group->ID(),
590
+				)
591
+			);
592
+		}
593
+		$query_args = array(
594
+			'action' => ! empty($this->_req_data['redirect_back_to'])
595
+				? $this->_req_data['redirect_back_to']
596
+				: 'default',
597
+		);
598
+		$this->_redirect_after_action(false, '', '', $query_args, true);
599
+	}
600 600
 
601 601
 
602
-    /**
603
-     * This is called when javascript is being enqueued to setup the various data needed for the reports js.
604
-     * Also $this->{$_reports_template_data} property is set for later usage by the _registration_reports method.
605
-     */
606
-    protected function _registration_reports_js_setup()
607
-    {
608
-        $this->_reports_template_data['admin_reports'][] = $this->_registrations_per_day_report();
609
-        $this->_reports_template_data['admin_reports'][] = $this->_registrations_per_event_report();
610
-    }
602
+	/**
603
+	 * This is called when javascript is being enqueued to setup the various data needed for the reports js.
604
+	 * Also $this->{$_reports_template_data} property is set for later usage by the _registration_reports method.
605
+	 */
606
+	protected function _registration_reports_js_setup()
607
+	{
608
+		$this->_reports_template_data['admin_reports'][] = $this->_registrations_per_day_report();
609
+		$this->_reports_template_data['admin_reports'][] = $this->_registrations_per_event_report();
610
+	}
611 611
 
612 612
 
613
-    /**
614
-     *        generates Business Reports regarding Registrations
615
-     *
616
-     * @access protected
617
-     * @return void
618
-     * @throws DomainException
619
-     */
620
-    protected function _registration_reports()
621
-    {
622
-        $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
623
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
624
-            $template_path,
625
-            $this->_reports_template_data,
626
-            true
627
-        );
628
-        // the final template wrapper
629
-        $this->display_admin_page_with_no_sidebar();
630
-    }
613
+	/**
614
+	 *        generates Business Reports regarding Registrations
615
+	 *
616
+	 * @access protected
617
+	 * @return void
618
+	 * @throws DomainException
619
+	 */
620
+	protected function _registration_reports()
621
+	{
622
+		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
623
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
624
+			$template_path,
625
+			$this->_reports_template_data,
626
+			true
627
+		);
628
+		// the final template wrapper
629
+		$this->display_admin_page_with_no_sidebar();
630
+	}
631 631
 
632 632
 
633
-    /**
634
-     * Generates Business Report showing total registrations per day.
635
-     *
636
-     * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
637
-     * @return string
638
-     * @throws EE_Error
639
-     * @throws InvalidArgumentException
640
-     * @throws InvalidDataTypeException
641
-     * @throws InvalidInterfaceException
642
-     */
643
-    private function _registrations_per_day_report($period = '-1 month')
644
-    {
645
-        $report_ID = 'reg-admin-registrations-per-day-report-dv';
646
-        $results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report($period);
647
-        $results = (array) $results;
648
-        $regs = array();
649
-        $subtitle = '';
650
-        if ($results) {
651
-            $column_titles = array();
652
-            $tracker = 0;
653
-            foreach ($results as $result) {
654
-                $report_column_values = array();
655
-                foreach ($result as $property_name => $property_value) {
656
-                    $property_value = $property_name === 'Registration_REG_date' ? $property_value
657
-                        : (int) $property_value;
658
-                    $report_column_values[] = $property_value;
659
-                    if ($tracker === 0) {
660
-                        if ($property_name === 'Registration_REG_date') {
661
-                            $column_titles[] = esc_html__(
662
-                                'Date (only days with registrations are shown)',
663
-                                'event_espresso'
664
-                            );
665
-                        } else {
666
-                            $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
667
-                        }
668
-                    }
669
-                }
670
-                $tracker++;
671
-                $regs[] = $report_column_values;
672
-            }
673
-            // make sure the column_titles is pushed to the beginning of the array
674
-            array_unshift($regs, $column_titles);
675
-            // setup the date range.
676
-            $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
677
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
678
-            $ending_date = new DateTime("now", $DateTimeZone);
679
-            $subtitle = sprintf(
680
-                wp_strip_all_tags(
681
-                    _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
682
-                ),
683
-                $beginning_date->format('Y-m-d'),
684
-                $ending_date->format('Y-m-d')
685
-            );
686
-        }
687
-        $report_title = wp_strip_all_tags(__('Total Registrations per Day', 'event_espresso'));
688
-        $report_params = array(
689
-            'title'     => $report_title,
690
-            'subtitle'  => $subtitle,
691
-            'id'        => $report_ID,
692
-            'regs'      => $regs,
693
-            'noResults' => empty($regs),
694
-            'noRegsMsg' => sprintf(
695
-                wp_strip_all_tags(
696
-                    __(
697
-                        '%sThere are currently no registration records in the last month for this report.%s',
698
-                        'event_espresso'
699
-                    )
700
-                ),
701
-                '<h2>' . $report_title . '</h2><p>',
702
-                '</p>'
703
-            ),
704
-        );
705
-        wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params);
706
-        return $report_ID;
707
-    }
633
+	/**
634
+	 * Generates Business Report showing total registrations per day.
635
+	 *
636
+	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
637
+	 * @return string
638
+	 * @throws EE_Error
639
+	 * @throws InvalidArgumentException
640
+	 * @throws InvalidDataTypeException
641
+	 * @throws InvalidInterfaceException
642
+	 */
643
+	private function _registrations_per_day_report($period = '-1 month')
644
+	{
645
+		$report_ID = 'reg-admin-registrations-per-day-report-dv';
646
+		$results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report($period);
647
+		$results = (array) $results;
648
+		$regs = array();
649
+		$subtitle = '';
650
+		if ($results) {
651
+			$column_titles = array();
652
+			$tracker = 0;
653
+			foreach ($results as $result) {
654
+				$report_column_values = array();
655
+				foreach ($result as $property_name => $property_value) {
656
+					$property_value = $property_name === 'Registration_REG_date' ? $property_value
657
+						: (int) $property_value;
658
+					$report_column_values[] = $property_value;
659
+					if ($tracker === 0) {
660
+						if ($property_name === 'Registration_REG_date') {
661
+							$column_titles[] = esc_html__(
662
+								'Date (only days with registrations are shown)',
663
+								'event_espresso'
664
+							);
665
+						} else {
666
+							$column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
667
+						}
668
+					}
669
+				}
670
+				$tracker++;
671
+				$regs[] = $report_column_values;
672
+			}
673
+			// make sure the column_titles is pushed to the beginning of the array
674
+			array_unshift($regs, $column_titles);
675
+			// setup the date range.
676
+			$DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
677
+			$beginning_date = new DateTime("now " . $period, $DateTimeZone);
678
+			$ending_date = new DateTime("now", $DateTimeZone);
679
+			$subtitle = sprintf(
680
+				wp_strip_all_tags(
681
+					_x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
682
+				),
683
+				$beginning_date->format('Y-m-d'),
684
+				$ending_date->format('Y-m-d')
685
+			);
686
+		}
687
+		$report_title = wp_strip_all_tags(__('Total Registrations per Day', 'event_espresso'));
688
+		$report_params = array(
689
+			'title'     => $report_title,
690
+			'subtitle'  => $subtitle,
691
+			'id'        => $report_ID,
692
+			'regs'      => $regs,
693
+			'noResults' => empty($regs),
694
+			'noRegsMsg' => sprintf(
695
+				wp_strip_all_tags(
696
+					__(
697
+						'%sThere are currently no registration records in the last month for this report.%s',
698
+						'event_espresso'
699
+					)
700
+				),
701
+				'<h2>' . $report_title . '</h2><p>',
702
+				'</p>'
703
+			),
704
+		);
705
+		wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params);
706
+		return $report_ID;
707
+	}
708 708
 
709 709
 
710
-    /**
711
-     * Generates Business Report showing total registrations per event.
712
-     *
713
-     * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
714
-     * @return string
715
-     * @throws EE_Error
716
-     * @throws InvalidArgumentException
717
-     * @throws InvalidDataTypeException
718
-     * @throws InvalidInterfaceException
719
-     */
720
-    private function _registrations_per_event_report($period = '-1 month')
721
-    {
722
-        $report_ID = 'reg-admin-registrations-per-event-report-dv';
723
-        $results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report($period);
724
-        $results = (array) $results;
725
-        $regs = array();
726
-        $subtitle = '';
727
-        if ($results) {
728
-            $column_titles = array();
729
-            $tracker = 0;
730
-            foreach ($results as $result) {
731
-                $report_column_values = array();
732
-                foreach ($result as $property_name => $property_value) {
733
-                    $property_value = $property_name === 'Registration_Event' ? wp_trim_words(
734
-                        $property_value,
735
-                        4,
736
-                        '...'
737
-                    ) : (int) $property_value;
738
-                    $report_column_values[] = $property_value;
739
-                    if ($tracker === 0) {
740
-                        if ($property_name === 'Registration_Event') {
741
-                            $column_titles[] = esc_html__('Event', 'event_espresso');
742
-                        } else {
743
-                            $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
744
-                        }
745
-                    }
746
-                }
747
-                $tracker++;
748
-                $regs[] = $report_column_values;
749
-            }
750
-            // make sure the column_titles is pushed to the beginning of the array
751
-            array_unshift($regs, $column_titles);
752
-            // setup the date range.
753
-            $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
754
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
755
-            $ending_date = new DateTime("now", $DateTimeZone);
756
-            $subtitle = sprintf(
757
-                wp_strip_all_tags(
758
-                    _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
759
-                ),
760
-                $beginning_date->format('Y-m-d'),
761
-                $ending_date->format('Y-m-d')
762
-            );
763
-        }
764
-        $report_title = wp_strip_all_tags(__('Total Registrations per Event', 'event_espresso'));
765
-        $report_params = array(
766
-            'title'     => $report_title,
767
-            'subtitle'  => $subtitle,
768
-            'id'        => $report_ID,
769
-            'regs'      => $regs,
770
-            'noResults' => empty($regs),
771
-            'noRegsMsg' => sprintf(
772
-                wp_strip_all_tags(
773
-                    __(
774
-                        '%sThere are currently no registration records in the last month for this report.%s',
775
-                        'event_espresso'
776
-                    )
777
-                ),
778
-                '<h2>' . $report_title . '</h2><p>',
779
-                '</p>'
780
-            ),
781
-        );
782
-        wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params);
783
-        return $report_ID;
784
-    }
710
+	/**
711
+	 * Generates Business Report showing total registrations per event.
712
+	 *
713
+	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
714
+	 * @return string
715
+	 * @throws EE_Error
716
+	 * @throws InvalidArgumentException
717
+	 * @throws InvalidDataTypeException
718
+	 * @throws InvalidInterfaceException
719
+	 */
720
+	private function _registrations_per_event_report($period = '-1 month')
721
+	{
722
+		$report_ID = 'reg-admin-registrations-per-event-report-dv';
723
+		$results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report($period);
724
+		$results = (array) $results;
725
+		$regs = array();
726
+		$subtitle = '';
727
+		if ($results) {
728
+			$column_titles = array();
729
+			$tracker = 0;
730
+			foreach ($results as $result) {
731
+				$report_column_values = array();
732
+				foreach ($result as $property_name => $property_value) {
733
+					$property_value = $property_name === 'Registration_Event' ? wp_trim_words(
734
+						$property_value,
735
+						4,
736
+						'...'
737
+					) : (int) $property_value;
738
+					$report_column_values[] = $property_value;
739
+					if ($tracker === 0) {
740
+						if ($property_name === 'Registration_Event') {
741
+							$column_titles[] = esc_html__('Event', 'event_espresso');
742
+						} else {
743
+							$column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
744
+						}
745
+					}
746
+				}
747
+				$tracker++;
748
+				$regs[] = $report_column_values;
749
+			}
750
+			// make sure the column_titles is pushed to the beginning of the array
751
+			array_unshift($regs, $column_titles);
752
+			// setup the date range.
753
+			$DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
754
+			$beginning_date = new DateTime("now " . $period, $DateTimeZone);
755
+			$ending_date = new DateTime("now", $DateTimeZone);
756
+			$subtitle = sprintf(
757
+				wp_strip_all_tags(
758
+					_x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
759
+				),
760
+				$beginning_date->format('Y-m-d'),
761
+				$ending_date->format('Y-m-d')
762
+			);
763
+		}
764
+		$report_title = wp_strip_all_tags(__('Total Registrations per Event', 'event_espresso'));
765
+		$report_params = array(
766
+			'title'     => $report_title,
767
+			'subtitle'  => $subtitle,
768
+			'id'        => $report_ID,
769
+			'regs'      => $regs,
770
+			'noResults' => empty($regs),
771
+			'noRegsMsg' => sprintf(
772
+				wp_strip_all_tags(
773
+					__(
774
+						'%sThere are currently no registration records in the last month for this report.%s',
775
+						'event_espresso'
776
+					)
777
+				),
778
+				'<h2>' . $report_title . '</h2><p>',
779
+				'</p>'
780
+			),
781
+		);
782
+		wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params);
783
+		return $report_ID;
784
+	}
785 785
 
786 786
 
787
-    /**
788
-     * generates HTML for the Registration Check-in list table (showing all Check-ins for a specific registration)
789
-     *
790
-     * @access protected
791
-     * @return void
792
-     * @throws EE_Error
793
-     * @throws InvalidArgumentException
794
-     * @throws InvalidDataTypeException
795
-     * @throws InvalidInterfaceException
796
-     * @throws \EventEspresso\core\exceptions\EntityNotFoundException
797
-     */
798
-    protected function _registration_checkin_list_table()
799
-    {
800
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
801
-        $reg_id = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : null;
802
-        /** @var EE_Registration $registration */
803
-        $registration = EEM_Registration::instance()->get_one_by_ID($reg_id);
804
-        if (! $registration instanceof EE_Registration) {
805
-            throw new EE_Error(
806
-                sprintf(
807
-                    esc_html__('An error occurred. There is no registration with ID (%d)', 'event_espresso'),
808
-                    $reg_id
809
-                )
810
-            );
811
-        }
812
-        $attendee = $registration->attendee();
813
-        $this->_admin_page_title .= $this->get_action_link_or_button(
814
-            'new_registration',
815
-            'add-registrant',
816
-            array('event_id' => $registration->event_ID()),
817
-            'add-new-h2'
818
-        );
819
-        $checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
820
-        $checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
821
-        $legend_items = array(
822
-            'checkin'  => array(
823
-                'class' => $checked_in->cssClasses(),
824
-                'desc'  => $checked_in->legendLabel(),
825
-            ),
826
-            'checkout' => array(
827
-                'class' => $checked_out->cssClasses(),
828
-                'desc'  => $checked_out->legendLabel(),
829
-            ),
830
-        );
831
-        $this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
832
-        $dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
833
-        /** @var EE_Datetime $datetime */
834
-        $datetime = EEM_Datetime::instance()->get_one_by_ID($dtt_id);
835
-        $datetime_label = '';
836
-        if ($datetime instanceof EE_Datetime) {
837
-            $datetime_label = $datetime->get_dtt_display_name(true);
838
-            $datetime_label .= ! empty($datetime_label)
839
-                ? ' (' . $datetime->get_dtt_display_name() . ')'
840
-                : $datetime->get_dtt_display_name();
841
-        }
842
-        $datetime_link = ! empty($dtt_id) && $registration instanceof EE_Registration
843
-            ? EE_Admin_Page::add_query_args_and_nonce(
844
-                array(
845
-                    'action'   => 'event_registrations',
846
-                    'event_id' => $registration->event_ID(),
847
-                    'DTT_ID'   => $dtt_id,
848
-                ),
849
-                $this->_admin_base_url
850
-            )
851
-            : '';
852
-        $datetime_link = ! empty($datetime_link)
853
-            ? '<a href="' . $datetime_link . '">'
854
-              . '<span id="checkin-dtt">'
855
-              . $datetime_label
856
-              . '</span></a>'
857
-            : $datetime_label;
858
-        $attendee_name = $attendee instanceof EE_Attendee
859
-            ? $attendee->full_name()
860
-            : '';
861
-        $attendee_link = $attendee instanceof EE_Attendee
862
-            ? $attendee->get_admin_details_link()
863
-            : '';
864
-        $attendee_link = ! empty($attendee_link)
865
-            ? '<a href="' . $attendee->get_admin_details_link() . '"'
866
-              . ' aria-label="' . esc_html__('Click for attendee details', 'event_espresso') . '">'
867
-              . '<span id="checkin-attendee-name">'
868
-              . $attendee_name
869
-              . '</span></a>'
870
-            : '';
871
-        $event_link = $registration->event() instanceof EE_Event
872
-            ? $registration->event()->get_admin_details_link()
873
-            : '';
874
-        $event_link = ! empty($event_link)
875
-            ? '<a href="' . $event_link . '"'
876
-              . ' aria-label="' . esc_html__('Click here to edit event.', 'event_espresso') . '">'
877
-              . '<span id="checkin-event-name">'
878
-              . $registration->event_name()
879
-              . '</span>'
880
-              . '</a>'
881
-            : '';
882
-        $this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id)
883
-            ? '<h2>' . sprintf(
884
-                esc_html__('Displaying check in records for %1$s for %2$s at the event, %3$s', 'event_espresso'),
885
-                $attendee_link,
886
-                $datetime_link,
887
-                $event_link
888
-            ) . '</h2>'
889
-            : '';
890
-        $this->_template_args['list_table_hidden_fields'] = ! empty($reg_id)
891
-            ? '<input type="hidden" name="_REG_ID" value="' . $reg_id . '">' : '';
892
-        $this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id)
893
-            ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
894
-        $this->display_admin_list_table_page_with_no_sidebar();
895
-    }
787
+	/**
788
+	 * generates HTML for the Registration Check-in list table (showing all Check-ins for a specific registration)
789
+	 *
790
+	 * @access protected
791
+	 * @return void
792
+	 * @throws EE_Error
793
+	 * @throws InvalidArgumentException
794
+	 * @throws InvalidDataTypeException
795
+	 * @throws InvalidInterfaceException
796
+	 * @throws \EventEspresso\core\exceptions\EntityNotFoundException
797
+	 */
798
+	protected function _registration_checkin_list_table()
799
+	{
800
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
801
+		$reg_id = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : null;
802
+		/** @var EE_Registration $registration */
803
+		$registration = EEM_Registration::instance()->get_one_by_ID($reg_id);
804
+		if (! $registration instanceof EE_Registration) {
805
+			throw new EE_Error(
806
+				sprintf(
807
+					esc_html__('An error occurred. There is no registration with ID (%d)', 'event_espresso'),
808
+					$reg_id
809
+				)
810
+			);
811
+		}
812
+		$attendee = $registration->attendee();
813
+		$this->_admin_page_title .= $this->get_action_link_or_button(
814
+			'new_registration',
815
+			'add-registrant',
816
+			array('event_id' => $registration->event_ID()),
817
+			'add-new-h2'
818
+		);
819
+		$checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
820
+		$checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
821
+		$legend_items = array(
822
+			'checkin'  => array(
823
+				'class' => $checked_in->cssClasses(),
824
+				'desc'  => $checked_in->legendLabel(),
825
+			),
826
+			'checkout' => array(
827
+				'class' => $checked_out->cssClasses(),
828
+				'desc'  => $checked_out->legendLabel(),
829
+			),
830
+		);
831
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
832
+		$dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
833
+		/** @var EE_Datetime $datetime */
834
+		$datetime = EEM_Datetime::instance()->get_one_by_ID($dtt_id);
835
+		$datetime_label = '';
836
+		if ($datetime instanceof EE_Datetime) {
837
+			$datetime_label = $datetime->get_dtt_display_name(true);
838
+			$datetime_label .= ! empty($datetime_label)
839
+				? ' (' . $datetime->get_dtt_display_name() . ')'
840
+				: $datetime->get_dtt_display_name();
841
+		}
842
+		$datetime_link = ! empty($dtt_id) && $registration instanceof EE_Registration
843
+			? EE_Admin_Page::add_query_args_and_nonce(
844
+				array(
845
+					'action'   => 'event_registrations',
846
+					'event_id' => $registration->event_ID(),
847
+					'DTT_ID'   => $dtt_id,
848
+				),
849
+				$this->_admin_base_url
850
+			)
851
+			: '';
852
+		$datetime_link = ! empty($datetime_link)
853
+			? '<a href="' . $datetime_link . '">'
854
+			  . '<span id="checkin-dtt">'
855
+			  . $datetime_label
856
+			  . '</span></a>'
857
+			: $datetime_label;
858
+		$attendee_name = $attendee instanceof EE_Attendee
859
+			? $attendee->full_name()
860
+			: '';
861
+		$attendee_link = $attendee instanceof EE_Attendee
862
+			? $attendee->get_admin_details_link()
863
+			: '';
864
+		$attendee_link = ! empty($attendee_link)
865
+			? '<a href="' . $attendee->get_admin_details_link() . '"'
866
+			  . ' aria-label="' . esc_html__('Click for attendee details', 'event_espresso') . '">'
867
+			  . '<span id="checkin-attendee-name">'
868
+			  . $attendee_name
869
+			  . '</span></a>'
870
+			: '';
871
+		$event_link = $registration->event() instanceof EE_Event
872
+			? $registration->event()->get_admin_details_link()
873
+			: '';
874
+		$event_link = ! empty($event_link)
875
+			? '<a href="' . $event_link . '"'
876
+			  . ' aria-label="' . esc_html__('Click here to edit event.', 'event_espresso') . '">'
877
+			  . '<span id="checkin-event-name">'
878
+			  . $registration->event_name()
879
+			  . '</span>'
880
+			  . '</a>'
881
+			: '';
882
+		$this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id)
883
+			? '<h2>' . sprintf(
884
+				esc_html__('Displaying check in records for %1$s for %2$s at the event, %3$s', 'event_espresso'),
885
+				$attendee_link,
886
+				$datetime_link,
887
+				$event_link
888
+			) . '</h2>'
889
+			: '';
890
+		$this->_template_args['list_table_hidden_fields'] = ! empty($reg_id)
891
+			? '<input type="hidden" name="_REG_ID" value="' . $reg_id . '">' : '';
892
+		$this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id)
893
+			? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
894
+		$this->display_admin_list_table_page_with_no_sidebar();
895
+	}
896 896
 
897 897
 
898
-    /**
899
-     * toggle the Check-in status for the given registration (coming from ajax)
900
-     *
901
-     * @return void (JSON)
902
-     * @throws EE_Error
903
-     * @throws InvalidArgumentException
904
-     * @throws InvalidDataTypeException
905
-     * @throws InvalidInterfaceException
906
-     */
907
-    public function toggle_checkin_status()
908
-    {
909
-        // first make sure we have the necessary data
910
-        if (! isset($this->_req_data['_regid'])) {
911
-            EE_Error::add_error(
912
-                esc_html__(
913
-                    'There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax',
914
-                    'event_espresso'
915
-                ),
916
-                __FILE__,
917
-                __FUNCTION__,
918
-                __LINE__
919
-            );
920
-            $this->_template_args['success'] = false;
921
-            $this->_template_args['error'] = true;
922
-            $this->_return_json();
923
-        };
924
-        // do a nonce check cause we're not coming in from an normal route here.
925
-        $nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce'])
926
-            : '';
927
-        $nonce_ref = 'checkin_nonce';
928
-        $this->_verify_nonce($nonce, $nonce_ref);
929
-        // beautiful! Made it this far so let's get the status.
930
-        $new_status = new CheckinStatusDashicon($this->_toggle_checkin_status());
931
-        // setup new class to return via ajax
932
-        $this->_template_args['admin_page_content'] = 'clickable trigger-checkin ' . $new_status->cssClasses();
933
-        $this->_template_args['success'] = true;
934
-        $this->_return_json();
935
-    }
898
+	/**
899
+	 * toggle the Check-in status for the given registration (coming from ajax)
900
+	 *
901
+	 * @return void (JSON)
902
+	 * @throws EE_Error
903
+	 * @throws InvalidArgumentException
904
+	 * @throws InvalidDataTypeException
905
+	 * @throws InvalidInterfaceException
906
+	 */
907
+	public function toggle_checkin_status()
908
+	{
909
+		// first make sure we have the necessary data
910
+		if (! isset($this->_req_data['_regid'])) {
911
+			EE_Error::add_error(
912
+				esc_html__(
913
+					'There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax',
914
+					'event_espresso'
915
+				),
916
+				__FILE__,
917
+				__FUNCTION__,
918
+				__LINE__
919
+			);
920
+			$this->_template_args['success'] = false;
921
+			$this->_template_args['error'] = true;
922
+			$this->_return_json();
923
+		};
924
+		// do a nonce check cause we're not coming in from an normal route here.
925
+		$nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce'])
926
+			: '';
927
+		$nonce_ref = 'checkin_nonce';
928
+		$this->_verify_nonce($nonce, $nonce_ref);
929
+		// beautiful! Made it this far so let's get the status.
930
+		$new_status = new CheckinStatusDashicon($this->_toggle_checkin_status());
931
+		// setup new class to return via ajax
932
+		$this->_template_args['admin_page_content'] = 'clickable trigger-checkin ' . $new_status->cssClasses();
933
+		$this->_template_args['success'] = true;
934
+		$this->_return_json();
935
+	}
936 936
 
937 937
 
938
-    /**
939
-     * handles toggling the checkin status for the registration,
940
-     *
941
-     * @access protected
942
-     * @return int|void
943
-     * @throws EE_Error
944
-     * @throws InvalidArgumentException
945
-     * @throws InvalidDataTypeException
946
-     * @throws InvalidInterfaceException
947
-     */
948
-    protected function _toggle_checkin_status()
949
-    {
950
-        // first let's get the query args out of the way for the redirect
951
-        $query_args = array(
952
-            'action'   => 'event_registrations',
953
-            'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null,
954
-            'DTT_ID'   => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null,
955
-        );
956
-        $new_status = false;
957
-        // bulk action check in toggle
958
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
959
-            // cycle thru checkboxes
960
-            while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
961
-                $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
962
-                $new_status = $this->_toggle_checkin($REG_ID, $DTT_ID);
963
-            }
964
-        } elseif (isset($this->_req_data['_regid'])) {
965
-            // coming from ajax request
966
-            $DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : null;
967
-            $query_args['DTT_ID'] = $DTT_ID;
968
-            $new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID);
969
-        } else {
970
-            EE_Error::add_error(
971
-                esc_html__('Missing some required data to toggle the Check-in', 'event_espresso'),
972
-                __FILE__,
973
-                __FUNCTION__,
974
-                __LINE__
975
-            );
976
-        }
977
-        if (defined('DOING_AJAX')) {
978
-            return $new_status;
979
-        }
980
-        $this->_redirect_after_action(false, '', '', $query_args, true);
981
-    }
938
+	/**
939
+	 * handles toggling the checkin status for the registration,
940
+	 *
941
+	 * @access protected
942
+	 * @return int|void
943
+	 * @throws EE_Error
944
+	 * @throws InvalidArgumentException
945
+	 * @throws InvalidDataTypeException
946
+	 * @throws InvalidInterfaceException
947
+	 */
948
+	protected function _toggle_checkin_status()
949
+	{
950
+		// first let's get the query args out of the way for the redirect
951
+		$query_args = array(
952
+			'action'   => 'event_registrations',
953
+			'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null,
954
+			'DTT_ID'   => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null,
955
+		);
956
+		$new_status = false;
957
+		// bulk action check in toggle
958
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
959
+			// cycle thru checkboxes
960
+			while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
961
+				$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
962
+				$new_status = $this->_toggle_checkin($REG_ID, $DTT_ID);
963
+			}
964
+		} elseif (isset($this->_req_data['_regid'])) {
965
+			// coming from ajax request
966
+			$DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : null;
967
+			$query_args['DTT_ID'] = $DTT_ID;
968
+			$new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID);
969
+		} else {
970
+			EE_Error::add_error(
971
+				esc_html__('Missing some required data to toggle the Check-in', 'event_espresso'),
972
+				__FILE__,
973
+				__FUNCTION__,
974
+				__LINE__
975
+			);
976
+		}
977
+		if (defined('DOING_AJAX')) {
978
+			return $new_status;
979
+		}
980
+		$this->_redirect_after_action(false, '', '', $query_args, true);
981
+	}
982 982
 
983 983
 
984
-    /**
985
-     * This is toggles a single Check-in for the given registration and datetime.
986
-     *
987
-     * @param  int $REG_ID The registration we're toggling
988
-     * @param  int $DTT_ID The datetime we're toggling
989
-     * @return int The new status toggled to.
990
-     * @throws EE_Error
991
-     * @throws InvalidArgumentException
992
-     * @throws InvalidDataTypeException
993
-     * @throws InvalidInterfaceException
994
-     */
995
-    private function _toggle_checkin($REG_ID, $DTT_ID)
996
-    {
997
-        /** @var EE_Registration $REG */
998
-        $REG = EEM_Registration::instance()->get_one_by_ID($REG_ID);
999
-        $new_status = $REG->toggle_checkin_status($DTT_ID);
1000
-        if ($new_status !== false) {
1001
-            EE_Error::add_success($REG->get_checkin_msg($DTT_ID));
1002
-        } else {
1003
-            EE_Error::add_error($REG->get_checkin_msg($DTT_ID, true), __FILE__, __FUNCTION__, __LINE__);
1004
-            $new_status = false;
1005
-        }
1006
-        return $new_status;
1007
-    }
984
+	/**
985
+	 * This is toggles a single Check-in for the given registration and datetime.
986
+	 *
987
+	 * @param  int $REG_ID The registration we're toggling
988
+	 * @param  int $DTT_ID The datetime we're toggling
989
+	 * @return int The new status toggled to.
990
+	 * @throws EE_Error
991
+	 * @throws InvalidArgumentException
992
+	 * @throws InvalidDataTypeException
993
+	 * @throws InvalidInterfaceException
994
+	 */
995
+	private function _toggle_checkin($REG_ID, $DTT_ID)
996
+	{
997
+		/** @var EE_Registration $REG */
998
+		$REG = EEM_Registration::instance()->get_one_by_ID($REG_ID);
999
+		$new_status = $REG->toggle_checkin_status($DTT_ID);
1000
+		if ($new_status !== false) {
1001
+			EE_Error::add_success($REG->get_checkin_msg($DTT_ID));
1002
+		} else {
1003
+			EE_Error::add_error($REG->get_checkin_msg($DTT_ID, true), __FILE__, __FUNCTION__, __LINE__);
1004
+			$new_status = false;
1005
+		}
1006
+		return $new_status;
1007
+	}
1008 1008
 
1009 1009
 
1010
-    /**
1011
-     * Takes care of deleting multiple EE_Checkin table rows
1012
-     *
1013
-     * @access protected
1014
-     * @return void
1015
-     * @throws EE_Error
1016
-     * @throws InvalidArgumentException
1017
-     * @throws InvalidDataTypeException
1018
-     * @throws InvalidInterfaceException
1019
-     */
1020
-    protected function _delete_checkin_rows()
1021
-    {
1022
-        $query_args = array(
1023
-            'action'  => 'registration_checkins',
1024
-            'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1025
-            '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1026
-        );
1027
-        $errors = 0;
1028
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1029
-            while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
1030
-                if (! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1031
-                    $errors++;
1032
-                }
1033
-            }
1034
-        } else {
1035
-            EE_Error::add_error(
1036
-                esc_html__(
1037
-                    'So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!',
1038
-                    'event_espresso'
1039
-                ),
1040
-                __FILE__,
1041
-                __FUNCTION__,
1042
-                __LINE__
1043
-            );
1044
-            $this->_redirect_after_action(false, '', '', $query_args, true);
1045
-        }
1046
-        if ($errors > 0) {
1047
-            EE_Error::add_error(
1048
-                sprintf(esc_html__('There were %d records that did not delete successfully', 'event_espresso'), $errors),
1049
-                __FILE__,
1050
-                __FUNCTION__,
1051
-                __LINE__
1052
-            );
1053
-        } else {
1054
-            EE_Error::add_success(esc_html__('Records were successfully deleted', 'event_espresso'));
1055
-        }
1056
-        $this->_redirect_after_action(false, '', '', $query_args, true);
1057
-    }
1010
+	/**
1011
+	 * Takes care of deleting multiple EE_Checkin table rows
1012
+	 *
1013
+	 * @access protected
1014
+	 * @return void
1015
+	 * @throws EE_Error
1016
+	 * @throws InvalidArgumentException
1017
+	 * @throws InvalidDataTypeException
1018
+	 * @throws InvalidInterfaceException
1019
+	 */
1020
+	protected function _delete_checkin_rows()
1021
+	{
1022
+		$query_args = array(
1023
+			'action'  => 'registration_checkins',
1024
+			'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1025
+			'_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1026
+		);
1027
+		$errors = 0;
1028
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1029
+			while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
1030
+				if (! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1031
+					$errors++;
1032
+				}
1033
+			}
1034
+		} else {
1035
+			EE_Error::add_error(
1036
+				esc_html__(
1037
+					'So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!',
1038
+					'event_espresso'
1039
+				),
1040
+				__FILE__,
1041
+				__FUNCTION__,
1042
+				__LINE__
1043
+			);
1044
+			$this->_redirect_after_action(false, '', '', $query_args, true);
1045
+		}
1046
+		if ($errors > 0) {
1047
+			EE_Error::add_error(
1048
+				sprintf(esc_html__('There were %d records that did not delete successfully', 'event_espresso'), $errors),
1049
+				__FILE__,
1050
+				__FUNCTION__,
1051
+				__LINE__
1052
+			);
1053
+		} else {
1054
+			EE_Error::add_success(esc_html__('Records were successfully deleted', 'event_espresso'));
1055
+		}
1056
+		$this->_redirect_after_action(false, '', '', $query_args, true);
1057
+	}
1058 1058
 
1059 1059
 
1060
-    /**
1061
-     * Deletes a single EE_Checkin row
1062
-     *
1063
-     * @return void
1064
-     * @throws EE_Error
1065
-     * @throws InvalidArgumentException
1066
-     * @throws InvalidDataTypeException
1067
-     * @throws InvalidInterfaceException
1068
-     */
1069
-    protected function _delete_checkin_row()
1070
-    {
1071
-        $query_args = array(
1072
-            'action'  => 'registration_checkins',
1073
-            'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1074
-            '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1075
-        );
1076
-        if (! empty($this->_req_data['CHK_ID'])) {
1077
-            if (! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1078
-                EE_Error::add_error(
1079
-                    esc_html__('Something went wrong and this check-in record was not deleted', 'event_espresso'),
1080
-                    __FILE__,
1081
-                    __FUNCTION__,
1082
-                    __LINE__
1083
-                );
1084
-            } else {
1085
-                EE_Error::add_success(esc_html__('Check-In record successfully deleted', 'event_espresso'));
1086
-            }
1087
-        } else {
1088
-            EE_Error::add_error(
1089
-                esc_html__(
1090
-                    'In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code',
1091
-                    'event_espresso'
1092
-                ),
1093
-                __FILE__,
1094
-                __FUNCTION__,
1095
-                __LINE__
1096
-            );
1097
-        }
1098
-        $this->_redirect_after_action(false, '', '', $query_args, true);
1099
-    }
1060
+	/**
1061
+	 * Deletes a single EE_Checkin row
1062
+	 *
1063
+	 * @return void
1064
+	 * @throws EE_Error
1065
+	 * @throws InvalidArgumentException
1066
+	 * @throws InvalidDataTypeException
1067
+	 * @throws InvalidInterfaceException
1068
+	 */
1069
+	protected function _delete_checkin_row()
1070
+	{
1071
+		$query_args = array(
1072
+			'action'  => 'registration_checkins',
1073
+			'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1074
+			'_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1075
+		);
1076
+		if (! empty($this->_req_data['CHK_ID'])) {
1077
+			if (! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1078
+				EE_Error::add_error(
1079
+					esc_html__('Something went wrong and this check-in record was not deleted', 'event_espresso'),
1080
+					__FILE__,
1081
+					__FUNCTION__,
1082
+					__LINE__
1083
+				);
1084
+			} else {
1085
+				EE_Error::add_success(esc_html__('Check-In record successfully deleted', 'event_espresso'));
1086
+			}
1087
+		} else {
1088
+			EE_Error::add_error(
1089
+				esc_html__(
1090
+					'In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code',
1091
+					'event_espresso'
1092
+				),
1093
+				__FILE__,
1094
+				__FUNCTION__,
1095
+				__LINE__
1096
+			);
1097
+		}
1098
+		$this->_redirect_after_action(false, '', '', $query_args, true);
1099
+	}
1100 1100
 
1101 1101
 
1102
-    /**
1103
-     *        generates HTML for the Event Registrations List Table
1104
-     *
1105
-     * @access protected
1106
-     * @return void
1107
-     * @throws EE_Error
1108
-     * @throws InvalidArgumentException
1109
-     * @throws InvalidDataTypeException
1110
-     * @throws InvalidInterfaceException
1111
-     */
1112
-    protected function _event_registrations_list_table()
1113
-    {
1114
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1115
-        $this->_admin_page_title .= isset($this->_req_data['event_id'])
1116
-            ? $this->get_action_link_or_button(
1117
-                'new_registration',
1118
-                'add-registrant',
1119
-                array('event_id' => $this->_req_data['event_id']),
1120
-                'add-new-h2',
1121
-                '',
1122
-                false
1123
-            )
1124
-            : '';
1125
-        $checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
1126
-        $checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
1127
-        $checked_never = new CheckinStatusDashicon(EE_Checkin::status_checked_never);
1128
-        $legend_items = array(
1129
-            'star-icon'        => array(
1130
-                'class' => 'dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8',
1131
-                'desc'  => esc_html__('This Registrant is the Primary Registrant', 'event_espresso'),
1132
-            ),
1133
-            'checkin'          => array(
1134
-                'class' => $checked_in->cssClasses(),
1135
-                'desc'  => $checked_in->legendLabel(),
1136
-            ),
1137
-            'checkout'         => array(
1138
-                'class' => $checked_out->cssClasses(),
1139
-                'desc'  => $checked_out->legendLabel(),
1140
-            ),
1141
-            'nocheckinrecord'  => array(
1142
-                'class' => $checked_never->cssClasses(),
1143
-                'desc'  => $checked_never->legendLabel(),
1144
-            ),
1145
-            'approved_status'  => array(
1146
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
1147
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'),
1148
-            ),
1149
-            'cancelled_status' => array(
1150
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
1151
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'),
1152
-            ),
1153
-            'declined_status'  => array(
1154
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
1155
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'),
1156
-            ),
1157
-            'not_approved'     => array(
1158
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
1159
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'),
1160
-            ),
1161
-            'pending_status'   => array(
1162
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
1163
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'),
1164
-            ),
1165
-            'wait_list'        => array(
1166
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list,
1167
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence'),
1168
-            ),
1169
-        );
1170
-        $this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
1171
-        $event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null;
1172
-        /** @var EE_Event $event */
1173
-        $event = EEM_Event::instance()->get_one_by_ID($event_id);
1174
-        $this->_template_args['before_list_table'] = $event instanceof EE_Event
1175
-            ? '<h2>' . sprintf(
1176
-                esc_html__('Viewing Registrations for Event: %s', 'event_espresso'),
1177
-                EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')
1178
-            ) . '</h2>'
1179
-            : '';
1180
-        // need to get the number of datetimes on the event and set default datetime_id if there is only one datetime on
1181
-        // the event.
1182
-        $DTT_ID = ! empty($this->_req_data['DTT_ID']) ? absint($this->_req_data['DTT_ID']) : 0;
1183
-        $datetime = null;
1184
-        if ($event instanceof EE_Event) {
1185
-            $datetimes_on_event = $event->datetimes();
1186
-            if (count($datetimes_on_event) === 1) {
1187
-                $datetime = reset($datetimes_on_event);
1188
-            }
1189
-        }
1190
-        $datetime = $datetime instanceof EE_Datetime ? $datetime : EEM_Datetime::instance()->get_one_by_ID($DTT_ID);
1191
-        if ($datetime instanceof EE_Datetime && $this->_template_args['before_list_table'] !== '') {
1192
-            $this->_template_args['before_list_table'] = substr($this->_template_args['before_list_table'], 0, -5);
1193
-            $this->_template_args['before_list_table'] .= ' &nbsp;<span class="drk-grey-text">';
1194
-            $this->_template_args['before_list_table'] .= '<span class="dashicons dashicons-calendar"></span>';
1195
-            $this->_template_args['before_list_table'] .= $datetime->name();
1196
-            $this->_template_args['before_list_table'] .= ' ( ' . $datetime->date_and_time_range() . ' )';
1197
-            $this->_template_args['before_list_table'] .= '</span></h2>';
1198
-        }
1199
-        // if no datetime, then we're on the initial view, so let's give some helpful instructions on what the status
1200
-        // column represents
1201
-        if (! $datetime instanceof EE_Datetime) {
1202
-            $this->_template_args['before_list_table'] .= '<br><p class="description">'
1203
-                                                          . esc_html__(
1204
-                                                              'In this view, the check-in status represents the latest check-in record for the registration in that row.',
1205
-                                                              'event_espresso'
1206
-                                                          )
1207
-                                                          . '</p>';
1208
-        }
1209
-        $this->display_admin_list_table_page_with_no_sidebar();
1210
-    }
1102
+	/**
1103
+	 *        generates HTML for the Event Registrations List Table
1104
+	 *
1105
+	 * @access protected
1106
+	 * @return void
1107
+	 * @throws EE_Error
1108
+	 * @throws InvalidArgumentException
1109
+	 * @throws InvalidDataTypeException
1110
+	 * @throws InvalidInterfaceException
1111
+	 */
1112
+	protected function _event_registrations_list_table()
1113
+	{
1114
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1115
+		$this->_admin_page_title .= isset($this->_req_data['event_id'])
1116
+			? $this->get_action_link_or_button(
1117
+				'new_registration',
1118
+				'add-registrant',
1119
+				array('event_id' => $this->_req_data['event_id']),
1120
+				'add-new-h2',
1121
+				'',
1122
+				false
1123
+			)
1124
+			: '';
1125
+		$checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
1126
+		$checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
1127
+		$checked_never = new CheckinStatusDashicon(EE_Checkin::status_checked_never);
1128
+		$legend_items = array(
1129
+			'star-icon'        => array(
1130
+				'class' => 'dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8',
1131
+				'desc'  => esc_html__('This Registrant is the Primary Registrant', 'event_espresso'),
1132
+			),
1133
+			'checkin'          => array(
1134
+				'class' => $checked_in->cssClasses(),
1135
+				'desc'  => $checked_in->legendLabel(),
1136
+			),
1137
+			'checkout'         => array(
1138
+				'class' => $checked_out->cssClasses(),
1139
+				'desc'  => $checked_out->legendLabel(),
1140
+			),
1141
+			'nocheckinrecord'  => array(
1142
+				'class' => $checked_never->cssClasses(),
1143
+				'desc'  => $checked_never->legendLabel(),
1144
+			),
1145
+			'approved_status'  => array(
1146
+				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
1147
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'),
1148
+			),
1149
+			'cancelled_status' => array(
1150
+				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
1151
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'),
1152
+			),
1153
+			'declined_status'  => array(
1154
+				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
1155
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'),
1156
+			),
1157
+			'not_approved'     => array(
1158
+				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
1159
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'),
1160
+			),
1161
+			'pending_status'   => array(
1162
+				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
1163
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'),
1164
+			),
1165
+			'wait_list'        => array(
1166
+				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list,
1167
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence'),
1168
+			),
1169
+		);
1170
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
1171
+		$event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null;
1172
+		/** @var EE_Event $event */
1173
+		$event = EEM_Event::instance()->get_one_by_ID($event_id);
1174
+		$this->_template_args['before_list_table'] = $event instanceof EE_Event
1175
+			? '<h2>' . sprintf(
1176
+				esc_html__('Viewing Registrations for Event: %s', 'event_espresso'),
1177
+				EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')
1178
+			) . '</h2>'
1179
+			: '';
1180
+		// need to get the number of datetimes on the event and set default datetime_id if there is only one datetime on
1181
+		// the event.
1182
+		$DTT_ID = ! empty($this->_req_data['DTT_ID']) ? absint($this->_req_data['DTT_ID']) : 0;
1183
+		$datetime = null;
1184
+		if ($event instanceof EE_Event) {
1185
+			$datetimes_on_event = $event->datetimes();
1186
+			if (count($datetimes_on_event) === 1) {
1187
+				$datetime = reset($datetimes_on_event);
1188
+			}
1189
+		}
1190
+		$datetime = $datetime instanceof EE_Datetime ? $datetime : EEM_Datetime::instance()->get_one_by_ID($DTT_ID);
1191
+		if ($datetime instanceof EE_Datetime && $this->_template_args['before_list_table'] !== '') {
1192
+			$this->_template_args['before_list_table'] = substr($this->_template_args['before_list_table'], 0, -5);
1193
+			$this->_template_args['before_list_table'] .= ' &nbsp;<span class="drk-grey-text">';
1194
+			$this->_template_args['before_list_table'] .= '<span class="dashicons dashicons-calendar"></span>';
1195
+			$this->_template_args['before_list_table'] .= $datetime->name();
1196
+			$this->_template_args['before_list_table'] .= ' ( ' . $datetime->date_and_time_range() . ' )';
1197
+			$this->_template_args['before_list_table'] .= '</span></h2>';
1198
+		}
1199
+		// if no datetime, then we're on the initial view, so let's give some helpful instructions on what the status
1200
+		// column represents
1201
+		if (! $datetime instanceof EE_Datetime) {
1202
+			$this->_template_args['before_list_table'] .= '<br><p class="description">'
1203
+														  . esc_html__(
1204
+															  'In this view, the check-in status represents the latest check-in record for the registration in that row.',
1205
+															  'event_espresso'
1206
+														  )
1207
+														  . '</p>';
1208
+		}
1209
+		$this->display_admin_list_table_page_with_no_sidebar();
1210
+	}
1211 1211
 
1212
-    /**
1213
-     * Download the registrations check-in report (same as the normal registration report, but with different where
1214
-     * conditions)
1215
-     *
1216
-     * @return void ends the request by a redirect or download
1217
-     */
1218
-    public function _registrations_checkin_report()
1219
-    {
1220
-        $this->_registrations_report_base('_get_checkin_query_params_from_request');
1221
-    }
1212
+	/**
1213
+	 * Download the registrations check-in report (same as the normal registration report, but with different where
1214
+	 * conditions)
1215
+	 *
1216
+	 * @return void ends the request by a redirect or download
1217
+	 */
1218
+	public function _registrations_checkin_report()
1219
+	{
1220
+		$this->_registrations_report_base('_get_checkin_query_params_from_request');
1221
+	}
1222 1222
 
1223
-    /**
1224
-     * Gets the query params from the request, plus adds a where condition for the registration status,
1225
-     * because on the checkin page we only ever want to see approved and pending-approval registrations
1226
-     *
1227
-     * @param array $request
1228
-     * @param int   $per_page
1229
-     * @param bool  $count
1230
-     * @return array
1231
-     * @throws EE_Error
1232
-     */
1233
-    protected function _get_checkin_query_params_from_request(
1234
-        $request,
1235
-        $per_page = 10,
1236
-        $count = false
1237
-    ) {
1238
-        $query_params = $this->_get_registration_query_parameters($request, $per_page, $count);
1239
-        // unlike the regular registrations list table,
1240
-        $status_ids_array = apply_filters(
1241
-            'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
1242
-            array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)
1243
-        );
1244
-        $query_params[0]['STS_ID'] = array('IN', $status_ids_array);
1245
-        return $query_params;
1246
-    }
1223
+	/**
1224
+	 * Gets the query params from the request, plus adds a where condition for the registration status,
1225
+	 * because on the checkin page we only ever want to see approved and pending-approval registrations
1226
+	 *
1227
+	 * @param array $request
1228
+	 * @param int   $per_page
1229
+	 * @param bool  $count
1230
+	 * @return array
1231
+	 * @throws EE_Error
1232
+	 */
1233
+	protected function _get_checkin_query_params_from_request(
1234
+		$request,
1235
+		$per_page = 10,
1236
+		$count = false
1237
+	) {
1238
+		$query_params = $this->_get_registration_query_parameters($request, $per_page, $count);
1239
+		// unlike the regular registrations list table,
1240
+		$status_ids_array = apply_filters(
1241
+			'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
1242
+			array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)
1243
+		);
1244
+		$query_params[0]['STS_ID'] = array('IN', $status_ids_array);
1245
+		return $query_params;
1246
+	}
1247 1247
 
1248 1248
 
1249
-    /**
1250
-     * Gets registrations for an event
1251
-     *
1252
-     * @param int    $per_page
1253
-     * @param bool   $count whether to return count or data.
1254
-     * @param bool   $trash
1255
-     * @param string $orderby
1256
-     * @return EE_Registration[]|int
1257
-     * @throws EE_Error
1258
-     * @throws InvalidArgumentException
1259
-     * @throws InvalidDataTypeException
1260
-     * @throws InvalidInterfaceException
1261
-     */
1262
-    public function get_event_attendees($per_page = 10, $count = false, $trash = false, $orderby = 'ATT_fname')
1263
-    {
1264
-        // set some defaults, these will get overridden if included in the actual request parameters
1265
-        $defaults = [
1266
-            'orderby' => $orderby,
1267
-            'order' => 'ASC',
1268
-        ];
1269
-        if ($trash) {
1270
-            $defaults['status'] = 'trash';
1271
-        }
1272
-        $query_params = $this->_get_checkin_query_params_from_request($defaults, $per_page, $count);
1249
+	/**
1250
+	 * Gets registrations for an event
1251
+	 *
1252
+	 * @param int    $per_page
1253
+	 * @param bool   $count whether to return count or data.
1254
+	 * @param bool   $trash
1255
+	 * @param string $orderby
1256
+	 * @return EE_Registration[]|int
1257
+	 * @throws EE_Error
1258
+	 * @throws InvalidArgumentException
1259
+	 * @throws InvalidDataTypeException
1260
+	 * @throws InvalidInterfaceException
1261
+	 */
1262
+	public function get_event_attendees($per_page = 10, $count = false, $trash = false, $orderby = 'ATT_fname')
1263
+	{
1264
+		// set some defaults, these will get overridden if included in the actual request parameters
1265
+		$defaults = [
1266
+			'orderby' => $orderby,
1267
+			'order' => 'ASC',
1268
+		];
1269
+		if ($trash) {
1270
+			$defaults['status'] = 'trash';
1271
+		}
1272
+		$query_params = $this->_get_checkin_query_params_from_request($defaults, $per_page, $count);
1273 1273
 
1274
-        /**
1275
-         * Override the default groupby added by EEM_Base so that sorts with multiple order bys work as expected
1276
-         *
1277
-         * @link https://events.codebasehq.com/projects/event-espresso/tickets/10093
1278
-         * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
1279
-         *                             or if you have the development copy of EE you can view this at the path:
1280
-         *                             /docs/G--Model-System/model-query-params.md
1281
-         */
1282
-        $query_params['group_by'] = '';
1274
+		/**
1275
+		 * Override the default groupby added by EEM_Base so that sorts with multiple order bys work as expected
1276
+		 *
1277
+		 * @link https://events.codebasehq.com/projects/event-espresso/tickets/10093
1278
+		 * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
1279
+		 *                             or if you have the development copy of EE you can view this at the path:
1280
+		 *                             /docs/G--Model-System/model-query-params.md
1281
+		 */
1282
+		$query_params['group_by'] = '';
1283 1283
 
1284
-        return $count
1285
-            ? EEM_Registration::instance()->count($query_params)
1286
-            /** @type EE_Registration[] */
1287
-            : EEM_Registration::instance()->get_all($query_params);
1288
-    }
1284
+		return $count
1285
+			? EEM_Registration::instance()->count($query_params)
1286
+			/** @type EE_Registration[] */
1287
+			: EEM_Registration::instance()->get_all($query_params);
1288
+	}
1289 1289
 }
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
     public function __construct($routing = true)
31 31
     {
32 32
         parent::__construct($routing);
33
-        if (! defined('REG_CAF_TEMPLATE_PATH')) {
34
-            define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
35
-            define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
36
-            define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
33
+        if ( ! defined('REG_CAF_TEMPLATE_PATH')) {
34
+            define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'registrations/templates/');
35
+            define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'registrations/assets/');
36
+            define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registrations/assets/');
37 37
         }
38 38
     }
39 39
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     protected function _extend_page_config()
45 45
     {
46
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
46
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'registrations';
47 47
         $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID'])
48 48
             ? $this->_req_data['_REG_ID']
49 49
             : 0;
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
             // enqueue newsletter js
181 181
             wp_enqueue_script(
182 182
                 'ee-newsletter-trigger',
183
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js',
183
+                REG_CAF_ASSETS_URL.'ee-newsletter-trigger.js',
184 184
                 array('ee-dialog'),
185 185
                 EVENT_ESPRESSO_VERSION,
186 186
                 true
187 187
             );
188 188
             wp_enqueue_style(
189 189
                 'ee-newsletter-trigger-css',
190
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css',
190
+                REG_CAF_ASSETS_URL.'ee-newsletter-trigger.css',
191 191
                 array(),
192 192
                 EVENT_ESPRESSO_VERSION
193 193
             );
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     {
209 209
         wp_register_script(
210 210
             'ee-reg-reports-js',
211
-            REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js',
211
+            REG_CAF_ASSETS_URL.'ee-registration-admin-reports.js',
212 212
             array('google-charts'),
213 213
             EVENT_ESPRESSO_VERSION,
214 214
             true
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         $nonce_ref = 'get_newsletter_form_content_nonce';
295 295
         $this->_verify_nonce($nonce, $nonce_ref);
296 296
         // let's get the mtp for the incoming MTP_ ID
297
-        if (! isset($this->_req_data['GRP_ID'])) {
297
+        if ( ! isset($this->_req_data['GRP_ID'])) {
298 298
             EE_Error::add_error(
299 299
                 esc_html__(
300 300
                     'There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).',
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             $this->_return_json();
310 310
         }
311 311
         $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
312
-        if (! $MTPG instanceof EE_Message_Template_Group) {
312
+        if ( ! $MTPG instanceof EE_Message_Template_Group) {
313 313
             EE_Error::add_error(
314 314
                 sprintf(
315 315
                     esc_html__(
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
             $field = $MTP->get('MTP_template_field');
335 335
             if ($field === 'content') {
336 336
                 $content = $MTP->get('MTP_content');
337
-                if (! empty($content['newsletter_content'])) {
337
+                if ( ! empty($content['newsletter_content'])) {
338 338
                     $template_fields['newsletter_content'] = $content['newsletter_content'];
339 339
                 }
340 340
                 continue;
341 341
             }
342
-            $template_fields[ $MTP->get('MTP_template_field') ] = $MTP->get('MTP_content');
342
+            $template_fields[$MTP->get('MTP_template_field')] = $MTP->get('MTP_content');
343 343
         }
344 344
         $this->_template_args['success'] = true;
345 345
         $this->_template_args['error'] = false;
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
                 $field_id = $field === '[NEWSLETTER_CONTENT]'
442 442
                     ? 'content'
443 443
                     : $field;
444
-                $field_id = 'batch-message-' . strtolower($field_id);
444
+                $field_id = 'batch-message-'.strtolower($field_id);
445 445
                 $available_shortcodes[] = '<span class="js-shortcode-selection" data-value="'
446 446
                                           . $shortcode
447
-                                          . '" data-linked-input-id="' . $field_id . '">'
447
+                                          . '" data-linked-input-id="'.$field_id.'">'
448 448
                                           . $shortcode
449 449
                                           . '</span>';
450 450
             }
451
-            $codes[ $field ] = implode(', ', $available_shortcodes);
451
+            $codes[$field] = implode(', ', $available_shortcodes);
452 452
         }
453 453
         $shortcodes = $codes;
454
-        $form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
454
+        $form_template = REG_CAF_TEMPLATE_PATH.'newsletter-send-form.template.php';
455 455
         $form_template_args = array(
456 456
             'form_action'       => admin_url('admin.php?page=espresso_registrations'),
457 457
             'form_route'        => 'newsletter_selected_send',
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
      */
620 620
     protected function _registration_reports()
621 621
     {
622
-        $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
622
+        $template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
623 623
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
624 624
             $template_path,
625 625
             $this->_reports_template_data,
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
             array_unshift($regs, $column_titles);
675 675
             // setup the date range.
676 676
             $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
677
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
677
+            $beginning_date = new DateTime("now ".$period, $DateTimeZone);
678 678
             $ending_date = new DateTime("now", $DateTimeZone);
679 679
             $subtitle = sprintf(
680 680
                 wp_strip_all_tags(
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
                         'event_espresso'
699 699
                     )
700 700
                 ),
701
-                '<h2>' . $report_title . '</h2><p>',
701
+                '<h2>'.$report_title.'</h2><p>',
702 702
                 '</p>'
703 703
             ),
704 704
         );
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
             array_unshift($regs, $column_titles);
752 752
             // setup the date range.
753 753
             $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
754
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
754
+            $beginning_date = new DateTime("now ".$period, $DateTimeZone);
755 755
             $ending_date = new DateTime("now", $DateTimeZone);
756 756
             $subtitle = sprintf(
757 757
                 wp_strip_all_tags(
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
                         'event_espresso'
776 776
                     )
777 777
                 ),
778
-                '<h2>' . $report_title . '</h2><p>',
778
+                '<h2>'.$report_title.'</h2><p>',
779 779
                 '</p>'
780 780
             ),
781 781
         );
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
         $reg_id = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : null;
802 802
         /** @var EE_Registration $registration */
803 803
         $registration = EEM_Registration::instance()->get_one_by_ID($reg_id);
804
-        if (! $registration instanceof EE_Registration) {
804
+        if ( ! $registration instanceof EE_Registration) {
805 805
             throw new EE_Error(
806 806
                 sprintf(
807 807
                     esc_html__('An error occurred. There is no registration with ID (%d)', 'event_espresso'),
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
         if ($datetime instanceof EE_Datetime) {
837 837
             $datetime_label = $datetime->get_dtt_display_name(true);
838 838
             $datetime_label .= ! empty($datetime_label)
839
-                ? ' (' . $datetime->get_dtt_display_name() . ')'
839
+                ? ' ('.$datetime->get_dtt_display_name().')'
840 840
                 : $datetime->get_dtt_display_name();
841 841
         }
842 842
         $datetime_link = ! empty($dtt_id) && $registration instanceof EE_Registration
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
             )
851 851
             : '';
852 852
         $datetime_link = ! empty($datetime_link)
853
-            ? '<a href="' . $datetime_link . '">'
853
+            ? '<a href="'.$datetime_link.'">'
854 854
               . '<span id="checkin-dtt">'
855 855
               . $datetime_label
856 856
               . '</span></a>'
@@ -862,8 +862,8 @@  discard block
 block discarded – undo
862 862
             ? $attendee->get_admin_details_link()
863 863
             : '';
864 864
         $attendee_link = ! empty($attendee_link)
865
-            ? '<a href="' . $attendee->get_admin_details_link() . '"'
866
-              . ' aria-label="' . esc_html__('Click for attendee details', 'event_espresso') . '">'
865
+            ? '<a href="'.$attendee->get_admin_details_link().'"'
866
+              . ' aria-label="'.esc_html__('Click for attendee details', 'event_espresso').'">'
867 867
               . '<span id="checkin-attendee-name">'
868 868
               . $attendee_name
869 869
               . '</span></a>'
@@ -872,25 +872,25 @@  discard block
 block discarded – undo
872 872
             ? $registration->event()->get_admin_details_link()
873 873
             : '';
874 874
         $event_link = ! empty($event_link)
875
-            ? '<a href="' . $event_link . '"'
876
-              . ' aria-label="' . esc_html__('Click here to edit event.', 'event_espresso') . '">'
875
+            ? '<a href="'.$event_link.'"'
876
+              . ' aria-label="'.esc_html__('Click here to edit event.', 'event_espresso').'">'
877 877
               . '<span id="checkin-event-name">'
878 878
               . $registration->event_name()
879 879
               . '</span>'
880 880
               . '</a>'
881 881
             : '';
882 882
         $this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id)
883
-            ? '<h2>' . sprintf(
883
+            ? '<h2>'.sprintf(
884 884
                 esc_html__('Displaying check in records for %1$s for %2$s at the event, %3$s', 'event_espresso'),
885 885
                 $attendee_link,
886 886
                 $datetime_link,
887 887
                 $event_link
888
-            ) . '</h2>'
888
+            ).'</h2>'
889 889
             : '';
890 890
         $this->_template_args['list_table_hidden_fields'] = ! empty($reg_id)
891
-            ? '<input type="hidden" name="_REG_ID" value="' . $reg_id . '">' : '';
891
+            ? '<input type="hidden" name="_REG_ID" value="'.$reg_id.'">' : '';
892 892
         $this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id)
893
-            ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
893
+            ? '<input type="hidden" name="DTT_ID" value="'.$dtt_id.'">' : '';
894 894
         $this->display_admin_list_table_page_with_no_sidebar();
895 895
     }
896 896
 
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
     public function toggle_checkin_status()
908 908
     {
909 909
         // first make sure we have the necessary data
910
-        if (! isset($this->_req_data['_regid'])) {
910
+        if ( ! isset($this->_req_data['_regid'])) {
911 911
             EE_Error::add_error(
912 912
                 esc_html__(
913 913
                     'There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax',
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
         // beautiful! Made it this far so let's get the status.
930 930
         $new_status = new CheckinStatusDashicon($this->_toggle_checkin_status());
931 931
         // setup new class to return via ajax
932
-        $this->_template_args['admin_page_content'] = 'clickable trigger-checkin ' . $new_status->cssClasses();
932
+        $this->_template_args['admin_page_content'] = 'clickable trigger-checkin '.$new_status->cssClasses();
933 933
         $this->_template_args['success'] = true;
934 934
         $this->_return_json();
935 935
     }
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
         );
956 956
         $new_status = false;
957 957
         // bulk action check in toggle
958
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
958
+        if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
959 959
             // cycle thru checkboxes
960 960
             while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
961 961
                 $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
@@ -1025,9 +1025,9 @@  discard block
 block discarded – undo
1025 1025
             '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1026 1026
         );
1027 1027
         $errors = 0;
1028
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1028
+        if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1029 1029
             while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
1030
-                if (! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1030
+                if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1031 1031
                     $errors++;
1032 1032
                 }
1033 1033
             }
@@ -1073,8 +1073,8 @@  discard block
 block discarded – undo
1073 1073
             'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1074 1074
             '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1075 1075
         );
1076
-        if (! empty($this->_req_data['CHK_ID'])) {
1077
-            if (! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1076
+        if ( ! empty($this->_req_data['CHK_ID'])) {
1077
+            if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1078 1078
                 EE_Error::add_error(
1079 1079
                     esc_html__('Something went wrong and this check-in record was not deleted', 'event_espresso'),
1080 1080
                     __FILE__,
@@ -1143,27 +1143,27 @@  discard block
 block discarded – undo
1143 1143
                 'desc'  => $checked_never->legendLabel(),
1144 1144
             ),
1145 1145
             'approved_status'  => array(
1146
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
1146
+                'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
1147 1147
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'),
1148 1148
             ),
1149 1149
             'cancelled_status' => array(
1150
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
1150
+                'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
1151 1151
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'),
1152 1152
             ),
1153 1153
             'declined_status'  => array(
1154
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
1154
+                'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
1155 1155
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'),
1156 1156
             ),
1157 1157
             'not_approved'     => array(
1158
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
1158
+                'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
1159 1159
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'),
1160 1160
             ),
1161 1161
             'pending_status'   => array(
1162
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
1162
+                'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
1163 1163
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'),
1164 1164
             ),
1165 1165
             'wait_list'        => array(
1166
-                'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list,
1166
+                'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_wait_list,
1167 1167
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence'),
1168 1168
             ),
1169 1169
         );
@@ -1172,10 +1172,10 @@  discard block
 block discarded – undo
1172 1172
         /** @var EE_Event $event */
1173 1173
         $event = EEM_Event::instance()->get_one_by_ID($event_id);
1174 1174
         $this->_template_args['before_list_table'] = $event instanceof EE_Event
1175
-            ? '<h2>' . sprintf(
1175
+            ? '<h2>'.sprintf(
1176 1176
                 esc_html__('Viewing Registrations for Event: %s', 'event_espresso'),
1177 1177
                 EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')
1178
-            ) . '</h2>'
1178
+            ).'</h2>'
1179 1179
             : '';
1180 1180
         // need to get the number of datetimes on the event and set default datetime_id if there is only one datetime on
1181 1181
         // the event.
@@ -1193,12 +1193,12 @@  discard block
 block discarded – undo
1193 1193
             $this->_template_args['before_list_table'] .= ' &nbsp;<span class="drk-grey-text">';
1194 1194
             $this->_template_args['before_list_table'] .= '<span class="dashicons dashicons-calendar"></span>';
1195 1195
             $this->_template_args['before_list_table'] .= $datetime->name();
1196
-            $this->_template_args['before_list_table'] .= ' ( ' . $datetime->date_and_time_range() . ' )';
1196
+            $this->_template_args['before_list_table'] .= ' ( '.$datetime->date_and_time_range().' )';
1197 1197
             $this->_template_args['before_list_table'] .= '</span></h2>';
1198 1198
         }
1199 1199
         // if no datetime, then we're on the initial view, so let's give some helpful instructions on what the status
1200 1200
         // column represents
1201
-        if (! $datetime instanceof EE_Datetime) {
1201
+        if ( ! $datetime instanceof EE_Datetime) {
1202 1202
             $this->_template_args['before_list_table'] .= '<br><p class="description">'
1203 1203
                                                           . esc_html__(
1204 1204
                                                               'In this view, the check-in status represents the latest check-in record for the registration in that row.',
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Prices_List_Table.class.php 2 patches
Indentation   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -15,228 +15,228 @@
 block discarded – undo
15 15
  */
16 16
 class Prices_List_Table extends EE_Admin_List_Table
17 17
 {
18
-    private $_PRT;
19
-
20
-    /**
21
-     * Array of price types.
22
-     *
23
-     * @var EE_Price_Type[]
24
-     */
25
-    protected $_price_types = array();
26
-
27
-    public function __construct($admin_page)
28
-    {
29
-        parent::__construct($admin_page);
30
-        require_once(EE_MODELS . 'EEM_Price_Type.model.php');
31
-        $this->_PRT = EEM_Price_Type::instance();
32
-        $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
33
-    }
34
-
35
-
36
-    protected function _setup_data()
37
-    {
38
-        $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
39
-        $this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed);
40
-        $this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false);
41
-        $this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true);
42
-    }
43
-
44
-
45
-    protected function _set_properties()
46
-    {
47
-        $this->_wp_list_args = array(
48
-            'singular' => esc_html__('price', 'event_espresso'),
49
-            'plural'   => esc_html__('prices', 'event_espresso'),
50
-            'ajax'     => true,
51
-            'screen'   => $this->_admin_page->get_current_screen()->id,
52
-        );
53
-
54
-        $this->_columns = array(
55
-            'cb'          => '<input type="checkbox" />', // Render a checkbox instead of text
56
-            'name'        => esc_html__('Name', 'event_espresso'),
57
-            'type'        => esc_html__('Price Type', 'event_espresso'),
58
-            'description' => esc_html__('Description', 'event_espresso'),
59
-            'amount'      => esc_html__('Amount', 'event_espresso'),
60
-        );
61
-
62
-        $this->_sortable_columns = array(
63
-            // true means its already sorted
64
-            'name'   => array('name' => false),
65
-            'type'   => array('type' => false),
66
-            'amount' => array('amount' => false),
67
-        );
68
-
69
-        $this->_hidden_columns = array();
70
-
71
-        $this->_ajax_sorting_callback = 'update_prices_order';
72
-    }
73
-
74
-
75
-    protected function _get_table_filters()
76
-    {
77
-    }
78
-
79
-
80
-    protected function _add_view_counts()
81
-    {
82
-        $this->_views['all']['count'] = $this->_all_data_count;
83
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
84
-            $this->_views['trashed']['count'] = $this->_trashed_count;
85
-        }
86
-    }
87
-
88
-
89
-    /**
90
-     * overriding parent method so that we can make sure the row isn't sortable for certain items
91
-     *
92
-     * @param  object $item the current item
93
-     * @return string
94
-     */
95
-    protected function _get_row_class($item)
96
-    {
97
-        static $row_class = '';
98
-        $row_class = ($row_class == '' ? 'alternate' : '');
99
-
100
-        $new_row = $row_class;
101
-
102
-        if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) {
103
-            $new_row .= ' rowsortable';
104
-        }
105
-
106
-        return ' class="' . $new_row . '"';
107
-    }
108
-
109
-
110
-    public function column_cb($item)
111
-    {
112
-        if ($item->type_obj()->base_type() !== 1) {
113
-            return sprintf(
114
-                '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
115
-                $item->ID()
116
-            );
117
-        }
118
-        return '';
119
-    }
120
-
121
-
122
-    public function column_name($item)
123
-    {
124
-
125
-        // Build row actions
126
-        $actions = array();
127
-        // edit price link
128
-        if (
129
-            EE_Registry::instance()->CAP->current_user_can(
130
-                'ee_edit_default_price',
131
-                'pricing_edit_price',
132
-                $item->ID()
133
-            )
134
-        ) {
135
-            $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
136
-                'action' => 'edit_price',
137
-                'id'     => $item->ID(),
138
-            ), PRICING_ADMIN_URL);
139
-            $actions['edit'] = '<a href="' . $edit_lnk_url . '" aria-label="'
140
-                               . esc_attr__('Edit Price', 'event_espresso') . '">'
141
-                               . esc_html__('Edit', 'event_espresso') . '</a>';
142
-        }
143
-
144
-        $name_link = EE_Registry::instance()->CAP->current_user_can(
145
-            'ee_edit_default_price',
146
-            'edit_price',
147
-            $item->ID()
148
-        )
149
-            ? '<a href="' . $edit_lnk_url . '" aria-label="'
150
-              . esc_attr__('Edit Price', 'event_espresso') . '">'
151
-              . stripslashes($item->name()) . '</a>'
152
-            : $item->name();
153
-
154
-        if ($item->type_obj()->base_type() !== 1) {
155
-            if ($this->_view == 'all') {
156
-                // trash price link
157
-                if (
158
-                    EE_Registry::instance()->CAP->current_user_can(
159
-                        'ee_delete_default_price',
160
-                        'pricing_trash_price',
161
-                        $item->ID()
162
-                    )
163
-                ) {
164
-                    $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
165
-                        'action'   => 'trash_price',
166
-                        'id'       => $item->ID(),
167
-                        'noheader' => true,
168
-                    ), PRICING_ADMIN_URL);
169
-                    $actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
170
-                                        . esc_attr__('Move Price to Trash', 'event_espresso') . '">'
171
-                                        . esc_html__('Move to Trash', 'event_espresso') . '</a>';
172
-                }
173
-            } else {
174
-                if (
175
-                    EE_Registry::instance()->CAP->current_user_can(
176
-                        'ee_delete_default_price',
177
-                        'pricing_restore_price',
178
-                        $item->ID()
179
-                    )
180
-                ) {
181
-                    // restore price link
182
-                    $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
183
-                        'action'   => 'restore_price',
184
-                        'id'       => $item->ID(),
185
-                        'noheader' => true,
186
-                    ), PRICING_ADMIN_URL);
187
-                    $actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
188
-                                          . esc_attr__('Restore Price', 'event_espresso') . '">'
189
-                                          . esc_html__('Restore', 'event_espresso') . '</a>';
190
-                }
191
-
192
-                // delete price link
193
-                if (
194
-                    EE_Registry::instance()->CAP->current_user_can(
195
-                        'ee_delete_default_price',
196
-                        'pricing_delete_price',
197
-                        $item->ID()
198
-                    )
199
-                ) {
200
-                    $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
201
-                        'action'   => 'delete_price',
202
-                        'id'       => $item->ID(),
203
-                        'noheader' => true,
204
-                    ), PRICING_ADMIN_URL);
205
-                    $actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
206
-                                         . esc_attr__('Delete Price Permanently', 'event_espresso') . '">'
207
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
208
-                }
209
-            }
210
-        }
211
-
212
-        // Return the name contents
213
-        return sprintf(
214
-            '%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
215
-            $name_link,
216
-            $item->ID(),
217
-            $this->row_actions($actions)
218
-        );
219
-    }
220
-
221
-
222
-    public function column_type($item)
223
-    {
224
-        return $this->_price_types[ $item->type() ]->name();
225
-    }
226
-
227
-
228
-    public function column_description($item)
229
-    {
230
-        return stripslashes($item->desc());
231
-    }
232
-
233
-
234
-    public function column_amount($item)
235
-    {
236
-        if ($this->_price_types[ $item->type() ]->is_percent()) {
237
-            return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
238
-        } else {
239
-            return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>';
240
-        }
241
-    }
18
+	private $_PRT;
19
+
20
+	/**
21
+	 * Array of price types.
22
+	 *
23
+	 * @var EE_Price_Type[]
24
+	 */
25
+	protected $_price_types = array();
26
+
27
+	public function __construct($admin_page)
28
+	{
29
+		parent::__construct($admin_page);
30
+		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
31
+		$this->_PRT = EEM_Price_Type::instance();
32
+		$this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
33
+	}
34
+
35
+
36
+	protected function _setup_data()
37
+	{
38
+		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
39
+		$this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed);
40
+		$this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false);
41
+		$this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true);
42
+	}
43
+
44
+
45
+	protected function _set_properties()
46
+	{
47
+		$this->_wp_list_args = array(
48
+			'singular' => esc_html__('price', 'event_espresso'),
49
+			'plural'   => esc_html__('prices', 'event_espresso'),
50
+			'ajax'     => true,
51
+			'screen'   => $this->_admin_page->get_current_screen()->id,
52
+		);
53
+
54
+		$this->_columns = array(
55
+			'cb'          => '<input type="checkbox" />', // Render a checkbox instead of text
56
+			'name'        => esc_html__('Name', 'event_espresso'),
57
+			'type'        => esc_html__('Price Type', 'event_espresso'),
58
+			'description' => esc_html__('Description', 'event_espresso'),
59
+			'amount'      => esc_html__('Amount', 'event_espresso'),
60
+		);
61
+
62
+		$this->_sortable_columns = array(
63
+			// true means its already sorted
64
+			'name'   => array('name' => false),
65
+			'type'   => array('type' => false),
66
+			'amount' => array('amount' => false),
67
+		);
68
+
69
+		$this->_hidden_columns = array();
70
+
71
+		$this->_ajax_sorting_callback = 'update_prices_order';
72
+	}
73
+
74
+
75
+	protected function _get_table_filters()
76
+	{
77
+	}
78
+
79
+
80
+	protected function _add_view_counts()
81
+	{
82
+		$this->_views['all']['count'] = $this->_all_data_count;
83
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
84
+			$this->_views['trashed']['count'] = $this->_trashed_count;
85
+		}
86
+	}
87
+
88
+
89
+	/**
90
+	 * overriding parent method so that we can make sure the row isn't sortable for certain items
91
+	 *
92
+	 * @param  object $item the current item
93
+	 * @return string
94
+	 */
95
+	protected function _get_row_class($item)
96
+	{
97
+		static $row_class = '';
98
+		$row_class = ($row_class == '' ? 'alternate' : '');
99
+
100
+		$new_row = $row_class;
101
+
102
+		if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) {
103
+			$new_row .= ' rowsortable';
104
+		}
105
+
106
+		return ' class="' . $new_row . '"';
107
+	}
108
+
109
+
110
+	public function column_cb($item)
111
+	{
112
+		if ($item->type_obj()->base_type() !== 1) {
113
+			return sprintf(
114
+				'<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
115
+				$item->ID()
116
+			);
117
+		}
118
+		return '';
119
+	}
120
+
121
+
122
+	public function column_name($item)
123
+	{
124
+
125
+		// Build row actions
126
+		$actions = array();
127
+		// edit price link
128
+		if (
129
+			EE_Registry::instance()->CAP->current_user_can(
130
+				'ee_edit_default_price',
131
+				'pricing_edit_price',
132
+				$item->ID()
133
+			)
134
+		) {
135
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
136
+				'action' => 'edit_price',
137
+				'id'     => $item->ID(),
138
+			), PRICING_ADMIN_URL);
139
+			$actions['edit'] = '<a href="' . $edit_lnk_url . '" aria-label="'
140
+							   . esc_attr__('Edit Price', 'event_espresso') . '">'
141
+							   . esc_html__('Edit', 'event_espresso') . '</a>';
142
+		}
143
+
144
+		$name_link = EE_Registry::instance()->CAP->current_user_can(
145
+			'ee_edit_default_price',
146
+			'edit_price',
147
+			$item->ID()
148
+		)
149
+			? '<a href="' . $edit_lnk_url . '" aria-label="'
150
+			  . esc_attr__('Edit Price', 'event_espresso') . '">'
151
+			  . stripslashes($item->name()) . '</a>'
152
+			: $item->name();
153
+
154
+		if ($item->type_obj()->base_type() !== 1) {
155
+			if ($this->_view == 'all') {
156
+				// trash price link
157
+				if (
158
+					EE_Registry::instance()->CAP->current_user_can(
159
+						'ee_delete_default_price',
160
+						'pricing_trash_price',
161
+						$item->ID()
162
+					)
163
+				) {
164
+					$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
165
+						'action'   => 'trash_price',
166
+						'id'       => $item->ID(),
167
+						'noheader' => true,
168
+					), PRICING_ADMIN_URL);
169
+					$actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
170
+										. esc_attr__('Move Price to Trash', 'event_espresso') . '">'
171
+										. esc_html__('Move to Trash', 'event_espresso') . '</a>';
172
+				}
173
+			} else {
174
+				if (
175
+					EE_Registry::instance()->CAP->current_user_can(
176
+						'ee_delete_default_price',
177
+						'pricing_restore_price',
178
+						$item->ID()
179
+					)
180
+				) {
181
+					// restore price link
182
+					$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
183
+						'action'   => 'restore_price',
184
+						'id'       => $item->ID(),
185
+						'noheader' => true,
186
+					), PRICING_ADMIN_URL);
187
+					$actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
188
+										  . esc_attr__('Restore Price', 'event_espresso') . '">'
189
+										  . esc_html__('Restore', 'event_espresso') . '</a>';
190
+				}
191
+
192
+				// delete price link
193
+				if (
194
+					EE_Registry::instance()->CAP->current_user_can(
195
+						'ee_delete_default_price',
196
+						'pricing_delete_price',
197
+						$item->ID()
198
+					)
199
+				) {
200
+					$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
201
+						'action'   => 'delete_price',
202
+						'id'       => $item->ID(),
203
+						'noheader' => true,
204
+					), PRICING_ADMIN_URL);
205
+					$actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
206
+										 . esc_attr__('Delete Price Permanently', 'event_espresso') . '">'
207
+										 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
208
+				}
209
+			}
210
+		}
211
+
212
+		// Return the name contents
213
+		return sprintf(
214
+			'%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
215
+			$name_link,
216
+			$item->ID(),
217
+			$this->row_actions($actions)
218
+		);
219
+	}
220
+
221
+
222
+	public function column_type($item)
223
+	{
224
+		return $this->_price_types[ $item->type() ]->name();
225
+	}
226
+
227
+
228
+	public function column_description($item)
229
+	{
230
+		return stripslashes($item->desc());
231
+	}
232
+
233
+
234
+	public function column_amount($item)
235
+	{
236
+		if ($this->_price_types[ $item->type() ]->is_percent()) {
237
+			return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
238
+		} else {
239
+			return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>';
240
+		}
241
+	}
242 242
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function __construct($admin_page)
28 28
     {
29 29
         parent::__construct($admin_page);
30
-        require_once(EE_MODELS . 'EEM_Price_Type.model.php');
30
+        require_once(EE_MODELS.'EEM_Price_Type.model.php');
31 31
         $this->_PRT = EEM_Price_Type::instance();
32 32
         $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
33 33
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $new_row .= ' rowsortable';
104 104
         }
105 105
 
106
-        return ' class="' . $new_row . '"';
106
+        return ' class="'.$new_row.'"';
107 107
     }
108 108
 
109 109
 
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
                 'action' => 'edit_price',
137 137
                 'id'     => $item->ID(),
138 138
             ), PRICING_ADMIN_URL);
139
-            $actions['edit'] = '<a href="' . $edit_lnk_url . '" aria-label="'
140
-                               . esc_attr__('Edit Price', 'event_espresso') . '">'
141
-                               . esc_html__('Edit', 'event_espresso') . '</a>';
139
+            $actions['edit'] = '<a href="'.$edit_lnk_url.'" aria-label="'
140
+                               . esc_attr__('Edit Price', 'event_espresso').'">'
141
+                               . esc_html__('Edit', 'event_espresso').'</a>';
142 142
         }
143 143
 
144 144
         $name_link = EE_Registry::instance()->CAP->current_user_can(
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
             'edit_price',
147 147
             $item->ID()
148 148
         )
149
-            ? '<a href="' . $edit_lnk_url . '" aria-label="'
150
-              . esc_attr__('Edit Price', 'event_espresso') . '">'
151
-              . stripslashes($item->name()) . '</a>'
149
+            ? '<a href="'.$edit_lnk_url.'" aria-label="'
150
+              . esc_attr__('Edit Price', 'event_espresso').'">'
151
+              . stripslashes($item->name()).'</a>'
152 152
             : $item->name();
153 153
 
154 154
         if ($item->type_obj()->base_type() !== 1) {
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
                         'id'       => $item->ID(),
167 167
                         'noheader' => true,
168 168
                     ), PRICING_ADMIN_URL);
169
-                    $actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
170
-                                        . esc_attr__('Move Price to Trash', 'event_espresso') . '">'
171
-                                        . esc_html__('Move to Trash', 'event_espresso') . '</a>';
169
+                    $actions['trash'] = '<a href="'.$trash_lnk_url.'" aria-label="'
170
+                                        . esc_attr__('Move Price to Trash', 'event_espresso').'">'
171
+                                        . esc_html__('Move to Trash', 'event_espresso').'</a>';
172 172
                 }
173 173
             } else {
174 174
                 if (
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
                         'id'       => $item->ID(),
185 185
                         'noheader' => true,
186 186
                     ), PRICING_ADMIN_URL);
187
-                    $actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
188
-                                          . esc_attr__('Restore Price', 'event_espresso') . '">'
189
-                                          . esc_html__('Restore', 'event_espresso') . '</a>';
187
+                    $actions['restore'] = '<a href="'.$restore_lnk_url.'" aria-label="'
188
+                                          . esc_attr__('Restore Price', 'event_espresso').'">'
189
+                                          . esc_html__('Restore', 'event_espresso').'</a>';
190 190
                 }
191 191
 
192 192
                 // delete price link
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
                         'id'       => $item->ID(),
203 203
                         'noheader' => true,
204 204
                     ), PRICING_ADMIN_URL);
205
-                    $actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
206
-                                         . esc_attr__('Delete Price Permanently', 'event_espresso') . '">'
207
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
205
+                    $actions['delete'] = '<a href="'.$delete_lnk_url.'" aria-label="'
206
+                                         . esc_attr__('Delete Price Permanently', 'event_espresso').'">'
207
+                                         . esc_html__('Delete Permanently', 'event_espresso').'</a>';
208 208
                 }
209 209
             }
210 210
         }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
     public function column_type($item)
223 223
     {
224
-        return $this->_price_types[ $item->type() ]->name();
224
+        return $this->_price_types[$item->type()]->name();
225 225
     }
226 226
 
227 227
 
@@ -233,10 +233,10 @@  discard block
 block discarded – undo
233 233
 
234 234
     public function column_amount($item)
235 235
     {
236
-        if ($this->_price_types[ $item->type() ]->is_percent()) {
237
-            return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
236
+        if ($this->_price_types[$item->type()]->is_percent()) {
237
+            return '<div class="pad-amnt-rght">'.number_format($item->amount(), 1).'%</div>';
238 238
         } else {
239
-            return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>';
239
+            return '<div class="pad-amnt-rght">'.EEH_Template::format_currency($item->amount()).'</div>';
240 240
         }
241 241
     }
242 242
 }
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_List_Table.class.php 2 patches
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -16,153 +16,153 @@
 block discarded – undo
16 16
  */
17 17
 class Tickets_List_Table extends EE_Admin_List_Table
18 18
 {
19
-    protected function _setup_data()
20
-    {
21
-        $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
22
-        $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
23
-        $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
24
-        $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
25
-    }
26
-
27
-
28
-    protected function _set_properties()
29
-    {
30
-        $this->_wp_list_args = array(
31
-            'singular' => esc_html__('ticket', 'event_espresso'),
32
-            'plural'   => esc_html__('tickets', 'event_espresso'),
33
-            'ajax'     => true,
34
-            'screen'   => $this->_admin_page->get_current_screen()->id,
35
-        );
36
-
37
-        $this->_columns = array(
38
-            'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
39
-            'TKT_name'        => esc_html__('Name', 'event_espresso'),
40
-            'TKT_description' => esc_html__('Description', 'event_espresso'),
41
-            'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
42
-            'TKT_uses'        => esc_html__('Uses', 'event_espresso'),
43
-            'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
44
-            'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
45
-            'TKT_price'       => esc_html__('Price', 'event_espresso'),
46
-            'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
47
-        );
48
-
49
-        $this->_sortable_columns = array(
50
-            // TRUE means its already sorted
51
-            'TKT_name'        => array('TKT_name', true),
52
-            'TKT_description' => array('TKT_description', false),
53
-            'TKT_qty'         => array('TKT_qty', false),
54
-            'TKT_uses'        => array('TKT_uses', false),
55
-            'TKT_min'         => array('TKT_min', false),
56
-            'TKT_max'         => array('TKT_max', false),
57
-            'TKT_price'       => array('TKT_price', false),
58
-        );
59
-
60
-        $this->_hidden_columns = array();
61
-    }
62
-
63
-
64
-    protected function _get_table_filters()
65
-    {
66
-    }
67
-
68
-
69
-    protected function _add_view_counts()
70
-    {
71
-        $this->_views['all']['count'] = $this->_all_data_count;
72
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) {
73
-            $this->_views['trashed']['count'] = $this->_trashed_count;
74
-        }
75
-    }
76
-
77
-
78
-    public function column_cb($item)
79
-    {
80
-        return $item->ID() === 1
81
-            ? '<span class="ee-lock-icon"></span>'
82
-            : sprintf(
83
-                '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
84
-                $item->ID()
85
-            );
86
-    }
87
-
88
-
89
-    public function column_TKT_name($item)
90
-    {
91
-        // build row actions
92
-        $actions = array();
93
-
94
-        // trash links
95
-        if ($item->ID() !== 1) {
96
-            if ($this->_view == 'all') {
97
-                $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
98
-                    'action' => 'trash_ticket',
99
-                    'TKT_ID' => $item->ID(),
100
-                ), TICKETS_ADMIN_URL);
101
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
102
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
103
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
104
-            } else {
105
-                // restore price link
106
-                $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
107
-                    'action' => 'restore_ticket',
108
-                    'TKT_ID' => $item->ID(),
109
-                ), TICKETS_ADMIN_URL);
110
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
111
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
112
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
113
-                // delete price link
114
-                $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
115
-                    'action' => 'delete_ticket',
116
-                    'TKT_ID' => $item->ID(),
117
-                ), TICKETS_ADMIN_URL);
118
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
119
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
120
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
121
-            }
122
-        }
123
-
124
-        return $item->get('TKT_name') . $this->row_actions($actions);
125
-    }
126
-
127
-
128
-    public function column_TKT_description($item)
129
-    {
130
-        return $item->get('TKT_description');
131
-    }
132
-
133
-
134
-    public function column_TKT_qty($item)
135
-    {
136
-        return $item->get_pretty('TKT_qty', 'text');
137
-    }
138
-
139
-
140
-    public function column_TKT_uses($item)
141
-    {
142
-        return $item->get_pretty('TKT_uses', 'text');
143
-    }
144
-
145
-
146
-    public function column_TKT_min($item)
147
-    {
148
-        return $item->get('TKT_min');
149
-    }
150
-
151
-
152
-    public function column_TKT_max($item)
153
-    {
154
-        return $item->get_pretty('TKT_max', 'text');
155
-    }
156
-
157
-
158
-    public function column_TKT_price($item)
159
-    {
160
-        return EEH_Template::format_currency($item->get('TKT_price'));
161
-    }
162
-
163
-
164
-    public function column_TKT_taxable($item)
165
-    {
166
-        return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
167
-    }
19
+	protected function _setup_data()
20
+	{
21
+		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
22
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
23
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
24
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
25
+	}
26
+
27
+
28
+	protected function _set_properties()
29
+	{
30
+		$this->_wp_list_args = array(
31
+			'singular' => esc_html__('ticket', 'event_espresso'),
32
+			'plural'   => esc_html__('tickets', 'event_espresso'),
33
+			'ajax'     => true,
34
+			'screen'   => $this->_admin_page->get_current_screen()->id,
35
+		);
36
+
37
+		$this->_columns = array(
38
+			'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
39
+			'TKT_name'        => esc_html__('Name', 'event_espresso'),
40
+			'TKT_description' => esc_html__('Description', 'event_espresso'),
41
+			'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
42
+			'TKT_uses'        => esc_html__('Uses', 'event_espresso'),
43
+			'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
44
+			'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
45
+			'TKT_price'       => esc_html__('Price', 'event_espresso'),
46
+			'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
47
+		);
48
+
49
+		$this->_sortable_columns = array(
50
+			// TRUE means its already sorted
51
+			'TKT_name'        => array('TKT_name', true),
52
+			'TKT_description' => array('TKT_description', false),
53
+			'TKT_qty'         => array('TKT_qty', false),
54
+			'TKT_uses'        => array('TKT_uses', false),
55
+			'TKT_min'         => array('TKT_min', false),
56
+			'TKT_max'         => array('TKT_max', false),
57
+			'TKT_price'       => array('TKT_price', false),
58
+		);
59
+
60
+		$this->_hidden_columns = array();
61
+	}
62
+
63
+
64
+	protected function _get_table_filters()
65
+	{
66
+	}
67
+
68
+
69
+	protected function _add_view_counts()
70
+	{
71
+		$this->_views['all']['count'] = $this->_all_data_count;
72
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) {
73
+			$this->_views['trashed']['count'] = $this->_trashed_count;
74
+		}
75
+	}
76
+
77
+
78
+	public function column_cb($item)
79
+	{
80
+		return $item->ID() === 1
81
+			? '<span class="ee-lock-icon"></span>'
82
+			: sprintf(
83
+				'<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
84
+				$item->ID()
85
+			);
86
+	}
87
+
88
+
89
+	public function column_TKT_name($item)
90
+	{
91
+		// build row actions
92
+		$actions = array();
93
+
94
+		// trash links
95
+		if ($item->ID() !== 1) {
96
+			if ($this->_view == 'all') {
97
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
98
+					'action' => 'trash_ticket',
99
+					'TKT_ID' => $item->ID(),
100
+				), TICKETS_ADMIN_URL);
101
+				$actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
102
+									. esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
103
+									. esc_html__('Trash', 'event_espresso') . '</a>';
104
+			} else {
105
+				// restore price link
106
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
107
+					'action' => 'restore_ticket',
108
+					'TKT_ID' => $item->ID(),
109
+				), TICKETS_ADMIN_URL);
110
+				$actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
111
+									  . esc_attr__('Restore Ticket', 'event_espresso') . '">'
112
+									  . esc_html__('Restore', 'event_espresso') . '</a>';
113
+				// delete price link
114
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
115
+					'action' => 'delete_ticket',
116
+					'TKT_ID' => $item->ID(),
117
+				), TICKETS_ADMIN_URL);
118
+				$actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
119
+									 . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
120
+									 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
121
+			}
122
+		}
123
+
124
+		return $item->get('TKT_name') . $this->row_actions($actions);
125
+	}
126
+
127
+
128
+	public function column_TKT_description($item)
129
+	{
130
+		return $item->get('TKT_description');
131
+	}
132
+
133
+
134
+	public function column_TKT_qty($item)
135
+	{
136
+		return $item->get_pretty('TKT_qty', 'text');
137
+	}
138
+
139
+
140
+	public function column_TKT_uses($item)
141
+	{
142
+		return $item->get_pretty('TKT_uses', 'text');
143
+	}
144
+
145
+
146
+	public function column_TKT_min($item)
147
+	{
148
+		return $item->get('TKT_min');
149
+	}
150
+
151
+
152
+	public function column_TKT_max($item)
153
+	{
154
+		return $item->get_pretty('TKT_max', 'text');
155
+	}
156
+
157
+
158
+	public function column_TKT_price($item)
159
+	{
160
+		return EEH_Template::format_currency($item->get('TKT_price'));
161
+	}
162
+
163
+
164
+	public function column_TKT_taxable($item)
165
+	{
166
+		return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
167
+	}
168 168
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,30 +98,30 @@
 block discarded – undo
98 98
                     'action' => 'trash_ticket',
99 99
                     'TKT_ID' => $item->ID(),
100 100
                 ), TICKETS_ADMIN_URL);
101
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" aria-label="'
102
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
103
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
101
+                $actions['trash'] = '<a href="'.$trash_lnk_url.'" aria-label="'
102
+                                    . esc_attr__('Move Ticket to trash', 'event_espresso').'">'
103
+                                    . esc_html__('Trash', 'event_espresso').'</a>';
104 104
             } else {
105 105
                 // restore price link
106 106
                 $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
107 107
                     'action' => 'restore_ticket',
108 108
                     'TKT_ID' => $item->ID(),
109 109
                 ), TICKETS_ADMIN_URL);
110
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" aria-label="'
111
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
112
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
110
+                $actions['restore'] = '<a href="'.$restore_lnk_url.'" aria-label="'
111
+                                      . esc_attr__('Restore Ticket', 'event_espresso').'">'
112
+                                      . esc_html__('Restore', 'event_espresso').'</a>';
113 113
                 // delete price link
114 114
                 $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
115 115
                     'action' => 'delete_ticket',
116 116
                     'TKT_ID' => $item->ID(),
117 117
                 ), TICKETS_ADMIN_URL);
118
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" aria-label="'
119
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
120
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
118
+                $actions['delete'] = '<a href="'.$delete_lnk_url.'" aria-label="'
119
+                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'
120
+                                     . esc_html__('Delete Permanently', 'event_espresso').'</a>';
121 121
             }
122 122
         }
123 123
 
124
-        return $item->get('TKT_name') . $this->row_actions($actions);
124
+        return $item->get('TKT_name').$this->row_actions($actions);
125 125
     }
126 126
 
127 127
 
Please login to merge, or discard this patch.
core/db_classes/EE_Venue.class.php 1 patch
Indentation   +562 added lines, -562 removed lines patch added patch discarded remove patch
@@ -9,566 +9,566 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Venue extends EE_CPT_Base implements EEI_Address
11 11
 {
12
-    /**
13
-     *
14
-     * @param array  $props_n_values          incoming values
15
-     * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
16
-     *                                        used.)
17
-     * @param array  $date_formats            incoming date_formats in an array where the first value is the
18
-     *                                        date_format and the second value is the time format
19
-     * @return EE_Attendee
20
-     */
21
-    public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
22
-    {
23
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
24
-        return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
25
-    }
26
-
27
-
28
-    /**
29
-     * @param array  $props_n_values  incoming values from the database
30
-     * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
31
-     *                                the website will be used.
32
-     * @return EE_Attendee
33
-     */
34
-    public static function new_instance_from_db($props_n_values = array(), $timezone = null)
35
-    {
36
-        return new self($props_n_values, true, $timezone);
37
-    }
38
-
39
-
40
-    /**
41
-     * Gets name
42
-     *
43
-     * @return string
44
-     */
45
-    public function name()
46
-    {
47
-        return $this->get('VNU_name');
48
-    }
49
-
50
-
51
-    /**
52
-     * Gets phone
53
-     *
54
-     * @return string
55
-     */
56
-    public function phone()
57
-    {
58
-        return $this->get('VNU_phone');
59
-    }
60
-
61
-
62
-    /**
63
-     * venue_url
64
-     *
65
-     * @return string
66
-     */
67
-    public function venue_url()
68
-    {
69
-        return $this->get('VNU_url');
70
-    }
71
-
72
-
73
-    /**
74
-     * Gets desc
75
-     *
76
-     * @return string
77
-     */
78
-    public function description()
79
-    {
80
-        return $this->get('VNU_desc');
81
-    }
82
-
83
-
84
-    /**
85
-     * Gets short description (AKA: the excerpt)
86
-     *
87
-     * @return string
88
-     */
89
-    public function excerpt()
90
-    {
91
-        return $this->get('VNU_short_desc');
92
-    }
93
-
94
-
95
-    /**
96
-     * Gets identifier
97
-     *
98
-     * @return string
99
-     */
100
-    public function identifier()
101
-    {
102
-        return $this->get('VNU_identifier');
103
-    }
104
-
105
-
106
-    /**
107
-     * Gets address
108
-     *
109
-     * @return string
110
-     */
111
-    public function address()
112
-    {
113
-        return $this->get('VNU_address');
114
-    }
115
-
116
-
117
-    /**
118
-     * Gets address2
119
-     *
120
-     * @return string
121
-     */
122
-    public function address2()
123
-    {
124
-        return $this->get('VNU_address2');
125
-    }
126
-
127
-
128
-    /**
129
-     * Gets city
130
-     *
131
-     * @return string
132
-     */
133
-    public function city()
134
-    {
135
-        return $this->get('VNU_city');
136
-    }
137
-
138
-    /**
139
-     * Gets state
140
-     *
141
-     * @return int
142
-     */
143
-    public function state_ID()
144
-    {
145
-        return $this->get('STA_ID');
146
-    }
147
-
148
-
149
-    /**
150
-     * @return string
151
-     */
152
-    public function state_abbrev()
153
-    {
154
-        return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : '';
155
-    }
156
-
157
-
158
-    /**
159
-     * @return string
160
-     */
161
-    public function state_name()
162
-    {
163
-        return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : '';
164
-    }
165
-
166
-
167
-    /**
168
-     * Gets the state for this venue
169
-     *
170
-     * @return EE_State
171
-     */
172
-    public function state_obj()
173
-    {
174
-        return $this->get_first_related('State');
175
-    }
176
-
177
-
178
-    /**
179
-     * either displays the state abbreviation or the state name, as determined
180
-     * by the "FHEE__EEI_Address__state__use_abbreviation" filter.
181
-     * defaults to abbreviation
182
-     *
183
-     * @return string
184
-     */
185
-    public function state()
186
-    {
187
-        if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
188
-            return $this->state_abbrev();
189
-        } else {
190
-            return $this->state_name();
191
-        }
192
-    }
193
-
194
-
195
-    /**
196
-     * country_ID
197
-     *
198
-     * @return string
199
-     */
200
-    public function country_ID()
201
-    {
202
-        return $this->get('CNT_ISO');
203
-    }
204
-
205
-
206
-    /**
207
-     * @return string
208
-     */
209
-    public function country_name()
210
-    {
211
-        return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : '';
212
-    }
213
-
214
-
215
-    /**
216
-     * Gets the country of this venue
217
-     *
218
-     * @return EE_Country
219
-     */
220
-    public function country_obj()
221
-    {
222
-        return $this->get_first_related('Country');
223
-    }
224
-
225
-
226
-    /**
227
-     * either displays the country ISO2 code or the country name, as determined
228
-     * by the "FHEE__EEI_Address__country__use_abbreviation" filter.
229
-     * defaults to abbreviation
230
-     *
231
-     * @return string
232
-     */
233
-    public function country()
234
-    {
235
-        if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
236
-            return $this->country_ID();
237
-        } else {
238
-            return $this->country_name();
239
-        }
240
-    }
241
-
242
-
243
-    /**
244
-     * Gets zip
245
-     *
246
-     * @return string
247
-     */
248
-    public function zip()
249
-    {
250
-        return $this->get('VNU_zip');
251
-    }
252
-
253
-
254
-    /**
255
-     * Gets capacity
256
-     *
257
-     * @return int|string
258
-     * @throws EE_Error
259
-     * @throws ReflectionException
260
-     */
261
-    public function capacity()
262
-    {
263
-        return $this->get_pretty('VNU_capacity', 'symbol');
264
-    }
265
-
266
-
267
-    /**
268
-     * Gets created
269
-     *
270
-     * @return string
271
-     */
272
-    public function created()
273
-    {
274
-        return $this->get('VNU_created');
275
-    }
276
-
277
-
278
-    /**
279
-     * Gets modified
280
-     *
281
-     * @return string
282
-     */
283
-    public function modified()
284
-    {
285
-        return $this->get('VNU_modified');
286
-    }
287
-
288
-
289
-    /**
290
-     * Gets order
291
-     *
292
-     * @return int
293
-     */
294
-    public function order()
295
-    {
296
-        return $this->get('VNU_order');
297
-    }
298
-
299
-
300
-    /**
301
-     * Gets wp_user
302
-     *
303
-     * @return int
304
-     */
305
-    public function wp_user()
306
-    {
307
-        return $this->get('VNU_wp_user');
308
-    }
309
-
310
-
311
-    /**
312
-     * @return string
313
-     */
314
-    public function virtual_phone()
315
-    {
316
-        return $this->get('VNU_virtual_phone');
317
-    }
318
-
319
-
320
-    /**
321
-     * @return string
322
-     */
323
-    public function virtual_url()
324
-    {
325
-        return $this->get('VNU_virtual_url');
326
-    }
327
-
328
-
329
-    /**
330
-     * @return bool
331
-     */
332
-    public function enable_for_gmap()
333
-    {
334
-        return $this->get('VNU_enable_for_gmap');
335
-    }
336
-
337
-
338
-    /**
339
-     * @return string
340
-     */
341
-    public function google_map_link()
342
-    {
343
-        return $this->get('VNU_google_map_link');
344
-    }
345
-
346
-
347
-    /**
348
-     * Gets all events happening at this venue. Query parameters can be added to
349
-     * fetch a subset of those events.
350
-     *
351
-     * @param array $query_params @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
352
-     * @param bool  $upcoming
353
-     * @return EE_Event[]
354
-     */
355
-    public function events($query_params = array(), $upcoming = false)
356
-    {
357
-        if ($upcoming) {
358
-            $query_params = array(
359
-                array(
360
-                    'status'                 => 'publish',
361
-                    'Datetime.DTT_EVT_start' => array(
362
-                        '>',
363
-                        EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'),
364
-                    ),
365
-                ),
366
-            );
367
-        }
368
-        return $this->get_many_related('Event', $query_params);
369
-    }
370
-
371
-
372
-    /**
373
-     * Sets address
374
-     */
375
-    public function set_address($address = '')
376
-    {
377
-        $this->set('VNU_address', $address);
378
-    }
379
-
380
-
381
-    /**
382
-     * @param string $address2
383
-     */
384
-    public function set_address2($address2 = '')
385
-    {
386
-        $this->set('VNU_address2', $address2);
387
-    }
388
-
389
-
390
-    /**
391
-     * @param string $city
392
-     */
393
-    public function set_city($city = '')
394
-    {
395
-        $this->set('VNU_city', $city);
396
-    }
397
-
398
-
399
-    /**
400
-     * @param int $state
401
-     */
402
-    public function set_state_ID($state = 0)
403
-    {
404
-        $this->set('STA_ID', $state);
405
-    }
406
-
407
-
408
-    /**
409
-     * Sets the state, given either a state id or state object
410
-     *
411
-     * @param EE_State /int $state_id_or_obj
412
-     * @return EE_State
413
-     */
414
-    public function set_state_obj($state_id_or_obj)
415
-    {
416
-        return $this->_add_relation_to($state_id_or_obj, 'State');
417
-    }
418
-
419
-
420
-    /**
421
-     * @param int $country_ID
422
-     */
423
-    public function set_country_ID($country_ID = 0)
424
-    {
425
-        $this->set('CNT_ISO', $country_ID);
426
-    }
427
-
428
-
429
-    /**
430
-     * Sets the country on the venue
431
-     *
432
-     * @param EE_Country /string $country_id_or_obj
433
-     * @return EE_Country
434
-     */
435
-    public function set_country_obj($country_id_or_obj)
436
-    {
437
-        return $this->_add_relation_to($country_id_or_obj, 'Country');
438
-    }
439
-
440
-
441
-    /**
442
-     * @param string $zip
443
-     */
444
-    public function set_zip($zip = '')
445
-    {
446
-        $this->set('VNU_zip', $zip);
447
-    }
448
-
449
-
450
-    /**
451
-     * @param int $capacity
452
-     */
453
-    public function set_capacity($capacity = 0)
454
-    {
455
-        $this->set('VNU_capacity', $capacity);
456
-    }
457
-
458
-
459
-    /**
460
-     * @param string $created
461
-     */
462
-    public function set_created($created = '')
463
-    {
464
-        $this->set('VNU_created', $created);
465
-    }
466
-
467
-
468
-    /**
469
-     * @param string $desc
470
-     */
471
-    public function set_description($desc = '')
472
-    {
473
-        $this->set('VNU_desc', $desc);
474
-    }
475
-
476
-
477
-    /**
478
-     * @param string $identifier
479
-     */
480
-    public function set_identifier($identifier = '')
481
-    {
482
-        $this->set('VNU_identifier', $identifier);
483
-    }
484
-
485
-
486
-    /**
487
-     * @param string $modified
488
-     */
489
-    public function set_modified($modified = '')
490
-    {
491
-        $this->set('VNU_modified', $modified);
492
-    }
493
-
494
-
495
-    /**
496
-     * @param string $name
497
-     */
498
-    public function set_name($name = '')
499
-    {
500
-        $this->set('VNU_name', $name);
501
-    }
502
-
503
-
504
-    /**
505
-     * @param int $order
506
-     */
507
-    public function set_order($order = 0)
508
-    {
509
-        $this->set('VNU_order', $order);
510
-    }
511
-
512
-
513
-    /**
514
-     * @param string $phone
515
-     */
516
-    public function set_phone($phone = '')
517
-    {
518
-        $this->set('VNU_phone', $phone);
519
-    }
520
-
521
-
522
-    /**
523
-     * @param int $wp_user
524
-     */
525
-    public function set_wp_user($wp_user = 1)
526
-    {
527
-        $this->set('VNU_wp_user', $wp_user);
528
-    }
529
-
530
-
531
-    /**
532
-     * @param string $url
533
-     */
534
-    public function set_venue_url($url = '')
535
-    {
536
-        $this->set('VNU_url', $url);
537
-    }
538
-
539
-
540
-    /**
541
-     * @param string $phone
542
-     */
543
-    public function set_virtual_phone($phone = '')
544
-    {
545
-        $this->set('VNU_virtual_phone', $phone);
546
-    }
547
-
548
-
549
-    /**
550
-     * @param string $url
551
-     */
552
-    public function set_virtual_url($url = '')
553
-    {
554
-        $this->set('VNU_virtual_url', $url);
555
-    }
556
-
557
-
558
-    /**
559
-     * @param string $enable
560
-     */
561
-    public function set_enable_for_gmap($enable = '')
562
-    {
563
-        $this->set('VNU_enable_for_gmap', $enable);
564
-    }
565
-
566
-
567
-    /**
568
-     * @param string $google_map_link
569
-     */
570
-    public function set_google_map_link($google_map_link = '')
571
-    {
572
-        $this->set('VNU_google_map_link', $google_map_link);
573
-    }
12
+	/**
13
+	 *
14
+	 * @param array  $props_n_values          incoming values
15
+	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
16
+	 *                                        used.)
17
+	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
18
+	 *                                        date_format and the second value is the time format
19
+	 * @return EE_Attendee
20
+	 */
21
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
22
+	{
23
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
24
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
25
+	}
26
+
27
+
28
+	/**
29
+	 * @param array  $props_n_values  incoming values from the database
30
+	 * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
31
+	 *                                the website will be used.
32
+	 * @return EE_Attendee
33
+	 */
34
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null)
35
+	{
36
+		return new self($props_n_values, true, $timezone);
37
+	}
38
+
39
+
40
+	/**
41
+	 * Gets name
42
+	 *
43
+	 * @return string
44
+	 */
45
+	public function name()
46
+	{
47
+		return $this->get('VNU_name');
48
+	}
49
+
50
+
51
+	/**
52
+	 * Gets phone
53
+	 *
54
+	 * @return string
55
+	 */
56
+	public function phone()
57
+	{
58
+		return $this->get('VNU_phone');
59
+	}
60
+
61
+
62
+	/**
63
+	 * venue_url
64
+	 *
65
+	 * @return string
66
+	 */
67
+	public function venue_url()
68
+	{
69
+		return $this->get('VNU_url');
70
+	}
71
+
72
+
73
+	/**
74
+	 * Gets desc
75
+	 *
76
+	 * @return string
77
+	 */
78
+	public function description()
79
+	{
80
+		return $this->get('VNU_desc');
81
+	}
82
+
83
+
84
+	/**
85
+	 * Gets short description (AKA: the excerpt)
86
+	 *
87
+	 * @return string
88
+	 */
89
+	public function excerpt()
90
+	{
91
+		return $this->get('VNU_short_desc');
92
+	}
93
+
94
+
95
+	/**
96
+	 * Gets identifier
97
+	 *
98
+	 * @return string
99
+	 */
100
+	public function identifier()
101
+	{
102
+		return $this->get('VNU_identifier');
103
+	}
104
+
105
+
106
+	/**
107
+	 * Gets address
108
+	 *
109
+	 * @return string
110
+	 */
111
+	public function address()
112
+	{
113
+		return $this->get('VNU_address');
114
+	}
115
+
116
+
117
+	/**
118
+	 * Gets address2
119
+	 *
120
+	 * @return string
121
+	 */
122
+	public function address2()
123
+	{
124
+		return $this->get('VNU_address2');
125
+	}
126
+
127
+
128
+	/**
129
+	 * Gets city
130
+	 *
131
+	 * @return string
132
+	 */
133
+	public function city()
134
+	{
135
+		return $this->get('VNU_city');
136
+	}
137
+
138
+	/**
139
+	 * Gets state
140
+	 *
141
+	 * @return int
142
+	 */
143
+	public function state_ID()
144
+	{
145
+		return $this->get('STA_ID');
146
+	}
147
+
148
+
149
+	/**
150
+	 * @return string
151
+	 */
152
+	public function state_abbrev()
153
+	{
154
+		return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : '';
155
+	}
156
+
157
+
158
+	/**
159
+	 * @return string
160
+	 */
161
+	public function state_name()
162
+	{
163
+		return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : '';
164
+	}
165
+
166
+
167
+	/**
168
+	 * Gets the state for this venue
169
+	 *
170
+	 * @return EE_State
171
+	 */
172
+	public function state_obj()
173
+	{
174
+		return $this->get_first_related('State');
175
+	}
176
+
177
+
178
+	/**
179
+	 * either displays the state abbreviation or the state name, as determined
180
+	 * by the "FHEE__EEI_Address__state__use_abbreviation" filter.
181
+	 * defaults to abbreviation
182
+	 *
183
+	 * @return string
184
+	 */
185
+	public function state()
186
+	{
187
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
188
+			return $this->state_abbrev();
189
+		} else {
190
+			return $this->state_name();
191
+		}
192
+	}
193
+
194
+
195
+	/**
196
+	 * country_ID
197
+	 *
198
+	 * @return string
199
+	 */
200
+	public function country_ID()
201
+	{
202
+		return $this->get('CNT_ISO');
203
+	}
204
+
205
+
206
+	/**
207
+	 * @return string
208
+	 */
209
+	public function country_name()
210
+	{
211
+		return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : '';
212
+	}
213
+
214
+
215
+	/**
216
+	 * Gets the country of this venue
217
+	 *
218
+	 * @return EE_Country
219
+	 */
220
+	public function country_obj()
221
+	{
222
+		return $this->get_first_related('Country');
223
+	}
224
+
225
+
226
+	/**
227
+	 * either displays the country ISO2 code or the country name, as determined
228
+	 * by the "FHEE__EEI_Address__country__use_abbreviation" filter.
229
+	 * defaults to abbreviation
230
+	 *
231
+	 * @return string
232
+	 */
233
+	public function country()
234
+	{
235
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
236
+			return $this->country_ID();
237
+		} else {
238
+			return $this->country_name();
239
+		}
240
+	}
241
+
242
+
243
+	/**
244
+	 * Gets zip
245
+	 *
246
+	 * @return string
247
+	 */
248
+	public function zip()
249
+	{
250
+		return $this->get('VNU_zip');
251
+	}
252
+
253
+
254
+	/**
255
+	 * Gets capacity
256
+	 *
257
+	 * @return int|string
258
+	 * @throws EE_Error
259
+	 * @throws ReflectionException
260
+	 */
261
+	public function capacity()
262
+	{
263
+		return $this->get_pretty('VNU_capacity', 'symbol');
264
+	}
265
+
266
+
267
+	/**
268
+	 * Gets created
269
+	 *
270
+	 * @return string
271
+	 */
272
+	public function created()
273
+	{
274
+		return $this->get('VNU_created');
275
+	}
276
+
277
+
278
+	/**
279
+	 * Gets modified
280
+	 *
281
+	 * @return string
282
+	 */
283
+	public function modified()
284
+	{
285
+		return $this->get('VNU_modified');
286
+	}
287
+
288
+
289
+	/**
290
+	 * Gets order
291
+	 *
292
+	 * @return int
293
+	 */
294
+	public function order()
295
+	{
296
+		return $this->get('VNU_order');
297
+	}
298
+
299
+
300
+	/**
301
+	 * Gets wp_user
302
+	 *
303
+	 * @return int
304
+	 */
305
+	public function wp_user()
306
+	{
307
+		return $this->get('VNU_wp_user');
308
+	}
309
+
310
+
311
+	/**
312
+	 * @return string
313
+	 */
314
+	public function virtual_phone()
315
+	{
316
+		return $this->get('VNU_virtual_phone');
317
+	}
318
+
319
+
320
+	/**
321
+	 * @return string
322
+	 */
323
+	public function virtual_url()
324
+	{
325
+		return $this->get('VNU_virtual_url');
326
+	}
327
+
328
+
329
+	/**
330
+	 * @return bool
331
+	 */
332
+	public function enable_for_gmap()
333
+	{
334
+		return $this->get('VNU_enable_for_gmap');
335
+	}
336
+
337
+
338
+	/**
339
+	 * @return string
340
+	 */
341
+	public function google_map_link()
342
+	{
343
+		return $this->get('VNU_google_map_link');
344
+	}
345
+
346
+
347
+	/**
348
+	 * Gets all events happening at this venue. Query parameters can be added to
349
+	 * fetch a subset of those events.
350
+	 *
351
+	 * @param array $query_params @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
352
+	 * @param bool  $upcoming
353
+	 * @return EE_Event[]
354
+	 */
355
+	public function events($query_params = array(), $upcoming = false)
356
+	{
357
+		if ($upcoming) {
358
+			$query_params = array(
359
+				array(
360
+					'status'                 => 'publish',
361
+					'Datetime.DTT_EVT_start' => array(
362
+						'>',
363
+						EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'),
364
+					),
365
+				),
366
+			);
367
+		}
368
+		return $this->get_many_related('Event', $query_params);
369
+	}
370
+
371
+
372
+	/**
373
+	 * Sets address
374
+	 */
375
+	public function set_address($address = '')
376
+	{
377
+		$this->set('VNU_address', $address);
378
+	}
379
+
380
+
381
+	/**
382
+	 * @param string $address2
383
+	 */
384
+	public function set_address2($address2 = '')
385
+	{
386
+		$this->set('VNU_address2', $address2);
387
+	}
388
+
389
+
390
+	/**
391
+	 * @param string $city
392
+	 */
393
+	public function set_city($city = '')
394
+	{
395
+		$this->set('VNU_city', $city);
396
+	}
397
+
398
+
399
+	/**
400
+	 * @param int $state
401
+	 */
402
+	public function set_state_ID($state = 0)
403
+	{
404
+		$this->set('STA_ID', $state);
405
+	}
406
+
407
+
408
+	/**
409
+	 * Sets the state, given either a state id or state object
410
+	 *
411
+	 * @param EE_State /int $state_id_or_obj
412
+	 * @return EE_State
413
+	 */
414
+	public function set_state_obj($state_id_or_obj)
415
+	{
416
+		return $this->_add_relation_to($state_id_or_obj, 'State');
417
+	}
418
+
419
+
420
+	/**
421
+	 * @param int $country_ID
422
+	 */
423
+	public function set_country_ID($country_ID = 0)
424
+	{
425
+		$this->set('CNT_ISO', $country_ID);
426
+	}
427
+
428
+
429
+	/**
430
+	 * Sets the country on the venue
431
+	 *
432
+	 * @param EE_Country /string $country_id_or_obj
433
+	 * @return EE_Country
434
+	 */
435
+	public function set_country_obj($country_id_or_obj)
436
+	{
437
+		return $this->_add_relation_to($country_id_or_obj, 'Country');
438
+	}
439
+
440
+
441
+	/**
442
+	 * @param string $zip
443
+	 */
444
+	public function set_zip($zip = '')
445
+	{
446
+		$this->set('VNU_zip', $zip);
447
+	}
448
+
449
+
450
+	/**
451
+	 * @param int $capacity
452
+	 */
453
+	public function set_capacity($capacity = 0)
454
+	{
455
+		$this->set('VNU_capacity', $capacity);
456
+	}
457
+
458
+
459
+	/**
460
+	 * @param string $created
461
+	 */
462
+	public function set_created($created = '')
463
+	{
464
+		$this->set('VNU_created', $created);
465
+	}
466
+
467
+
468
+	/**
469
+	 * @param string $desc
470
+	 */
471
+	public function set_description($desc = '')
472
+	{
473
+		$this->set('VNU_desc', $desc);
474
+	}
475
+
476
+
477
+	/**
478
+	 * @param string $identifier
479
+	 */
480
+	public function set_identifier($identifier = '')
481
+	{
482
+		$this->set('VNU_identifier', $identifier);
483
+	}
484
+
485
+
486
+	/**
487
+	 * @param string $modified
488
+	 */
489
+	public function set_modified($modified = '')
490
+	{
491
+		$this->set('VNU_modified', $modified);
492
+	}
493
+
494
+
495
+	/**
496
+	 * @param string $name
497
+	 */
498
+	public function set_name($name = '')
499
+	{
500
+		$this->set('VNU_name', $name);
501
+	}
502
+
503
+
504
+	/**
505
+	 * @param int $order
506
+	 */
507
+	public function set_order($order = 0)
508
+	{
509
+		$this->set('VNU_order', $order);
510
+	}
511
+
512
+
513
+	/**
514
+	 * @param string $phone
515
+	 */
516
+	public function set_phone($phone = '')
517
+	{
518
+		$this->set('VNU_phone', $phone);
519
+	}
520
+
521
+
522
+	/**
523
+	 * @param int $wp_user
524
+	 */
525
+	public function set_wp_user($wp_user = 1)
526
+	{
527
+		$this->set('VNU_wp_user', $wp_user);
528
+	}
529
+
530
+
531
+	/**
532
+	 * @param string $url
533
+	 */
534
+	public function set_venue_url($url = '')
535
+	{
536
+		$this->set('VNU_url', $url);
537
+	}
538
+
539
+
540
+	/**
541
+	 * @param string $phone
542
+	 */
543
+	public function set_virtual_phone($phone = '')
544
+	{
545
+		$this->set('VNU_virtual_phone', $phone);
546
+	}
547
+
548
+
549
+	/**
550
+	 * @param string $url
551
+	 */
552
+	public function set_virtual_url($url = '')
553
+	{
554
+		$this->set('VNU_virtual_url', $url);
555
+	}
556
+
557
+
558
+	/**
559
+	 * @param string $enable
560
+	 */
561
+	public function set_enable_for_gmap($enable = '')
562
+	{
563
+		$this->set('VNU_enable_for_gmap', $enable);
564
+	}
565
+
566
+
567
+	/**
568
+	 * @param string $google_map_link
569
+	 */
570
+	public function set_google_map_link($google_map_link = '')
571
+	{
572
+		$this->set('VNU_google_map_link', $google_map_link);
573
+	}
574 574
 }
Please login to merge, or discard this patch.