@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function get_key($classname, $data) |
48 | 48 | { |
49 | - return md5($classname . serialize($data)); |
|
49 | + return md5($classname.serialize($data)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 |
@@ -11,69 +11,69 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | |
14 | - public function __construct() |
|
15 | - { |
|
16 | - $this->interface = 'EE_Messages_incoming_data'; |
|
17 | - } |
|
18 | - |
|
19 | - |
|
20 | - /** |
|
21 | - * This adds the EE_Messages_incoming_data data handler object to the collection. |
|
22 | - * |
|
23 | - * @param EE_Messages_incoming_data $data_handler |
|
24 | - * @param mixed $data Usually an array of data used in combination with the $data_handler |
|
25 | - * classname to create an alternative index for retrieving data_handlers. |
|
26 | - * @return bool |
|
27 | - */ |
|
28 | - public function add($data_handler, $data = null) |
|
29 | - { |
|
30 | - $data = $data === null ? array() : (array) $data; |
|
31 | - $info['key'] = $this->get_key(get_class($data_handler), $data); |
|
32 | - return parent::add($data_handler, $info); |
|
33 | - } |
|
34 | - |
|
35 | - |
|
36 | - |
|
37 | - |
|
38 | - |
|
39 | - /** |
|
40 | - * This returns a key for retrieving data for the given references used to generate the key. |
|
41 | - * Data handlers are cached to the repository along with a md5() generated key using known references. |
|
42 | - * @param string $classname The classname of the datahandler being checked for. |
|
43 | - * @param mixed $data The data that was used to instantiate the data_handler. |
|
44 | - * |
|
45 | - * @return string md5 hash using provided info. |
|
46 | - */ |
|
47 | - public function get_key($classname, $data) |
|
48 | - { |
|
49 | - return md5($classname . serialize($data)); |
|
50 | - } |
|
51 | - |
|
52 | - |
|
53 | - |
|
54 | - |
|
55 | - |
|
56 | - |
|
57 | - /** |
|
58 | - * This returns a saved EE_Messages_incoming_data object if there is one in the repository indexed by a key matching |
|
59 | - * the given string. |
|
60 | - * |
|
61 | - * @param string $key @see EE_Messages_Data_Handler_Collection::get_key() to setup a key formatted for searching. |
|
62 | - * |
|
63 | - * @return null|EE_Messages_incoming_data |
|
64 | - */ |
|
65 | - public function get_by_key($key) |
|
66 | - { |
|
67 | - $this->rewind(); |
|
68 | - while ($this->valid()) { |
|
69 | - $data = $this->getInfo(); |
|
70 | - if (isset($data['key']) && $data['key'] === $key) { |
|
71 | - $handler = $this->current(); |
|
72 | - $this->rewind(); |
|
73 | - return $handler; |
|
74 | - } |
|
75 | - $this->next(); |
|
76 | - } |
|
77 | - return null; |
|
78 | - } |
|
14 | + public function __construct() |
|
15 | + { |
|
16 | + $this->interface = 'EE_Messages_incoming_data'; |
|
17 | + } |
|
18 | + |
|
19 | + |
|
20 | + /** |
|
21 | + * This adds the EE_Messages_incoming_data data handler object to the collection. |
|
22 | + * |
|
23 | + * @param EE_Messages_incoming_data $data_handler |
|
24 | + * @param mixed $data Usually an array of data used in combination with the $data_handler |
|
25 | + * classname to create an alternative index for retrieving data_handlers. |
|
26 | + * @return bool |
|
27 | + */ |
|
28 | + public function add($data_handler, $data = null) |
|
29 | + { |
|
30 | + $data = $data === null ? array() : (array) $data; |
|
31 | + $info['key'] = $this->get_key(get_class($data_handler), $data); |
|
32 | + return parent::add($data_handler, $info); |
|
33 | + } |
|
34 | + |
|
35 | + |
|
36 | + |
|
37 | + |
|
38 | + |
|
39 | + /** |
|
40 | + * This returns a key for retrieving data for the given references used to generate the key. |
|
41 | + * Data handlers are cached to the repository along with a md5() generated key using known references. |
|
42 | + * @param string $classname The classname of the datahandler being checked for. |
|
43 | + * @param mixed $data The data that was used to instantiate the data_handler. |
|
44 | + * |
|
45 | + * @return string md5 hash using provided info. |
|
46 | + */ |
|
47 | + public function get_key($classname, $data) |
|
48 | + { |
|
49 | + return md5($classname . serialize($data)); |
|
50 | + } |
|
51 | + |
|
52 | + |
|
53 | + |
|
54 | + |
|
55 | + |
|
56 | + |
|
57 | + /** |
|
58 | + * This returns a saved EE_Messages_incoming_data object if there is one in the repository indexed by a key matching |
|
59 | + * the given string. |
|
60 | + * |
|
61 | + * @param string $key @see EE_Messages_Data_Handler_Collection::get_key() to setup a key formatted for searching. |
|
62 | + * |
|
63 | + * @return null|EE_Messages_incoming_data |
|
64 | + */ |
|
65 | + public function get_by_key($key) |
|
66 | + { |
|
67 | + $this->rewind(); |
|
68 | + while ($this->valid()) { |
|
69 | + $data = $this->getInfo(); |
|
70 | + if (isset($data['key']) && $data['key'] === $key) { |
|
71 | + $handler = $this->current(); |
|
72 | + $this->rewind(); |
|
73 | + return $handler; |
|
74 | + } |
|
75 | + $this->next(); |
|
76 | + } |
|
77 | + return null; |
|
78 | + } |
|
79 | 79 | } |
@@ -15,67 +15,67 @@ |
||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * @see parent::get_priority() for documentation. |
|
20 | - * @return int |
|
21 | - */ |
|
22 | - public function get_priority() |
|
23 | - { |
|
24 | - return EEM_Message::priority_high; |
|
25 | - } |
|
18 | + /** |
|
19 | + * @see parent::get_priority() for documentation. |
|
20 | + * @return int |
|
21 | + */ |
|
22 | + public function get_priority() |
|
23 | + { |
|
24 | + return EEM_Message::priority_high; |
|
25 | + } |
|
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * see abstract declaration in parent class for details. |
|
32 | - */ |
|
33 | - protected function _set_admin_pages() |
|
34 | - { |
|
35 | - $this->admin_registered_pages = array( |
|
36 | - 'events_edit' => true |
|
37 | - ); |
|
38 | - } |
|
30 | + /** |
|
31 | + * see abstract declaration in parent class for details. |
|
32 | + */ |
|
33 | + protected function _set_admin_pages() |
|
34 | + { |
|
35 | + $this->admin_registered_pages = array( |
|
36 | + 'events_edit' => true |
|
37 | + ); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | - protected function _set_data_handler() |
|
43 | - { |
|
44 | - $this->_data_handler = 'Gateways'; |
|
45 | - } |
|
42 | + protected function _set_data_handler() |
|
43 | + { |
|
44 | + $this->_data_handler = 'Gateways'; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | 48 | |
49 | 49 | |
50 | - protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
51 | - { |
|
50 | + protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
51 | + { |
|
52 | 52 | |
53 | - // use the registration to get the transaction. |
|
54 | - $transaction = $registration->transaction(); |
|
53 | + // use the registration to get the transaction. |
|
54 | + $transaction = $registration->transaction(); |
|
55 | 55 | |
56 | - // bail early if no transaction |
|
57 | - if (! $transaction instanceof EE_Transaction) { |
|
58 | - throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso')); |
|
59 | - } |
|
56 | + // bail early if no transaction |
|
57 | + if (! $transaction instanceof EE_Transaction) { |
|
58 | + throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso')); |
|
59 | + } |
|
60 | 60 | |
61 | - $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0; |
|
61 | + $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0; |
|
62 | 62 | |
63 | - return array( $transaction, $payment ); |
|
64 | - } |
|
63 | + return array( $transaction, $payment ); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | - protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger) |
|
69 | - { |
|
70 | - // this is just a test |
|
71 | - return $this->name . ' Message Type for ' . $messenger->name . ' Messenger '; |
|
72 | - } |
|
68 | + protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger) |
|
69 | + { |
|
70 | + // this is just a test |
|
71 | + return $this->name . ' Message Type for ' . $messenger->name . ' Messenger '; |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * This message type doesn't need any settings so we are just setting to empty array. |
|
76 | - */ |
|
77 | - protected function _set_admin_settings_fields() |
|
78 | - { |
|
79 | - $this->_admin_settings_fields = array(); |
|
80 | - } |
|
74 | + /** |
|
75 | + * This message type doesn't need any settings so we are just setting to empty array. |
|
76 | + */ |
|
77 | + protected function _set_admin_settings_fields() |
|
78 | + { |
|
79 | + $this->_admin_settings_fields = array(); |
|
80 | + } |
|
81 | 81 | } |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | $transaction = $registration->transaction(); |
55 | 55 | |
56 | 56 | // bail early if no transaction |
57 | - if (! $transaction instanceof EE_Transaction) { |
|
57 | + if ( ! $transaction instanceof EE_Transaction) { |
|
58 | 58 | throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso')); |
59 | 59 | } |
60 | 60 | |
61 | - $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0; |
|
61 | + $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array(array('PAY_ID' => $id, 'TXN_ID' => $transaction->ID()))) : 0; |
|
62 | 62 | |
63 | - return array( $transaction, $payment ); |
|
63 | + return array($transaction, $payment); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger) |
69 | 69 | { |
70 | 70 | // this is just a test |
71 | - return $this->name . ' Message Type for ' . $messenger->name . ' Messenger '; |
|
71 | + return $this->name.' Message Type for '.$messenger->name.' Messenger '; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -14,126 +14,126 @@ |
||
14 | 14 | { |
15 | 15 | |
16 | 16 | |
17 | - /** |
|
18 | - * @see parent::get_priority() for documentation. |
|
19 | - * @return int |
|
20 | - */ |
|
21 | - public function get_priority() |
|
22 | - { |
|
23 | - return EEM_Message::priority_medium; |
|
24 | - } |
|
25 | - |
|
26 | - |
|
27 | - |
|
28 | - protected function _set_admin_pages() |
|
29 | - { |
|
30 | - $this->admin_registered_pages = array( |
|
31 | - 'events_edit' => true |
|
32 | - ); |
|
33 | - } |
|
34 | - |
|
35 | - |
|
36 | - protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger) |
|
37 | - { |
|
38 | - // this is just a test |
|
39 | - return $this->name . ' Message Type for ' . $messenger->name . ' Messenger '; |
|
40 | - } |
|
41 | - |
|
42 | - |
|
43 | - |
|
44 | - |
|
45 | - protected function _set_data_handler() |
|
46 | - { |
|
47 | - if (is_array($this->_data)) { |
|
48 | - $data_type = reset($this->_data); |
|
49 | - |
|
50 | - if (is_array($data_type)) { |
|
51 | - // grab the first item and see if its a registration. |
|
52 | - $maybe_reg = isset($data_type[0]) && is_array($data_type[0]) ? reset($data_type[0]) : reset($data_type); |
|
53 | - if ($maybe_reg instanceof EE_Registration) { |
|
54 | - // is $data_type itself just an array of registrations? |
|
55 | - if (isset($data_type[1]) && $data_type[1] instanceof EE_Registration) { |
|
56 | - $regs = $data_type; |
|
57 | - } else { |
|
58 | - $regs = is_array($data_type[0]) ? $data_type[0] : array( $maybe_reg ); |
|
59 | - } |
|
60 | - |
|
61 | - foreach ($regs as $reg) { |
|
62 | - if ($reg instanceof EE_Registration) { |
|
63 | - $this->_regs_for_sending[] = $reg->ID(); |
|
64 | - } |
|
65 | - } |
|
66 | - $this->_data = isset($this->_data[1]) ? array( $maybe_reg->transaction(), null, $this->_data[1] ) : array( $maybe_reg->transaction() ); |
|
67 | - $this->_data_handler = 'Gateways'; |
|
68 | - } else { |
|
69 | - $this->_data_handler = 'Gateways'; |
|
70 | - } |
|
71 | - } else { |
|
72 | - $this->_data_handler = $data_type instanceof EE_Registration ? 'REG' : 'Gateways'; |
|
73 | - } |
|
74 | - } else { |
|
75 | - $this->_data_handler = $this->_data instanceof EE_Registration ? 'REG' : 'Gateways'; |
|
76 | - } |
|
77 | - |
|
78 | - $this->_single_message = $this->_data_handler == 'REG' ? true : false; |
|
79 | - } |
|
80 | - |
|
81 | - |
|
82 | - |
|
83 | - protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
84 | - { |
|
85 | - if ($context == 'admin') { |
|
86 | - // use the registration to get the transaction. |
|
87 | - $transaction = $registration->transaction(); |
|
88 | - |
|
89 | - // bail early if no transaction |
|
90 | - if (! $transaction instanceof EE_Transaction) { |
|
91 | - throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso')); |
|
92 | - } |
|
93 | - |
|
94 | - $payment = !empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0; |
|
95 | - return array( $transaction, $payment ); |
|
96 | - } else { |
|
97 | - return $registration; |
|
98 | - } |
|
99 | - } |
|
100 | - |
|
101 | - |
|
102 | - |
|
103 | - /** |
|
104 | - * Setup admin settings for this message type. |
|
105 | - */ |
|
106 | - protected function _set_admin_settings_fields() |
|
107 | - { |
|
108 | - $this->_admin_settings_fields = array(); |
|
109 | - } |
|
110 | - |
|
111 | - |
|
112 | - |
|
113 | - |
|
114 | - |
|
115 | - /** |
|
116 | - * returns an array of addressee objects for event_admins |
|
117 | - * |
|
118 | - * @access protected |
|
119 | - * @return array array of EE_Messages_Addressee objects |
|
120 | - */ |
|
121 | - protected function _admin_addressees() |
|
122 | - { |
|
123 | - if ($this->_single_message) { |
|
124 | - return array(); |
|
125 | - } |
|
126 | - return parent::_admin_addressees(); |
|
127 | - } |
|
128 | - |
|
129 | - |
|
130 | - |
|
131 | - protected function _primary_attendee_addressees() |
|
132 | - { |
|
133 | - if ($this->_single_message) { |
|
134 | - return array(); |
|
135 | - } |
|
136 | - |
|
137 | - return parent::_primary_attendee_addressees(); |
|
138 | - } |
|
17 | + /** |
|
18 | + * @see parent::get_priority() for documentation. |
|
19 | + * @return int |
|
20 | + */ |
|
21 | + public function get_priority() |
|
22 | + { |
|
23 | + return EEM_Message::priority_medium; |
|
24 | + } |
|
25 | + |
|
26 | + |
|
27 | + |
|
28 | + protected function _set_admin_pages() |
|
29 | + { |
|
30 | + $this->admin_registered_pages = array( |
|
31 | + 'events_edit' => true |
|
32 | + ); |
|
33 | + } |
|
34 | + |
|
35 | + |
|
36 | + protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger) |
|
37 | + { |
|
38 | + // this is just a test |
|
39 | + return $this->name . ' Message Type for ' . $messenger->name . ' Messenger '; |
|
40 | + } |
|
41 | + |
|
42 | + |
|
43 | + |
|
44 | + |
|
45 | + protected function _set_data_handler() |
|
46 | + { |
|
47 | + if (is_array($this->_data)) { |
|
48 | + $data_type = reset($this->_data); |
|
49 | + |
|
50 | + if (is_array($data_type)) { |
|
51 | + // grab the first item and see if its a registration. |
|
52 | + $maybe_reg = isset($data_type[0]) && is_array($data_type[0]) ? reset($data_type[0]) : reset($data_type); |
|
53 | + if ($maybe_reg instanceof EE_Registration) { |
|
54 | + // is $data_type itself just an array of registrations? |
|
55 | + if (isset($data_type[1]) && $data_type[1] instanceof EE_Registration) { |
|
56 | + $regs = $data_type; |
|
57 | + } else { |
|
58 | + $regs = is_array($data_type[0]) ? $data_type[0] : array( $maybe_reg ); |
|
59 | + } |
|
60 | + |
|
61 | + foreach ($regs as $reg) { |
|
62 | + if ($reg instanceof EE_Registration) { |
|
63 | + $this->_regs_for_sending[] = $reg->ID(); |
|
64 | + } |
|
65 | + } |
|
66 | + $this->_data = isset($this->_data[1]) ? array( $maybe_reg->transaction(), null, $this->_data[1] ) : array( $maybe_reg->transaction() ); |
|
67 | + $this->_data_handler = 'Gateways'; |
|
68 | + } else { |
|
69 | + $this->_data_handler = 'Gateways'; |
|
70 | + } |
|
71 | + } else { |
|
72 | + $this->_data_handler = $data_type instanceof EE_Registration ? 'REG' : 'Gateways'; |
|
73 | + } |
|
74 | + } else { |
|
75 | + $this->_data_handler = $this->_data instanceof EE_Registration ? 'REG' : 'Gateways'; |
|
76 | + } |
|
77 | + |
|
78 | + $this->_single_message = $this->_data_handler == 'REG' ? true : false; |
|
79 | + } |
|
80 | + |
|
81 | + |
|
82 | + |
|
83 | + protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
84 | + { |
|
85 | + if ($context == 'admin') { |
|
86 | + // use the registration to get the transaction. |
|
87 | + $transaction = $registration->transaction(); |
|
88 | + |
|
89 | + // bail early if no transaction |
|
90 | + if (! $transaction instanceof EE_Transaction) { |
|
91 | + throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso')); |
|
92 | + } |
|
93 | + |
|
94 | + $payment = !empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0; |
|
95 | + return array( $transaction, $payment ); |
|
96 | + } else { |
|
97 | + return $registration; |
|
98 | + } |
|
99 | + } |
|
100 | + |
|
101 | + |
|
102 | + |
|
103 | + /** |
|
104 | + * Setup admin settings for this message type. |
|
105 | + */ |
|
106 | + protected function _set_admin_settings_fields() |
|
107 | + { |
|
108 | + $this->_admin_settings_fields = array(); |
|
109 | + } |
|
110 | + |
|
111 | + |
|
112 | + |
|
113 | + |
|
114 | + |
|
115 | + /** |
|
116 | + * returns an array of addressee objects for event_admins |
|
117 | + * |
|
118 | + * @access protected |
|
119 | + * @return array array of EE_Messages_Addressee objects |
|
120 | + */ |
|
121 | + protected function _admin_addressees() |
|
122 | + { |
|
123 | + if ($this->_single_message) { |
|
124 | + return array(); |
|
125 | + } |
|
126 | + return parent::_admin_addressees(); |
|
127 | + } |
|
128 | + |
|
129 | + |
|
130 | + |
|
131 | + protected function _primary_attendee_addressees() |
|
132 | + { |
|
133 | + if ($this->_single_message) { |
|
134 | + return array(); |
|
135 | + } |
|
136 | + |
|
137 | + return parent::_primary_attendee_addressees(); |
|
138 | + } |
|
139 | 139 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger) |
37 | 37 | { |
38 | 38 | // this is just a test |
39 | - return $this->name . ' Message Type for ' . $messenger->name . ' Messenger '; |
|
39 | + return $this->name.' Message Type for '.$messenger->name.' Messenger '; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | if (isset($data_type[1]) && $data_type[1] instanceof EE_Registration) { |
56 | 56 | $regs = $data_type; |
57 | 57 | } else { |
58 | - $regs = is_array($data_type[0]) ? $data_type[0] : array( $maybe_reg ); |
|
58 | + $regs = is_array($data_type[0]) ? $data_type[0] : array($maybe_reg); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | foreach ($regs as $reg) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $this->_regs_for_sending[] = $reg->ID(); |
64 | 64 | } |
65 | 65 | } |
66 | - $this->_data = isset($this->_data[1]) ? array( $maybe_reg->transaction(), null, $this->_data[1] ) : array( $maybe_reg->transaction() ); |
|
66 | + $this->_data = isset($this->_data[1]) ? array($maybe_reg->transaction(), null, $this->_data[1]) : array($maybe_reg->transaction()); |
|
67 | 67 | $this->_data_handler = 'Gateways'; |
68 | 68 | } else { |
69 | 69 | $this->_data_handler = 'Gateways'; |
@@ -82,17 +82,17 @@ discard block |
||
82 | 82 | |
83 | 83 | protected function _get_data_for_context($context, EE_Registration $registration, $id) |
84 | 84 | { |
85 | - if ($context == 'admin') { |
|
85 | + if ($context == 'admin') { |
|
86 | 86 | // use the registration to get the transaction. |
87 | 87 | $transaction = $registration->transaction(); |
88 | 88 | |
89 | 89 | // bail early if no transaction |
90 | - if (! $transaction instanceof EE_Transaction) { |
|
90 | + if ( ! $transaction instanceof EE_Transaction) { |
|
91 | 91 | throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso')); |
92 | 92 | } |
93 | 93 | |
94 | - $payment = !empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0; |
|
95 | - return array( $transaction, $payment ); |
|
94 | + $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array(array('PAY_ID' => $id, 'TXN_ID' => $transaction->ID()))) : 0; |
|
95 | + return array($transaction, $payment); |
|
96 | 96 | } else { |
97 | 97 | return $registration; |
98 | 98 | } |
@@ -15,50 +15,50 @@ |
||
15 | 15 | class EE_Payment_Refund_message_type extends EE_Payment_Base_message_type |
16 | 16 | { |
17 | 17 | |
18 | - public function __construct() |
|
19 | - { |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | 20 | |
21 | - // setup type details for reference |
|
22 | - $this->name = 'payment_refund'; |
|
23 | - $this->description = __('This message type is used for all payment notification messages that go out for refunds.', 'event_espresso'); |
|
24 | - $this->label = array( |
|
25 | - 'singular' => __('refund issued', 'event_espresso'), |
|
26 | - 'plural' => __('refunds issued', 'event_espresso') |
|
27 | - ); |
|
21 | + // setup type details for reference |
|
22 | + $this->name = 'payment_refund'; |
|
23 | + $this->description = __('This message type is used for all payment notification messages that go out for refunds.', 'event_espresso'); |
|
24 | + $this->label = array( |
|
25 | + 'singular' => __('refund issued', 'event_espresso'), |
|
26 | + 'plural' => __('refunds issued', 'event_espresso') |
|
27 | + ); |
|
28 | 28 | |
29 | - $this->_master_templates = array( |
|
30 | - 'email' => 'payment' |
|
31 | - ); |
|
29 | + $this->_master_templates = array( |
|
30 | + 'email' => 'payment' |
|
31 | + ); |
|
32 | 32 | |
33 | - parent::__construct(); |
|
34 | - } |
|
33 | + parent::__construct(); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * _set_contexts |
|
40 | - * This sets up the contexts associated with the message_type |
|
41 | - * |
|
42 | - * @access protected |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - protected function _set_contexts() |
|
46 | - { |
|
47 | - $this->_context_label = array( |
|
48 | - 'label' => __('recipient', 'event_espresso'), |
|
49 | - 'plural' => __('recipients', 'event_espresso'), |
|
50 | - 'description' => __('Recipient\'s are who will receive the template. You may want different payment details sent out depending on who the recipient is', 'event_espresso') |
|
51 | - ); |
|
38 | + /** |
|
39 | + * _set_contexts |
|
40 | + * This sets up the contexts associated with the message_type |
|
41 | + * |
|
42 | + * @access protected |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + protected function _set_contexts() |
|
46 | + { |
|
47 | + $this->_context_label = array( |
|
48 | + 'label' => __('recipient', 'event_espresso'), |
|
49 | + 'plural' => __('recipients', 'event_espresso'), |
|
50 | + 'description' => __('Recipient\'s are who will receive the template. You may want different payment details sent out depending on who the recipient is', 'event_espresso') |
|
51 | + ); |
|
52 | 52 | |
53 | - $this->_contexts = array( |
|
54 | - 'admin' => array( |
|
55 | - 'label' => __('Event Admin', 'event_espresso'), |
|
56 | - 'description' => __('This template is what event administrators will receive on a successful refund.', 'event_espresso') |
|
57 | - ), |
|
58 | - 'primary_attendee' => array( |
|
59 | - 'label' => __('Primary Registrant', 'event_espresso'), |
|
60 | - 'description' => __('This template is what the primary registrant (the person who made the main registration) will receive on successful refund.', 'event_espresso') |
|
61 | - ) |
|
62 | - ); |
|
63 | - } |
|
53 | + $this->_contexts = array( |
|
54 | + 'admin' => array( |
|
55 | + 'label' => __('Event Admin', 'event_espresso'), |
|
56 | + 'description' => __('This template is what event administrators will receive on a successful refund.', 'event_espresso') |
|
57 | + ), |
|
58 | + 'primary_attendee' => array( |
|
59 | + 'label' => __('Primary Registrant', 'event_espresso'), |
|
60 | + 'description' => __('This template is what the primary registrant (the person who made the main registration) will receive on successful refund.', 'event_espresso') |
|
61 | + ) |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | } |
@@ -14,48 +14,48 @@ |
||
14 | 14 | class EE_Registration_message_type extends EE_Registration_Base_message_type |
15 | 15 | { |
16 | 16 | |
17 | - public function __construct() |
|
18 | - { |
|
19 | - $this->name = 'registration'; |
|
20 | - $this->description = __('This message type is for messages sent to attendees when their registration is approved.', 'event_espresso'); |
|
21 | - $this->label = array( |
|
22 | - 'singular' => __('registration approved', 'event_espresso'), |
|
23 | - 'plural' => __('registrations approved', 'event_espresso') |
|
24 | - ); |
|
17 | + public function __construct() |
|
18 | + { |
|
19 | + $this->name = 'registration'; |
|
20 | + $this->description = __('This message type is for messages sent to attendees when their registration is approved.', 'event_espresso'); |
|
21 | + $this->label = array( |
|
22 | + 'singular' => __('registration approved', 'event_espresso'), |
|
23 | + 'plural' => __('registrations approved', 'event_espresso') |
|
24 | + ); |
|
25 | 25 | |
26 | - parent::__construct(); |
|
27 | - } |
|
26 | + parent::__construct(); |
|
27 | + } |
|
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * _set_contexts |
|
33 | - * This sets up the contexts associated with the message_type |
|
34 | - * |
|
35 | - * @access protected |
|
36 | - * @return void |
|
37 | - */ |
|
38 | - protected function _set_contexts() |
|
39 | - { |
|
40 | - $this->_context_label = array( |
|
41 | - 'label' => __('recipient', 'event_espresso'), |
|
42 | - 'plural' => __('recipients', 'event_espresso'), |
|
43 | - 'description' => __('Recipient\'s are who will receive the template. You may want different registration details sent out depending on who the recipient is', 'event_espresso') |
|
44 | - ); |
|
31 | + /** |
|
32 | + * _set_contexts |
|
33 | + * This sets up the contexts associated with the message_type |
|
34 | + * |
|
35 | + * @access protected |
|
36 | + * @return void |
|
37 | + */ |
|
38 | + protected function _set_contexts() |
|
39 | + { |
|
40 | + $this->_context_label = array( |
|
41 | + 'label' => __('recipient', 'event_espresso'), |
|
42 | + 'plural' => __('recipients', 'event_espresso'), |
|
43 | + 'description' => __('Recipient\'s are who will receive the template. You may want different registration details sent out depending on who the recipient is', 'event_espresso') |
|
44 | + ); |
|
45 | 45 | |
46 | - $this->_contexts = array( |
|
47 | - 'admin' => array( |
|
48 | - 'label' => __('Event Admin', 'event_espresso'), |
|
49 | - 'description' => __('This template is what event administrators will receive with an approved registration', 'event_espresso') |
|
50 | - ), |
|
51 | - 'primary_attendee' => array( |
|
52 | - 'label' => __('Primary Registrant', 'event_espresso'), |
|
53 | - 'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive with approved registration', 'event_espresso') |
|
54 | - ), |
|
55 | - 'attendee' => array( |
|
56 | - 'label' => __('Registrant', 'event_espresso'), |
|
57 | - 'description' => __('This template is what each registrant for the event will receive when their registration is approved.', 'event_espresso') |
|
58 | - ) |
|
59 | - ); |
|
60 | - } |
|
46 | + $this->_contexts = array( |
|
47 | + 'admin' => array( |
|
48 | + 'label' => __('Event Admin', 'event_espresso'), |
|
49 | + 'description' => __('This template is what event administrators will receive with an approved registration', 'event_espresso') |
|
50 | + ), |
|
51 | + 'primary_attendee' => array( |
|
52 | + 'label' => __('Primary Registrant', 'event_espresso'), |
|
53 | + 'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive with approved registration', 'event_espresso') |
|
54 | + ), |
|
55 | + 'attendee' => array( |
|
56 | + 'label' => __('Registrant', 'event_espresso'), |
|
57 | + 'description' => __('This template is what each registrant for the event will receive when their registration is approved.', 'event_espresso') |
|
58 | + ) |
|
59 | + ); |
|
60 | + } |
|
61 | 61 | } |
@@ -14,60 +14,60 @@ |
||
14 | 14 | class EE_Not_Approved_Registration_message_type extends EE_Registration_Base_message_type |
15 | 15 | { |
16 | 16 | |
17 | - public function __construct() |
|
18 | - { |
|
19 | - $this->name = 'not_approved_registration'; |
|
20 | - $this->description = __('This message type is for messages sent to registrants when their registration is set to the not approved status.', 'event_espresso'); |
|
21 | - $this->label = array( |
|
22 | - 'singular' => __('not approved registration', 'event_espresso'), |
|
23 | - 'plural' => __('not approved registrations', 'event_espresso') |
|
24 | - ); |
|
17 | + public function __construct() |
|
18 | + { |
|
19 | + $this->name = 'not_approved_registration'; |
|
20 | + $this->description = __('This message type is for messages sent to registrants when their registration is set to the not approved status.', 'event_espresso'); |
|
21 | + $this->label = array( |
|
22 | + 'singular' => __('not approved registration', 'event_espresso'), |
|
23 | + 'plural' => __('not approved registrations', 'event_espresso') |
|
24 | + ); |
|
25 | 25 | |
26 | - $this->_master_templates = array( |
|
27 | - 'email' => 'registration' |
|
28 | - ); |
|
26 | + $this->_master_templates = array( |
|
27 | + 'email' => 'registration' |
|
28 | + ); |
|
29 | 29 | |
30 | - parent::__construct(); |
|
31 | - } |
|
30 | + parent::__construct(); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * _set_contexts |
|
38 | - * This sets up the contexts associated with the message_type |
|
39 | - * |
|
40 | - * @access protected |
|
41 | - * @return void |
|
42 | - */ |
|
43 | - protected function _set_contexts() |
|
44 | - { |
|
45 | - $this->_context_label = array( |
|
46 | - 'label' => __('recipient', 'event_espresso'), |
|
47 | - 'plural' => __('recipients', 'event_espresso'), |
|
48 | - 'description' => __('Recipient\'s are who will receive the template. You may want different registration details sent out depending on who the recipient is', 'event_espresso') |
|
49 | - ); |
|
36 | + /** |
|
37 | + * _set_contexts |
|
38 | + * This sets up the contexts associated with the message_type |
|
39 | + * |
|
40 | + * @access protected |
|
41 | + * @return void |
|
42 | + */ |
|
43 | + protected function _set_contexts() |
|
44 | + { |
|
45 | + $this->_context_label = array( |
|
46 | + 'label' => __('recipient', 'event_espresso'), |
|
47 | + 'plural' => __('recipients', 'event_espresso'), |
|
48 | + 'description' => __('Recipient\'s are who will receive the template. You may want different registration details sent out depending on who the recipient is', 'event_espresso') |
|
49 | + ); |
|
50 | 50 | |
51 | - $this->_contexts = array( |
|
52 | - 'admin' => array( |
|
53 | - 'label' => __('Event Admin', 'event_espresso'), |
|
54 | - 'description' => __('This template is what event administrators will receive when registration status is set to not approved.', 'event_espresso') |
|
55 | - ), |
|
56 | - 'primary_attendee' => array( |
|
57 | - 'label' => __('Primary Registrant', 'event_espresso'), |
|
58 | - 'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive when the registration status is not approved.', 'event_espresso') |
|
59 | - ) |
|
60 | - ); |
|
61 | - } |
|
51 | + $this->_contexts = array( |
|
52 | + 'admin' => array( |
|
53 | + 'label' => __('Event Admin', 'event_espresso'), |
|
54 | + 'description' => __('This template is what event administrators will receive when registration status is set to not approved.', 'event_espresso') |
|
55 | + ), |
|
56 | + 'primary_attendee' => array( |
|
57 | + 'label' => __('Primary Registrant', 'event_espresso'), |
|
58 | + 'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive when the registration status is not approved.', 'event_espresso') |
|
59 | + ) |
|
60 | + ); |
|
61 | + } |
|
62 | 62 | |
63 | 63 | |
64 | 64 | |
65 | - protected function _primary_attendee_addressees() |
|
66 | - { |
|
67 | - $cached = $this->_single_message; |
|
68 | - $this->_single_message = false; |
|
69 | - $addressees = parent::_primary_attendee_addressees(); |
|
70 | - $this->_single_message = $cached; |
|
71 | - return $addressees; |
|
72 | - } |
|
65 | + protected function _primary_attendee_addressees() |
|
66 | + { |
|
67 | + $cached = $this->_single_message; |
|
68 | + $this->_single_message = false; |
|
69 | + $addressees = parent::_primary_attendee_addressees(); |
|
70 | + $this->_single_message = $cached; |
|
71 | + return $addressees; |
|
72 | + } |
|
73 | 73 | } |
@@ -16,59 +16,59 @@ |
||
16 | 16 | class EE_Registration_Summary_message_type extends EE_Registration_Base_message_type |
17 | 17 | { |
18 | 18 | |
19 | - public function __construct() |
|
20 | - { |
|
21 | - $this->name = 'registration_summary'; |
|
22 | - $this->description = __('This message type provides a summary notification to Primary Registrants and Admin recipients when there are multiple registrations in a transaction with different statuses.', 'event_espresso'); |
|
23 | - $this->label = array( |
|
24 | - 'singular' => __('registration multi-status summary', 'event_espresso'), |
|
25 | - 'plural' => __('registrations multi-status summary', 'event_espresso') |
|
26 | - ); |
|
19 | + public function __construct() |
|
20 | + { |
|
21 | + $this->name = 'registration_summary'; |
|
22 | + $this->description = __('This message type provides a summary notification to Primary Registrants and Admin recipients when there are multiple registrations in a transaction with different statuses.', 'event_espresso'); |
|
23 | + $this->label = array( |
|
24 | + 'singular' => __('registration multi-status summary', 'event_espresso'), |
|
25 | + 'plural' => __('registrations multi-status summary', 'event_espresso') |
|
26 | + ); |
|
27 | 27 | |
28 | - $this->_master_templates = array( |
|
29 | - 'email' => 'registration' |
|
30 | - ); |
|
28 | + $this->_master_templates = array( |
|
29 | + 'email' => 'registration' |
|
30 | + ); |
|
31 | 31 | |
32 | - parent::__construct(); |
|
33 | - } |
|
32 | + parent::__construct(); |
|
33 | + } |
|
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * _set_contexts |
|
39 | - * This sets up the contexts associated with the message_type |
|
40 | - * |
|
41 | - * @access protected |
|
42 | - * @return void |
|
43 | - */ |
|
44 | - protected function _set_contexts() |
|
45 | - { |
|
46 | - $this->_context_label = array( |
|
47 | - 'label' => __('recipient', 'event_espresso'), |
|
48 | - 'plural' => __('recipients', 'event_espresso'), |
|
49 | - 'description' => __('Recipient\'s are who will receive the template. You may want different details sent out depending on who the recipient is. To "turn off" a recipient from receiving message, simply remove any content from the "to" field in the template.', 'event_espresso') |
|
50 | - ); |
|
37 | + /** |
|
38 | + * _set_contexts |
|
39 | + * This sets up the contexts associated with the message_type |
|
40 | + * |
|
41 | + * @access protected |
|
42 | + * @return void |
|
43 | + */ |
|
44 | + protected function _set_contexts() |
|
45 | + { |
|
46 | + $this->_context_label = array( |
|
47 | + 'label' => __('recipient', 'event_espresso'), |
|
48 | + 'plural' => __('recipients', 'event_espresso'), |
|
49 | + 'description' => __('Recipient\'s are who will receive the template. You may want different details sent out depending on who the recipient is. To "turn off" a recipient from receiving message, simply remove any content from the "to" field in the template.', 'event_espresso') |
|
50 | + ); |
|
51 | 51 | |
52 | - $this->_contexts = array( |
|
53 | - 'admin' => array( |
|
54 | - 'label' => __('Event Admin', 'event_espresso'), |
|
55 | - 'description' => __('This template is what event administrators will receive when a transaction is finalized that has registrations with multiple different statuses.', 'event_espresso') |
|
56 | - ), |
|
57 | - 'primary_attendee' => array( |
|
58 | - 'label' => __('Primary Registrant', 'event_espresso'), |
|
59 | - 'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive when the transaction completed has registrations with different statuses. By default it is a summary email of all registrations for all events on the transaction and their status.', 'event_espresso') |
|
60 | - ) |
|
61 | - ); |
|
62 | - } |
|
52 | + $this->_contexts = array( |
|
53 | + 'admin' => array( |
|
54 | + 'label' => __('Event Admin', 'event_espresso'), |
|
55 | + 'description' => __('This template is what event administrators will receive when a transaction is finalized that has registrations with multiple different statuses.', 'event_espresso') |
|
56 | + ), |
|
57 | + 'primary_attendee' => array( |
|
58 | + 'label' => __('Primary Registrant', 'event_espresso'), |
|
59 | + 'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive when the transaction completed has registrations with different statuses. By default it is a summary email of all registrations for all events on the transaction and their status.', 'event_espresso') |
|
60 | + ) |
|
61 | + ); |
|
62 | + } |
|
63 | 63 | |
64 | 64 | |
65 | 65 | |
66 | - protected function _primary_attendee_addressees() |
|
67 | - { |
|
68 | - $cached = $this->_single_message; |
|
69 | - $this->_single_message = false; |
|
70 | - $addressees = parent::_primary_attendee_addressees(); |
|
71 | - $this->_single_message = $cached; |
|
72 | - return $addressees; |
|
73 | - } |
|
66 | + protected function _primary_attendee_addressees() |
|
67 | + { |
|
68 | + $cached = $this->_single_message; |
|
69 | + $this->_single_message = false; |
|
70 | + $addressees = parent::_primary_attendee_addressees(); |
|
71 | + $this->_single_message = $cached; |
|
72 | + return $addressees; |
|
73 | + } |
|
74 | 74 | } |
@@ -14,44 +14,44 @@ |
||
14 | 14 | class EE_Payment_message_type extends EE_Payment_Base_message_type |
15 | 15 | { |
16 | 16 | |
17 | - public function __construct() |
|
18 | - { |
|
17 | + public function __construct() |
|
18 | + { |
|
19 | 19 | |
20 | - // setup type details for reference |
|
21 | - $this->name = 'payment'; |
|
22 | - $this->description = __('This message type is used for all payment notification messages that go out including any manual payments entered by an event administrator.', 'event_espresso'); |
|
23 | - $this->label = array( |
|
24 | - 'singular' => __('payment received', 'event_espresso'), |
|
25 | - 'plural' => __('payments received', 'event_espresso') |
|
26 | - ); |
|
20 | + // setup type details for reference |
|
21 | + $this->name = 'payment'; |
|
22 | + $this->description = __('This message type is used for all payment notification messages that go out including any manual payments entered by an event administrator.', 'event_espresso'); |
|
23 | + $this->label = array( |
|
24 | + 'singular' => __('payment received', 'event_espresso'), |
|
25 | + 'plural' => __('payments received', 'event_espresso') |
|
26 | + ); |
|
27 | 27 | |
28 | - parent::__construct(); |
|
29 | - } |
|
28 | + parent::__construct(); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * _set_contexts |
|
33 | - * This sets up the contexts associated with the message_type |
|
34 | - * |
|
35 | - * @access protected |
|
36 | - * @return void |
|
37 | - */ |
|
38 | - protected function _set_contexts() |
|
39 | - { |
|
40 | - $this->_context_label = array( |
|
41 | - 'label' => __('recipient', 'event_espresso'), |
|
42 | - 'plural' => __('recipients', 'event_espresso'), |
|
43 | - 'description' => __('Recipient\'s are who will receive the template. You may want different payment details sent out depending on who the recipient is', 'event_espresso') |
|
44 | - ); |
|
31 | + /** |
|
32 | + * _set_contexts |
|
33 | + * This sets up the contexts associated with the message_type |
|
34 | + * |
|
35 | + * @access protected |
|
36 | + * @return void |
|
37 | + */ |
|
38 | + protected function _set_contexts() |
|
39 | + { |
|
40 | + $this->_context_label = array( |
|
41 | + 'label' => __('recipient', 'event_espresso'), |
|
42 | + 'plural' => __('recipients', 'event_espresso'), |
|
43 | + 'description' => __('Recipient\'s are who will receive the template. You may want different payment details sent out depending on who the recipient is', 'event_espresso') |
|
44 | + ); |
|
45 | 45 | |
46 | - $this->_contexts = array( |
|
47 | - 'admin' => array( |
|
48 | - 'label' => __('Event Admin', 'event_espresso'), |
|
49 | - 'description' => __('This template is what event administrators will receive on a successful payment', 'event_espresso') |
|
50 | - ), |
|
51 | - 'primary_attendee' => array( |
|
52 | - 'label' => __('Primary Registrant', 'event_espresso'), |
|
53 | - 'description' => __('This template is what the primary registrant (the person who made the main registration) will receive on successful payment', 'event_espresso') |
|
54 | - ) |
|
55 | - ); |
|
56 | - } |
|
46 | + $this->_contexts = array( |
|
47 | + 'admin' => array( |
|
48 | + 'label' => __('Event Admin', 'event_espresso'), |
|
49 | + 'description' => __('This template is what event administrators will receive on a successful payment', 'event_espresso') |
|
50 | + ), |
|
51 | + 'primary_attendee' => array( |
|
52 | + 'label' => __('Primary Registrant', 'event_espresso'), |
|
53 | + 'description' => __('This template is what the primary registrant (the person who made the main registration) will receive on successful payment', 'event_espresso') |
|
54 | + ) |
|
55 | + ); |
|
56 | + } |
|
57 | 57 | } |
@@ -13,123 +13,123 @@ |
||
13 | 13 | class EE_Invoice_message_type extends EE_message_type |
14 | 14 | { |
15 | 15 | |
16 | - public function __construct() |
|
17 | - { |
|
18 | - $this->name = 'invoice'; |
|
19 | - $this->description = __('The invoice message type is triggered via a url on the thank you page and via at url generated by the [INVOICE_URL] or [INVOICE_LINK] shortcode.', 'event_espresso'); |
|
20 | - $this->label = array( |
|
21 | - 'singular' => __('invoice', 'event_espresso'), |
|
22 | - 'plural' => __('invoices', 'event_espresso') |
|
23 | - ); |
|
24 | - $this->_master_templates = array(); |
|
25 | - parent::__construct(); |
|
26 | - } |
|
16 | + public function __construct() |
|
17 | + { |
|
18 | + $this->name = 'invoice'; |
|
19 | + $this->description = __('The invoice message type is triggered via a url on the thank you page and via at url generated by the [INVOICE_URL] or [INVOICE_LINK] shortcode.', 'event_espresso'); |
|
20 | + $this->label = array( |
|
21 | + 'singular' => __('invoice', 'event_espresso'), |
|
22 | + 'plural' => __('invoices', 'event_espresso') |
|
23 | + ); |
|
24 | + $this->_master_templates = array(); |
|
25 | + parent::__construct(); |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * @see parent::get_priority() for documentation. |
|
32 | - * @return int |
|
33 | - */ |
|
34 | - public function get_priority() |
|
35 | - { |
|
36 | - return EEM_Message::priority_high; |
|
37 | - } |
|
30 | + /** |
|
31 | + * @see parent::get_priority() for documentation. |
|
32 | + * @return int |
|
33 | + */ |
|
34 | + public function get_priority() |
|
35 | + { |
|
36 | + return EEM_Message::priority_high; |
|
37 | + } |
|
38 | 38 | |
39 | 39 | |
40 | - /** |
|
41 | - * This method returns whether this message type should always generate a new copy |
|
42 | - * when requested, or if links can be to the already generated copy. |
|
43 | - * Note: this does NOT affect viewing/resending already generated messages in the EE_Message list table. |
|
44 | - * Invoices always generate. |
|
45 | - * @return bool false means can link to generated EE_Message. true must regenerate. |
|
46 | - */ |
|
47 | - public function always_generate() |
|
48 | - { |
|
49 | - return true; |
|
50 | - } |
|
40 | + /** |
|
41 | + * This method returns whether this message type should always generate a new copy |
|
42 | + * when requested, or if links can be to the already generated copy. |
|
43 | + * Note: this does NOT affect viewing/resending already generated messages in the EE_Message list table. |
|
44 | + * Invoices always generate. |
|
45 | + * @return bool false means can link to generated EE_Message. true must regenerate. |
|
46 | + */ |
|
47 | + public function always_generate() |
|
48 | + { |
|
49 | + return true; |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | - protected function _set_admin_pages() |
|
54 | - { |
|
55 | - $this->admin_registered_pages = array( 'events_edit' => true ); |
|
56 | - } |
|
53 | + protected function _set_admin_pages() |
|
54 | + { |
|
55 | + $this->admin_registered_pages = array( 'events_edit' => true ); |
|
56 | + } |
|
57 | 57 | |
58 | 58 | |
59 | 59 | |
60 | - protected function _set_data_handler() |
|
61 | - { |
|
62 | - $this->_data_handler = 'Gateways'; |
|
63 | - } |
|
60 | + protected function _set_data_handler() |
|
61 | + { |
|
62 | + $this->_data_handler = 'Gateways'; |
|
63 | + } |
|
64 | 64 | |
65 | 65 | |
66 | 66 | |
67 | - protected function _set_with_messengers() |
|
68 | - { |
|
69 | - $this->_with_messengers = array( |
|
70 | - 'html' => array( 'pdf' ) |
|
71 | - ); |
|
72 | - } |
|
67 | + protected function _set_with_messengers() |
|
68 | + { |
|
69 | + $this->_with_messengers = array( |
|
70 | + 'html' => array( 'pdf' ) |
|
71 | + ); |
|
72 | + } |
|
73 | 73 | |
74 | 74 | |
75 | 75 | |
76 | - protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
77 | - { |
|
78 | - // receipt message type data handler is 'Gateways' and it expects a transaction object. |
|
79 | - $transaction = $registration->transaction(); |
|
80 | - if ($transaction instanceof EE_Transaction) { |
|
81 | - return array( $transaction ); |
|
82 | - } |
|
83 | - return array(); |
|
84 | - } |
|
76 | + protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
77 | + { |
|
78 | + // receipt message type data handler is 'Gateways' and it expects a transaction object. |
|
79 | + $transaction = $registration->transaction(); |
|
80 | + if ($transaction instanceof EE_Transaction) { |
|
81 | + return array( $transaction ); |
|
82 | + } |
|
83 | + return array(); |
|
84 | + } |
|
85 | 85 | |
86 | 86 | |
87 | 87 | |
88 | - protected function _set_admin_settings_fields() |
|
89 | - { |
|
90 | - $this->_admin_settings_fields = array(); |
|
91 | - } |
|
88 | + protected function _set_admin_settings_fields() |
|
89 | + { |
|
90 | + $this->_admin_settings_fields = array(); |
|
91 | + } |
|
92 | 92 | |
93 | 93 | |
94 | 94 | |
95 | - protected function _set_contexts() |
|
96 | - { |
|
97 | - $this->_context_label = array( |
|
98 | - 'label' => __('recipient', 'event_espresso'), |
|
99 | - 'plural' => __('recipients', 'event_espresso'), |
|
100 | - 'description' => __('Recipient\'s are who will view the invoice.', 'event_espresso') |
|
101 | - ); |
|
95 | + protected function _set_contexts() |
|
96 | + { |
|
97 | + $this->_context_label = array( |
|
98 | + 'label' => __('recipient', 'event_espresso'), |
|
99 | + 'plural' => __('recipients', 'event_espresso'), |
|
100 | + 'description' => __('Recipient\'s are who will view the invoice.', 'event_espresso') |
|
101 | + ); |
|
102 | 102 | |
103 | - $this->_contexts = array( |
|
104 | - 'purchaser' => array( |
|
105 | - 'label' => __('Purchaser', 'event_espresso'), |
|
106 | - 'description' => __('This template goes to the person who conducted the transaction.', 'event_espresso') |
|
107 | - ) |
|
108 | - ); |
|
109 | - } |
|
103 | + $this->_contexts = array( |
|
104 | + 'purchaser' => array( |
|
105 | + 'label' => __('Purchaser', 'event_espresso'), |
|
106 | + 'description' => __('This template goes to the person who conducted the transaction.', 'event_espresso') |
|
107 | + ) |
|
108 | + ); |
|
109 | + } |
|
110 | 110 | |
111 | 111 | |
112 | 112 | |
113 | 113 | |
114 | - /** |
|
115 | - * used to set the valid shortcodes for the receipt message type |
|
116 | - * |
|
117 | - * @since 4.5.0 |
|
118 | - * |
|
119 | - * @return void |
|
120 | - */ |
|
121 | - protected function _set_valid_shortcodes() |
|
122 | - { |
|
123 | - $this->_valid_shortcodes['purchaser'] = array( |
|
124 | - 'attendee_list', 'attendee', 'datetime_list', 'datetime', 'event_list', 'event', 'event_meta', 'messenger', 'organization', 'primary_registration_list', 'primary_registration_details', 'ticket_list', 'ticket', 'transaction', 'venue', 'line_item_list', 'payment_list', 'line_item', 'payment' |
|
125 | - ); |
|
126 | - } |
|
114 | + /** |
|
115 | + * used to set the valid shortcodes for the receipt message type |
|
116 | + * |
|
117 | + * @since 4.5.0 |
|
118 | + * |
|
119 | + * @return void |
|
120 | + */ |
|
121 | + protected function _set_valid_shortcodes() |
|
122 | + { |
|
123 | + $this->_valid_shortcodes['purchaser'] = array( |
|
124 | + 'attendee_list', 'attendee', 'datetime_list', 'datetime', 'event_list', 'event', 'event_meta', 'messenger', 'organization', 'primary_registration_list', 'primary_registration_details', 'ticket_list', 'ticket', 'transaction', 'venue', 'line_item_list', 'payment_list', 'line_item', 'payment' |
|
125 | + ); |
|
126 | + } |
|
127 | 127 | |
128 | 128 | |
129 | 129 | |
130 | 130 | |
131 | - protected function _purchaser_addressees() |
|
132 | - { |
|
133 | - return parent::_primary_attendee_addressees(); |
|
134 | - } |
|
131 | + protected function _purchaser_addressees() |
|
132 | + { |
|
133 | + return parent::_primary_attendee_addressees(); |
|
134 | + } |
|
135 | 135 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | protected function _set_admin_pages() |
54 | 54 | { |
55 | - $this->admin_registered_pages = array( 'events_edit' => true ); |
|
55 | + $this->admin_registered_pages = array('events_edit' => true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | protected function _set_with_messengers() |
68 | 68 | { |
69 | 69 | $this->_with_messengers = array( |
70 | - 'html' => array( 'pdf' ) |
|
70 | + 'html' => array('pdf') |
|
71 | 71 | ); |
72 | 72 | } |
73 | 73 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // receipt message type data handler is 'Gateways' and it expects a transaction object. |
79 | 79 | $transaction = $registration->transaction(); |
80 | 80 | if ($transaction instanceof EE_Transaction) { |
81 | - return array( $transaction ); |
|
81 | + return array($transaction); |
|
82 | 82 | } |
83 | 83 | return array(); |
84 | 84 | } |