@@ -17,172 +17,172 @@ |
||
17 | 17 | { |
18 | 18 | |
19 | 19 | |
20 | - /** |
|
21 | - * Constructor. |
|
22 | - * |
|
23 | - * @param EE_Registration[] $data expecting an array of EE_Registration objects. |
|
24 | - * @throws EE_Error |
|
25 | - * @access protected |
|
26 | - */ |
|
27 | - public function __construct($data = array()) |
|
28 | - { |
|
29 | - |
|
30 | - // validate that the first element in the array is an EE_Registration object. |
|
31 | - if (! reset($data) instanceof EE_Registration) { |
|
32 | - throw new EE_Error( |
|
33 | - esc_html__( |
|
34 | - 'The EE_Message_Registrations_incoming_data class expects an array of EE_Registration objects.', |
|
35 | - 'event_espresso' |
|
36 | - ) |
|
37 | - ); |
|
38 | - } |
|
39 | - parent::__construct($data); |
|
40 | - } |
|
41 | - |
|
42 | - |
|
43 | - /** |
|
44 | - * setup the data. |
|
45 | - * Sets up the expected data object for the messages prep using incoming registration objects. |
|
46 | - * |
|
47 | - * @return void |
|
48 | - * @throws EE_Error |
|
49 | - * @throws EntityNotFoundException |
|
50 | - * @access protected |
|
51 | - */ |
|
52 | - protected function _setup_data() |
|
53 | - { |
|
54 | - // we'll loop through each contact and setup the data needed. Note that many properties will just be set as |
|
55 | - // empty because this data handler is for a very specific set of data (i.e. just what's related to the |
|
56 | - // registration). |
|
57 | - |
|
58 | - $this->reg_objs = $this->data(); |
|
59 | - $this->txn = $this->_maybe_get_transaction(); |
|
60 | - $this->_assemble_data(); |
|
61 | - } |
|
62 | - |
|
63 | - |
|
64 | - /** |
|
65 | - * If the incoming registrations all share the same transaction then this will return the transaction object shared |
|
66 | - * among the registrations. Otherwise the transaction object is set to null because its intended to only represent |
|
67 | - * one transaction. |
|
68 | - * |
|
69 | - * @return EE_Transaction|null |
|
70 | - * @throws EE_Error |
|
71 | - * @throws EntityNotFoundException |
|
72 | - */ |
|
73 | - protected function _maybe_get_transaction() |
|
74 | - { |
|
75 | - $transactions = array(); |
|
76 | - foreach ($this->reg_objs as $registration) { |
|
77 | - if ($registration instanceof EE_Registration) { |
|
78 | - $transaction = $registration->transaction(); |
|
79 | - if ($transaction instanceof EE_Transaction) { |
|
80 | - $transactions[ $transaction->ID() ] = $transaction; |
|
81 | - } |
|
82 | - } |
|
83 | - } |
|
84 | - return count($transactions) === 1 ? reset($transactions) : null; |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * Returns database safe representation of the data later used to when instantiating this object. |
|
90 | - * |
|
91 | - * @param array $registrations The incoming data to be prepped. |
|
92 | - * @return EE_Registration[] The data being prepared for the db |
|
93 | - * @throws EE_Error |
|
94 | - * @throws InvalidArgumentException |
|
95 | - * @throws InvalidDataTypeException |
|
96 | - * @throws InvalidInterfaceException |
|
97 | - */ |
|
98 | - public static function convert_data_for_persistent_storage($registrations) |
|
99 | - { |
|
100 | - if (! self::validateRegistrationsForConversion($registrations)) { |
|
101 | - return array(); |
|
102 | - } |
|
103 | - |
|
104 | - // is this an array of ints? |
|
105 | - $first_item = reset($registrations); |
|
106 | - if (is_int($first_item)) { |
|
107 | - return $registrations; |
|
108 | - } |
|
109 | - |
|
110 | - // k nope so let's pull from the registrations |
|
111 | - $registration_ids = array_filter( |
|
112 | - array_map( |
|
113 | - function ($registration) { |
|
114 | - if ($registration instanceof EE_Registration) { |
|
115 | - return $registration->ID(); |
|
116 | - } |
|
117 | - return false; |
|
118 | - }, |
|
119 | - $registrations |
|
120 | - ) |
|
121 | - ); |
|
122 | - |
|
123 | - return $registration_ids; |
|
124 | - } |
|
125 | - |
|
126 | - |
|
127 | - /** |
|
128 | - * This validates incoming registrations (considers whether they are ids or EE_Registration objects. |
|
129 | - * |
|
130 | - * @param array $registrations Could be EE_Registration[] or int[] |
|
131 | - * @return bool |
|
132 | - * @throws EE_Error |
|
133 | - * @throws InvalidArgumentException |
|
134 | - * @throws InvalidDataTypeException |
|
135 | - * @throws InvalidInterfaceException |
|
136 | - */ |
|
137 | - protected static function validateRegistrationsForConversion($registrations) |
|
138 | - { |
|
139 | - if (is_array($registrations)) { |
|
140 | - $first_item = reset($registrations); |
|
141 | - if ($first_item instanceof EE_Registration) { |
|
142 | - return true; |
|
143 | - } |
|
144 | - if (is_int($first_item)) { |
|
145 | - // k let's some basic validation here. This isn't foolproof but better than nothing. |
|
146 | - // the purpose of this validation is to verify that the ids sent in match valid registrations existing |
|
147 | - // in the db. If the count is different, then we know they aren't valid. |
|
148 | - $count_for_ids = EEM_Registration::instance()->count( |
|
149 | - array( |
|
150 | - array( |
|
151 | - 'REG_ID' => array('IN', $registrations) |
|
152 | - ) |
|
153 | - ) |
|
154 | - ); |
|
155 | - return $count_for_ids === count($registrations); |
|
156 | - } |
|
157 | - } |
|
158 | - return false; |
|
159 | - } |
|
160 | - |
|
161 | - |
|
162 | - /** |
|
163 | - * Data that has been stored in persistent storage that was prepped by _convert_data_for_persistent_storage |
|
164 | - * can be sent into this method and converted back into the format used for instantiating with this data handler. |
|
165 | - * |
|
166 | - * @param array $data |
|
167 | - * @return EE_Registration[] |
|
168 | - * @throws EE_Error |
|
169 | - * @throws InvalidArgumentException |
|
170 | - * @throws InvalidDataTypeException |
|
171 | - * @throws InvalidInterfaceException |
|
172 | - */ |
|
173 | - public static function convert_data_from_persistent_storage($data) |
|
174 | - { |
|
175 | - // since this was added later, we need to account of possible back compat issues where data already queued for |
|
176 | - // generation is in the old format, which is an array of EE_Registration objects. So if that's the case, then |
|
177 | - // let's just return them |
|
178 | - // @see https://events.codebasehq.com/projects/event-espresso/tickets/10127 |
|
179 | - if (is_array($data) && reset($data) instanceof EE_Registration) { |
|
180 | - return $data; |
|
181 | - } |
|
182 | - |
|
183 | - $registrations = is_array($data) |
|
184 | - ? EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $data)))) |
|
185 | - : array(); |
|
186 | - return $registrations; |
|
187 | - } |
|
20 | + /** |
|
21 | + * Constructor. |
|
22 | + * |
|
23 | + * @param EE_Registration[] $data expecting an array of EE_Registration objects. |
|
24 | + * @throws EE_Error |
|
25 | + * @access protected |
|
26 | + */ |
|
27 | + public function __construct($data = array()) |
|
28 | + { |
|
29 | + |
|
30 | + // validate that the first element in the array is an EE_Registration object. |
|
31 | + if (! reset($data) instanceof EE_Registration) { |
|
32 | + throw new EE_Error( |
|
33 | + esc_html__( |
|
34 | + 'The EE_Message_Registrations_incoming_data class expects an array of EE_Registration objects.', |
|
35 | + 'event_espresso' |
|
36 | + ) |
|
37 | + ); |
|
38 | + } |
|
39 | + parent::__construct($data); |
|
40 | + } |
|
41 | + |
|
42 | + |
|
43 | + /** |
|
44 | + * setup the data. |
|
45 | + * Sets up the expected data object for the messages prep using incoming registration objects. |
|
46 | + * |
|
47 | + * @return void |
|
48 | + * @throws EE_Error |
|
49 | + * @throws EntityNotFoundException |
|
50 | + * @access protected |
|
51 | + */ |
|
52 | + protected function _setup_data() |
|
53 | + { |
|
54 | + // we'll loop through each contact and setup the data needed. Note that many properties will just be set as |
|
55 | + // empty because this data handler is for a very specific set of data (i.e. just what's related to the |
|
56 | + // registration). |
|
57 | + |
|
58 | + $this->reg_objs = $this->data(); |
|
59 | + $this->txn = $this->_maybe_get_transaction(); |
|
60 | + $this->_assemble_data(); |
|
61 | + } |
|
62 | + |
|
63 | + |
|
64 | + /** |
|
65 | + * If the incoming registrations all share the same transaction then this will return the transaction object shared |
|
66 | + * among the registrations. Otherwise the transaction object is set to null because its intended to only represent |
|
67 | + * one transaction. |
|
68 | + * |
|
69 | + * @return EE_Transaction|null |
|
70 | + * @throws EE_Error |
|
71 | + * @throws EntityNotFoundException |
|
72 | + */ |
|
73 | + protected function _maybe_get_transaction() |
|
74 | + { |
|
75 | + $transactions = array(); |
|
76 | + foreach ($this->reg_objs as $registration) { |
|
77 | + if ($registration instanceof EE_Registration) { |
|
78 | + $transaction = $registration->transaction(); |
|
79 | + if ($transaction instanceof EE_Transaction) { |
|
80 | + $transactions[ $transaction->ID() ] = $transaction; |
|
81 | + } |
|
82 | + } |
|
83 | + } |
|
84 | + return count($transactions) === 1 ? reset($transactions) : null; |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * Returns database safe representation of the data later used to when instantiating this object. |
|
90 | + * |
|
91 | + * @param array $registrations The incoming data to be prepped. |
|
92 | + * @return EE_Registration[] The data being prepared for the db |
|
93 | + * @throws EE_Error |
|
94 | + * @throws InvalidArgumentException |
|
95 | + * @throws InvalidDataTypeException |
|
96 | + * @throws InvalidInterfaceException |
|
97 | + */ |
|
98 | + public static function convert_data_for_persistent_storage($registrations) |
|
99 | + { |
|
100 | + if (! self::validateRegistrationsForConversion($registrations)) { |
|
101 | + return array(); |
|
102 | + } |
|
103 | + |
|
104 | + // is this an array of ints? |
|
105 | + $first_item = reset($registrations); |
|
106 | + if (is_int($first_item)) { |
|
107 | + return $registrations; |
|
108 | + } |
|
109 | + |
|
110 | + // k nope so let's pull from the registrations |
|
111 | + $registration_ids = array_filter( |
|
112 | + array_map( |
|
113 | + function ($registration) { |
|
114 | + if ($registration instanceof EE_Registration) { |
|
115 | + return $registration->ID(); |
|
116 | + } |
|
117 | + return false; |
|
118 | + }, |
|
119 | + $registrations |
|
120 | + ) |
|
121 | + ); |
|
122 | + |
|
123 | + return $registration_ids; |
|
124 | + } |
|
125 | + |
|
126 | + |
|
127 | + /** |
|
128 | + * This validates incoming registrations (considers whether they are ids or EE_Registration objects. |
|
129 | + * |
|
130 | + * @param array $registrations Could be EE_Registration[] or int[] |
|
131 | + * @return bool |
|
132 | + * @throws EE_Error |
|
133 | + * @throws InvalidArgumentException |
|
134 | + * @throws InvalidDataTypeException |
|
135 | + * @throws InvalidInterfaceException |
|
136 | + */ |
|
137 | + protected static function validateRegistrationsForConversion($registrations) |
|
138 | + { |
|
139 | + if (is_array($registrations)) { |
|
140 | + $first_item = reset($registrations); |
|
141 | + if ($first_item instanceof EE_Registration) { |
|
142 | + return true; |
|
143 | + } |
|
144 | + if (is_int($first_item)) { |
|
145 | + // k let's some basic validation here. This isn't foolproof but better than nothing. |
|
146 | + // the purpose of this validation is to verify that the ids sent in match valid registrations existing |
|
147 | + // in the db. If the count is different, then we know they aren't valid. |
|
148 | + $count_for_ids = EEM_Registration::instance()->count( |
|
149 | + array( |
|
150 | + array( |
|
151 | + 'REG_ID' => array('IN', $registrations) |
|
152 | + ) |
|
153 | + ) |
|
154 | + ); |
|
155 | + return $count_for_ids === count($registrations); |
|
156 | + } |
|
157 | + } |
|
158 | + return false; |
|
159 | + } |
|
160 | + |
|
161 | + |
|
162 | + /** |
|
163 | + * Data that has been stored in persistent storage that was prepped by _convert_data_for_persistent_storage |
|
164 | + * can be sent into this method and converted back into the format used for instantiating with this data handler. |
|
165 | + * |
|
166 | + * @param array $data |
|
167 | + * @return EE_Registration[] |
|
168 | + * @throws EE_Error |
|
169 | + * @throws InvalidArgumentException |
|
170 | + * @throws InvalidDataTypeException |
|
171 | + * @throws InvalidInterfaceException |
|
172 | + */ |
|
173 | + public static function convert_data_from_persistent_storage($data) |
|
174 | + { |
|
175 | + // since this was added later, we need to account of possible back compat issues where data already queued for |
|
176 | + // generation is in the old format, which is an array of EE_Registration objects. So if that's the case, then |
|
177 | + // let's just return them |
|
178 | + // @see https://events.codebasehq.com/projects/event-espresso/tickets/10127 |
|
179 | + if (is_array($data) && reset($data) instanceof EE_Registration) { |
|
180 | + return $data; |
|
181 | + } |
|
182 | + |
|
183 | + $registrations = is_array($data) |
|
184 | + ? EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $data)))) |
|
185 | + : array(); |
|
186 | + return $registrations; |
|
187 | + } |
|
188 | 188 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | |
30 | 30 | // validate that the first element in the array is an EE_Registration object. |
31 | - if (! reset($data) instanceof EE_Registration) { |
|
31 | + if ( ! reset($data) instanceof EE_Registration) { |
|
32 | 32 | throw new EE_Error( |
33 | 33 | esc_html__( |
34 | 34 | 'The EE_Message_Registrations_incoming_data class expects an array of EE_Registration objects.', |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if ($registration instanceof EE_Registration) { |
78 | 78 | $transaction = $registration->transaction(); |
79 | 79 | if ($transaction instanceof EE_Transaction) { |
80 | - $transactions[ $transaction->ID() ] = $transaction; |
|
80 | + $transactions[$transaction->ID()] = $transaction; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public static function convert_data_for_persistent_storage($registrations) |
99 | 99 | { |
100 | - if (! self::validateRegistrationsForConversion($registrations)) { |
|
100 | + if ( ! self::validateRegistrationsForConversion($registrations)) { |
|
101 | 101 | return array(); |
102 | 102 | } |
103 | 103 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // k nope so let's pull from the registrations |
111 | 111 | $registration_ids = array_filter( |
112 | 112 | array_map( |
113 | - function ($registration) { |
|
113 | + function($registration) { |
|
114 | 114 | if ($registration instanceof EE_Registration) { |
115 | 115 | return $registration->ID(); |
116 | 116 | } |
@@ -15,37 +15,37 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'payment_refund'; |
|
22 | - |
|
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
25 | - |
|
26 | - /** |
|
27 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - |
|
33 | - // modify just event_list |
|
34 | - $new_config['event_list'] = array( |
|
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | - ); |
|
37 | - $new_config['ticket_list'] = array( |
|
38 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | - ); |
|
40 | - $new_config['content'] = array( |
|
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | - ); |
|
43 | - $this->_messenger->set_validator_config($new_config); |
|
44 | - |
|
45 | - if ($this->_context != 'admin') { |
|
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | - } |
|
48 | - |
|
49 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | - } |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'payment_refund'; |
|
22 | + |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | + |
|
26 | + /** |
|
27 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + |
|
33 | + // modify just event_list |
|
34 | + $new_config['event_list'] = array( |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | + ); |
|
37 | + $new_config['ticket_list'] = array( |
|
38 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | + ); |
|
40 | + $new_config['content'] = array( |
|
41 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | + ); |
|
43 | + $this->_messenger->set_validator_config($new_config); |
|
44 | + |
|
45 | + if ($this->_context != 'admin') { |
|
46 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | + } |
|
48 | + |
|
49 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | + } |
|
51 | 51 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -16,31 +16,31 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - public function __construct($fields, $context) |
|
20 | - { |
|
21 | - $this->_m_name = 'email'; |
|
22 | - $this->_mt_name = 'registration_summary'; |
|
19 | + public function __construct($fields, $context) |
|
20 | + { |
|
21 | + $this->_m_name = 'email'; |
|
22 | + $this->_mt_name = 'registration_summary'; |
|
23 | 23 | |
24 | - parent::__construct($fields, $context); |
|
25 | - } |
|
24 | + parent::__construct($fields, $context); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * custom validator (restricting what was originally set by the messenger) |
|
29 | - */ |
|
30 | - protected function _modify_validator() |
|
31 | - { |
|
32 | - $new_config = $this->_messenger->get_validator_config(); |
|
33 | - // modify just event_list |
|
34 | - $new_config['event_list'] = array( |
|
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
36 | - 'required' => array('[EVENT_LIST]') |
|
37 | - ); |
|
38 | - $this->_messenger->set_validator_config($new_config); |
|
27 | + /** |
|
28 | + * custom validator (restricting what was originally set by the messenger) |
|
29 | + */ |
|
30 | + protected function _modify_validator() |
|
31 | + { |
|
32 | + $new_config = $this->_messenger->get_validator_config(); |
|
33 | + // modify just event_list |
|
34 | + $new_config['event_list'] = array( |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
36 | + 'required' => array('[EVENT_LIST]') |
|
37 | + ); |
|
38 | + $this->_messenger->set_validator_config($new_config); |
|
39 | 39 | |
40 | - if ($this->_context != 'admin') { |
|
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | - } |
|
40 | + if ($this->_context != 'admin') { |
|
41 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | + } |
|
43 | 43 | |
44 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
45 | - } |
|
44 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
45 | + } |
|
46 | 46 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'registration'; |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'registration'; |
|
22 | 22 | |
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * custom validator (restricting what was originally set by the messenger) |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - // modify just event_list |
|
33 | - $new_config['event_list'] = array( |
|
34 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | - 'required' => array('[EVENT_LIST]') |
|
36 | - ); |
|
37 | - $this->_messenger->set_validator_config($new_config); |
|
26 | + /** |
|
27 | + * custom validator (restricting what was originally set by the messenger) |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + // modify just event_list |
|
33 | + $new_config['event_list'] = array( |
|
34 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | + 'required' => array('[EVENT_LIST]') |
|
36 | + ); |
|
37 | + $this->_messenger->set_validator_config($new_config); |
|
38 | 38 | |
39 | - if ($this->_context != 'admin') { |
|
40 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | - } |
|
39 | + if ($this->_context != 'admin') { |
|
40 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + } |
|
42 | 42 | |
43 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | - } |
|
43 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | + } |
|
45 | 45 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,30 +15,30 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'not_approved_registration'; |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'not_approved_registration'; |
|
22 | 22 | |
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * custom validator (restricting what was originally set by the messenger) |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - $new_config['event_list'] = array( |
|
33 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
34 | - 'required' => array('[EVENT_LIST]') |
|
35 | - ); |
|
36 | - $this->_messenger->set_validator_config($new_config); |
|
26 | + /** |
|
27 | + * custom validator (restricting what was originally set by the messenger) |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + $new_config['event_list'] = array( |
|
33 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
34 | + 'required' => array('[EVENT_LIST]') |
|
35 | + ); |
|
36 | + $this->_messenger->set_validator_config($new_config); |
|
37 | 37 | |
38 | - if ($this->_context != 'admin') { |
|
39 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
40 | - } |
|
38 | + if ($this->_context != 'admin') { |
|
39 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
40 | + } |
|
41 | 41 | |
42 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
43 | - } |
|
42 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
43 | + } |
|
44 | 44 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'pending_approval'; |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'pending_approval'; |
|
22 | 22 | |
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * custom validator (restricting what was originally set by the messenger) |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - // modify just event_list |
|
33 | - $new_config['event_list'] = array( |
|
34 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | - 'required' => array('[EVENT_LIST]') |
|
36 | - ); |
|
37 | - $this->_messenger->set_validator_config($new_config); |
|
26 | + /** |
|
27 | + * custom validator (restricting what was originally set by the messenger) |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + // modify just event_list |
|
33 | + $new_config['event_list'] = array( |
|
34 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | + 'required' => array('[EVENT_LIST]') |
|
36 | + ); |
|
37 | + $this->_messenger->set_validator_config($new_config); |
|
38 | 38 | |
39 | - if ($this->_context != 'admin') { |
|
40 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | - } |
|
39 | + if ($this->_context != 'admin') { |
|
40 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + } |
|
42 | 42 | |
43 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | - } |
|
43 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | + } |
|
45 | 45 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,37 +15,37 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'payment'; |
|
22 | - |
|
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
25 | - |
|
26 | - /** |
|
27 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - |
|
33 | - // modify just event_list |
|
34 | - $new_config['event_list'] = array( |
|
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | - ); |
|
37 | - $new_config['ticket_list'] = array( |
|
38 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | - ); |
|
40 | - $new_config['content'] = array( |
|
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | - ); |
|
43 | - $this->_messenger->set_validator_config($new_config); |
|
44 | - |
|
45 | - if ($this->_context != 'admin') { |
|
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | - } |
|
48 | - |
|
49 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | - } |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'payment'; |
|
22 | + |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | + |
|
26 | + /** |
|
27 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + |
|
33 | + // modify just event_list |
|
34 | + $new_config['event_list'] = array( |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | + ); |
|
37 | + $new_config['ticket_list'] = array( |
|
38 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | + ); |
|
40 | + $new_config['content'] = array( |
|
41 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | + ); |
|
43 | + $this->_messenger->set_validator_config($new_config); |
|
44 | + |
|
45 | + if ($this->_context != 'admin') { |
|
46 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | + } |
|
48 | + |
|
49 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | + } |
|
51 | 51 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -16,21 +16,21 @@ |
||
16 | 16 | class EE_Messages_Html_Invoice_Validator extends EE_Messages_Validator |
17 | 17 | { |
18 | 18 | |
19 | - public function __construct($fields, $context) |
|
20 | - { |
|
21 | - $this->_m_name = 'html'; |
|
22 | - $this->_mt_name = 'invoice'; |
|
19 | + public function __construct($fields, $context) |
|
20 | + { |
|
21 | + $this->_m_name = 'html'; |
|
22 | + $this->_mt_name = 'invoice'; |
|
23 | 23 | |
24 | - parent::__construct($fields, $context); |
|
25 | - } |
|
24 | + parent::__construct($fields, $context); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * custom validator (restricting what was originally set by the messenger). |
|
29 | - * Note nothing is currently done for this messenger and message type. |
|
30 | - */ |
|
31 | - protected function _modify_validator() |
|
32 | - { |
|
33 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | - return; |
|
35 | - } |
|
27 | + /** |
|
28 | + * custom validator (restricting what was originally set by the messenger). |
|
29 | + * Note nothing is currently done for this messenger and message type. |
|
30 | + */ |
|
31 | + protected function _modify_validator() |
|
32 | + { |
|
33 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | + return; |
|
35 | + } |
|
36 | 36 | } |
@@ -16,21 +16,21 @@ |
||
16 | 16 | class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator |
17 | 17 | { |
18 | 18 | |
19 | - public function __construct($fields, $context) |
|
20 | - { |
|
21 | - $this->_m_name = 'html'; |
|
22 | - $this->_mt_name = 'receipt'; |
|
19 | + public function __construct($fields, $context) |
|
20 | + { |
|
21 | + $this->_m_name = 'html'; |
|
22 | + $this->_mt_name = 'receipt'; |
|
23 | 23 | |
24 | - parent::__construct($fields, $context); |
|
25 | - } |
|
24 | + parent::__construct($fields, $context); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * custom validator (restricting what was originally set by the messenger). |
|
29 | - * Note nothing is currently done for this messenger and message type. |
|
30 | - */ |
|
31 | - protected function _modify_validator() |
|
32 | - { |
|
33 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | - return; |
|
35 | - } |
|
27 | + /** |
|
28 | + * custom validator (restricting what was originally set by the messenger). |
|
29 | + * Note nothing is currently done for this messenger and message type. |
|
30 | + */ |
|
31 | + protected function _modify_validator() |
|
32 | + { |
|
33 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | + return; |
|
35 | + } |
|
36 | 36 | } |