@@ -110,13 +110,13 @@ |
||
110 | 110 | 'WP_User' => new EE_Belongs_To_Relation(), |
111 | 111 | ]; |
112 | 112 | // this model is generally available for reading |
113 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
113 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = |
|
114 | 114 | new EE_Restriction_Generator_Public(); |
115 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
115 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = |
|
116 | 116 | new EE_Restriction_Generator_Reg_Form('QSG_system'); |
117 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
117 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = |
|
118 | 118 | new EE_Restriction_Generator_Reg_Form('QSG_system'); |
119 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
119 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = |
|
120 | 120 | new EE_Restriction_Generator_Reg_Form('QSG_system'); |
121 | 121 | |
122 | 122 | parent::__construct($timezone); |
@@ -9,136 +9,136 @@ |
||
9 | 9 | */ |
10 | 10 | class EEM_Question_Group extends EEM_Soft_Delete_Base |
11 | 11 | { |
12 | - const system_personal = 1; |
|
12 | + const system_personal = 1; |
|
13 | 13 | |
14 | - const system_address = 2; |
|
14 | + const system_address = 2; |
|
15 | 15 | |
16 | - /** |
|
17 | - * private instance of the EEM_Question_Group object |
|
18 | - * |
|
19 | - * @var EEM_Question_Group |
|
20 | - */ |
|
21 | - protected static $_instance = null; |
|
16 | + /** |
|
17 | + * private instance of the EEM_Question_Group object |
|
18 | + * |
|
19 | + * @var EEM_Question_Group |
|
20 | + */ |
|
21 | + protected static $_instance = null; |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * EEM_Question_Group constructor. |
|
26 | - * |
|
27 | - * @param string|null $timezone |
|
28 | - */ |
|
29 | - protected function __construct($timezone = null) |
|
30 | - { |
|
31 | - $this->singular_item = esc_html__('Question Group', 'event_espresso'); |
|
32 | - $this->plural_item = esc_html__('Question Groups', 'event_espresso'); |
|
24 | + /** |
|
25 | + * EEM_Question_Group constructor. |
|
26 | + * |
|
27 | + * @param string|null $timezone |
|
28 | + */ |
|
29 | + protected function __construct($timezone = null) |
|
30 | + { |
|
31 | + $this->singular_item = esc_html__('Question Group', 'event_espresso'); |
|
32 | + $this->plural_item = esc_html__('Question Groups', 'event_espresso'); |
|
33 | 33 | |
34 | - $this->_tables = [ |
|
35 | - 'Question_Group' => new EE_Primary_Table('esp_question_group', 'QSG_ID'), |
|
36 | - ]; |
|
37 | - $this->_fields = [ |
|
38 | - 'Question_Group' => [ |
|
39 | - 'QSG_ID' => new EE_Primary_Key_Int_Field( |
|
40 | - 'QSG_ID', |
|
41 | - esc_html__('Question Group ID', 'event_espresso') |
|
42 | - ), |
|
43 | - 'QSG_deleted' => new EE_Trashed_Flag_Field( |
|
44 | - 'QSG_deleted', |
|
45 | - esc_html__('Flag indicating this question group was deleted', 'event_espresso'), |
|
46 | - false, |
|
47 | - false |
|
48 | - ), |
|
49 | - 'QSG_desc' => new EE_Post_Content_Field( |
|
50 | - 'QSG_desc', |
|
51 | - esc_html__('Description of Question Group', 'event_espresso'), |
|
52 | - true, |
|
53 | - '' |
|
54 | - ), |
|
55 | - 'QSG_identifier' => new EE_Plain_Text_Field( |
|
56 | - 'QSG_identifier', |
|
57 | - esc_html__('Text ID for question Group', 'event_espresso'), |
|
58 | - false, |
|
59 | - '' |
|
60 | - ), |
|
61 | - 'QSG_name' => new EE_Plain_Text_Field( |
|
62 | - 'QSG_name', |
|
63 | - esc_html__('Question Group Name', 'event_espresso'), |
|
64 | - false, |
|
65 | - '' |
|
66 | - ), |
|
67 | - 'QSG_order' => new EE_Integer_Field( |
|
68 | - 'QSG_order', |
|
69 | - esc_html__('Order in which to show the question group', 'event_espresso'), |
|
70 | - true, |
|
71 | - 0 |
|
72 | - ), |
|
73 | - 'QSG_show_group_desc' => new EE_Boolean_Field( |
|
74 | - 'QSG_show_group_desc', |
|
75 | - esc_html__( |
|
76 | - 'Flag indicating whether to show the group\s description on the registration page', |
|
77 | - 'event_espresso' |
|
78 | - ), |
|
79 | - false, |
|
80 | - false |
|
81 | - ), |
|
82 | - 'QSG_show_group_name' => new EE_Boolean_Field( |
|
83 | - 'QSG_show_group_name', |
|
84 | - esc_html__( |
|
85 | - 'Flag indicating whether to show the group\'s name on the registration page', |
|
86 | - 'event_espresso' |
|
87 | - ), |
|
88 | - false, |
|
89 | - true |
|
90 | - ), |
|
91 | - 'QSG_system' => new EE_Integer_Field( |
|
92 | - 'QSG_system', |
|
93 | - esc_html__( |
|
94 | - 'Indicate IF this is a system group and if it is what system group it corresponds to.', |
|
95 | - 'event_espresso' |
|
96 | - ), |
|
97 | - false, |
|
98 | - 0 |
|
99 | - ), |
|
100 | - 'QSG_wp_user' => new EE_WP_User_Field( |
|
101 | - 'QSG_wp_user', |
|
102 | - esc_html__('Question Group Creator ID', 'event_espresso'), |
|
103 | - false |
|
104 | - ), |
|
105 | - ], |
|
106 | - ]; |
|
107 | - $this->_model_relations = [ |
|
108 | - 'Event' => new EE_HABTM_Relation('Event_Question_Group'), |
|
109 | - 'Event_Question_Group' => new EE_Has_Many_Relation(), |
|
110 | - 'Question' => new EE_HABTM_Relation('Question_Group_Question'), |
|
111 | - 'WP_User' => new EE_Belongs_To_Relation(), |
|
112 | - ]; |
|
113 | - // this model is generally available for reading |
|
114 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
115 | - new EE_Restriction_Generator_Public(); |
|
116 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
117 | - new EE_Restriction_Generator_Reg_Form('QSG_system'); |
|
118 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
119 | - new EE_Restriction_Generator_Reg_Form('QSG_system'); |
|
120 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
121 | - new EE_Restriction_Generator_Reg_Form('QSG_system'); |
|
34 | + $this->_tables = [ |
|
35 | + 'Question_Group' => new EE_Primary_Table('esp_question_group', 'QSG_ID'), |
|
36 | + ]; |
|
37 | + $this->_fields = [ |
|
38 | + 'Question_Group' => [ |
|
39 | + 'QSG_ID' => new EE_Primary_Key_Int_Field( |
|
40 | + 'QSG_ID', |
|
41 | + esc_html__('Question Group ID', 'event_espresso') |
|
42 | + ), |
|
43 | + 'QSG_deleted' => new EE_Trashed_Flag_Field( |
|
44 | + 'QSG_deleted', |
|
45 | + esc_html__('Flag indicating this question group was deleted', 'event_espresso'), |
|
46 | + false, |
|
47 | + false |
|
48 | + ), |
|
49 | + 'QSG_desc' => new EE_Post_Content_Field( |
|
50 | + 'QSG_desc', |
|
51 | + esc_html__('Description of Question Group', 'event_espresso'), |
|
52 | + true, |
|
53 | + '' |
|
54 | + ), |
|
55 | + 'QSG_identifier' => new EE_Plain_Text_Field( |
|
56 | + 'QSG_identifier', |
|
57 | + esc_html__('Text ID for question Group', 'event_espresso'), |
|
58 | + false, |
|
59 | + '' |
|
60 | + ), |
|
61 | + 'QSG_name' => new EE_Plain_Text_Field( |
|
62 | + 'QSG_name', |
|
63 | + esc_html__('Question Group Name', 'event_espresso'), |
|
64 | + false, |
|
65 | + '' |
|
66 | + ), |
|
67 | + 'QSG_order' => new EE_Integer_Field( |
|
68 | + 'QSG_order', |
|
69 | + esc_html__('Order in which to show the question group', 'event_espresso'), |
|
70 | + true, |
|
71 | + 0 |
|
72 | + ), |
|
73 | + 'QSG_show_group_desc' => new EE_Boolean_Field( |
|
74 | + 'QSG_show_group_desc', |
|
75 | + esc_html__( |
|
76 | + 'Flag indicating whether to show the group\s description on the registration page', |
|
77 | + 'event_espresso' |
|
78 | + ), |
|
79 | + false, |
|
80 | + false |
|
81 | + ), |
|
82 | + 'QSG_show_group_name' => new EE_Boolean_Field( |
|
83 | + 'QSG_show_group_name', |
|
84 | + esc_html__( |
|
85 | + 'Flag indicating whether to show the group\'s name on the registration page', |
|
86 | + 'event_espresso' |
|
87 | + ), |
|
88 | + false, |
|
89 | + true |
|
90 | + ), |
|
91 | + 'QSG_system' => new EE_Integer_Field( |
|
92 | + 'QSG_system', |
|
93 | + esc_html__( |
|
94 | + 'Indicate IF this is a system group and if it is what system group it corresponds to.', |
|
95 | + 'event_espresso' |
|
96 | + ), |
|
97 | + false, |
|
98 | + 0 |
|
99 | + ), |
|
100 | + 'QSG_wp_user' => new EE_WP_User_Field( |
|
101 | + 'QSG_wp_user', |
|
102 | + esc_html__('Question Group Creator ID', 'event_espresso'), |
|
103 | + false |
|
104 | + ), |
|
105 | + ], |
|
106 | + ]; |
|
107 | + $this->_model_relations = [ |
|
108 | + 'Event' => new EE_HABTM_Relation('Event_Question_Group'), |
|
109 | + 'Event_Question_Group' => new EE_Has_Many_Relation(), |
|
110 | + 'Question' => new EE_HABTM_Relation('Question_Group_Question'), |
|
111 | + 'WP_User' => new EE_Belongs_To_Relation(), |
|
112 | + ]; |
|
113 | + // this model is generally available for reading |
|
114 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
115 | + new EE_Restriction_Generator_Public(); |
|
116 | + $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
117 | + new EE_Restriction_Generator_Reg_Form('QSG_system'); |
|
118 | + $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
119 | + new EE_Restriction_Generator_Reg_Form('QSG_system'); |
|
120 | + $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
121 | + new EE_Restriction_Generator_Reg_Form('QSG_system'); |
|
122 | 122 | |
123 | - parent::__construct($timezone); |
|
124 | - } |
|
123 | + parent::__construct($timezone); |
|
124 | + } |
|
125 | 125 | |
126 | 126 | |
127 | - /** |
|
128 | - * searches the db for the question group with the latest question order and returns that value. |
|
129 | - * |
|
130 | - * @return int |
|
131 | - * @throws EE_Error |
|
132 | - */ |
|
133 | - public function get_latest_question_group_order() |
|
134 | - { |
|
135 | - $max = $this->_get_all_wpdb_results( |
|
136 | - [], |
|
137 | - ARRAY_A, |
|
138 | - [ |
|
139 | - 'max_order' => ["MAX(QSG_order)", "%d"], |
|
140 | - ] |
|
141 | - ); |
|
142 | - return $max[0]['max_order']; |
|
143 | - } |
|
127 | + /** |
|
128 | + * searches the db for the question group with the latest question order and returns that value. |
|
129 | + * |
|
130 | + * @return int |
|
131 | + * @throws EE_Error |
|
132 | + */ |
|
133 | + public function get_latest_question_group_order() |
|
134 | + { |
|
135 | + $max = $this->_get_all_wpdb_results( |
|
136 | + [], |
|
137 | + ARRAY_A, |
|
138 | + [ |
|
139 | + 'max_order' => ["MAX(QSG_order)", "%d"], |
|
140 | + ] |
|
141 | + ); |
|
142 | + return $max[0]['max_order']; |
|
143 | + } |
|
144 | 144 | } |
@@ -74,13 +74,13 @@ |
||
74 | 74 | $this->_model_chain_to_wp_user = 'Question'; |
75 | 75 | |
76 | 76 | // this model is generally available for reading |
77 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
77 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = |
|
78 | 78 | new EE_Restriction_Generator_Public(); |
79 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
79 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = |
|
80 | 80 | new EE_Restriction_Generator_Reg_Form('QSO_system'); |
81 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
81 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = |
|
82 | 82 | new EE_Restriction_Generator_Reg_Form('QSO_system'); |
83 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
83 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = |
|
84 | 84 | new EE_Restriction_Generator_Reg_Form('QSO_system'); |
85 | 85 | |
86 | 86 | parent::__construct($timezone); |
@@ -9,80 +9,80 @@ |
||
9 | 9 | */ |
10 | 10 | class EEM_Question_Option extends EEM_Soft_Delete_Base |
11 | 11 | { |
12 | - // private instance of the Attendee object |
|
13 | - protected static $_instance = null; |
|
12 | + // private instance of the Attendee object |
|
13 | + protected static $_instance = null; |
|
14 | 14 | |
15 | 15 | |
16 | - protected function __construct($timezone = null) |
|
17 | - { |
|
18 | - $this->singular_item = esc_html__('Question Option', 'event_espresso'); |
|
19 | - $this->plural_item = esc_html__('Question Options', 'event_espresso'); |
|
16 | + protected function __construct($timezone = null) |
|
17 | + { |
|
18 | + $this->singular_item = esc_html__('Question Option', 'event_espresso'); |
|
19 | + $this->plural_item = esc_html__('Question Options', 'event_espresso'); |
|
20 | 20 | |
21 | - $this->_tables = [ |
|
22 | - 'Question_Option' => new EE_Primary_Table('esp_question_option', 'QSO_ID'), |
|
23 | - ]; |
|
24 | - $this->_fields = [ |
|
25 | - 'Question_Option' => [ |
|
26 | - 'QSO_ID' => new EE_Primary_Key_Int_Field( |
|
27 | - 'QSO_ID', |
|
28 | - esc_html__('Question Option ID', 'event_espresso') |
|
29 | - ), |
|
30 | - 'QST_ID' => new EE_Foreign_Key_Int_Field( |
|
31 | - 'QST_ID', |
|
32 | - esc_html__('Question ID', 'event_espresso'), |
|
33 | - false, |
|
34 | - 0, |
|
35 | - 'Question' |
|
36 | - ), |
|
37 | - 'QSO_deleted' => new EE_Trashed_Flag_Field( |
|
38 | - 'QSO_deleted', |
|
39 | - esc_html__('Flag indicating Option was trashed', 'event_espresso'), |
|
40 | - false, |
|
41 | - false |
|
42 | - ), |
|
43 | - 'QSO_desc' => new EE_Post_Content_Field( |
|
44 | - 'QSO_desc', |
|
45 | - esc_html__('Question Option Description', 'event_espresso'), |
|
46 | - false, |
|
47 | - '' |
|
48 | - ), |
|
49 | - 'QSO_order' => new EE_Integer_Field( |
|
50 | - 'QSO_order', |
|
51 | - esc_html__('Question Option Order', 'event_espresso'), |
|
52 | - false, |
|
53 | - 0 |
|
54 | - ), |
|
55 | - 'QSO_system' => new EE_Plain_Text_Field( |
|
56 | - 'QSO_system', |
|
57 | - esc_html__('Internal string ID for question option', 'event_espresso'), |
|
58 | - true, |
|
59 | - null |
|
60 | - ), |
|
61 | - 'QSO_value' => new EE_Plain_Text_Field( |
|
62 | - 'QSO_value', |
|
63 | - esc_html__("Question Option Value", "event_espresso"), |
|
64 | - false, |
|
65 | - '' |
|
66 | - ), |
|
67 | - ], |
|
68 | - ]; |
|
69 | - $this->_model_relations = [ |
|
70 | - 'Question' => new EE_Belongs_To_Relation(), |
|
71 | - ]; |
|
21 | + $this->_tables = [ |
|
22 | + 'Question_Option' => new EE_Primary_Table('esp_question_option', 'QSO_ID'), |
|
23 | + ]; |
|
24 | + $this->_fields = [ |
|
25 | + 'Question_Option' => [ |
|
26 | + 'QSO_ID' => new EE_Primary_Key_Int_Field( |
|
27 | + 'QSO_ID', |
|
28 | + esc_html__('Question Option ID', 'event_espresso') |
|
29 | + ), |
|
30 | + 'QST_ID' => new EE_Foreign_Key_Int_Field( |
|
31 | + 'QST_ID', |
|
32 | + esc_html__('Question ID', 'event_espresso'), |
|
33 | + false, |
|
34 | + 0, |
|
35 | + 'Question' |
|
36 | + ), |
|
37 | + 'QSO_deleted' => new EE_Trashed_Flag_Field( |
|
38 | + 'QSO_deleted', |
|
39 | + esc_html__('Flag indicating Option was trashed', 'event_espresso'), |
|
40 | + false, |
|
41 | + false |
|
42 | + ), |
|
43 | + 'QSO_desc' => new EE_Post_Content_Field( |
|
44 | + 'QSO_desc', |
|
45 | + esc_html__('Question Option Description', 'event_espresso'), |
|
46 | + false, |
|
47 | + '' |
|
48 | + ), |
|
49 | + 'QSO_order' => new EE_Integer_Field( |
|
50 | + 'QSO_order', |
|
51 | + esc_html__('Question Option Order', 'event_espresso'), |
|
52 | + false, |
|
53 | + 0 |
|
54 | + ), |
|
55 | + 'QSO_system' => new EE_Plain_Text_Field( |
|
56 | + 'QSO_system', |
|
57 | + esc_html__('Internal string ID for question option', 'event_espresso'), |
|
58 | + true, |
|
59 | + null |
|
60 | + ), |
|
61 | + 'QSO_value' => new EE_Plain_Text_Field( |
|
62 | + 'QSO_value', |
|
63 | + esc_html__("Question Option Value", "event_espresso"), |
|
64 | + false, |
|
65 | + '' |
|
66 | + ), |
|
67 | + ], |
|
68 | + ]; |
|
69 | + $this->_model_relations = [ |
|
70 | + 'Question' => new EE_Belongs_To_Relation(), |
|
71 | + ]; |
|
72 | 72 | |
73 | - $this->_caps_slug = 'questions'; |
|
74 | - $this->_model_chain_to_wp_user = 'Question'; |
|
73 | + $this->_caps_slug = 'questions'; |
|
74 | + $this->_model_chain_to_wp_user = 'Question'; |
|
75 | 75 | |
76 | - // this model is generally available for reading |
|
77 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
78 | - new EE_Restriction_Generator_Public(); |
|
79 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
80 | - new EE_Restriction_Generator_Reg_Form('QSO_system'); |
|
81 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
82 | - new EE_Restriction_Generator_Reg_Form('QSO_system'); |
|
83 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
84 | - new EE_Restriction_Generator_Reg_Form('QSO_system'); |
|
76 | + // this model is generally available for reading |
|
77 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
78 | + new EE_Restriction_Generator_Public(); |
|
79 | + $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
80 | + new EE_Restriction_Generator_Reg_Form('QSO_system'); |
|
81 | + $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
82 | + new EE_Restriction_Generator_Reg_Form('QSO_system'); |
|
83 | + $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
84 | + new EE_Restriction_Generator_Reg_Form('QSO_system'); |
|
85 | 85 | |
86 | - parent::__construct($timezone); |
|
87 | - } |
|
86 | + parent::__construct($timezone); |
|
87 | + } |
|
88 | 88 | } |
@@ -61,13 +61,13 @@ |
||
61 | 61 | $this->_model_chain_to_wp_user = 'Question_Group'; |
62 | 62 | |
63 | 63 | // this model is generally available for reading |
64 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
64 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = |
|
65 | 65 | new EE_Restriction_Generator_Public(); |
66 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
66 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = |
|
67 | 67 | new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
68 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
68 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = |
|
69 | 69 | new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
70 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
70 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = |
|
71 | 71 | new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
72 | 72 | |
73 | 73 | // use the caps for question groups |
@@ -13,64 +13,64 @@ |
||
13 | 13 | */ |
14 | 14 | class EEM_Question_Group_Question extends EEM_Base |
15 | 15 | { |
16 | - // private instance of the Attendee object |
|
17 | - protected static $_instance = null; |
|
16 | + // private instance of the Attendee object |
|
17 | + protected static $_instance = null; |
|
18 | 18 | |
19 | 19 | |
20 | - protected function __construct($timezone = null) |
|
21 | - { |
|
22 | - $this->singular_item = esc_html__('Question Group to Question Link', 'event_espresso'); |
|
23 | - $this->plural_item = esc_html__('Question Group to Question Links', 'event_espresso'); |
|
24 | - $this->_tables = [ |
|
25 | - 'Question_Group_Question' => new EE_Primary_Table('esp_question_group_question', 'QGQ_ID'), |
|
26 | - ]; |
|
27 | - $this->_fields = [ |
|
28 | - 'Question_Group_Question' => [ |
|
29 | - 'QGQ_ID' => new EE_Primary_Key_Int_Field( |
|
30 | - 'QGQ_ID', |
|
31 | - esc_html__('Question Group to Question Link ID', 'event_espresso') |
|
32 | - ), |
|
33 | - 'QSG_ID' => new EE_Foreign_Key_Int_Field( |
|
34 | - 'QSG_ID', |
|
35 | - esc_html__('Question Group ID', 'event_espresso'), |
|
36 | - false, |
|
37 | - 0, |
|
38 | - 'Question_Group' |
|
39 | - ), |
|
40 | - 'QST_ID' => new EE_Foreign_Key_Int_Field( |
|
41 | - 'QST_ID', |
|
42 | - esc_html__('Question Id', 'event_espresso'), |
|
43 | - false, |
|
44 | - 0, |
|
45 | - 'Question' |
|
46 | - ), |
|
47 | - 'QGQ_order' => new EE_Integer_Field( |
|
48 | - 'QGQ_order', |
|
49 | - esc_html__('Question Group Question Order', 'event_espresso'), |
|
50 | - false, |
|
51 | - 0 |
|
52 | - ), |
|
53 | - ], |
|
54 | - ]; |
|
55 | - $this->_model_relations = [ |
|
56 | - 'Question_Group' => new EE_Belongs_To_Relation(), |
|
57 | - 'Question' => new EE_Belongs_To_Relation(), |
|
58 | - ]; |
|
20 | + protected function __construct($timezone = null) |
|
21 | + { |
|
22 | + $this->singular_item = esc_html__('Question Group to Question Link', 'event_espresso'); |
|
23 | + $this->plural_item = esc_html__('Question Group to Question Links', 'event_espresso'); |
|
24 | + $this->_tables = [ |
|
25 | + 'Question_Group_Question' => new EE_Primary_Table('esp_question_group_question', 'QGQ_ID'), |
|
26 | + ]; |
|
27 | + $this->_fields = [ |
|
28 | + 'Question_Group_Question' => [ |
|
29 | + 'QGQ_ID' => new EE_Primary_Key_Int_Field( |
|
30 | + 'QGQ_ID', |
|
31 | + esc_html__('Question Group to Question Link ID', 'event_espresso') |
|
32 | + ), |
|
33 | + 'QSG_ID' => new EE_Foreign_Key_Int_Field( |
|
34 | + 'QSG_ID', |
|
35 | + esc_html__('Question Group ID', 'event_espresso'), |
|
36 | + false, |
|
37 | + 0, |
|
38 | + 'Question_Group' |
|
39 | + ), |
|
40 | + 'QST_ID' => new EE_Foreign_Key_Int_Field( |
|
41 | + 'QST_ID', |
|
42 | + esc_html__('Question Id', 'event_espresso'), |
|
43 | + false, |
|
44 | + 0, |
|
45 | + 'Question' |
|
46 | + ), |
|
47 | + 'QGQ_order' => new EE_Integer_Field( |
|
48 | + 'QGQ_order', |
|
49 | + esc_html__('Question Group Question Order', 'event_espresso'), |
|
50 | + false, |
|
51 | + 0 |
|
52 | + ), |
|
53 | + ], |
|
54 | + ]; |
|
55 | + $this->_model_relations = [ |
|
56 | + 'Question_Group' => new EE_Belongs_To_Relation(), |
|
57 | + 'Question' => new EE_Belongs_To_Relation(), |
|
58 | + ]; |
|
59 | 59 | |
60 | - $this->_model_chain_to_wp_user = 'Question_Group'; |
|
60 | + $this->_model_chain_to_wp_user = 'Question_Group'; |
|
61 | 61 | |
62 | - // this model is generally available for reading |
|
63 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
64 | - new EE_Restriction_Generator_Public(); |
|
65 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
66 | - new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
|
67 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
68 | - new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
|
69 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
70 | - new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
|
62 | + // this model is generally available for reading |
|
63 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = |
|
64 | + new EE_Restriction_Generator_Public(); |
|
65 | + $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = |
|
66 | + new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
|
67 | + $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = |
|
68 | + new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
|
69 | + $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = |
|
70 | + new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system'); |
|
71 | 71 | |
72 | - // use the caps for question groups |
|
73 | - $this->_caps_slug = 'question_groups'; |
|
74 | - parent::__construct($timezone); |
|
75 | - } |
|
72 | + // use the caps for question groups |
|
73 | + $this->_caps_slug = 'question_groups'; |
|
74 | + parent::__construct($timezone); |
|
75 | + } |
|
76 | 76 | } |
@@ -52,21 +52,21 @@ |
||
52 | 52 | 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', |
53 | 53 | [] |
54 | 54 | ); |
55 | - $conditions = [ |
|
55 | + $conditions = [ |
|
56 | 56 | $this->_key_field_name => ['NOT_LIKE', "\\\\_%"], |
57 | 57 | // each slash is escaped because we are using double quotes, and |
58 | 58 | // stripslashes will be called on this because the models assume this is from user input |
59 | 59 | $this->_value_field_name => ['NOT_REGEXP', '^[aOs]:[\d]:.*$'], |
60 | 60 | ]; |
61 | - if (! empty($blacklisted_meta_keys)) { |
|
62 | - $conditions[ $this->_key_field_name . '*blacklisted' ] = |
|
61 | + if ( ! empty($blacklisted_meta_keys)) { |
|
62 | + $conditions[$this->_key_field_name.'*blacklisted'] = |
|
63 | 63 | ['NOT_IN', $blacklisted_meta_keys]; |
64 | 64 | } |
65 | - if (! empty($whitelisted_meta_keys)) { |
|
65 | + if ( ! empty($whitelisted_meta_keys)) { |
|
66 | 66 | $conditions = [ |
67 | 67 | 'OR*whitelisted-or-normal' => [ |
68 | 68 | 'AND' => $conditions, |
69 | - $this->_key_field_name . '*whitelisted' => [ |
|
69 | + $this->_key_field_name.'*whitelisted' => [ |
|
70 | 70 | 'IN', |
71 | 71 | $whitelisted_meta_keys, |
72 | 72 | ], |
@@ -11,77 +11,77 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Restriction_Generator_Meta extends EE_Restriction_Generator_Base |
13 | 13 | { |
14 | - /** |
|
15 | - * @var string the name of the field containing the meta key |
|
16 | - */ |
|
17 | - protected $_key_field_name = null; |
|
14 | + /** |
|
15 | + * @var string the name of the field containing the meta key |
|
16 | + */ |
|
17 | + protected $_key_field_name = null; |
|
18 | 18 | |
19 | - /** |
|
20 | - * @var string the name of the field containing the meta value |
|
21 | - */ |
|
22 | - protected $_value_field_name = null; |
|
19 | + /** |
|
20 | + * @var string the name of the field containing the meta value |
|
21 | + */ |
|
22 | + protected $_value_field_name = null; |
|
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * Accepts the name of the field that indicates whether or not an object is |
|
27 | - * a "system" one or not |
|
28 | - * |
|
29 | - * @param string $key_field_name |
|
30 | - * @param string $value_field_name |
|
31 | - */ |
|
32 | - public function __construct($key_field_name, $value_field_name) |
|
33 | - { |
|
34 | - $key_field_name = (string) $key_field_name; |
|
35 | - $value_field_name = (string) $value_field_name; |
|
36 | - $this->_key_field_name = $key_field_name; |
|
37 | - $this->_value_field_name = $value_field_name; |
|
38 | - } |
|
25 | + /** |
|
26 | + * Accepts the name of the field that indicates whether or not an object is |
|
27 | + * a "system" one or not |
|
28 | + * |
|
29 | + * @param string $key_field_name |
|
30 | + * @param string $value_field_name |
|
31 | + */ |
|
32 | + public function __construct($key_field_name, $value_field_name) |
|
33 | + { |
|
34 | + $key_field_name = (string) $key_field_name; |
|
35 | + $value_field_name = (string) $value_field_name; |
|
36 | + $this->_key_field_name = $key_field_name; |
|
37 | + $this->_value_field_name = $value_field_name; |
|
38 | + } |
|
39 | 39 | |
40 | 40 | |
41 | - /** |
|
42 | - * @return EE_Default_Where_Conditions[]|EE_Return_None_Where_Conditions[] |
|
43 | - */ |
|
44 | - protected function _generate_restrictions() |
|
45 | - { |
|
46 | - $whitelisted_meta_keys = |
|
47 | - apply_filters( |
|
48 | - 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__whitelisted_meta_keys', |
|
49 | - [] |
|
50 | - ); |
|
51 | - $blacklisted_meta_keys = |
|
52 | - apply_filters( |
|
53 | - 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', |
|
54 | - [] |
|
55 | - ); |
|
56 | - $conditions = [ |
|
57 | - $this->_key_field_name => ['NOT_LIKE', "\\\\_%"], |
|
58 | - // each slash is escaped because we are using double quotes, and |
|
59 | - // stripslashes will be called on this because the models assume this is from user input |
|
60 | - $this->_value_field_name => ['NOT_REGEXP', '^[aOs]:[\d]:.*$'], |
|
61 | - ]; |
|
62 | - if (! empty($blacklisted_meta_keys)) { |
|
63 | - $conditions[ $this->_key_field_name . '*blacklisted' ] = |
|
64 | - ['NOT_IN', $blacklisted_meta_keys]; |
|
65 | - } |
|
66 | - if (! empty($whitelisted_meta_keys)) { |
|
67 | - $conditions = [ |
|
68 | - 'OR*whitelisted-or-normal' => [ |
|
69 | - 'AND' => $conditions, |
|
70 | - $this->_key_field_name . '*whitelisted' => [ |
|
71 | - 'IN', |
|
72 | - $whitelisted_meta_keys, |
|
73 | - ], |
|
74 | - ], |
|
75 | - ]; |
|
76 | - } |
|
77 | - return [ |
|
78 | - // only allow access to non-protected metas if they're an admin |
|
79 | - EE_Restriction_Generator_Base::get_default_restrictions_cap() => new EE_Return_None_Where_Conditions(), |
|
80 | - // don't allow access to protected metas to anyone. |
|
81 | - // If they want that, don't apply caps to the query |
|
82 | - 'apply-to-all-queries-using-caps' => new EE_Default_Where_Conditions( |
|
83 | - $conditions |
|
84 | - ), |
|
85 | - ]; |
|
86 | - } |
|
41 | + /** |
|
42 | + * @return EE_Default_Where_Conditions[]|EE_Return_None_Where_Conditions[] |
|
43 | + */ |
|
44 | + protected function _generate_restrictions() |
|
45 | + { |
|
46 | + $whitelisted_meta_keys = |
|
47 | + apply_filters( |
|
48 | + 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__whitelisted_meta_keys', |
|
49 | + [] |
|
50 | + ); |
|
51 | + $blacklisted_meta_keys = |
|
52 | + apply_filters( |
|
53 | + 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', |
|
54 | + [] |
|
55 | + ); |
|
56 | + $conditions = [ |
|
57 | + $this->_key_field_name => ['NOT_LIKE', "\\\\_%"], |
|
58 | + // each slash is escaped because we are using double quotes, and |
|
59 | + // stripslashes will be called on this because the models assume this is from user input |
|
60 | + $this->_value_field_name => ['NOT_REGEXP', '^[aOs]:[\d]:.*$'], |
|
61 | + ]; |
|
62 | + if (! empty($blacklisted_meta_keys)) { |
|
63 | + $conditions[ $this->_key_field_name . '*blacklisted' ] = |
|
64 | + ['NOT_IN', $blacklisted_meta_keys]; |
|
65 | + } |
|
66 | + if (! empty($whitelisted_meta_keys)) { |
|
67 | + $conditions = [ |
|
68 | + 'OR*whitelisted-or-normal' => [ |
|
69 | + 'AND' => $conditions, |
|
70 | + $this->_key_field_name . '*whitelisted' => [ |
|
71 | + 'IN', |
|
72 | + $whitelisted_meta_keys, |
|
73 | + ], |
|
74 | + ], |
|
75 | + ]; |
|
76 | + } |
|
77 | + return [ |
|
78 | + // only allow access to non-protected metas if they're an admin |
|
79 | + EE_Restriction_Generator_Base::get_default_restrictions_cap() => new EE_Return_None_Where_Conditions(), |
|
80 | + // don't allow access to protected metas to anyone. |
|
81 | + // If they want that, don't apply caps to the query |
|
82 | + 'apply-to-all-queries-using-caps' => new EE_Default_Where_Conditions( |
|
83 | + $conditions |
|
84 | + ), |
|
85 | + ]; |
|
86 | + } |
|
87 | 87 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | // if there are no standard caps for this model, then for now |
42 | 42 | // all we know if they need the default cap to access this |
43 | - if (! $this->model()->cap_slug()) { |
|
43 | + if ( ! $this->model()->cap_slug()) { |
|
44 | 44 | return [ |
45 | 45 | EE_Restriction_Generator_Base::get_default_restrictions_cap( |
46 | 46 | ) => new EE_Return_None_Where_Conditions(), |
@@ -57,18 +57,18 @@ discard block |
||
57 | 57 | // there is also no "ee_delete_system_questions" cap. |
58 | 58 | // But folks shouldn't be deleting system questions anyway |
59 | 59 | if ($this->action() !== EEM_Base::caps_read) { |
60 | - $restrictions[ EE_Restriction_Generator_Base::get_cap_name( |
|
60 | + $restrictions[EE_Restriction_Generator_Base::get_cap_name( |
|
61 | 61 | $this->model(), |
62 | - $this->action() . '_system' |
|
63 | - ) ] = new EE_Default_Where_Conditions( |
|
62 | + $this->action().'_system' |
|
63 | + )] = new EE_Default_Where_Conditions( |
|
64 | 64 | [ |
65 | - 'OR*no_' . |
|
65 | + 'OR*no_'. |
|
66 | 66 | EE_Restriction_Generator_Base::get_cap_name( |
67 | 67 | $this->model(), |
68 | - $this->action() . '_system' |
|
68 | + $this->action().'_system' |
|
69 | 69 | ) => [ |
70 | 70 | $this->_system_field_name => ['IN', ['', 0]], |
71 | - $this->_system_field_name . '*' => ['IS_NULL'], |
|
71 | + $this->_system_field_name.'*' => ['IS_NULL'], |
|
72 | 72 | ], |
73 | 73 | ] |
74 | 74 | ); |
@@ -12,67 +12,67 @@ |
||
12 | 12 | */ |
13 | 13 | class EE_Restriction_Generator_Reg_Form extends EE_Restriction_Generator_Base |
14 | 14 | { |
15 | - /** |
|
16 | - * @var string the name of the field that indicates |
|
17 | - * whether or not this is a system thing |
|
18 | - */ |
|
19 | - protected $_system_field_name = null; |
|
15 | + /** |
|
16 | + * @var string the name of the field that indicates |
|
17 | + * whether or not this is a system thing |
|
18 | + */ |
|
19 | + protected $_system_field_name = null; |
|
20 | 20 | |
21 | 21 | |
22 | - /** |
|
23 | - * Accepts the name of the field that indicates |
|
24 | - * whether or not an object is a "system" one or not |
|
25 | - * |
|
26 | - * @param string $system_field_name |
|
27 | - */ |
|
28 | - public function __construct($system_field_name) |
|
29 | - { |
|
30 | - $system_field_name = (string) $system_field_name; |
|
31 | - $this->_system_field_name = $system_field_name; |
|
32 | - } |
|
22 | + /** |
|
23 | + * Accepts the name of the field that indicates |
|
24 | + * whether or not an object is a "system" one or not |
|
25 | + * |
|
26 | + * @param string $system_field_name |
|
27 | + */ |
|
28 | + public function __construct($system_field_name) |
|
29 | + { |
|
30 | + $system_field_name = (string) $system_field_name; |
|
31 | + $this->_system_field_name = $system_field_name; |
|
32 | + } |
|
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * @return EE_Default_Where_Conditions[]|EE_Return_None_Where_Conditions[] |
|
37 | - * @throws EE_Error |
|
38 | - */ |
|
39 | - protected function _generate_restrictions() |
|
40 | - { |
|
41 | - // if there are no standard caps for this model, then for now |
|
42 | - // all we know if they need the default cap to access this |
|
43 | - if (! $this->model()->cap_slug()) { |
|
44 | - return [ |
|
45 | - EE_Restriction_Generator_Base::get_default_restrictions_cap( |
|
46 | - ) => new EE_Return_None_Where_Conditions(), |
|
47 | - ]; |
|
48 | - } |
|
49 | - $restrictions = [ |
|
50 | - EE_Restriction_Generator_Base::get_cap_name( |
|
51 | - $this->model(), |
|
52 | - $this->action() |
|
53 | - ) => new EE_Return_None_Where_Conditions(), |
|
54 | - ]; |
|
55 | - // there is no "ee_read_system_questions" cap; |
|
56 | - // in order to read reg form items you only need "ee_read_{model_name}". |
|
57 | - // there is also no "ee_delete_system_questions" cap. |
|
58 | - // But folks shouldn't be deleting system questions anyway |
|
59 | - if ($this->action() !== EEM_Base::caps_read) { |
|
60 | - $restrictions[ EE_Restriction_Generator_Base::get_cap_name( |
|
61 | - $this->model(), |
|
62 | - $this->action() . '_system' |
|
63 | - ) ] = new EE_Default_Where_Conditions( |
|
64 | - [ |
|
65 | - 'OR*no_' . |
|
66 | - EE_Restriction_Generator_Base::get_cap_name( |
|
67 | - $this->model(), |
|
68 | - $this->action() . '_system' |
|
69 | - ) => [ |
|
70 | - $this->_system_field_name => ['IN', ['', 0]], |
|
71 | - $this->_system_field_name . '*' => ['IS_NULL'], |
|
72 | - ], |
|
73 | - ] |
|
74 | - ); |
|
75 | - } |
|
76 | - return $restrictions; |
|
77 | - } |
|
35 | + /** |
|
36 | + * @return EE_Default_Where_Conditions[]|EE_Return_None_Where_Conditions[] |
|
37 | + * @throws EE_Error |
|
38 | + */ |
|
39 | + protected function _generate_restrictions() |
|
40 | + { |
|
41 | + // if there are no standard caps for this model, then for now |
|
42 | + // all we know if they need the default cap to access this |
|
43 | + if (! $this->model()->cap_slug()) { |
|
44 | + return [ |
|
45 | + EE_Restriction_Generator_Base::get_default_restrictions_cap( |
|
46 | + ) => new EE_Return_None_Where_Conditions(), |
|
47 | + ]; |
|
48 | + } |
|
49 | + $restrictions = [ |
|
50 | + EE_Restriction_Generator_Base::get_cap_name( |
|
51 | + $this->model(), |
|
52 | + $this->action() |
|
53 | + ) => new EE_Return_None_Where_Conditions(), |
|
54 | + ]; |
|
55 | + // there is no "ee_read_system_questions" cap; |
|
56 | + // in order to read reg form items you only need "ee_read_{model_name}". |
|
57 | + // there is also no "ee_delete_system_questions" cap. |
|
58 | + // But folks shouldn't be deleting system questions anyway |
|
59 | + if ($this->action() !== EEM_Base::caps_read) { |
|
60 | + $restrictions[ EE_Restriction_Generator_Base::get_cap_name( |
|
61 | + $this->model(), |
|
62 | + $this->action() . '_system' |
|
63 | + ) ] = new EE_Default_Where_Conditions( |
|
64 | + [ |
|
65 | + 'OR*no_' . |
|
66 | + EE_Restriction_Generator_Base::get_cap_name( |
|
67 | + $this->model(), |
|
68 | + $this->action() . '_system' |
|
69 | + ) => [ |
|
70 | + $this->_system_field_name => ['IN', ['', 0]], |
|
71 | + $this->_system_field_name . '*' => ['IS_NULL'], |
|
72 | + ], |
|
73 | + ] |
|
74 | + ); |
|
75 | + } |
|
76 | + return $restrictions; |
|
77 | + } |
|
78 | 78 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | esc_html_e( |
4 | - 'Bank is an offline payment method for accepting payments. Payments are processed manually by providing your registrants/attendees with information on how to pay with a bank transfer.', |
|
5 | - 'event_espresso' |
|
4 | + 'Bank is an offline payment method for accepting payments. Payments are processed manually by providing your registrants/attendees with information on how to pay with a bank transfer.', |
|
5 | + 'event_espresso' |
|
6 | 6 | ); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | esc_html_e( |
4 | - 'Check is an offline payment method for accepting payments. Payments are processed manually by providing your registrants/attendees with information on how to pay with a check.', |
|
5 | - 'event_espresso' |
|
4 | + 'Check is an offline payment method for accepting payments. Payments are processed manually by providing your registrants/attendees with information on how to pay with a check.', |
|
5 | + 'event_espresso' |
|
6 | 6 | ); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | '<br />' |
41 | 41 | ); |
42 | 42 | parent::__construct($pm_instance); |
43 | - $this->_default_button_url = $this->file_url() . 'lib/invoice-logo.png'; |
|
43 | + $this->_default_button_url = $this->file_url().'lib/invoice-logo.png'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $pdf_payee_input_name = 'pdf_payee_name'; |
67 | 67 | $confirmation_text_input_name = 'page_confirmation_text'; |
68 | - $form = new EE_Payment_Method_Form(array( |
|
68 | + $form = new EE_Payment_Method_Form(array( |
|
69 | 69 | // 'payment_method_type' => $this, |
70 | 70 | 'extra_meta_inputs' => array( |
71 | 71 | $pdf_payee_input_name => new EE_Text_Input(array( |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | )), |
80 | 80 | 'pdf_payee_address' => new EE_Text_Area_Input(array( |
81 | 81 | 'html_label_text' => sprintf(esc_html__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
82 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
82 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
83 | 83 | )), |
84 | 84 | 'pdf_instructions' => new EE_Text_Area_Input(array( |
85 | 85 | 'html_label_text' => sprintf(esc_html__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
86 | 86 | 'default' => esc_html__("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso'), |
87 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
87 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
88 | 88 | )), |
89 | 89 | 'pdf_logo_image' => new EE_Admin_File_Uploader_Input(array( |
90 | 90 | 'html_label_text' => sprintf(esc_html__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
@@ -94,24 +94,24 @@ discard block |
||
94 | 94 | $confirmation_text_input_name => new EE_Text_Area_Input(array( |
95 | 95 | 'html_label_text' => sprintf(esc_html__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
96 | 96 | 'default' => esc_html__("Payment must be received within 48 hours of event date. Details about where to send the payment are included on the invoice.", 'event_espresso'), |
97 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
97 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
98 | 98 | )), |
99 | 99 | 'page_extra_info' => new EE_Text_Area_Input(array( |
100 | 100 | 'html_label_text' => sprintf(esc_html__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
101 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
101 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
102 | 102 | )), |
103 | 103 | ), |
104 | 104 | 'include' => array( |
105 | - 'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency','PMD_order', |
|
106 | - $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
105 | + 'PMD_ID', 'PMD_name', 'PMD_desc', 'PMD_admin_name', 'PMD_admin_desc', 'PMD_type', 'PMD_slug', 'PMD_open_by_default', 'PMD_button_url', 'PMD_scope', 'Currency', 'PMD_order', |
|
106 | + $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image', |
|
107 | 107 | $confirmation_text_input_name, 'page_extra_info'), |
108 | 108 | )); |
109 | 109 | $form->add_subsections( |
110 | - array( 'header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
110 | + array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
111 | 111 | $pdf_payee_input_name |
112 | 112 | ); |
113 | 113 | $form->add_subsections( |
114 | - array( 'header2' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
114 | + array('header2' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
115 | 115 | $confirmation_text_input_name |
116 | 116 | ); |
117 | 117 | return $form; |
@@ -24,147 +24,147 @@ |
||
24 | 24 | */ |
25 | 25 | class EE_PMT_Invoice extends EE_PMT_Base |
26 | 26 | { |
27 | - /** |
|
28 | - * @param EE_Payment_Method|null $pm_instance |
|
29 | - * @throws ReflectionException |
|
30 | - * @throws EE_Error |
|
31 | - */ |
|
32 | - public function __construct($pm_instance = null) |
|
33 | - { |
|
34 | - $this->_pretty_name = esc_html__("Invoice", 'event_espresso'); |
|
35 | - $this->_default_description = sprintf( |
|
36 | - esc_html__('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.%sPlease note that event spaces will not be reserved until payment is received in full, and any remaining tickets could be sold to others in the meantime.', 'event_espresso'), |
|
37 | - '<br />' |
|
38 | - ); |
|
39 | - parent::__construct($pm_instance); |
|
40 | - $this->_default_button_url = $this->file_url() . 'lib/invoice-logo.png'; |
|
41 | - } |
|
27 | + /** |
|
28 | + * @param EE_Payment_Method|null $pm_instance |
|
29 | + * @throws ReflectionException |
|
30 | + * @throws EE_Error |
|
31 | + */ |
|
32 | + public function __construct($pm_instance = null) |
|
33 | + { |
|
34 | + $this->_pretty_name = esc_html__("Invoice", 'event_espresso'); |
|
35 | + $this->_default_description = sprintf( |
|
36 | + esc_html__('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.%sPlease note that event spaces will not be reserved until payment is received in full, and any remaining tickets could be sold to others in the meantime.', 'event_espresso'), |
|
37 | + '<br />' |
|
38 | + ); |
|
39 | + parent::__construct($pm_instance); |
|
40 | + $this->_default_button_url = $this->file_url() . 'lib/invoice-logo.png'; |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | - /** |
|
46 | - * Creates the billing form for this payment method type |
|
47 | - * @param EE_Transaction|null $transaction |
|
48 | - * @param array|null $extra_args |
|
49 | - * @return EE_Billing_Info_Form|null |
|
50 | - * @throws EE_Error |
|
51 | - * @throws ReflectionException |
|
52 | - */ |
|
53 | - public function generate_new_billing_form( |
|
54 | - $transaction = null, |
|
55 | - $extra_args = [] |
|
56 | - ) { |
|
57 | - return null; |
|
58 | - } |
|
45 | + /** |
|
46 | + * Creates the billing form for this payment method type |
|
47 | + * @param EE_Transaction|null $transaction |
|
48 | + * @param array|null $extra_args |
|
49 | + * @return EE_Billing_Info_Form|null |
|
50 | + * @throws EE_Error |
|
51 | + * @throws ReflectionException |
|
52 | + */ |
|
53 | + public function generate_new_billing_form( |
|
54 | + $transaction = null, |
|
55 | + $extra_args = [] |
|
56 | + ) { |
|
57 | + return null; |
|
58 | + } |
|
59 | 59 | |
60 | 60 | |
61 | 61 | |
62 | - /** |
|
63 | - * Gets the form for all the settings related to this payment method type |
|
64 | - * |
|
65 | - * @return EE_Payment_Method_Form |
|
66 | - * @throws EE_Error |
|
67 | - * @throws ReflectionException |
|
68 | - */ |
|
69 | - public function generate_new_settings_form() |
|
70 | - { |
|
71 | - $pdf_payee_input_name = 'pdf_payee_name'; |
|
72 | - $confirmation_text_input_name = 'page_confirmation_text'; |
|
73 | - $form = new EE_Payment_Method_Form(array( |
|
62 | + /** |
|
63 | + * Gets the form for all the settings related to this payment method type |
|
64 | + * |
|
65 | + * @return EE_Payment_Method_Form |
|
66 | + * @throws EE_Error |
|
67 | + * @throws ReflectionException |
|
68 | + */ |
|
69 | + public function generate_new_settings_form() |
|
70 | + { |
|
71 | + $pdf_payee_input_name = 'pdf_payee_name'; |
|
72 | + $confirmation_text_input_name = 'page_confirmation_text'; |
|
73 | + $form = new EE_Payment_Method_Form(array( |
|
74 | 74 | // 'payment_method_type' => $this, |
75 | - 'extra_meta_inputs' => array( |
|
76 | - $pdf_payee_input_name => new EE_Text_Input(array( |
|
77 | - 'html_label_text' => sprintf(esc_html__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()) |
|
78 | - )), |
|
79 | - 'pdf_payee_email' => new EE_Email_Input(array( |
|
80 | - 'html_label_text' => sprintf(esc_html__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()), |
|
81 | - )), |
|
82 | - 'pdf_payee_tax_number' => new EE_Text_Input(array( |
|
83 | - 'html_label_text' => sprintf(esc_html__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()), |
|
84 | - )), |
|
85 | - 'pdf_payee_address' => new EE_Text_Area_Input(array( |
|
86 | - 'html_label_text' => sprintf(esc_html__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
87 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
88 | - )), |
|
89 | - 'pdf_instructions' => new EE_Text_Area_Input(array( |
|
90 | - 'html_label_text' => sprintf(esc_html__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
91 | - 'default' => esc_html__("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso'), |
|
92 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
93 | - )), |
|
94 | - 'pdf_logo_image' => new EE_Admin_File_Uploader_Input(array( |
|
95 | - 'html_label_text' => sprintf(esc_html__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
96 | - 'default' => EE_Config::instance()->organization->logo_url, |
|
97 | - 'html_help_text' => esc_html__("(Logo for the top left of the invoice)", 'event_espresso'), |
|
98 | - )), |
|
99 | - $confirmation_text_input_name => new EE_Text_Area_Input(array( |
|
100 | - 'html_label_text' => sprintf(esc_html__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
101 | - 'default' => esc_html__("Payment must be received within 48 hours of event date. Details about where to send the payment are included on the invoice.", 'event_espresso'), |
|
102 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
103 | - )), |
|
104 | - 'page_extra_info' => new EE_Text_Area_Input(array( |
|
105 | - 'html_label_text' => sprintf(esc_html__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
106 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
107 | - )), |
|
108 | - ), |
|
109 | - 'include' => array( |
|
110 | - 'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency','PMD_order', |
|
111 | - $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
112 | - $confirmation_text_input_name, 'page_extra_info'), |
|
113 | - )); |
|
114 | - $form->add_subsections( |
|
115 | - array( 'header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
116 | - $pdf_payee_input_name |
|
117 | - ); |
|
118 | - $form->add_subsections( |
|
119 | - array( 'header2' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
120 | - $confirmation_text_input_name |
|
121 | - ); |
|
122 | - return $form; |
|
123 | - } |
|
75 | + 'extra_meta_inputs' => array( |
|
76 | + $pdf_payee_input_name => new EE_Text_Input(array( |
|
77 | + 'html_label_text' => sprintf(esc_html__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()) |
|
78 | + )), |
|
79 | + 'pdf_payee_email' => new EE_Email_Input(array( |
|
80 | + 'html_label_text' => sprintf(esc_html__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()), |
|
81 | + )), |
|
82 | + 'pdf_payee_tax_number' => new EE_Text_Input(array( |
|
83 | + 'html_label_text' => sprintf(esc_html__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()), |
|
84 | + )), |
|
85 | + 'pdf_payee_address' => new EE_Text_Area_Input(array( |
|
86 | + 'html_label_text' => sprintf(esc_html__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
87 | + 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
88 | + )), |
|
89 | + 'pdf_instructions' => new EE_Text_Area_Input(array( |
|
90 | + 'html_label_text' => sprintf(esc_html__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
91 | + 'default' => esc_html__("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso'), |
|
92 | + 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
93 | + )), |
|
94 | + 'pdf_logo_image' => new EE_Admin_File_Uploader_Input(array( |
|
95 | + 'html_label_text' => sprintf(esc_html__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
96 | + 'default' => EE_Config::instance()->organization->logo_url, |
|
97 | + 'html_help_text' => esc_html__("(Logo for the top left of the invoice)", 'event_espresso'), |
|
98 | + )), |
|
99 | + $confirmation_text_input_name => new EE_Text_Area_Input(array( |
|
100 | + 'html_label_text' => sprintf(esc_html__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
101 | + 'default' => esc_html__("Payment must be received within 48 hours of event date. Details about where to send the payment are included on the invoice.", 'event_espresso'), |
|
102 | + 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
103 | + )), |
|
104 | + 'page_extra_info' => new EE_Text_Area_Input(array( |
|
105 | + 'html_label_text' => sprintf(esc_html__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
106 | + 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
107 | + )), |
|
108 | + ), |
|
109 | + 'include' => array( |
|
110 | + 'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency','PMD_order', |
|
111 | + $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
112 | + $confirmation_text_input_name, 'page_extra_info'), |
|
113 | + )); |
|
114 | + $form->add_subsections( |
|
115 | + array( 'header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
116 | + $pdf_payee_input_name |
|
117 | + ); |
|
118 | + $form->add_subsections( |
|
119 | + array( 'header2' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
120 | + $confirmation_text_input_name |
|
121 | + ); |
|
122 | + return $form; |
|
123 | + } |
|
124 | 124 | |
125 | 125 | |
126 | 126 | |
127 | - /** |
|
128 | - * Adds the help tab |
|
129 | - * |
|
130 | - * @return array |
|
131 | - * @see EE_PMT_Base::help_tabs_config() |
|
132 | - */ |
|
133 | - public function help_tabs_config() |
|
134 | - { |
|
135 | - return array( |
|
136 | - $this->get_help_tab_name() => array( |
|
137 | - 'title' => esc_html__('Invoice Settings', 'event_espresso'), |
|
138 | - 'filename' => 'payment_methods_overview_invoice' |
|
139 | - ), |
|
140 | - ); |
|
141 | - } |
|
127 | + /** |
|
128 | + * Adds the help tab |
|
129 | + * |
|
130 | + * @return array |
|
131 | + * @see EE_PMT_Base::help_tabs_config() |
|
132 | + */ |
|
133 | + public function help_tabs_config() |
|
134 | + { |
|
135 | + return array( |
|
136 | + $this->get_help_tab_name() => array( |
|
137 | + 'title' => esc_html__('Invoice Settings', 'event_espresso'), |
|
138 | + 'filename' => 'payment_methods_overview_invoice' |
|
139 | + ), |
|
140 | + ); |
|
141 | + } |
|
142 | 142 | |
143 | 143 | |
144 | - /** |
|
145 | - * For adding any html output above the payment overview. |
|
146 | - * Many gateways won't want ot display anything, so this function just returns an empty string. |
|
147 | - * Other gateways may want to override this, such as offline gateways. |
|
148 | - * |
|
149 | - * @param EE_Payment $payment |
|
150 | - * @return string |
|
151 | - * @throws EE_Error |
|
152 | - * @throws ReflectionException |
|
153 | - */ |
|
154 | - public function payment_overview_content($payment) |
|
155 | - { |
|
156 | - return EEH_Template::locate_template( |
|
157 | - 'payment_methods/Invoice/templates/invoice_payment_details_content.template.php', |
|
158 | - array_merge( |
|
159 | - array( |
|
160 | - 'payment_method' => $this->_pm_instance, |
|
161 | - 'payment' => $payment, |
|
162 | - 'page_confirmation_text' => '', |
|
163 | - 'page_extra_info' => '', |
|
164 | - 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html') |
|
165 | - ), |
|
166 | - $this->_pm_instance->all_extra_meta_array() |
|
167 | - ) |
|
168 | - ); |
|
169 | - } |
|
144 | + /** |
|
145 | + * For adding any html output above the payment overview. |
|
146 | + * Many gateways won't want ot display anything, so this function just returns an empty string. |
|
147 | + * Other gateways may want to override this, such as offline gateways. |
|
148 | + * |
|
149 | + * @param EE_Payment $payment |
|
150 | + * @return string |
|
151 | + * @throws EE_Error |
|
152 | + * @throws ReflectionException |
|
153 | + */ |
|
154 | + public function payment_overview_content($payment) |
|
155 | + { |
|
156 | + return EEH_Template::locate_template( |
|
157 | + 'payment_methods/Invoice/templates/invoice_payment_details_content.template.php', |
|
158 | + array_merge( |
|
159 | + array( |
|
160 | + 'payment_method' => $this->_pm_instance, |
|
161 | + 'payment' => $payment, |
|
162 | + 'page_confirmation_text' => '', |
|
163 | + 'page_extra_info' => '', |
|
164 | + 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html') |
|
165 | + ), |
|
166 | + $this->_pm_instance->all_extra_meta_array() |
|
167 | + ) |
|
168 | + ); |
|
169 | + } |
|
170 | 170 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | esc_html_e( |
4 | - 'Invoice is an offline payment method for accepting payments. Payments are processed manually by providing your registrants/attendees with information on how to pay their invoice.', |
|
5 | - 'event_espresso' |
|
4 | + 'Invoice is an offline payment method for accepting payments. Payments are processed manually by providing your registrants/attendees with information on how to pay their invoice.', |
|
5 | + 'event_espresso' |
|
6 | 6 | ); |