@@ -16,20 +16,20 @@ |
||
| 16 | 16 | interface PrivacyPolicyInterface |
| 17 | 17 | { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Returns the translated name to display in this privacy policy's section's title |
|
| 21 | - * |
|
| 22 | - * @return string |
|
| 23 | - */ |
|
| 24 | - public function getName(); |
|
| 19 | + /** |
|
| 20 | + * Returns the translated name to display in this privacy policy's section's title |
|
| 21 | + * |
|
| 22 | + * @return string |
|
| 23 | + */ |
|
| 24 | + public function getName(); |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Returns the suggested privacy policy content for this plugin. May contain HTML |
|
| 29 | - * |
|
| 30 | - * @return string |
|
| 31 | - */ |
|
| 32 | - public function getContent(); |
|
| 27 | + /** |
|
| 28 | + * Returns the suggested privacy policy content for this plugin. May contain HTML |
|
| 29 | + * |
|
| 30 | + * @return string |
|
| 31 | + */ |
|
| 32 | + public function getContent(); |
|
| 33 | 33 | } |
| 34 | 34 | // End of file PrivacyPolicyInterface.php |
| 35 | 35 | // Location: EventEspresso\core\domain\services\admin/PrivacyPolicyInterface.php |
@@ -15,106 +15,106 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ExportTransaction implements PersonalDataExporterInterface |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var EEM_Transaction $transaction_model |
|
| 20 | - */ |
|
| 21 | - protected $transaction_model; |
|
| 18 | + /** |
|
| 19 | + * @var EEM_Transaction $transaction_model |
|
| 20 | + */ |
|
| 21 | + protected $transaction_model; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * ExportTransaction constructor. |
|
| 25 | - * |
|
| 26 | - * @param $transaction_model |
|
| 27 | - */ |
|
| 28 | - public function __construct(EEM_Transaction $transaction_model) |
|
| 29 | - { |
|
| 30 | - $this->transaction_model = $transaction_model; |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * ExportTransaction constructor. |
|
| 25 | + * |
|
| 26 | + * @param $transaction_model |
|
| 27 | + */ |
|
| 28 | + public function __construct(EEM_Transaction $transaction_model) |
|
| 29 | + { |
|
| 30 | + $this->transaction_model = $transaction_model; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Returns data for export. |
|
| 36 | - * |
|
| 37 | - * @param string $email_address , |
|
| 38 | - * @param int $page starts at 1, not 0 |
|
| 39 | - * @return array { |
|
| 40 | - * @type array $data { |
|
| 41 | - * @type array { |
|
| 42 | - * @type string $group_id (not translated, same for all exports) |
|
| 43 | - * @type string $group_label (translated string) |
|
| 44 | - * @type string|int $item_id |
|
| 45 | - * @type array $data { |
|
| 46 | - * @type array { |
|
| 47 | - * @type string $name what's shown in the left-column of the export row |
|
| 48 | - * @type string $value what's showin the right-column of the export row |
|
| 49 | - * } |
|
| 50 | - * } |
|
| 51 | - * } |
|
| 52 | - * } |
|
| 53 | - * } |
|
| 54 | - */ |
|
| 55 | - public function export($email_address, $page = 1) |
|
| 56 | - { |
|
| 57 | - $page_size = 10; |
|
| 58 | - $transactions = $this->transaction_model->get_all( |
|
| 59 | - array( |
|
| 60 | - array( |
|
| 61 | - 'Registration.Attendee.ATT_email' => $email_address, |
|
| 62 | - ), |
|
| 63 | - 'limit' => array( |
|
| 64 | - ($page - 1) * $page_size, |
|
| 65 | - $page_size, |
|
| 66 | - ), |
|
| 67 | - ) |
|
| 68 | - ); |
|
| 69 | - $export_fields = array_intersect_key( |
|
| 70 | - EEM_Transaction::instance()->field_settings(), |
|
| 71 | - array_flip( |
|
| 72 | - array( |
|
| 73 | - 'TXN_timestamp', |
|
| 74 | - 'TXN_total', |
|
| 75 | - 'TXN_paid', |
|
| 76 | - 'TXN_session_data', |
|
| 77 | - ) |
|
| 78 | - ) |
|
| 79 | - ); |
|
| 80 | - $export_items = array(); |
|
| 81 | - $found_something = false; |
|
| 82 | - foreach ($transactions as $transaction) { |
|
| 83 | - $found_something = true; |
|
| 84 | - $data = array(); |
|
| 85 | - foreach ($export_fields as $field_name => $field_obj) { |
|
| 86 | - if ($field_name === 'TXN_session_data') { |
|
| 87 | - $value = $transaction->get_pretty($field_name, 'print_r'); |
|
| 88 | - } else { |
|
| 89 | - $value = $transaction->get_pretty($field_name); |
|
| 90 | - } |
|
| 91 | - $data[] = array( |
|
| 92 | - 'name' => $field_obj->get_nicename(), |
|
| 93 | - 'value' => $value, |
|
| 94 | - ); |
|
| 95 | - } |
|
| 96 | - $export_items[] = array( |
|
| 97 | - 'group_id' => 'transactions', |
|
| 98 | - 'group_label' => esc_html__('Transactions', 'event_espresso'), |
|
| 99 | - 'item_id' => $transaction->ID(), |
|
| 100 | - 'data' => $data, |
|
| 101 | - ); |
|
| 102 | - } |
|
| 103 | - return array( |
|
| 104 | - 'data' => $export_items, |
|
| 105 | - 'done' => ! $found_something, |
|
| 106 | - ); |
|
| 107 | - } |
|
| 34 | + /** |
|
| 35 | + * Returns data for export. |
|
| 36 | + * |
|
| 37 | + * @param string $email_address , |
|
| 38 | + * @param int $page starts at 1, not 0 |
|
| 39 | + * @return array { |
|
| 40 | + * @type array $data { |
|
| 41 | + * @type array { |
|
| 42 | + * @type string $group_id (not translated, same for all exports) |
|
| 43 | + * @type string $group_label (translated string) |
|
| 44 | + * @type string|int $item_id |
|
| 45 | + * @type array $data { |
|
| 46 | + * @type array { |
|
| 47 | + * @type string $name what's shown in the left-column of the export row |
|
| 48 | + * @type string $value what's showin the right-column of the export row |
|
| 49 | + * } |
|
| 50 | + * } |
|
| 51 | + * } |
|
| 52 | + * } |
|
| 53 | + * } |
|
| 54 | + */ |
|
| 55 | + public function export($email_address, $page = 1) |
|
| 56 | + { |
|
| 57 | + $page_size = 10; |
|
| 58 | + $transactions = $this->transaction_model->get_all( |
|
| 59 | + array( |
|
| 60 | + array( |
|
| 61 | + 'Registration.Attendee.ATT_email' => $email_address, |
|
| 62 | + ), |
|
| 63 | + 'limit' => array( |
|
| 64 | + ($page - 1) * $page_size, |
|
| 65 | + $page_size, |
|
| 66 | + ), |
|
| 67 | + ) |
|
| 68 | + ); |
|
| 69 | + $export_fields = array_intersect_key( |
|
| 70 | + EEM_Transaction::instance()->field_settings(), |
|
| 71 | + array_flip( |
|
| 72 | + array( |
|
| 73 | + 'TXN_timestamp', |
|
| 74 | + 'TXN_total', |
|
| 75 | + 'TXN_paid', |
|
| 76 | + 'TXN_session_data', |
|
| 77 | + ) |
|
| 78 | + ) |
|
| 79 | + ); |
|
| 80 | + $export_items = array(); |
|
| 81 | + $found_something = false; |
|
| 82 | + foreach ($transactions as $transaction) { |
|
| 83 | + $found_something = true; |
|
| 84 | + $data = array(); |
|
| 85 | + foreach ($export_fields as $field_name => $field_obj) { |
|
| 86 | + if ($field_name === 'TXN_session_data') { |
|
| 87 | + $value = $transaction->get_pretty($field_name, 'print_r'); |
|
| 88 | + } else { |
|
| 89 | + $value = $transaction->get_pretty($field_name); |
|
| 90 | + } |
|
| 91 | + $data[] = array( |
|
| 92 | + 'name' => $field_obj->get_nicename(), |
|
| 93 | + 'value' => $value, |
|
| 94 | + ); |
|
| 95 | + } |
|
| 96 | + $export_items[] = array( |
|
| 97 | + 'group_id' => 'transactions', |
|
| 98 | + 'group_label' => esc_html__('Transactions', 'event_espresso'), |
|
| 99 | + 'item_id' => $transaction->ID(), |
|
| 100 | + 'data' => $data, |
|
| 101 | + ); |
|
| 102 | + } |
|
| 103 | + return array( |
|
| 104 | + 'data' => $export_items, |
|
| 105 | + 'done' => ! $found_something, |
|
| 106 | + ); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * Gets the Translated name of this exporter |
|
| 111 | - * |
|
| 112 | - * @return string |
|
| 113 | - */ |
|
| 114 | - public function name() |
|
| 115 | - { |
|
| 116 | - return esc_html__('Event Espresso Transaction Exporter', 'event_espresso'); |
|
| 117 | - } |
|
| 109 | + /** |
|
| 110 | + * Gets the Translated name of this exporter |
|
| 111 | + * |
|
| 112 | + * @return string |
|
| 113 | + */ |
|
| 114 | + public function name() |
|
| 115 | + { |
|
| 116 | + return esc_html__('Event Espresso Transaction Exporter', 'event_espresso'); |
|
| 117 | + } |
|
| 118 | 118 | } |
| 119 | 119 | // End of file ExportTransaction.php |
| 120 | 120 | // Location: EventEspresso\core\domain\services\admin\privacy\export/ExportTransaction.php |
@@ -16,112 +16,112 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class ExportCheckins implements PersonalDataExporterInterface |
| 18 | 18 | { |
| 19 | - /** |
|
| 20 | - * @var EEM_Checkin |
|
| 21 | - */ |
|
| 22 | - protected $checkin_model; |
|
| 19 | + /** |
|
| 20 | + * @var EEM_Checkin |
|
| 21 | + */ |
|
| 22 | + protected $checkin_model; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * ExportCheckins constructor. |
|
| 26 | - * |
|
| 27 | - * @param EEM_Checkin $checkin_model |
|
| 28 | - */ |
|
| 29 | - public function __construct(EEM_Checkin $checkin_model) |
|
| 30 | - { |
|
| 31 | - $this->checkin_model = $checkin_model; |
|
| 32 | - } |
|
| 24 | + /** |
|
| 25 | + * ExportCheckins constructor. |
|
| 26 | + * |
|
| 27 | + * @param EEM_Checkin $checkin_model |
|
| 28 | + */ |
|
| 29 | + public function __construct(EEM_Checkin $checkin_model) |
|
| 30 | + { |
|
| 31 | + $this->checkin_model = $checkin_model; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Returns data for export. |
|
| 37 | - * |
|
| 38 | - * @param string $email_address , |
|
| 39 | - * @param int $page starts at 1, not 0 |
|
| 40 | - * @return array { |
|
| 41 | - * @type array $data { |
|
| 42 | - * @type array { |
|
| 43 | - * @type string $group_id (not translated, same for all exports) |
|
| 44 | - * @type string $group_label (translated string) |
|
| 45 | - * @type string|int $item_id |
|
| 46 | - * @type array $data { |
|
| 47 | - * @type array { |
|
| 48 | - * @type string $name what's shown in the left-column of the export row |
|
| 49 | - * @type string $value what's showin the right-column of the export row |
|
| 50 | - * } |
|
| 51 | - * } |
|
| 52 | - * } |
|
| 53 | - * } |
|
| 54 | - * } |
|
| 55 | - */ |
|
| 56 | - public function export($email_address, $page = 1) |
|
| 57 | - { |
|
| 58 | - $page_size = 10; |
|
| 59 | - $checkins = $this->checkin_model->get_all( |
|
| 60 | - array( |
|
| 61 | - array( |
|
| 62 | - 'Registration.Attendee.ATT_email' => $email_address, |
|
| 63 | - ), |
|
| 64 | - 'limit' => array( |
|
| 65 | - ($page - 1) * $page_size, |
|
| 66 | - $page_size, |
|
| 67 | - ), |
|
| 68 | - 'force_join' => array('Registration.Event'), |
|
| 69 | - ) |
|
| 70 | - ); |
|
| 35 | + /** |
|
| 36 | + * Returns data for export. |
|
| 37 | + * |
|
| 38 | + * @param string $email_address , |
|
| 39 | + * @param int $page starts at 1, not 0 |
|
| 40 | + * @return array { |
|
| 41 | + * @type array $data { |
|
| 42 | + * @type array { |
|
| 43 | + * @type string $group_id (not translated, same for all exports) |
|
| 44 | + * @type string $group_label (translated string) |
|
| 45 | + * @type string|int $item_id |
|
| 46 | + * @type array $data { |
|
| 47 | + * @type array { |
|
| 48 | + * @type string $name what's shown in the left-column of the export row |
|
| 49 | + * @type string $value what's showin the right-column of the export row |
|
| 50 | + * } |
|
| 51 | + * } |
|
| 52 | + * } |
|
| 53 | + * } |
|
| 54 | + * } |
|
| 55 | + */ |
|
| 56 | + public function export($email_address, $page = 1) |
|
| 57 | + { |
|
| 58 | + $page_size = 10; |
|
| 59 | + $checkins = $this->checkin_model->get_all( |
|
| 60 | + array( |
|
| 61 | + array( |
|
| 62 | + 'Registration.Attendee.ATT_email' => $email_address, |
|
| 63 | + ), |
|
| 64 | + 'limit' => array( |
|
| 65 | + ($page - 1) * $page_size, |
|
| 66 | + $page_size, |
|
| 67 | + ), |
|
| 68 | + 'force_join' => array('Registration.Event'), |
|
| 69 | + ) |
|
| 70 | + ); |
|
| 71 | 71 | |
| 72 | - if (empty($checkins)) { |
|
| 73 | - return array( |
|
| 74 | - 'data' => array(), |
|
| 75 | - 'done' => true, |
|
| 76 | - ); |
|
| 77 | - } |
|
| 72 | + if (empty($checkins)) { |
|
| 73 | + return array( |
|
| 74 | + 'data' => array(), |
|
| 75 | + 'done' => true, |
|
| 76 | + ); |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - $export_items = array(); |
|
| 80 | - foreach ($checkins as $checkin) { |
|
| 81 | - $reg = $checkin->get_first_related('Registration'); |
|
| 82 | - if ($reg instanceof EE_Registration) { |
|
| 83 | - $event_name = $reg->event_name(); |
|
| 84 | - } else { |
|
| 85 | - $event_name = esc_html__('Unknown', 'event_espresso'); |
|
| 86 | - } |
|
| 87 | - $export_items[] = |
|
| 88 | - array( |
|
| 89 | - 'group_id' => 'check-ins', |
|
| 90 | - 'group_label' => esc_html__('Event Check-Ins', 'event_espresso'), |
|
| 91 | - 'item_id' => $checkin->ID(), |
|
| 92 | - 'data' => array( |
|
| 93 | - array( |
|
| 94 | - 'name' => esc_html__('Time', 'event_espresso'), |
|
| 95 | - 'value' => $checkin->get_pretty('CHK_timestamp'), |
|
| 96 | - ), |
|
| 97 | - array( |
|
| 98 | - 'name' => esc_html__('Check in/out', 'event_espresso'), |
|
| 99 | - 'value' => $checkin->get('CHK_in') |
|
| 100 | - ? esc_html__('In', 'event_espresso') |
|
| 101 | - : esc_html__('Out', 'event_espresso'), |
|
| 102 | - ), |
|
| 103 | - array( |
|
| 104 | - 'name' => esc_html__('Event', 'event_espresso'), |
|
| 105 | - 'value' => $event_name, |
|
| 106 | - ), |
|
| 107 | - ), |
|
| 108 | - ); |
|
| 109 | - } |
|
| 110 | - return array( |
|
| 111 | - 'data' => $export_items, |
|
| 112 | - 'done' => true, |
|
| 113 | - ); |
|
| 114 | - } |
|
| 79 | + $export_items = array(); |
|
| 80 | + foreach ($checkins as $checkin) { |
|
| 81 | + $reg = $checkin->get_first_related('Registration'); |
|
| 82 | + if ($reg instanceof EE_Registration) { |
|
| 83 | + $event_name = $reg->event_name(); |
|
| 84 | + } else { |
|
| 85 | + $event_name = esc_html__('Unknown', 'event_espresso'); |
|
| 86 | + } |
|
| 87 | + $export_items[] = |
|
| 88 | + array( |
|
| 89 | + 'group_id' => 'check-ins', |
|
| 90 | + 'group_label' => esc_html__('Event Check-Ins', 'event_espresso'), |
|
| 91 | + 'item_id' => $checkin->ID(), |
|
| 92 | + 'data' => array( |
|
| 93 | + array( |
|
| 94 | + 'name' => esc_html__('Time', 'event_espresso'), |
|
| 95 | + 'value' => $checkin->get_pretty('CHK_timestamp'), |
|
| 96 | + ), |
|
| 97 | + array( |
|
| 98 | + 'name' => esc_html__('Check in/out', 'event_espresso'), |
|
| 99 | + 'value' => $checkin->get('CHK_in') |
|
| 100 | + ? esc_html__('In', 'event_espresso') |
|
| 101 | + : esc_html__('Out', 'event_espresso'), |
|
| 102 | + ), |
|
| 103 | + array( |
|
| 104 | + 'name' => esc_html__('Event', 'event_espresso'), |
|
| 105 | + 'value' => $event_name, |
|
| 106 | + ), |
|
| 107 | + ), |
|
| 108 | + ); |
|
| 109 | + } |
|
| 110 | + return array( |
|
| 111 | + 'data' => $export_items, |
|
| 112 | + 'done' => true, |
|
| 113 | + ); |
|
| 114 | + } |
|
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Gets the Translated name of this exporter |
|
| 118 | - * |
|
| 119 | - * @return string |
|
| 120 | - */ |
|
| 121 | - public function name() |
|
| 122 | - { |
|
| 123 | - return esc_html__('Event Espresso Checkins Exporter', 'event_espresso'); |
|
| 124 | - } |
|
| 116 | + /** |
|
| 117 | + * Gets the Translated name of this exporter |
|
| 118 | + * |
|
| 119 | + * @return string |
|
| 120 | + */ |
|
| 121 | + public function name() |
|
| 122 | + { |
|
| 123 | + return esc_html__('Event Espresso Checkins Exporter', 'event_espresso'); |
|
| 124 | + } |
|
| 125 | 125 | } |
| 126 | 126 | // End of file ExportCheckins.php |
| 127 | 127 | // Location: EventEspresso\core\domain\services\admin\privacy\export/ExportCheckins.php |
@@ -15,116 +15,116 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ExportAttendee implements PersonalDataExporterInterface |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var EEM_Attendee |
|
| 20 | - */ |
|
| 21 | - protected $attendee_model; |
|
| 18 | + /** |
|
| 19 | + * @var EEM_Attendee |
|
| 20 | + */ |
|
| 21 | + protected $attendee_model; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * ExportAttendee constructor. |
|
| 25 | - * |
|
| 26 | - * @param EEM_Attendee $attendee_model |
|
| 27 | - */ |
|
| 28 | - public function __construct(EEM_Attendee $attendee_model) |
|
| 29 | - { |
|
| 30 | - $this->attendee_model = $attendee_model; |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * ExportAttendee constructor. |
|
| 25 | + * |
|
| 26 | + * @param EEM_Attendee $attendee_model |
|
| 27 | + */ |
|
| 28 | + public function __construct(EEM_Attendee $attendee_model) |
|
| 29 | + { |
|
| 30 | + $this->attendee_model = $attendee_model; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Returns data for export. |
|
| 36 | - * |
|
| 37 | - * @param string $email_address , |
|
| 38 | - * @param int $page starts at 1, not 0 |
|
| 39 | - * @return array { |
|
| 40 | - * @type array $data { |
|
| 41 | - * @type array { |
|
| 42 | - * @type string $group_id (not translated, same for all exports) |
|
| 43 | - * @type string $group_label (translated string) |
|
| 44 | - * @type string|int $item_id |
|
| 45 | - * @type array $data { |
|
| 46 | - * @type array { |
|
| 47 | - * @type string $name what's shown in the left-column of the export row |
|
| 48 | - * @type string $value what's showin the right-column of the export row |
|
| 49 | - * } |
|
| 50 | - * } |
|
| 51 | - * } |
|
| 52 | - * } |
|
| 53 | - * } |
|
| 54 | - */ |
|
| 55 | - public function export($email_address, $page = 1) |
|
| 56 | - { |
|
| 57 | - $attendees = $this->attendee_model->get_all( |
|
| 58 | - array( |
|
| 59 | - array( |
|
| 60 | - 'ATT_email' => $email_address, |
|
| 61 | - ), |
|
| 62 | - ) |
|
| 63 | - ); |
|
| 34 | + /** |
|
| 35 | + * Returns data for export. |
|
| 36 | + * |
|
| 37 | + * @param string $email_address , |
|
| 38 | + * @param int $page starts at 1, not 0 |
|
| 39 | + * @return array { |
|
| 40 | + * @type array $data { |
|
| 41 | + * @type array { |
|
| 42 | + * @type string $group_id (not translated, same for all exports) |
|
| 43 | + * @type string $group_label (translated string) |
|
| 44 | + * @type string|int $item_id |
|
| 45 | + * @type array $data { |
|
| 46 | + * @type array { |
|
| 47 | + * @type string $name what's shown in the left-column of the export row |
|
| 48 | + * @type string $value what's showin the right-column of the export row |
|
| 49 | + * } |
|
| 50 | + * } |
|
| 51 | + * } |
|
| 52 | + * } |
|
| 53 | + * } |
|
| 54 | + */ |
|
| 55 | + public function export($email_address, $page = 1) |
|
| 56 | + { |
|
| 57 | + $attendees = $this->attendee_model->get_all( |
|
| 58 | + array( |
|
| 59 | + array( |
|
| 60 | + 'ATT_email' => $email_address, |
|
| 61 | + ), |
|
| 62 | + ) |
|
| 63 | + ); |
|
| 64 | 64 | |
| 65 | - if (empty($attendees)) { |
|
| 66 | - return array( |
|
| 67 | - 'data' => array(), |
|
| 68 | - 'done' => true, |
|
| 69 | - ); |
|
| 70 | - } |
|
| 65 | + if (empty($attendees)) { |
|
| 66 | + return array( |
|
| 67 | + 'data' => array(), |
|
| 68 | + 'done' => true, |
|
| 69 | + ); |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - $export_items = array(); |
|
| 73 | - foreach ($attendees as $attendee) { |
|
| 74 | - $export_fields = array_intersect_key( |
|
| 75 | - $this->attendee_model->field_settings(), |
|
| 76 | - array_flip( |
|
| 77 | - array( |
|
| 78 | - 'ATT_fname', |
|
| 79 | - 'ATT_lname', |
|
| 80 | - 'ATT_email', |
|
| 81 | - 'ATT_address1', |
|
| 82 | - 'ATT_address2', |
|
| 83 | - 'ATT_city', |
|
| 84 | - 'STA_ID', |
|
| 85 | - 'CNT_ISO', |
|
| 86 | - 'ATT_zip', |
|
| 87 | - 'ATT_phone', |
|
| 88 | - ) |
|
| 89 | - ) |
|
| 90 | - ); |
|
| 91 | - $data = array(); |
|
| 92 | - foreach ($export_fields as $field_name => $field_obj) { |
|
| 93 | - if ($field_name === 'STA_ID') { |
|
| 94 | - $value = $attendee->state_name(); |
|
| 95 | - } elseif ($field_name == 'CNT_ISO') { |
|
| 96 | - $value = $attendee->country_name(); |
|
| 97 | - } else { |
|
| 98 | - $value = $attendee->get_pretty($field_name); |
|
| 99 | - } |
|
| 100 | - $data[] = array( |
|
| 101 | - 'name' => $field_obj->get_nicename(), |
|
| 102 | - 'value' => $value, |
|
| 103 | - ); |
|
| 104 | - } |
|
| 105 | - $export_items[] = |
|
| 106 | - array( |
|
| 107 | - 'group_id' => 'att-' . $attendee->ID(), |
|
| 108 | - 'group_label' => esc_html__('Contact Profiles', 'event_espresso'), |
|
| 109 | - 'item_id' => $attendee->ID(), |
|
| 110 | - 'data' => $data, |
|
| 111 | - ); |
|
| 112 | - } |
|
| 113 | - return array( |
|
| 114 | - 'data' => $export_items, |
|
| 115 | - 'done' => true, |
|
| 116 | - ); |
|
| 117 | - } |
|
| 72 | + $export_items = array(); |
|
| 73 | + foreach ($attendees as $attendee) { |
|
| 74 | + $export_fields = array_intersect_key( |
|
| 75 | + $this->attendee_model->field_settings(), |
|
| 76 | + array_flip( |
|
| 77 | + array( |
|
| 78 | + 'ATT_fname', |
|
| 79 | + 'ATT_lname', |
|
| 80 | + 'ATT_email', |
|
| 81 | + 'ATT_address1', |
|
| 82 | + 'ATT_address2', |
|
| 83 | + 'ATT_city', |
|
| 84 | + 'STA_ID', |
|
| 85 | + 'CNT_ISO', |
|
| 86 | + 'ATT_zip', |
|
| 87 | + 'ATT_phone', |
|
| 88 | + ) |
|
| 89 | + ) |
|
| 90 | + ); |
|
| 91 | + $data = array(); |
|
| 92 | + foreach ($export_fields as $field_name => $field_obj) { |
|
| 93 | + if ($field_name === 'STA_ID') { |
|
| 94 | + $value = $attendee->state_name(); |
|
| 95 | + } elseif ($field_name == 'CNT_ISO') { |
|
| 96 | + $value = $attendee->country_name(); |
|
| 97 | + } else { |
|
| 98 | + $value = $attendee->get_pretty($field_name); |
|
| 99 | + } |
|
| 100 | + $data[] = array( |
|
| 101 | + 'name' => $field_obj->get_nicename(), |
|
| 102 | + 'value' => $value, |
|
| 103 | + ); |
|
| 104 | + } |
|
| 105 | + $export_items[] = |
|
| 106 | + array( |
|
| 107 | + 'group_id' => 'att-' . $attendee->ID(), |
|
| 108 | + 'group_label' => esc_html__('Contact Profiles', 'event_espresso'), |
|
| 109 | + 'item_id' => $attendee->ID(), |
|
| 110 | + 'data' => $data, |
|
| 111 | + ); |
|
| 112 | + } |
|
| 113 | + return array( |
|
| 114 | + 'data' => $export_items, |
|
| 115 | + 'done' => true, |
|
| 116 | + ); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * Gets the Translated name of this exporter |
|
| 121 | - * |
|
| 122 | - * @return string |
|
| 123 | - */ |
|
| 124 | - public function name() |
|
| 125 | - { |
|
| 126 | - return esc_html__('Event Espresso Attendee Data Exporter', 'event_espresso'); |
|
| 127 | - } |
|
| 119 | + /** |
|
| 120 | + * Gets the Translated name of this exporter |
|
| 121 | + * |
|
| 122 | + * @return string |
|
| 123 | + */ |
|
| 124 | + public function name() |
|
| 125 | + { |
|
| 126 | + return esc_html__('Event Espresso Attendee Data Exporter', 'event_espresso'); |
|
| 127 | + } |
|
| 128 | 128 | } |
| 129 | 129 | // End of file ExportAttendee.php |
| 130 | 130 | // Location: EventEspresso\core\domain\services\admin\privacy\export/ExportAttendee.php |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | } |
| 105 | 105 | $export_items[] = |
| 106 | 106 | array( |
| 107 | - 'group_id' => 'att-' . $attendee->ID(), |
|
| 107 | + 'group_id' => 'att-'.$attendee->ID(), |
|
| 108 | 108 | 'group_label' => esc_html__('Contact Profiles', 'event_espresso'), |
| 109 | 109 | 'item_id' => $attendee->ID(), |
| 110 | 110 | 'data' => $data, |
@@ -18,133 +18,133 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class ExportRegistration implements PersonalDataExporterInterface |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * @var EEM_Registration |
|
| 23 | - */ |
|
| 24 | - protected $registration_model; |
|
| 21 | + /** |
|
| 22 | + * @var EEM_Registration |
|
| 23 | + */ |
|
| 24 | + protected $registration_model; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * ExportRegistration constructor. |
|
| 28 | - * |
|
| 29 | - * @param EEM_Registration $registration_model |
|
| 30 | - */ |
|
| 31 | - public function __construct(EEM_Registration $registration_model) |
|
| 32 | - { |
|
| 33 | - $this->registration_model = $registration_model; |
|
| 34 | - } |
|
| 26 | + /** |
|
| 27 | + * ExportRegistration constructor. |
|
| 28 | + * |
|
| 29 | + * @param EEM_Registration $registration_model |
|
| 30 | + */ |
|
| 31 | + public function __construct(EEM_Registration $registration_model) |
|
| 32 | + { |
|
| 33 | + $this->registration_model = $registration_model; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Returns data for export. |
|
| 39 | - * |
|
| 40 | - * @param string $email_address , |
|
| 41 | - * @param int $page starts at 1, not 0 |
|
| 42 | - * @return array { |
|
| 43 | - * @type array $data { |
|
| 44 | - * @type array { |
|
| 45 | - * @type string $group_id (not translated, same for all exports) |
|
| 46 | - * @type string $group_label (translated string) |
|
| 47 | - * @type string|int $item_id |
|
| 48 | - * @type array $data { |
|
| 49 | - * @type array { |
|
| 50 | - * @type string $name what's shown in the left-column of the export row |
|
| 51 | - * @type string $value what's showin the right-column of the export row |
|
| 52 | - * } |
|
| 53 | - * } |
|
| 54 | - * } |
|
| 55 | - * } |
|
| 56 | - * } |
|
| 57 | - */ |
|
| 58 | - public function export($email_address, $page = 1) |
|
| 59 | - { |
|
| 60 | - $page_size = 10; |
|
| 61 | - $registrations = $this->registration_model->get_all( |
|
| 62 | - array( |
|
| 63 | - array( |
|
| 64 | - 'Attendee.ATT_email' => $email_address, |
|
| 65 | - ), |
|
| 66 | - 'limit' => array( |
|
| 67 | - ($page - 1) * $page_size, |
|
| 68 | - $page_size, |
|
| 69 | - ), |
|
| 70 | - ) |
|
| 71 | - ); |
|
| 72 | - $export_fields = array_intersect_key( |
|
| 73 | - $this->registration_model->field_settings(), |
|
| 74 | - array_flip( |
|
| 75 | - array( |
|
| 76 | - 'REG_code', |
|
| 77 | - 'REG_date', |
|
| 78 | - 'REG_final_price', |
|
| 79 | - 'REG_paid', |
|
| 80 | - 'REG_url_link', |
|
| 81 | - 'REG_count', |
|
| 82 | - 'REG_group_size', |
|
| 83 | - 'REG_att_is_going', |
|
| 84 | - ) |
|
| 85 | - ) |
|
| 86 | - ); |
|
| 87 | - $export_items = array(); |
|
| 88 | - $found_something = false; |
|
| 89 | - foreach ($registrations as $registration) { |
|
| 90 | - /** |
|
| 91 | - * @var $registration EE_Registration |
|
| 92 | - */ |
|
| 93 | - $found_something = true; |
|
| 94 | - $data = array(); |
|
| 95 | - foreach ($export_fields as $field_name => $field_obj) { |
|
| 96 | - $data[] = array( |
|
| 97 | - 'name' => $field_obj->get_nicename(), |
|
| 98 | - 'value' => $registration->get_pretty($field_name), |
|
| 99 | - ); |
|
| 100 | - } |
|
| 101 | - $answers = $registration->answers( |
|
| 102 | - array( |
|
| 103 | - 'force_join' => array( |
|
| 104 | - 'Question', |
|
| 105 | - ), |
|
| 106 | - ) |
|
| 107 | - ); |
|
| 108 | - foreach ($answers as $answer) { |
|
| 109 | - $data[] = array( |
|
| 110 | - 'name' => $answer->question()->display_text(), |
|
| 111 | - 'value' => $answer->pretty_value(), |
|
| 112 | - ); |
|
| 113 | - } |
|
| 114 | - $ticket = $registration->ticket(); |
|
| 115 | - if ($ticket instanceof EE_Ticket) { |
|
| 116 | - $data[] = array( |
|
| 117 | - 'name' => esc_html__('Ticket', 'event_espresso'), |
|
| 118 | - 'value' => $ticket->name_and_info(), |
|
| 119 | - ); |
|
| 120 | - $data[] = array( |
|
| 121 | - 'name' => esc_html__('Event', 'event_espresso'), |
|
| 122 | - 'value' => $ticket->get_event_name(), |
|
| 123 | - ); |
|
| 124 | - } |
|
| 37 | + /** |
|
| 38 | + * Returns data for export. |
|
| 39 | + * |
|
| 40 | + * @param string $email_address , |
|
| 41 | + * @param int $page starts at 1, not 0 |
|
| 42 | + * @return array { |
|
| 43 | + * @type array $data { |
|
| 44 | + * @type array { |
|
| 45 | + * @type string $group_id (not translated, same for all exports) |
|
| 46 | + * @type string $group_label (translated string) |
|
| 47 | + * @type string|int $item_id |
|
| 48 | + * @type array $data { |
|
| 49 | + * @type array { |
|
| 50 | + * @type string $name what's shown in the left-column of the export row |
|
| 51 | + * @type string $value what's showin the right-column of the export row |
|
| 52 | + * } |
|
| 53 | + * } |
|
| 54 | + * } |
|
| 55 | + * } |
|
| 56 | + * } |
|
| 57 | + */ |
|
| 58 | + public function export($email_address, $page = 1) |
|
| 59 | + { |
|
| 60 | + $page_size = 10; |
|
| 61 | + $registrations = $this->registration_model->get_all( |
|
| 62 | + array( |
|
| 63 | + array( |
|
| 64 | + 'Attendee.ATT_email' => $email_address, |
|
| 65 | + ), |
|
| 66 | + 'limit' => array( |
|
| 67 | + ($page - 1) * $page_size, |
|
| 68 | + $page_size, |
|
| 69 | + ), |
|
| 70 | + ) |
|
| 71 | + ); |
|
| 72 | + $export_fields = array_intersect_key( |
|
| 73 | + $this->registration_model->field_settings(), |
|
| 74 | + array_flip( |
|
| 75 | + array( |
|
| 76 | + 'REG_code', |
|
| 77 | + 'REG_date', |
|
| 78 | + 'REG_final_price', |
|
| 79 | + 'REG_paid', |
|
| 80 | + 'REG_url_link', |
|
| 81 | + 'REG_count', |
|
| 82 | + 'REG_group_size', |
|
| 83 | + 'REG_att_is_going', |
|
| 84 | + ) |
|
| 85 | + ) |
|
| 86 | + ); |
|
| 87 | + $export_items = array(); |
|
| 88 | + $found_something = false; |
|
| 89 | + foreach ($registrations as $registration) { |
|
| 90 | + /** |
|
| 91 | + * @var $registration EE_Registration |
|
| 92 | + */ |
|
| 93 | + $found_something = true; |
|
| 94 | + $data = array(); |
|
| 95 | + foreach ($export_fields as $field_name => $field_obj) { |
|
| 96 | + $data[] = array( |
|
| 97 | + 'name' => $field_obj->get_nicename(), |
|
| 98 | + 'value' => $registration->get_pretty($field_name), |
|
| 99 | + ); |
|
| 100 | + } |
|
| 101 | + $answers = $registration->answers( |
|
| 102 | + array( |
|
| 103 | + 'force_join' => array( |
|
| 104 | + 'Question', |
|
| 105 | + ), |
|
| 106 | + ) |
|
| 107 | + ); |
|
| 108 | + foreach ($answers as $answer) { |
|
| 109 | + $data[] = array( |
|
| 110 | + 'name' => $answer->question()->display_text(), |
|
| 111 | + 'value' => $answer->pretty_value(), |
|
| 112 | + ); |
|
| 113 | + } |
|
| 114 | + $ticket = $registration->ticket(); |
|
| 115 | + if ($ticket instanceof EE_Ticket) { |
|
| 116 | + $data[] = array( |
|
| 117 | + 'name' => esc_html__('Ticket', 'event_espresso'), |
|
| 118 | + 'value' => $ticket->name_and_info(), |
|
| 119 | + ); |
|
| 120 | + $data[] = array( |
|
| 121 | + 'name' => esc_html__('Event', 'event_espresso'), |
|
| 122 | + 'value' => $ticket->get_event_name(), |
|
| 123 | + ); |
|
| 124 | + } |
|
| 125 | 125 | |
| 126 | - $export_items[] = array( |
|
| 127 | - 'group_id' => 'registration', |
|
| 128 | - 'group_label' => esc_html__('Event Registrations', 'event_espresso'), |
|
| 129 | - 'item_id' => $registration->ID(), |
|
| 130 | - 'data' => $data, |
|
| 131 | - ); |
|
| 132 | - } |
|
| 133 | - return array( |
|
| 134 | - 'data' => $export_items, |
|
| 135 | - 'done' => ! $found_something, |
|
| 136 | - ); |
|
| 137 | - } |
|
| 126 | + $export_items[] = array( |
|
| 127 | + 'group_id' => 'registration', |
|
| 128 | + 'group_label' => esc_html__('Event Registrations', 'event_espresso'), |
|
| 129 | + 'item_id' => $registration->ID(), |
|
| 130 | + 'data' => $data, |
|
| 131 | + ); |
|
| 132 | + } |
|
| 133 | + return array( |
|
| 134 | + 'data' => $export_items, |
|
| 135 | + 'done' => ! $found_something, |
|
| 136 | + ); |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | - /** |
|
| 140 | - * Gets the Translated name of this exporter |
|
| 141 | - * |
|
| 142 | - * @return string |
|
| 143 | - */ |
|
| 144 | - public function name() |
|
| 145 | - { |
|
| 146 | - return esc_html__('Event Espresso Registration Data Exporter', 'event_espresso'); |
|
| 147 | - } |
|
| 139 | + /** |
|
| 140 | + * Gets the Translated name of this exporter |
|
| 141 | + * |
|
| 142 | + * @return string |
|
| 143 | + */ |
|
| 144 | + public function name() |
|
| 145 | + { |
|
| 146 | + return esc_html__('Event Espresso Registration Data Exporter', 'event_espresso'); |
|
| 147 | + } |
|
| 148 | 148 | } |
| 149 | 149 | // End of file ExportRegistration.php |
| 150 | 150 | // Location: EventEspresso\core\domain\services\admin\privacy\export/ExportRegistration.php |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $JSON_response['success'] = $this->success(); |
| 123 | 123 | } |
| 124 | 124 | // but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked |
| 125 | - if (! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) { |
|
| 125 | + if ( ! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) { |
|
| 126 | 126 | $JSON_response['success'] = null; |
| 127 | 127 | } |
| 128 | 128 | // set redirect_url, IF it exists |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | // and finally, add return_data array to main JSON response array, IF it contains anything |
| 163 | 163 | // why did we add some of the above properties to the return data array? |
| 164 | 164 | // because it is easier and cleaner in the Javascript to deal with this way |
| 165 | - if (! empty($return_data)) { |
|
| 165 | + if ( ! empty($return_data)) { |
|
| 166 | 166 | $JSON_response['return_data'] = $return_data; |
| 167 | 167 | } |
| 168 | 168 | // filter final array |
@@ -15,401 +15,401 @@ |
||
| 15 | 15 | class EE_SPCO_JSON_Response |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 21 | - protected $_errors = ''; |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 26 | - protected $_unexpected_errors = ''; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * @var string |
|
| 30 | - */ |
|
| 31 | - protected $_attention = ''; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - protected $_success = ''; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * @var string |
|
| 40 | - */ |
|
| 41 | - protected $_plz_select_method_of_payment = ''; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * @var string |
|
| 45 | - */ |
|
| 46 | - protected $_redirect_url = ''; |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * @var string |
|
| 50 | - */ |
|
| 51 | - protected $_registration_time_limit = ''; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * @var string |
|
| 55 | - */ |
|
| 56 | - protected $_redirect_form = ''; |
|
| 57 | - |
|
| 58 | - /** |
|
| 59 | - * @var string |
|
| 60 | - */ |
|
| 61 | - protected $_reg_step_html = ''; |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * @var string |
|
| 65 | - */ |
|
| 66 | - protected $_method_of_payment = ''; |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * @var float |
|
| 70 | - */ |
|
| 71 | - protected $_payment_amount; |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * @var array |
|
| 75 | - */ |
|
| 76 | - protected $_return_data = array(); |
|
| 77 | - |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @var array |
|
| 81 | - */ |
|
| 82 | - protected $_validation_rules = array(); |
|
| 83 | - |
|
| 84 | - |
|
| 85 | - /** |
|
| 86 | - * class constructor |
|
| 87 | - */ |
|
| 88 | - public function __construct() |
|
| 89 | - { |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * __toString |
|
| 95 | - * |
|
| 96 | - * allows you to simply echo or print an EE_SPCO_JSON_Response object to produce a JSON encoded string |
|
| 97 | - * |
|
| 98 | - * @access public |
|
| 99 | - * @return string |
|
| 100 | - */ |
|
| 101 | - public function __toString() |
|
| 102 | - { |
|
| 103 | - $JSON_response = array(); |
|
| 104 | - // grab notices |
|
| 105 | - $notices = EE_Error::get_notices(false); |
|
| 106 | - $this->set_attention(isset($notices['attention']) ? $notices['attention'] : ''); |
|
| 107 | - $this->set_errors(isset($notices['errors']) ? $notices['errors'] : ''); |
|
| 108 | - $this->set_success(isset($notices['success']) ? $notices['success'] : ''); |
|
| 109 | - // add notices to JSON response, but only if they exist |
|
| 110 | - if ($this->attention()) { |
|
| 111 | - $JSON_response['attention'] = $this->attention(); |
|
| 112 | - } |
|
| 113 | - if ($this->errors()) { |
|
| 114 | - $JSON_response['errors'] = $this->errors(); |
|
| 115 | - } |
|
| 116 | - if ($this->unexpected_errors()) { |
|
| 117 | - $JSON_response['unexpected_errors'] = $this->unexpected_errors(); |
|
| 118 | - } |
|
| 119 | - if ($this->success()) { |
|
| 120 | - $JSON_response['success'] = $this->success(); |
|
| 121 | - } |
|
| 122 | - // but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked |
|
| 123 | - if (! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) { |
|
| 124 | - $JSON_response['success'] = null; |
|
| 125 | - } |
|
| 126 | - // set redirect_url, IF it exists |
|
| 127 | - if ($this->redirect_url()) { |
|
| 128 | - $JSON_response['redirect_url'] = $this->redirect_url(); |
|
| 129 | - } |
|
| 130 | - // set registration_time_limit, IF it exists |
|
| 131 | - if ($this->registration_time_limit()) { |
|
| 132 | - $JSON_response['registration_time_limit'] = $this->registration_time_limit(); |
|
| 133 | - } |
|
| 134 | - // set payment_amount, IF it exists |
|
| 135 | - if ($this->payment_amount() !== null) { |
|
| 136 | - $JSON_response['payment_amount'] = $this->payment_amount(); |
|
| 137 | - } |
|
| 138 | - // grab generic return data |
|
| 139 | - $return_data = $this->return_data(); |
|
| 140 | - // add billing form validation rules |
|
| 141 | - if ($this->validation_rules()) { |
|
| 142 | - $return_data['validation_rules'] = $this->validation_rules(); |
|
| 143 | - } |
|
| 144 | - // set reg_step_html, IF it exists |
|
| 145 | - if ($this->reg_step_html()) { |
|
| 146 | - $return_data['reg_step_html'] = $this->reg_step_html(); |
|
| 147 | - } |
|
| 148 | - // set method of payment, IF it exists |
|
| 149 | - if ($this->method_of_payment()) { |
|
| 150 | - $return_data['method_of_payment'] = $this->method_of_payment(); |
|
| 151 | - } |
|
| 152 | - // set "plz_select_method_of_payment" message, IF it exists |
|
| 153 | - if ($this->plz_select_method_of_payment()) { |
|
| 154 | - $return_data['plz_select_method_of_payment'] = $this->plz_select_method_of_payment(); |
|
| 155 | - } |
|
| 156 | - // set redirect_form, IF it exists |
|
| 157 | - if ($this->redirect_form()) { |
|
| 158 | - $return_data['redirect_form'] = $this->redirect_form(); |
|
| 159 | - } |
|
| 160 | - // and finally, add return_data array to main JSON response array, IF it contains anything |
|
| 161 | - // why did we add some of the above properties to the return data array? |
|
| 162 | - // because it is easier and cleaner in the Javascript to deal with this way |
|
| 163 | - if (! empty($return_data)) { |
|
| 164 | - $JSON_response['return_data'] = $return_data; |
|
| 165 | - } |
|
| 166 | - // filter final array |
|
| 167 | - $JSON_response = apply_filters('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response); |
|
| 168 | - // return encoded array |
|
| 169 | - return (string) wp_json_encode($JSON_response); |
|
| 170 | - } |
|
| 171 | - |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * @param string $attention |
|
| 175 | - */ |
|
| 176 | - public function set_attention($attention) |
|
| 177 | - { |
|
| 178 | - $this->_attention = $attention; |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * @return string |
|
| 184 | - */ |
|
| 185 | - public function attention() |
|
| 186 | - { |
|
| 187 | - return $this->_attention; |
|
| 188 | - } |
|
| 189 | - |
|
| 190 | - |
|
| 191 | - /** |
|
| 192 | - * @param string $errors |
|
| 193 | - */ |
|
| 194 | - public function set_errors($errors) |
|
| 195 | - { |
|
| 196 | - $this->_errors = $errors; |
|
| 197 | - } |
|
| 198 | - |
|
| 199 | - |
|
| 200 | - /** |
|
| 201 | - * @return string |
|
| 202 | - */ |
|
| 203 | - public function errors() |
|
| 204 | - { |
|
| 205 | - return $this->_errors; |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - |
|
| 209 | - /** |
|
| 210 | - * @return string |
|
| 211 | - */ |
|
| 212 | - public function unexpected_errors() |
|
| 213 | - { |
|
| 214 | - return $this->_unexpected_errors; |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - |
|
| 218 | - /** |
|
| 219 | - * @param string $unexpected_errors |
|
| 220 | - */ |
|
| 221 | - public function set_unexpected_errors($unexpected_errors) |
|
| 222 | - { |
|
| 223 | - $this->_unexpected_errors = $unexpected_errors; |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - |
|
| 227 | - /** |
|
| 228 | - * @param string $success |
|
| 229 | - */ |
|
| 230 | - public function set_success($success) |
|
| 231 | - { |
|
| 232 | - $this->_success = $success; |
|
| 233 | - } |
|
| 234 | - |
|
| 235 | - |
|
| 236 | - /** |
|
| 237 | - * @return string |
|
| 238 | - */ |
|
| 239 | - public function success() |
|
| 240 | - { |
|
| 241 | - return $this->_success; |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - |
|
| 245 | - /** |
|
| 246 | - * @param string $method_of_payment |
|
| 247 | - */ |
|
| 248 | - public function set_method_of_payment($method_of_payment) |
|
| 249 | - { |
|
| 250 | - $this->_method_of_payment = $method_of_payment; |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - |
|
| 254 | - /** |
|
| 255 | - * @return string |
|
| 256 | - */ |
|
| 257 | - public function method_of_payment() |
|
| 258 | - { |
|
| 259 | - return $this->_method_of_payment; |
|
| 260 | - } |
|
| 261 | - |
|
| 262 | - |
|
| 263 | - /** |
|
| 264 | - * @return float |
|
| 265 | - */ |
|
| 266 | - public function payment_amount() |
|
| 267 | - { |
|
| 268 | - return $this->_payment_amount; |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - |
|
| 272 | - /** |
|
| 273 | - * @param float $payment_amount |
|
| 274 | - * @throws EE_Error |
|
| 275 | - */ |
|
| 276 | - public function set_payment_amount($payment_amount) |
|
| 277 | - { |
|
| 278 | - $this->_payment_amount = (float) $payment_amount; |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - |
|
| 282 | - /** |
|
| 283 | - * @param string $next_step_html |
|
| 284 | - */ |
|
| 285 | - public function set_reg_step_html($next_step_html) |
|
| 286 | - { |
|
| 287 | - $this->_reg_step_html = $next_step_html; |
|
| 288 | - } |
|
| 289 | - |
|
| 290 | - |
|
| 291 | - /** |
|
| 292 | - * @return string |
|
| 293 | - */ |
|
| 294 | - public function reg_step_html() |
|
| 295 | - { |
|
| 296 | - return $this->_reg_step_html; |
|
| 297 | - } |
|
| 298 | - |
|
| 299 | - |
|
| 300 | - /** |
|
| 301 | - * @param string $redirect_form |
|
| 302 | - */ |
|
| 303 | - public function set_redirect_form($redirect_form) |
|
| 304 | - { |
|
| 305 | - $this->_redirect_form = $redirect_form; |
|
| 306 | - } |
|
| 307 | - |
|
| 308 | - |
|
| 309 | - /** |
|
| 310 | - * @return string |
|
| 311 | - */ |
|
| 312 | - public function redirect_form() |
|
| 313 | - { |
|
| 314 | - return ! empty($this->_redirect_form) ? $this->_redirect_form : false; |
|
| 315 | - } |
|
| 316 | - |
|
| 317 | - |
|
| 318 | - /** |
|
| 319 | - * @param string $plz_select_method_of_payment |
|
| 320 | - */ |
|
| 321 | - public function set_plz_select_method_of_payment($plz_select_method_of_payment) |
|
| 322 | - { |
|
| 323 | - $this->_plz_select_method_of_payment = $plz_select_method_of_payment; |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - |
|
| 327 | - /** |
|
| 328 | - * @return string |
|
| 329 | - */ |
|
| 330 | - public function plz_select_method_of_payment() |
|
| 331 | - { |
|
| 332 | - return $this->_plz_select_method_of_payment; |
|
| 333 | - } |
|
| 334 | - |
|
| 335 | - |
|
| 336 | - /** |
|
| 337 | - * @param string $redirect_url |
|
| 338 | - */ |
|
| 339 | - public function set_redirect_url($redirect_url) |
|
| 340 | - { |
|
| 341 | - $this->_redirect_url = $redirect_url; |
|
| 342 | - } |
|
| 343 | - |
|
| 344 | - |
|
| 345 | - /** |
|
| 346 | - * @return string |
|
| 347 | - */ |
|
| 348 | - public function redirect_url() |
|
| 349 | - { |
|
| 350 | - return $this->_redirect_url; |
|
| 351 | - } |
|
| 352 | - |
|
| 353 | - |
|
| 354 | - /** |
|
| 355 | - * @return string |
|
| 356 | - */ |
|
| 357 | - public function registration_time_limit() |
|
| 358 | - { |
|
| 359 | - return $this->_registration_time_limit; |
|
| 360 | - } |
|
| 361 | - |
|
| 362 | - |
|
| 363 | - /** |
|
| 364 | - * @param string $registration_time_limit |
|
| 365 | - */ |
|
| 366 | - public function set_registration_time_limit($registration_time_limit) |
|
| 367 | - { |
|
| 368 | - $this->_registration_time_limit = $registration_time_limit; |
|
| 369 | - } |
|
| 370 | - |
|
| 371 | - |
|
| 372 | - /** |
|
| 373 | - * @param array $return_data |
|
| 374 | - */ |
|
| 375 | - public function set_return_data($return_data) |
|
| 376 | - { |
|
| 377 | - $this->_return_data = array_merge($this->_return_data, $return_data); |
|
| 378 | - } |
|
| 379 | - |
|
| 380 | - |
|
| 381 | - /** |
|
| 382 | - * @return array |
|
| 383 | - */ |
|
| 384 | - public function return_data() |
|
| 385 | - { |
|
| 386 | - return $this->_return_data; |
|
| 387 | - } |
|
| 388 | - |
|
| 389 | - |
|
| 390 | - /** |
|
| 391 | - * @param array $validation_rules |
|
| 392 | - */ |
|
| 393 | - public function add_validation_rules(array $validation_rules = array()) |
|
| 394 | - { |
|
| 395 | - if (is_array($validation_rules) && ! empty($validation_rules)) { |
|
| 396 | - $this->_validation_rules = array_merge($this->_validation_rules, $validation_rules); |
|
| 397 | - } |
|
| 398 | - } |
|
| 399 | - |
|
| 400 | - |
|
| 401 | - /** |
|
| 402 | - * @return array | bool |
|
| 403 | - */ |
|
| 404 | - public function validation_rules() |
|
| 405 | - { |
|
| 406 | - return ! empty($this->_validation_rules) ? $this->_validation_rules : false; |
|
| 407 | - } |
|
| 408 | - |
|
| 409 | - |
|
| 410 | - public function echoAndExit() |
|
| 411 | - { |
|
| 412 | - echo $this; |
|
| 413 | - exit(); |
|
| 414 | - } |
|
| 18 | + /** |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | + protected $_errors = ''; |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | + protected $_unexpected_errors = ''; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @var string |
|
| 30 | + */ |
|
| 31 | + protected $_attention = ''; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + protected $_success = ''; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * @var string |
|
| 40 | + */ |
|
| 41 | + protected $_plz_select_method_of_payment = ''; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * @var string |
|
| 45 | + */ |
|
| 46 | + protected $_redirect_url = ''; |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * @var string |
|
| 50 | + */ |
|
| 51 | + protected $_registration_time_limit = ''; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * @var string |
|
| 55 | + */ |
|
| 56 | + protected $_redirect_form = ''; |
|
| 57 | + |
|
| 58 | + /** |
|
| 59 | + * @var string |
|
| 60 | + */ |
|
| 61 | + protected $_reg_step_html = ''; |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * @var string |
|
| 65 | + */ |
|
| 66 | + protected $_method_of_payment = ''; |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * @var float |
|
| 70 | + */ |
|
| 71 | + protected $_payment_amount; |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * @var array |
|
| 75 | + */ |
|
| 76 | + protected $_return_data = array(); |
|
| 77 | + |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @var array |
|
| 81 | + */ |
|
| 82 | + protected $_validation_rules = array(); |
|
| 83 | + |
|
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * class constructor |
|
| 87 | + */ |
|
| 88 | + public function __construct() |
|
| 89 | + { |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * __toString |
|
| 95 | + * |
|
| 96 | + * allows you to simply echo or print an EE_SPCO_JSON_Response object to produce a JSON encoded string |
|
| 97 | + * |
|
| 98 | + * @access public |
|
| 99 | + * @return string |
|
| 100 | + */ |
|
| 101 | + public function __toString() |
|
| 102 | + { |
|
| 103 | + $JSON_response = array(); |
|
| 104 | + // grab notices |
|
| 105 | + $notices = EE_Error::get_notices(false); |
|
| 106 | + $this->set_attention(isset($notices['attention']) ? $notices['attention'] : ''); |
|
| 107 | + $this->set_errors(isset($notices['errors']) ? $notices['errors'] : ''); |
|
| 108 | + $this->set_success(isset($notices['success']) ? $notices['success'] : ''); |
|
| 109 | + // add notices to JSON response, but only if they exist |
|
| 110 | + if ($this->attention()) { |
|
| 111 | + $JSON_response['attention'] = $this->attention(); |
|
| 112 | + } |
|
| 113 | + if ($this->errors()) { |
|
| 114 | + $JSON_response['errors'] = $this->errors(); |
|
| 115 | + } |
|
| 116 | + if ($this->unexpected_errors()) { |
|
| 117 | + $JSON_response['unexpected_errors'] = $this->unexpected_errors(); |
|
| 118 | + } |
|
| 119 | + if ($this->success()) { |
|
| 120 | + $JSON_response['success'] = $this->success(); |
|
| 121 | + } |
|
| 122 | + // but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked |
|
| 123 | + if (! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) { |
|
| 124 | + $JSON_response['success'] = null; |
|
| 125 | + } |
|
| 126 | + // set redirect_url, IF it exists |
|
| 127 | + if ($this->redirect_url()) { |
|
| 128 | + $JSON_response['redirect_url'] = $this->redirect_url(); |
|
| 129 | + } |
|
| 130 | + // set registration_time_limit, IF it exists |
|
| 131 | + if ($this->registration_time_limit()) { |
|
| 132 | + $JSON_response['registration_time_limit'] = $this->registration_time_limit(); |
|
| 133 | + } |
|
| 134 | + // set payment_amount, IF it exists |
|
| 135 | + if ($this->payment_amount() !== null) { |
|
| 136 | + $JSON_response['payment_amount'] = $this->payment_amount(); |
|
| 137 | + } |
|
| 138 | + // grab generic return data |
|
| 139 | + $return_data = $this->return_data(); |
|
| 140 | + // add billing form validation rules |
|
| 141 | + if ($this->validation_rules()) { |
|
| 142 | + $return_data['validation_rules'] = $this->validation_rules(); |
|
| 143 | + } |
|
| 144 | + // set reg_step_html, IF it exists |
|
| 145 | + if ($this->reg_step_html()) { |
|
| 146 | + $return_data['reg_step_html'] = $this->reg_step_html(); |
|
| 147 | + } |
|
| 148 | + // set method of payment, IF it exists |
|
| 149 | + if ($this->method_of_payment()) { |
|
| 150 | + $return_data['method_of_payment'] = $this->method_of_payment(); |
|
| 151 | + } |
|
| 152 | + // set "plz_select_method_of_payment" message, IF it exists |
|
| 153 | + if ($this->plz_select_method_of_payment()) { |
|
| 154 | + $return_data['plz_select_method_of_payment'] = $this->plz_select_method_of_payment(); |
|
| 155 | + } |
|
| 156 | + // set redirect_form, IF it exists |
|
| 157 | + if ($this->redirect_form()) { |
|
| 158 | + $return_data['redirect_form'] = $this->redirect_form(); |
|
| 159 | + } |
|
| 160 | + // and finally, add return_data array to main JSON response array, IF it contains anything |
|
| 161 | + // why did we add some of the above properties to the return data array? |
|
| 162 | + // because it is easier and cleaner in the Javascript to deal with this way |
|
| 163 | + if (! empty($return_data)) { |
|
| 164 | + $JSON_response['return_data'] = $return_data; |
|
| 165 | + } |
|
| 166 | + // filter final array |
|
| 167 | + $JSON_response = apply_filters('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response); |
|
| 168 | + // return encoded array |
|
| 169 | + return (string) wp_json_encode($JSON_response); |
|
| 170 | + } |
|
| 171 | + |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * @param string $attention |
|
| 175 | + */ |
|
| 176 | + public function set_attention($attention) |
|
| 177 | + { |
|
| 178 | + $this->_attention = $attention; |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * @return string |
|
| 184 | + */ |
|
| 185 | + public function attention() |
|
| 186 | + { |
|
| 187 | + return $this->_attention; |
|
| 188 | + } |
|
| 189 | + |
|
| 190 | + |
|
| 191 | + /** |
|
| 192 | + * @param string $errors |
|
| 193 | + */ |
|
| 194 | + public function set_errors($errors) |
|
| 195 | + { |
|
| 196 | + $this->_errors = $errors; |
|
| 197 | + } |
|
| 198 | + |
|
| 199 | + |
|
| 200 | + /** |
|
| 201 | + * @return string |
|
| 202 | + */ |
|
| 203 | + public function errors() |
|
| 204 | + { |
|
| 205 | + return $this->_errors; |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + |
|
| 209 | + /** |
|
| 210 | + * @return string |
|
| 211 | + */ |
|
| 212 | + public function unexpected_errors() |
|
| 213 | + { |
|
| 214 | + return $this->_unexpected_errors; |
|
| 215 | + } |
|
| 216 | + |
|
| 217 | + |
|
| 218 | + /** |
|
| 219 | + * @param string $unexpected_errors |
|
| 220 | + */ |
|
| 221 | + public function set_unexpected_errors($unexpected_errors) |
|
| 222 | + { |
|
| 223 | + $this->_unexpected_errors = $unexpected_errors; |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + |
|
| 227 | + /** |
|
| 228 | + * @param string $success |
|
| 229 | + */ |
|
| 230 | + public function set_success($success) |
|
| 231 | + { |
|
| 232 | + $this->_success = $success; |
|
| 233 | + } |
|
| 234 | + |
|
| 235 | + |
|
| 236 | + /** |
|
| 237 | + * @return string |
|
| 238 | + */ |
|
| 239 | + public function success() |
|
| 240 | + { |
|
| 241 | + return $this->_success; |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + |
|
| 245 | + /** |
|
| 246 | + * @param string $method_of_payment |
|
| 247 | + */ |
|
| 248 | + public function set_method_of_payment($method_of_payment) |
|
| 249 | + { |
|
| 250 | + $this->_method_of_payment = $method_of_payment; |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + |
|
| 254 | + /** |
|
| 255 | + * @return string |
|
| 256 | + */ |
|
| 257 | + public function method_of_payment() |
|
| 258 | + { |
|
| 259 | + return $this->_method_of_payment; |
|
| 260 | + } |
|
| 261 | + |
|
| 262 | + |
|
| 263 | + /** |
|
| 264 | + * @return float |
|
| 265 | + */ |
|
| 266 | + public function payment_amount() |
|
| 267 | + { |
|
| 268 | + return $this->_payment_amount; |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + |
|
| 272 | + /** |
|
| 273 | + * @param float $payment_amount |
|
| 274 | + * @throws EE_Error |
|
| 275 | + */ |
|
| 276 | + public function set_payment_amount($payment_amount) |
|
| 277 | + { |
|
| 278 | + $this->_payment_amount = (float) $payment_amount; |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + |
|
| 282 | + /** |
|
| 283 | + * @param string $next_step_html |
|
| 284 | + */ |
|
| 285 | + public function set_reg_step_html($next_step_html) |
|
| 286 | + { |
|
| 287 | + $this->_reg_step_html = $next_step_html; |
|
| 288 | + } |
|
| 289 | + |
|
| 290 | + |
|
| 291 | + /** |
|
| 292 | + * @return string |
|
| 293 | + */ |
|
| 294 | + public function reg_step_html() |
|
| 295 | + { |
|
| 296 | + return $this->_reg_step_html; |
|
| 297 | + } |
|
| 298 | + |
|
| 299 | + |
|
| 300 | + /** |
|
| 301 | + * @param string $redirect_form |
|
| 302 | + */ |
|
| 303 | + public function set_redirect_form($redirect_form) |
|
| 304 | + { |
|
| 305 | + $this->_redirect_form = $redirect_form; |
|
| 306 | + } |
|
| 307 | + |
|
| 308 | + |
|
| 309 | + /** |
|
| 310 | + * @return string |
|
| 311 | + */ |
|
| 312 | + public function redirect_form() |
|
| 313 | + { |
|
| 314 | + return ! empty($this->_redirect_form) ? $this->_redirect_form : false; |
|
| 315 | + } |
|
| 316 | + |
|
| 317 | + |
|
| 318 | + /** |
|
| 319 | + * @param string $plz_select_method_of_payment |
|
| 320 | + */ |
|
| 321 | + public function set_plz_select_method_of_payment($plz_select_method_of_payment) |
|
| 322 | + { |
|
| 323 | + $this->_plz_select_method_of_payment = $plz_select_method_of_payment; |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + |
|
| 327 | + /** |
|
| 328 | + * @return string |
|
| 329 | + */ |
|
| 330 | + public function plz_select_method_of_payment() |
|
| 331 | + { |
|
| 332 | + return $this->_plz_select_method_of_payment; |
|
| 333 | + } |
|
| 334 | + |
|
| 335 | + |
|
| 336 | + /** |
|
| 337 | + * @param string $redirect_url |
|
| 338 | + */ |
|
| 339 | + public function set_redirect_url($redirect_url) |
|
| 340 | + { |
|
| 341 | + $this->_redirect_url = $redirect_url; |
|
| 342 | + } |
|
| 343 | + |
|
| 344 | + |
|
| 345 | + /** |
|
| 346 | + * @return string |
|
| 347 | + */ |
|
| 348 | + public function redirect_url() |
|
| 349 | + { |
|
| 350 | + return $this->_redirect_url; |
|
| 351 | + } |
|
| 352 | + |
|
| 353 | + |
|
| 354 | + /** |
|
| 355 | + * @return string |
|
| 356 | + */ |
|
| 357 | + public function registration_time_limit() |
|
| 358 | + { |
|
| 359 | + return $this->_registration_time_limit; |
|
| 360 | + } |
|
| 361 | + |
|
| 362 | + |
|
| 363 | + /** |
|
| 364 | + * @param string $registration_time_limit |
|
| 365 | + */ |
|
| 366 | + public function set_registration_time_limit($registration_time_limit) |
|
| 367 | + { |
|
| 368 | + $this->_registration_time_limit = $registration_time_limit; |
|
| 369 | + } |
|
| 370 | + |
|
| 371 | + |
|
| 372 | + /** |
|
| 373 | + * @param array $return_data |
|
| 374 | + */ |
|
| 375 | + public function set_return_data($return_data) |
|
| 376 | + { |
|
| 377 | + $this->_return_data = array_merge($this->_return_data, $return_data); |
|
| 378 | + } |
|
| 379 | + |
|
| 380 | + |
|
| 381 | + /** |
|
| 382 | + * @return array |
|
| 383 | + */ |
|
| 384 | + public function return_data() |
|
| 385 | + { |
|
| 386 | + return $this->_return_data; |
|
| 387 | + } |
|
| 388 | + |
|
| 389 | + |
|
| 390 | + /** |
|
| 391 | + * @param array $validation_rules |
|
| 392 | + */ |
|
| 393 | + public function add_validation_rules(array $validation_rules = array()) |
|
| 394 | + { |
|
| 395 | + if (is_array($validation_rules) && ! empty($validation_rules)) { |
|
| 396 | + $this->_validation_rules = array_merge($this->_validation_rules, $validation_rules); |
|
| 397 | + } |
|
| 398 | + } |
|
| 399 | + |
|
| 400 | + |
|
| 401 | + /** |
|
| 402 | + * @return array | bool |
|
| 403 | + */ |
|
| 404 | + public function validation_rules() |
|
| 405 | + { |
|
| 406 | + return ! empty($this->_validation_rules) ? $this->_validation_rules : false; |
|
| 407 | + } |
|
| 408 | + |
|
| 409 | + |
|
| 410 | + public function echoAndExit() |
|
| 411 | + { |
|
| 412 | + echo $this; |
|
| 413 | + exit(); |
|
| 414 | + } |
|
| 415 | 415 | } |
@@ -16,14 +16,14 @@ |
||
| 16 | 16 | { |
| 17 | 17 | |
| 18 | 18 | |
| 19 | - public function __construct(EE_Admin_Page $admin_page) |
|
| 20 | - { |
|
| 21 | - parent::__construct($admin_page); |
|
| 22 | - } |
|
| 19 | + public function __construct(EE_Admin_Page $admin_page) |
|
| 20 | + { |
|
| 21 | + parent::__construct($admin_page); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - protected function _set_hooks_properties() |
|
| 26 | - { |
|
| 27 | - $this->_name = 'messages'; |
|
| 28 | - } |
|
| 25 | + protected function _set_hooks_properties() |
|
| 26 | + { |
|
| 27 | + $this->_name = 'messages'; |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -12,15 +12,15 @@ |
||
| 12 | 12 | class Extend_Events_Admin_List_Table extends Events_Admin_List_Table |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - protected function _column_name_action_setup(EE_Event $item) |
|
| 16 | - { |
|
| 17 | - $export_query_args = array( |
|
| 18 | - 'action' => 'export_events', |
|
| 19 | - 'EVT_ID' => $item->ID(), |
|
| 20 | - ); |
|
| 21 | - $export_event_link = EE_Admin_Page::add_query_args_and_nonce($export_query_args, EVENTS_ADMIN_URL); |
|
| 15 | + protected function _column_name_action_setup(EE_Event $item) |
|
| 16 | + { |
|
| 17 | + $export_query_args = array( |
|
| 18 | + 'action' => 'export_events', |
|
| 19 | + 'EVT_ID' => $item->ID(), |
|
| 20 | + ); |
|
| 21 | + $export_event_link = EE_Admin_Page::add_query_args_and_nonce($export_query_args, EVENTS_ADMIN_URL); |
|
| 22 | 22 | |
| 23 | - $actions = parent::_column_name_action_setup($item); |
|
| 24 | - return $actions; |
|
| 25 | - } |
|
| 23 | + $actions = parent::_column_name_action_setup($item); |
|
| 24 | + return $actions; |
|
| 25 | + } |
|
| 26 | 26 | } |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | 'ee_read_checkins', |
| 40 | 40 | 'espresso_registrations_registration_checkins' |
| 41 | 41 | ) |
| 42 | - ? '<a href="' . $check_in_url . '"' |
|
| 43 | - . ' title="' . esc_attr__( |
|
| 42 | + ? '<a href="'.$check_in_url.'"' |
|
| 43 | + . ' title="'.esc_attr__( |
|
| 44 | 44 | 'The Check-In List allows you to easily toggle check-in status for this event', |
| 45 | 45 | 'event_espresso' |
| 46 | 46 | ) |
| 47 | - . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 47 | + . '">'.esc_html__('View Check-ins', 'event_espresso').'</a>' |
|
| 48 | 48 | : esc_html__('View Check-ins', 'event_espresso'); |
| 49 | 49 | |
| 50 | 50 | return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
@@ -105,17 +105,17 @@ discard block |
||
| 105 | 105 | // add a "View Registrations" link that filters list by event AND datetime |
| 106 | 106 | $datetime_string .= $this->row_actions( |
| 107 | 107 | array( |
| 108 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 108 | + 'event_datetime_filter' => '<a href="'.EE_Admin_Page::add_query_args_and_nonce( |
|
| 109 | 109 | array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
| 110 | 110 | REG_ADMIN_URL |
| 111 | 111 | ) |
| 112 | - . '" title="' . sprintf( |
|
| 112 | + . '" title="'.sprintf( |
|
| 113 | 113 | esc_attr__( |
| 114 | 114 | 'Filter this list to only show registrations for this datetime %s', |
| 115 | 115 | 'event_espresso' |
| 116 | 116 | ), |
| 117 | 117 | $datetime->name() |
| 118 | - ) . '">' |
|
| 118 | + ).'">' |
|
| 119 | 119 | . esc_html__('View Registrations', 'event_espresso') |
| 120 | 120 | . '</a>', |
| 121 | 121 | ) |
@@ -13,117 +13,117 @@ |
||
| 13 | 13 | class Extend_EE_Registrations_List_Table extends EE_Registrations_List_Table |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @param EE_Registration $item |
|
| 18 | - * @return string |
|
| 19 | - * @throws EE_Error |
|
| 20 | - * @throws InvalidArgumentException |
|
| 21 | - * @throws ReflectionException |
|
| 22 | - * @throws InvalidDataTypeException |
|
| 23 | - * @throws InvalidInterfaceException |
|
| 24 | - */ |
|
| 25 | - public function column__REG_date(EE_Registration $item) |
|
| 26 | - { |
|
| 27 | - $date_linked = parent::column__REG_date($item); |
|
| 28 | - $actions = array(); |
|
| 29 | - // Build row actions |
|
| 30 | - $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 31 | - 'action' => 'event_registrations', |
|
| 32 | - 'event_id' => $item->event_ID(), |
|
| 33 | - ), REG_ADMIN_URL); |
|
| 34 | - $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 35 | - 'ee_read_registration', |
|
| 36 | - 'espresso_registrations_registration_checkins', |
|
| 37 | - $item->ID() |
|
| 38 | - ) && EE_Registry::instance()->CAP->current_user_can( |
|
| 39 | - 'ee_read_checkins', |
|
| 40 | - 'espresso_registrations_registration_checkins' |
|
| 41 | - ) |
|
| 42 | - ? '<a href="' . $check_in_url . '"' |
|
| 43 | - . ' title="' . esc_attr__( |
|
| 44 | - 'The Check-In List allows you to easily toggle check-in status for this event', |
|
| 45 | - 'event_espresso' |
|
| 46 | - ) |
|
| 47 | - . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 48 | - : esc_html__('View Check-ins', 'event_espresso'); |
|
| 16 | + /** |
|
| 17 | + * @param EE_Registration $item |
|
| 18 | + * @return string |
|
| 19 | + * @throws EE_Error |
|
| 20 | + * @throws InvalidArgumentException |
|
| 21 | + * @throws ReflectionException |
|
| 22 | + * @throws InvalidDataTypeException |
|
| 23 | + * @throws InvalidInterfaceException |
|
| 24 | + */ |
|
| 25 | + public function column__REG_date(EE_Registration $item) |
|
| 26 | + { |
|
| 27 | + $date_linked = parent::column__REG_date($item); |
|
| 28 | + $actions = array(); |
|
| 29 | + // Build row actions |
|
| 30 | + $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 31 | + 'action' => 'event_registrations', |
|
| 32 | + 'event_id' => $item->event_ID(), |
|
| 33 | + ), REG_ADMIN_URL); |
|
| 34 | + $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 35 | + 'ee_read_registration', |
|
| 36 | + 'espresso_registrations_registration_checkins', |
|
| 37 | + $item->ID() |
|
| 38 | + ) && EE_Registry::instance()->CAP->current_user_can( |
|
| 39 | + 'ee_read_checkins', |
|
| 40 | + 'espresso_registrations_registration_checkins' |
|
| 41 | + ) |
|
| 42 | + ? '<a href="' . $check_in_url . '"' |
|
| 43 | + . ' title="' . esc_attr__( |
|
| 44 | + 'The Check-In List allows you to easily toggle check-in status for this event', |
|
| 45 | + 'event_espresso' |
|
| 46 | + ) |
|
| 47 | + . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 48 | + : esc_html__('View Check-ins', 'event_espresso'); |
|
| 49 | 49 | |
| 50 | - return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
|
| 51 | - } |
|
| 50 | + return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * column_default |
|
| 56 | - * |
|
| 57 | - * @param \EE_Registration $item |
|
| 58 | - * @return string |
|
| 59 | - * @throws EE_Error |
|
| 60 | - * @throws InvalidArgumentException |
|
| 61 | - * @throws InvalidDataTypeException |
|
| 62 | - * @throws InvalidInterfaceException |
|
| 63 | - * @throws ReflectionException |
|
| 64 | - */ |
|
| 65 | - public function column_DTT_EVT_start(EE_Registration $item) |
|
| 66 | - { |
|
| 67 | - $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 68 | - $ticket = $item->ticket(); |
|
| 69 | - $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
|
| 70 | - $EVT_ID = $item->event_ID(); |
|
| 71 | - $datetimes_for_display = array(); |
|
| 72 | - foreach ($datetimes as $datetime) { |
|
| 73 | - $datetime_string = ''; |
|
| 74 | - if ( |
|
| 75 | - EE_Registry::instance()->CAP->current_user_can( |
|
| 76 | - 'ee_read_checkin', |
|
| 77 | - 'espresso_registrations_registration_checkins', |
|
| 78 | - $item->ID() |
|
| 79 | - ) |
|
| 80 | - ) { |
|
| 81 | - // open "a" tag and "href" |
|
| 82 | - $datetime_string .= '<a href="'; |
|
| 83 | - // checkin URL |
|
| 84 | - $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
| 85 | - array( |
|
| 86 | - 'action' => 'event_registrations', |
|
| 87 | - 'event_id' => $EVT_ID, |
|
| 88 | - 'DTT_ID' => $datetime->ID(), |
|
| 89 | - ), |
|
| 90 | - REG_ADMIN_URL |
|
| 91 | - ); |
|
| 92 | - // close "href" |
|
| 93 | - $datetime_string .= '"'; |
|
| 94 | - // open "title" tag |
|
| 95 | - $datetime_string .= ' title="'; |
|
| 96 | - // link title text |
|
| 97 | - $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
| 98 | - // close "title" tag and end of "a" tag opening |
|
| 99 | - $datetime_string .= '">'; |
|
| 100 | - // link text |
|
| 101 | - $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 102 | - // close "a" tag |
|
| 103 | - $datetime_string .= '</a>'; |
|
| 104 | - } else { |
|
| 105 | - $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 106 | - } |
|
| 107 | - // add a "View Registrations" link that filters list by event AND datetime |
|
| 108 | - $datetime_string .= $this->row_actions( |
|
| 109 | - array( |
|
| 110 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 111 | - array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
| 112 | - REG_ADMIN_URL |
|
| 113 | - ) |
|
| 114 | - . '" title="' . sprintf( |
|
| 115 | - esc_attr__( |
|
| 116 | - 'Filter this list to only show registrations for this datetime %s', |
|
| 117 | - 'event_espresso' |
|
| 118 | - ), |
|
| 119 | - $datetime->name() |
|
| 120 | - ) . '">' |
|
| 121 | - . esc_html__('View Registrations', 'event_espresso') |
|
| 122 | - . '</a>', |
|
| 123 | - ) |
|
| 124 | - ); |
|
| 125 | - $datetimes_for_display[] = $datetime_string; |
|
| 126 | - } |
|
| 127 | - return $this->generateDisplayForDateTimes($datetimes_for_display); |
|
| 128 | - } |
|
| 54 | + /** |
|
| 55 | + * column_default |
|
| 56 | + * |
|
| 57 | + * @param \EE_Registration $item |
|
| 58 | + * @return string |
|
| 59 | + * @throws EE_Error |
|
| 60 | + * @throws InvalidArgumentException |
|
| 61 | + * @throws InvalidDataTypeException |
|
| 62 | + * @throws InvalidInterfaceException |
|
| 63 | + * @throws ReflectionException |
|
| 64 | + */ |
|
| 65 | + public function column_DTT_EVT_start(EE_Registration $item) |
|
| 66 | + { |
|
| 67 | + $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 68 | + $ticket = $item->ticket(); |
|
| 69 | + $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
|
| 70 | + $EVT_ID = $item->event_ID(); |
|
| 71 | + $datetimes_for_display = array(); |
|
| 72 | + foreach ($datetimes as $datetime) { |
|
| 73 | + $datetime_string = ''; |
|
| 74 | + if ( |
|
| 75 | + EE_Registry::instance()->CAP->current_user_can( |
|
| 76 | + 'ee_read_checkin', |
|
| 77 | + 'espresso_registrations_registration_checkins', |
|
| 78 | + $item->ID() |
|
| 79 | + ) |
|
| 80 | + ) { |
|
| 81 | + // open "a" tag and "href" |
|
| 82 | + $datetime_string .= '<a href="'; |
|
| 83 | + // checkin URL |
|
| 84 | + $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
| 85 | + array( |
|
| 86 | + 'action' => 'event_registrations', |
|
| 87 | + 'event_id' => $EVT_ID, |
|
| 88 | + 'DTT_ID' => $datetime->ID(), |
|
| 89 | + ), |
|
| 90 | + REG_ADMIN_URL |
|
| 91 | + ); |
|
| 92 | + // close "href" |
|
| 93 | + $datetime_string .= '"'; |
|
| 94 | + // open "title" tag |
|
| 95 | + $datetime_string .= ' title="'; |
|
| 96 | + // link title text |
|
| 97 | + $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
| 98 | + // close "title" tag and end of "a" tag opening |
|
| 99 | + $datetime_string .= '">'; |
|
| 100 | + // link text |
|
| 101 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 102 | + // close "a" tag |
|
| 103 | + $datetime_string .= '</a>'; |
|
| 104 | + } else { |
|
| 105 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 106 | + } |
|
| 107 | + // add a "View Registrations" link that filters list by event AND datetime |
|
| 108 | + $datetime_string .= $this->row_actions( |
|
| 109 | + array( |
|
| 110 | + 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 111 | + array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
| 112 | + REG_ADMIN_URL |
|
| 113 | + ) |
|
| 114 | + . '" title="' . sprintf( |
|
| 115 | + esc_attr__( |
|
| 116 | + 'Filter this list to only show registrations for this datetime %s', |
|
| 117 | + 'event_espresso' |
|
| 118 | + ), |
|
| 119 | + $datetime->name() |
|
| 120 | + ) . '">' |
|
| 121 | + . esc_html__('View Registrations', 'event_espresso') |
|
| 122 | + . '</a>', |
|
| 123 | + ) |
|
| 124 | + ); |
|
| 125 | + $datetimes_for_display[] = $datetime_string; |
|
| 126 | + } |
|
| 127 | + return $this->generateDisplayForDateTimes($datetimes_for_display); |
|
| 128 | + } |
|
| 129 | 129 | } |