@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | <label><?php _e('Select from Venue Manager List', 'event_espresso'); ?></label> |
5 | 5 | <?php echo $venue_selector; ?> |
6 | 6 | <?php foreach ($venues as $venue) : |
7 | - $selected = $evt_venue_id == $venue->ID() ? '' : ' style="display:none;"'; |
|
8 | - $edit_url = EE_Admin_Page::add_query_args_and_nonce( |
|
9 | - array('action' => 'edit', 'post' => $venue->ID()), |
|
10 | - EE_VENUES_ADMIN_URL |
|
11 | - ); |
|
12 | - $state_name = is_object($venue->state_obj()) ? $venue->state_obj()->name() : null; |
|
13 | - $country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : null; |
|
14 | - ?> |
|
7 | + $selected = $evt_venue_id == $venue->ID() ? '' : ' style="display:none;"'; |
|
8 | + $edit_url = EE_Admin_Page::add_query_args_and_nonce( |
|
9 | + array('action' => 'edit', 'post' => $venue->ID()), |
|
10 | + EE_VENUES_ADMIN_URL |
|
11 | + ); |
|
12 | + $state_name = is_object($venue->state_obj()) ? $venue->state_obj()->name() : null; |
|
13 | + $country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : null; |
|
14 | + ?> |
|
15 | 15 | <fieldset id="eebox_<?php echo $venue->ID(); ?>" class="eebox"<?php echo $selected; ?>> |
16 | 16 | <ul class="address-view"> |
17 | 17 | <li> |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | <br/></p> |
27 | 27 | <a href="<?php echo $edit_url; ?>" target="_blank"> |
28 | 28 | <?php _e( |
29 | - 'Edit this Venue', |
|
30 | - 'event_espresso' |
|
31 | - ); ?></a> |
|
29 | + 'Edit this Venue', |
|
30 | + 'event_espresso' |
|
31 | + ); ?></a> |
|
32 | 32 | </li> |
33 | 33 | </ul> |
34 | 34 | </fieldset> |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - protected function _set_tips_array() |
|
19 | - { |
|
20 | - $this->_qtipsa = array( |
|
21 | - 0 => array( |
|
22 | - 'content_id' => 'registration-trash-lock', |
|
23 | - 'target' => '.ee-lock-icon', |
|
24 | - 'content' => $this->_registration_trash_message(), |
|
25 | - ), |
|
26 | - /** removing status strips for now because they are triggered anywhere on the row. */ |
|
27 | - /**1 => array( |
|
18 | + protected function _set_tips_array() |
|
19 | + { |
|
20 | + $this->_qtipsa = array( |
|
21 | + 0 => array( |
|
22 | + 'content_id' => 'registration-trash-lock', |
|
23 | + 'target' => '.ee-lock-icon', |
|
24 | + 'content' => $this->_registration_trash_message(), |
|
25 | + ), |
|
26 | + /** removing status strips for now because they are triggered anywhere on the row. */ |
|
27 | + /**1 => array( |
|
28 | 28 | * 'content_id' => 'registration-status-' . EEM_Registration::status_id_approved, |
29 | 29 | * 'target' => '.reg-status-' . EEM_Registration::status_id_approved, |
30 | 30 | * 'content' => $this->_registration_status_legend(EEM_Registration::status_id_approved), |
@@ -74,37 +74,37 @@ discard block |
||
74 | 74 | * ) |
75 | 75 | * ) |
76 | 76 | * )/**/ |
77 | - ); |
|
78 | - } |
|
77 | + ); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | |
81 | - private function _registration_trash_message() |
|
82 | - { |
|
83 | - return '<p>' |
|
84 | - . __( |
|
85 | - 'This lock-icon means that this registration cannot be trashed. Registrations that belong to a transaction that has payments cannot be trashed. If you wish to trash this registration then you must delete all payments attached to the related transaction first.', |
|
86 | - 'event_espresso' |
|
87 | - ) . '</p>'; |
|
88 | - } |
|
81 | + private function _registration_trash_message() |
|
82 | + { |
|
83 | + return '<p>' |
|
84 | + . __( |
|
85 | + 'This lock-icon means that this registration cannot be trashed. Registrations that belong to a transaction that has payments cannot be trashed. If you wish to trash this registration then you must delete all payments attached to the related transaction first.', |
|
86 | + 'event_espresso' |
|
87 | + ) . '</p>'; |
|
88 | + } |
|
89 | 89 | |
90 | 90 | |
91 | - /** |
|
92 | - * output the relevant ee-status-legend with the designated status highlighted. |
|
93 | - * |
|
94 | - * @param EEM_Registration constant $status What status is set (by class) |
|
95 | - * @return string The status legend with the related status highlighted |
|
96 | - */ |
|
97 | - private function _registration_status_legend($status) |
|
98 | - { |
|
91 | + /** |
|
92 | + * output the relevant ee-status-legend with the designated status highlighted. |
|
93 | + * |
|
94 | + * @param EEM_Registration constant $status What status is set (by class) |
|
95 | + * @return string The status legend with the related status highlighted |
|
96 | + */ |
|
97 | + private function _registration_status_legend($status) |
|
98 | + { |
|
99 | 99 | |
100 | - $status_array = array( |
|
101 | - 'approved_status' => EEM_Registration::status_id_approved, |
|
102 | - 'pending_status' => EEM_Registration::status_id_pending_payment, |
|
103 | - 'not_approved' => EEM_Registration::status_id_not_approved, |
|
104 | - 'declined_status' => EEM_Registration::status_id_declined, |
|
105 | - 'cancelled_status' => EEM_Registration::status_id_cancelled, |
|
106 | - ); |
|
100 | + $status_array = array( |
|
101 | + 'approved_status' => EEM_Registration::status_id_approved, |
|
102 | + 'pending_status' => EEM_Registration::status_id_pending_payment, |
|
103 | + 'not_approved' => EEM_Registration::status_id_not_approved, |
|
104 | + 'declined_status' => EEM_Registration::status_id_declined, |
|
105 | + 'cancelled_status' => EEM_Registration::status_id_cancelled, |
|
106 | + ); |
|
107 | 107 | |
108 | - return EEH_Template::status_legend($status_array, $status); |
|
109 | - } |
|
108 | + return EEH_Template::status_legend($status_array, $status); |
|
109 | + } |
|
110 | 110 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | . __( |
85 | 85 | 'This lock-icon means that this registration cannot be trashed. Registrations that belong to a transaction that has payments cannot be trashed. If you wish to trash this registration then you must delete all payments attached to the related transaction first.', |
86 | 86 | 'event_espresso' |
87 | - ) . '</p>'; |
|
87 | + ).'</p>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 |
@@ -13,50 +13,50 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | |
16 | - /** |
|
17 | - * constructor |
|
18 | - * |
|
19 | - * @Constructor |
|
20 | - * @access public |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
26 | - if (! defined('REG_PG_SLUG')) { |
|
27 | - define('REG_PG_SLUG', 'espresso_registrations'); |
|
28 | - define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
|
29 | - define('REG_ADMIN', EE_ADMIN_PAGES . 'registrations' . DS); |
|
30 | - define('REG_ADMIN_URL', admin_url('admin.php?page=' . REG_PG_SLUG)); |
|
31 | - define('REG_ASSETS_PATH', REG_ADMIN . 'assets' . DS); |
|
32 | - define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/'); |
|
33 | - define('REG_TEMPLATE_PATH', REG_ADMIN . 'templates' . DS); |
|
34 | - define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/'); |
|
35 | - } |
|
36 | - |
|
37 | - parent::__construct(); |
|
38 | - } |
|
39 | - |
|
40 | - |
|
41 | - protected function _set_init_properties() |
|
42 | - { |
|
43 | - $this->label = __('Registrations Overview', 'event_espresso'); |
|
44 | - } |
|
45 | - |
|
46 | - |
|
47 | - protected function _set_menu_map() |
|
48 | - { |
|
49 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
50 | - array( |
|
51 | - 'menu_group' => 'main', |
|
52 | - 'menu_order' => 40, |
|
53 | - 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
54 | - 'parent_slug' => 'espresso_events', |
|
55 | - 'menu_slug' => REG_PG_SLUG, |
|
56 | - 'menu_label' => __('Registrations', 'event_espresso'), |
|
57 | - 'capability' => 'ee_read_registrations', |
|
58 | - 'admin_init_page' => $this, |
|
59 | - ) |
|
60 | - ); |
|
61 | - } |
|
16 | + /** |
|
17 | + * constructor |
|
18 | + * |
|
19 | + * @Constructor |
|
20 | + * @access public |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
26 | + if (! defined('REG_PG_SLUG')) { |
|
27 | + define('REG_PG_SLUG', 'espresso_registrations'); |
|
28 | + define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
|
29 | + define('REG_ADMIN', EE_ADMIN_PAGES . 'registrations' . DS); |
|
30 | + define('REG_ADMIN_URL', admin_url('admin.php?page=' . REG_PG_SLUG)); |
|
31 | + define('REG_ASSETS_PATH', REG_ADMIN . 'assets' . DS); |
|
32 | + define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/'); |
|
33 | + define('REG_TEMPLATE_PATH', REG_ADMIN . 'templates' . DS); |
|
34 | + define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/'); |
|
35 | + } |
|
36 | + |
|
37 | + parent::__construct(); |
|
38 | + } |
|
39 | + |
|
40 | + |
|
41 | + protected function _set_init_properties() |
|
42 | + { |
|
43 | + $this->label = __('Registrations Overview', 'event_espresso'); |
|
44 | + } |
|
45 | + |
|
46 | + |
|
47 | + protected function _set_menu_map() |
|
48 | + { |
|
49 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
50 | + array( |
|
51 | + 'menu_group' => 'main', |
|
52 | + 'menu_order' => 40, |
|
53 | + 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
54 | + 'parent_slug' => 'espresso_events', |
|
55 | + 'menu_slug' => REG_PG_SLUG, |
|
56 | + 'menu_label' => __('Registrations', 'event_espresso'), |
|
57 | + 'capability' => 'ee_read_registrations', |
|
58 | + 'admin_init_page' => $this, |
|
59 | + ) |
|
60 | + ); |
|
61 | + } |
|
62 | 62 | } |
@@ -23,15 +23,15 @@ |
||
23 | 23 | public function __construct() |
24 | 24 | { |
25 | 25 | do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
26 | - if (! defined('REG_PG_SLUG')) { |
|
26 | + if ( ! defined('REG_PG_SLUG')) { |
|
27 | 27 | define('REG_PG_SLUG', 'espresso_registrations'); |
28 | 28 | define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
29 | - define('REG_ADMIN', EE_ADMIN_PAGES . 'registrations' . DS); |
|
30 | - define('REG_ADMIN_URL', admin_url('admin.php?page=' . REG_PG_SLUG)); |
|
31 | - define('REG_ASSETS_PATH', REG_ADMIN . 'assets' . DS); |
|
32 | - define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/'); |
|
33 | - define('REG_TEMPLATE_PATH', REG_ADMIN . 'templates' . DS); |
|
34 | - define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/'); |
|
29 | + define('REG_ADMIN', EE_ADMIN_PAGES.'registrations'.DS); |
|
30 | + define('REG_ADMIN_URL', admin_url('admin.php?page='.REG_PG_SLUG)); |
|
31 | + define('REG_ASSETS_PATH', REG_ADMIN.'assets'.DS); |
|
32 | + define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL.'registrations/assets/'); |
|
33 | + define('REG_TEMPLATE_PATH', REG_ADMIN.'templates'.DS); |
|
34 | + define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'registrations/templates/'); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | parent::__construct(); |
@@ -15,162 +15,162 @@ |
||
15 | 15 | */ |
16 | 16 | class EE_Registration_Custom_Questions_Form extends EE_Form_Section_Proper |
17 | 17 | { |
18 | - /** |
|
19 | - * |
|
20 | - * @var EE_Registration |
|
21 | - */ |
|
22 | - protected $_registration = null; |
|
18 | + /** |
|
19 | + * |
|
20 | + * @var EE_Registration |
|
21 | + */ |
|
22 | + protected $_registration = null; |
|
23 | 23 | |
24 | - /** |
|
25 | - * |
|
26 | - * @param EE_Registration $reg |
|
27 | - * @param array $options |
|
28 | - */ |
|
29 | - public function __construct(EE_Registration $reg, $options = array()) |
|
30 | - { |
|
31 | - $this->_registration = $reg; |
|
32 | - if (! isset($options['layout_strategy'])) { |
|
33 | - $options['layout_strategy'] = new EE_Admin_Two_Column_Layout(); |
|
34 | - } |
|
35 | - if (! isset($options['html_id'])) { |
|
36 | - $options['html_id'] = 'reg-admin-attendee-questions-frm'; |
|
37 | - } |
|
38 | - $this->build_form_from_registration(); |
|
39 | - parent::__construct($options); |
|
40 | - } |
|
24 | + /** |
|
25 | + * |
|
26 | + * @param EE_Registration $reg |
|
27 | + * @param array $options |
|
28 | + */ |
|
29 | + public function __construct(EE_Registration $reg, $options = array()) |
|
30 | + { |
|
31 | + $this->_registration = $reg; |
|
32 | + if (! isset($options['layout_strategy'])) { |
|
33 | + $options['layout_strategy'] = new EE_Admin_Two_Column_Layout(); |
|
34 | + } |
|
35 | + if (! isset($options['html_id'])) { |
|
36 | + $options['html_id'] = 'reg-admin-attendee-questions-frm'; |
|
37 | + } |
|
38 | + $this->build_form_from_registration(); |
|
39 | + parent::__construct($options); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | - /** |
|
44 | - * Gets the registration object this form is about |
|
45 | - * @return EE_Registration |
|
46 | - */ |
|
47 | - public function get_registration() |
|
48 | - { |
|
49 | - return $this->_registration; |
|
50 | - } |
|
43 | + /** |
|
44 | + * Gets the registration object this form is about |
|
45 | + * @return EE_Registration |
|
46 | + */ |
|
47 | + public function get_registration() |
|
48 | + { |
|
49 | + return $this->_registration; |
|
50 | + } |
|
51 | 51 | |
52 | - public function build_form_from_registration() |
|
53 | - { |
|
54 | - $reg = $this->get_registration(); |
|
55 | - if (! $reg instanceof EE_Registration) { |
|
56 | - throw new EE_Error(__('We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso')); |
|
57 | - } |
|
58 | - // we want to get all their question groups |
|
59 | - $question_groups = EEM_Question_Group::instance()->get_all( |
|
60 | - array( |
|
61 | - array( |
|
62 | - 'Event_Question_Group.EVT_ID' => $reg->event_ID(), |
|
63 | - 'Event_Question_Group.EQG_primary' => $reg->count() == 1 ? true : false, |
|
64 | - 'OR' => array( |
|
65 | - 'Question.QST_system*blank' => '', |
|
66 | - 'Question.QST_system*null' => array( 'IS_NULL' ) |
|
67 | - ) |
|
68 | - ), |
|
69 | - 'order_by' => array( 'QSG_order' => 'ASC' ) |
|
70 | - ) |
|
71 | - ); |
|
72 | - // get each question groups questions |
|
73 | - foreach ($question_groups as $question_group) { |
|
74 | - if ($question_group instanceof EE_Question_Group) { |
|
75 | - $this->_subsections[ $question_group->ID() ] = $this->build_subform_from_question_group( |
|
76 | - $question_group, |
|
77 | - $reg |
|
78 | - ); |
|
79 | - } |
|
80 | - } |
|
81 | - } |
|
52 | + public function build_form_from_registration() |
|
53 | + { |
|
54 | + $reg = $this->get_registration(); |
|
55 | + if (! $reg instanceof EE_Registration) { |
|
56 | + throw new EE_Error(__('We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso')); |
|
57 | + } |
|
58 | + // we want to get all their question groups |
|
59 | + $question_groups = EEM_Question_Group::instance()->get_all( |
|
60 | + array( |
|
61 | + array( |
|
62 | + 'Event_Question_Group.EVT_ID' => $reg->event_ID(), |
|
63 | + 'Event_Question_Group.EQG_primary' => $reg->count() == 1 ? true : false, |
|
64 | + 'OR' => array( |
|
65 | + 'Question.QST_system*blank' => '', |
|
66 | + 'Question.QST_system*null' => array( 'IS_NULL' ) |
|
67 | + ) |
|
68 | + ), |
|
69 | + 'order_by' => array( 'QSG_order' => 'ASC' ) |
|
70 | + ) |
|
71 | + ); |
|
72 | + // get each question groups questions |
|
73 | + foreach ($question_groups as $question_group) { |
|
74 | + if ($question_group instanceof EE_Question_Group) { |
|
75 | + $this->_subsections[ $question_group->ID() ] = $this->build_subform_from_question_group( |
|
76 | + $question_group, |
|
77 | + $reg |
|
78 | + ); |
|
79 | + } |
|
80 | + } |
|
81 | + } |
|
82 | 82 | |
83 | 83 | |
84 | 84 | |
85 | - /** |
|
86 | - * |
|
87 | - * @param EE_Question_Group $question_group |
|
88 | - * @param EE_Registration $registration |
|
89 | - * @return \EE_Form_Section_Proper |
|
90 | - * @throws \EE_Error |
|
91 | - */ |
|
92 | - public function build_subform_from_question_group($question_group, $registration) |
|
93 | - { |
|
94 | - if (! $question_group instanceof EE_Question_Group || |
|
95 | - ! $registration instanceof EE_Registration) { |
|
96 | - throw new EE_Error(__('A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso')); |
|
97 | - } |
|
98 | - $parts_of_subsection = array( |
|
99 | - 'title' => new EE_Form_Section_HTML( |
|
100 | - EEH_HTML::h5( |
|
101 | - $question_group->name(), |
|
102 | - $question_group->identifier(), |
|
103 | - 'espresso-question-group-title-h5 section-title' |
|
104 | - ) |
|
105 | - ) |
|
106 | - ); |
|
107 | - $questions = $question_group->questions( |
|
108 | - array( |
|
109 | - array( |
|
110 | - 'OR' => array( |
|
111 | - 'QST_system*blank' => '', |
|
112 | - 'QST_system*null' => array( 'IS_NULL' ) |
|
113 | - ) |
|
114 | - ) |
|
115 | - ) |
|
116 | - ); |
|
117 | - foreach ($questions as $question) { |
|
118 | - $parts_of_subsection[ $question->ID() ] = $question->generate_form_input($registration); |
|
119 | - } |
|
120 | - $parts_of_subsection['edit_link'] = new EE_Form_Section_HTML( |
|
121 | - '<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso') . '"> |
|
85 | + /** |
|
86 | + * |
|
87 | + * @param EE_Question_Group $question_group |
|
88 | + * @param EE_Registration $registration |
|
89 | + * @return \EE_Form_Section_Proper |
|
90 | + * @throws \EE_Error |
|
91 | + */ |
|
92 | + public function build_subform_from_question_group($question_group, $registration) |
|
93 | + { |
|
94 | + if (! $question_group instanceof EE_Question_Group || |
|
95 | + ! $registration instanceof EE_Registration) { |
|
96 | + throw new EE_Error(__('A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso')); |
|
97 | + } |
|
98 | + $parts_of_subsection = array( |
|
99 | + 'title' => new EE_Form_Section_HTML( |
|
100 | + EEH_HTML::h5( |
|
101 | + $question_group->name(), |
|
102 | + $question_group->identifier(), |
|
103 | + 'espresso-question-group-title-h5 section-title' |
|
104 | + ) |
|
105 | + ) |
|
106 | + ); |
|
107 | + $questions = $question_group->questions( |
|
108 | + array( |
|
109 | + array( |
|
110 | + 'OR' => array( |
|
111 | + 'QST_system*blank' => '', |
|
112 | + 'QST_system*null' => array( 'IS_NULL' ) |
|
113 | + ) |
|
114 | + ) |
|
115 | + ) |
|
116 | + ); |
|
117 | + foreach ($questions as $question) { |
|
118 | + $parts_of_subsection[ $question->ID() ] = $question->generate_form_input($registration); |
|
119 | + } |
|
120 | + $parts_of_subsection['edit_link'] = new EE_Form_Section_HTML( |
|
121 | + '<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso') . '"> |
|
122 | 122 | <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso') . '</span> |
123 | 123 | <div class="dashicons dashicons-edit"></div> |
124 | 124 | </a></td></tr>' |
125 | - ); |
|
126 | - return new EE_Form_Section_Proper( |
|
127 | - array( |
|
128 | - 'subsections' => $parts_of_subsection, |
|
129 | - 'html_class' => 'question-group-questions', |
|
130 | - ) |
|
131 | - ); |
|
132 | - } |
|
125 | + ); |
|
126 | + return new EE_Form_Section_Proper( |
|
127 | + array( |
|
128 | + 'subsections' => $parts_of_subsection, |
|
129 | + 'html_class' => 'question-group-questions', |
|
130 | + ) |
|
131 | + ); |
|
132 | + } |
|
133 | 133 | |
134 | - /** |
|
135 | - * Overrides parent so if inputs were disabled, we leave those with their defaults |
|
136 | - * from the answers in the DB |
|
137 | - * @param array $req_data like $_POST |
|
138 | - * @return void |
|
139 | - */ |
|
140 | - protected function _normalize($req_data) |
|
141 | - { |
|
142 | - $this->_received_submission = true; |
|
143 | - $this->_validation_errors = array(); |
|
144 | - foreach ($this->get_validatable_subsections() as $subsection) { |
|
145 | - if ($subsection->form_data_present_in($req_data)) { |
|
146 | - try { |
|
147 | - $subsection->_normalize($req_data); |
|
148 | - } catch (EE_Validation_Error $e) { |
|
149 | - $subsection->add_validation_error($e); |
|
150 | - } |
|
151 | - } |
|
152 | - } |
|
153 | - } |
|
134 | + /** |
|
135 | + * Overrides parent so if inputs were disabled, we leave those with their defaults |
|
136 | + * from the answers in the DB |
|
137 | + * @param array $req_data like $_POST |
|
138 | + * @return void |
|
139 | + */ |
|
140 | + protected function _normalize($req_data) |
|
141 | + { |
|
142 | + $this->_received_submission = true; |
|
143 | + $this->_validation_errors = array(); |
|
144 | + foreach ($this->get_validatable_subsections() as $subsection) { |
|
145 | + if ($subsection->form_data_present_in($req_data)) { |
|
146 | + try { |
|
147 | + $subsection->_normalize($req_data); |
|
148 | + } catch (EE_Validation_Error $e) { |
|
149 | + $subsection->add_validation_error($e); |
|
150 | + } |
|
151 | + } |
|
152 | + } |
|
153 | + } |
|
154 | 154 | |
155 | 155 | |
156 | 156 | |
157 | - /** |
|
158 | - * Performs validation on this form section and its subsections. For each subsection, |
|
159 | - * calls _validate_{subsection_name} on THIS form (if the function exists) and passes it the subsection, then calls _validate on that subsection. |
|
160 | - * If you need to perform validation on the form as a whole (considering multiple) you would be best to override this _validate method, |
|
161 | - * calling parent::_validate() first. |
|
162 | - */ |
|
163 | - protected function _validate() |
|
164 | - { |
|
165 | - foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) { |
|
166 | - if ($subsection->form_data_present_in(array_merge($_GET, $_POST))) { |
|
167 | - if (method_exists($this, '_validate_'.$subsection_name)) { |
|
168 | - call_user_func_array(array($this,'_validate_'.$subsection_name), array($subsection)); |
|
169 | - } |
|
170 | - $subsection->_validate(); |
|
171 | - } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
172 | - $subsection->_received_submission = true; |
|
173 | - } |
|
174 | - } |
|
175 | - } |
|
157 | + /** |
|
158 | + * Performs validation on this form section and its subsections. For each subsection, |
|
159 | + * calls _validate_{subsection_name} on THIS form (if the function exists) and passes it the subsection, then calls _validate on that subsection. |
|
160 | + * If you need to perform validation on the form as a whole (considering multiple) you would be best to override this _validate method, |
|
161 | + * calling parent::_validate() first. |
|
162 | + */ |
|
163 | + protected function _validate() |
|
164 | + { |
|
165 | + foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) { |
|
166 | + if ($subsection->form_data_present_in(array_merge($_GET, $_POST))) { |
|
167 | + if (method_exists($this, '_validate_'.$subsection_name)) { |
|
168 | + call_user_func_array(array($this,'_validate_'.$subsection_name), array($subsection)); |
|
169 | + } |
|
170 | + $subsection->_validate(); |
|
171 | + } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
172 | + $subsection->_received_submission = true; |
|
173 | + } |
|
174 | + } |
|
175 | + } |
|
176 | 176 | } |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | public function __construct(EE_Registration $reg, $options = array()) |
30 | 30 | { |
31 | 31 | $this->_registration = $reg; |
32 | - if (! isset($options['layout_strategy'])) { |
|
32 | + if ( ! isset($options['layout_strategy'])) { |
|
33 | 33 | $options['layout_strategy'] = new EE_Admin_Two_Column_Layout(); |
34 | 34 | } |
35 | - if (! isset($options['html_id'])) { |
|
35 | + if ( ! isset($options['html_id'])) { |
|
36 | 36 | $options['html_id'] = 'reg-admin-attendee-questions-frm'; |
37 | 37 | } |
38 | 38 | $this->build_form_from_registration(); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function build_form_from_registration() |
53 | 53 | { |
54 | 54 | $reg = $this->get_registration(); |
55 | - if (! $reg instanceof EE_Registration) { |
|
55 | + if ( ! $reg instanceof EE_Registration) { |
|
56 | 56 | throw new EE_Error(__('We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso')); |
57 | 57 | } |
58 | 58 | // we want to get all their question groups |
@@ -63,16 +63,16 @@ discard block |
||
63 | 63 | 'Event_Question_Group.EQG_primary' => $reg->count() == 1 ? true : false, |
64 | 64 | 'OR' => array( |
65 | 65 | 'Question.QST_system*blank' => '', |
66 | - 'Question.QST_system*null' => array( 'IS_NULL' ) |
|
66 | + 'Question.QST_system*null' => array('IS_NULL') |
|
67 | 67 | ) |
68 | 68 | ), |
69 | - 'order_by' => array( 'QSG_order' => 'ASC' ) |
|
69 | + 'order_by' => array('QSG_order' => 'ASC') |
|
70 | 70 | ) |
71 | 71 | ); |
72 | 72 | // get each question groups questions |
73 | 73 | foreach ($question_groups as $question_group) { |
74 | 74 | if ($question_group instanceof EE_Question_Group) { |
75 | - $this->_subsections[ $question_group->ID() ] = $this->build_subform_from_question_group( |
|
75 | + $this->_subsections[$question_group->ID()] = $this->build_subform_from_question_group( |
|
76 | 76 | $question_group, |
77 | 77 | $reg |
78 | 78 | ); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function build_subform_from_question_group($question_group, $registration) |
93 | 93 | { |
94 | - if (! $question_group instanceof EE_Question_Group || |
|
94 | + if ( ! $question_group instanceof EE_Question_Group || |
|
95 | 95 | ! $registration instanceof EE_Registration) { |
96 | 96 | throw new EE_Error(__('A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso')); |
97 | 97 | } |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | array( |
110 | 110 | 'OR' => array( |
111 | 111 | 'QST_system*blank' => '', |
112 | - 'QST_system*null' => array( 'IS_NULL' ) |
|
112 | + 'QST_system*null' => array('IS_NULL') |
|
113 | 113 | ) |
114 | 114 | ) |
115 | 115 | ) |
116 | 116 | ); |
117 | 117 | foreach ($questions as $question) { |
118 | - $parts_of_subsection[ $question->ID() ] = $question->generate_form_input($registration); |
|
118 | + $parts_of_subsection[$question->ID()] = $question->generate_form_input($registration); |
|
119 | 119 | } |
120 | 120 | $parts_of_subsection['edit_link'] = new EE_Form_Section_HTML( |
121 | - '<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso') . '"> |
|
122 | - <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso') . '</span> |
|
121 | + '<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="'.esc_attr__('click to edit question', 'event_espresso').'"> |
|
122 | + <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span> |
|
123 | 123 | <div class="dashicons dashicons-edit"></div> |
124 | 124 | </a></td></tr>' |
125 | 125 | ); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) { |
166 | 166 | if ($subsection->form_data_present_in(array_merge($_GET, $_POST))) { |
167 | 167 | if (method_exists($this, '_validate_'.$subsection_name)) { |
168 | - call_user_func_array(array($this,'_validate_'.$subsection_name), array($subsection)); |
|
168 | + call_user_func_array(array($this, '_validate_'.$subsection_name), array($subsection)); |
|
169 | 169 | } |
170 | 170 | $subsection->_validate(); |
171 | 171 | } elseif ($subsection instanceof EE_Form_Section_Proper) { |
@@ -3,25 +3,25 @@ |
||
3 | 3 | <div class="ee-new-registration-step-content"> |
4 | 4 | <?php echo $content; ?> |
5 | 5 | <?php |
6 | - if ($show_notification_toggle |
|
7 | - && EE_Registry::instance()->CAP->current_user_can( |
|
8 | - 'ee_send_message', |
|
9 | - 'registration_message_type' |
|
10 | - )) : ?> |
|
6 | + if ($show_notification_toggle |
|
7 | + && EE_Registry::instance()->CAP->current_user_can( |
|
8 | + 'ee_send_message', |
|
9 | + 'registration_message_type' |
|
10 | + )) : ?> |
|
11 | 11 | <div class="ee-attention"> |
12 | 12 | <label for="txn_reg_status_change" class="last"> |
13 | 13 | <?php _e( |
14 | - 'Send Related Messages?', |
|
15 | - 'event_espresso' |
|
16 | - ); ?></label> |
|
14 | + 'Send Related Messages?', |
|
15 | + 'event_espresso' |
|
16 | + ); ?></label> |
|
17 | 17 | <input type="checkbox" value="1" name="txn_reg_status_change[send_notifications]" checked=checked> |
18 | 18 | <br/> |
19 | 19 | <br/> |
20 | 20 | <p class="description"> |
21 | 21 | <?php _e( |
22 | - 'Send a notification to registrants after processing?', |
|
23 | - 'event_espresso' |
|
24 | - ); ?></p><br/> |
|
22 | + 'Send a notification to registrants after processing?', |
|
23 | + 'event_espresso' |
|
24 | + ); ?></p><br/> |
|
25 | 25 | <label></label> |
26 | 26 | </div> |
27 | 27 | <?php endif; ?> |
@@ -8,17 +8,17 @@ |
||
8 | 8 | <div id="titlewrap"> |
9 | 9 | <label class="hidden" id="attendee-first-name-text" for="ATT_fname"> |
10 | 10 | <?php _e( |
11 | - 'First Name:', |
|
12 | - 'event_espresso' |
|
13 | - ); ?></label> |
|
11 | + 'First Name:', |
|
12 | + 'event_espresso' |
|
13 | + ); ?></label> |
|
14 | 14 | <input type="text" class="smaller-text-field" name="ATT_fname" |
15 | 15 | value="<?php echo $attendee->get('ATT_fname'); ?>" id="ATT_fname" |
16 | 16 | placeholder="<?php _e('First Name', 'event_espresso'); ?>" required> |
17 | 17 | <label class="hidden" id="attendee-first-name-text" for="ATT_lname"> |
18 | 18 | <?php _e( |
19 | - 'Last Name:', |
|
20 | - 'event_espresso' |
|
21 | - ); ?></label> |
|
19 | + 'Last Name:', |
|
20 | + 'event_espresso' |
|
21 | + ); ?></label> |
|
22 | 22 | <input type="text" class="smaller-text-field" name="ATT_lname" |
23 | 23 | value="<?php echo $attendee->get('ATT_lname'); ?>" id="ATT_lname" |
24 | 24 | placeholder="<?php _e('Last Name', 'event_espresso'); ?>"> |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | |
8 | 8 | <h3 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span> |
9 | 9 | <?php _e( |
10 | - 'Registration Items', |
|
11 | - 'event_espresso' |
|
12 | - ); ?></h3> |
|
10 | + 'Registration Items', |
|
11 | + 'event_espresso' |
|
12 | + ); ?></h3> |
|
13 | 13 | |
14 | 14 | <?php echo $line_item_table; ?> |
15 | 15 | |
16 | 16 | <a id="display-additional-registration-session-info" class="display-the-hidden smaller-text" |
17 | 17 | rel="additional-registration-session-info"> |
18 | 18 | <span class="dashicons dashicons-plus-alt"></span><?php _e( |
19 | - 'view additional registration session details', |
|
20 | - 'event_espresso' |
|
21 | - ); ?> |
|
19 | + 'view additional registration session details', |
|
20 | + 'event_espresso' |
|
21 | + ); ?> |
|
22 | 22 | </a> |
23 | 23 | |
24 | 24 | <div id="additional-registration-session-info-dv" class="hidden"> |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | <a id="hide-additional-registration-session-info" class="hide-the-displayed hidden smaller-text" |
27 | 27 | rel="additional-registration-session-info"> |
28 | 28 | <span class="dashicons dashicons-dismiss"></span><?php _e( |
29 | - 'hide additional registration session details', |
|
30 | - 'event_espresso' |
|
31 | - ); ?> |
|
29 | + 'hide additional registration session details', |
|
30 | + 'event_espresso' |
|
31 | + ); ?> |
|
32 | 32 | </a> |
33 | 33 | <br class="clear"/> |
34 | 34 |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | |
27 | 27 | <p class="contact-details-buttons"> |
28 | 28 | <?php |
29 | - if ($att_check instanceof EE_Attendee |
|
30 | - && EE_Registry::instance()->CAP->current_user_can( |
|
31 | - 'ee_edit_contact', |
|
32 | - 'view_or_edit_contact_button', |
|
33 | - $att_check->ID() |
|
34 | - )) : |
|
35 | - ?> |
|
29 | + if ($att_check instanceof EE_Attendee |
|
30 | + && EE_Registry::instance()->CAP->current_user_can( |
|
31 | + 'ee_edit_contact', |
|
32 | + 'view_or_edit_contact_button', |
|
33 | + $att_check->ID() |
|
34 | + )) : |
|
35 | + ?> |
|
36 | 36 | <a class="button button-small" href="<?php echo $att_edit_link; ?>" |
37 | 37 | title="<?php echo esc_attr($att_edit_label); ?>"> |
38 | 38 | <span class="ee-icon ee-icon-user-edit"></span><?php echo $att_edit_label; ?> |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | <?php if (! empty($create_link)) : ?> |
41 | 41 | <a class="button button-small" href="<?php echo $create_link; ?>" |
42 | 42 | title="<?php |
43 | - esc_attr_e( |
|
44 | - 'This registration shares the contact details for the primary registration in this group. If you\'d like this registration to have its own details, you can do so by clicking this button', |
|
45 | - 'event_espresso' |
|
46 | - ); ?>"> |
|
43 | + esc_attr_e( |
|
44 | + 'This registration shares the contact details for the primary registration in this group. If you\'d like this registration to have its own details, you can do so by clicking this button', |
|
45 | + 'event_espresso' |
|
46 | + ); ?>"> |
|
47 | 47 | <span class="ee-icon ee-icon-user-add-new"></span><?php echo $create_label; ?> |
48 | 48 | </a> |
49 | 49 | <?php endif; ?> |
50 | 50 | <div style="clear:both"></div> |
51 | 51 | <?php |
52 | - endif; |
|
52 | + endif; |
|
53 | 53 | ?> |
54 | 54 | </p> |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | <p class="clearfix"> |
3 | 3 | <span class="admin-side-mbox-label-spn lt-grey-txt float-left"> |
4 | 4 | <?php _e('Name', 'event_espresso'); ?> |
5 | - </span><?php echo $fname . ' ' . $lname; ?> |
|
5 | + </span><?php echo $fname.' '.$lname; ?> |
|
6 | 6 | </p> |
7 | 7 | <p class="clearfix"> |
8 | 8 | <span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Email', 'event_espresso'); ?></span><a |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | title="<?php echo esc_attr($att_edit_label); ?>"> |
38 | 38 | <span class="ee-icon ee-icon-user-edit"></span><?php echo $att_edit_label; ?> |
39 | 39 | </a> |
40 | - <?php if (! empty($create_link)) : ?> |
|
40 | + <?php if ( ! empty($create_link)) : ?> |
|
41 | 41 | <a class="button button-small" href="<?php echo $create_link; ?>" |
42 | 42 | title="<?php |
43 | 43 | esc_attr_e( |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <tbody> |
21 | 21 | |
22 | 22 | <?php |
23 | - foreach ($attendees as $att_nmbr => $attendee) : ?> |
|
23 | + foreach ($attendees as $att_nmbr => $attendee) : ?> |
|
24 | 24 | <tr class="ee-status-strip reg-status-<?php echo $attendee['STS_ID']; ?>" |
25 | 25 | style="display: table-row;"> |
26 | 26 | <td class="jst-left"><?php echo $att_nmbr; ?></td> |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | </td> |
34 | 34 | <td class="jst-rght"> |
35 | 35 | <?php echo $currency_sign . ' ' . number_format( |
36 | - $attendee['final_price'], |
|
37 | - 2 |
|
38 | - ); ?></td> |
|
36 | + $attendee['final_price'], |
|
37 | + 2 |
|
38 | + ); ?></td> |
|
39 | 39 | <td class="jst-left"><?php echo $attendee['email']; ?></td> |
40 | 40 | <td class="jst-left"><?php echo $attendee['address']; ?></td> |
41 | 41 | <!--<th class="jst-cntr">view</th>--> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | <br/> |
4 | 4 | <?php // echo EEH_Debug_Tools::printr( $event_attendees, 'event_attendees' ); ?> |
5 | 5 | <?php echo $attendee_notice; ?> |
6 | - <?php if (! empty($attendees)) : ?> |
|
6 | + <?php if ( ! empty($attendees)) : ?> |
|
7 | 7 | <div class="admin-primary-mbox-tbl-wrap"> |
8 | 8 | <table id="reg-admin-transaction-attendees-table" class="admin-primary-mbox-tbl"> |
9 | 9 | <thead> |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | <td class="jst-left"> |
29 | 29 | <a href="<?php echo $attendee['att_link']; ?>" |
30 | 30 | title="<?php esc_attr_e('View details for this attendee', 'event_espresso'); ?>"> |
31 | - <?php echo $attendee['fname'] . ' ' . $attendee['lname']; ?> |
|
31 | + <?php echo $attendee['fname'].' '.$attendee['lname']; ?> |
|
32 | 32 | </a> |
33 | 33 | </td> |
34 | 34 | <td class="jst-rght"> |
35 | - <?php echo $currency_sign . ' ' . number_format( |
|
35 | + <?php echo $currency_sign.' '.number_format( |
|
36 | 36 | $attendee['final_price'], |
37 | 37 | 2 |
38 | 38 | ); ?></td> |