PluginProbe
The Innovative Form Builder – IvyForms / 1.0
The Innovative Form Builder – IvyForms v1.0
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Template / CustomerSupportFeedbackFormTemplate.php

CustomerSupportFeedbackFormTemplate.php in The Innovative Form Builder – IvyForms 1.0, at backend/src/Services/Template/CustomerSupportFeedbackFormTemplate.php

272 lines 8.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Template;
4
5 use IvyForms\Services\Translations\BackendStrings;
6
7 class CustomerSupportFeedbackFormTemplate
8 {
9 /**
10 * Get the Customer Support Feedback template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'customer_support_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['customer_support_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['customer_support_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'customer-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'customer-support-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['customer_support_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getIssueResolvedField(),
32 self::getAgentHelpfulnessRatingField(),
33 self::getResponseTimeRatingField(),
34 self::getImprovementsCheckboxField(),
35 self::getAdditionalCommentsTextareaField(),
36 self::getFollowUpEmailField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Was your issue resolved? (radio, required)
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getIssueResolvedField(): array
49 {
50 return [[
51 'id' => 4,
52 'fieldIndex' => 1,
53 'type' => 'radio',
54 'label' => BackendStrings::getTemplateStrings()['was_issue_resolved'],
55 'required' => true,
56 'parentId' => null,
57 'defaultValue' => '',
58 'placeholder' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'label' => BackendStrings::getTemplateStrings()['yes_fully'],
63 'value' => 'yes_fully',
64 'position' => 1,
65 ],
66 [
67 'label' => BackendStrings::getTemplateStrings()['partially'],
68 'value' => 'partially',
69 'position' => 2,
70 ],
71 [
72 'label' => BackendStrings::getComponentsStrings()['no'],
73 'value' => 'no',
74 'position' => 3,
75 ],
76 ]
77 ]];
78 }
79
80 /**
81 * Support agent helpfulness rating (required)
82 *
83 * @return array<int, array<string, mixed>>
84 */
85 private static function getAgentHelpfulnessRatingField(): array
86 {
87 return [[
88 'id' => 5,
89 'fieldIndex' => 2,
90 'type' => 'rating',
91 'label' => BackendStrings::getTemplateStrings()['support_agent_helpfulness'],
92 'required' => true,
93 'defaultValue' => '',
94 'placeholder' => '',
95 'position' => 2,
96 'labelPosition' => 'default',
97 'ratingIcon' => 'star',
98 'fieldOptions' => self::getStandardRatingOptions(1),
99 'showValues' => false,
100 'showRatingText' => true,
101 ]];
102 }
103
104 /**
105 * Response time rating (required)
106 *
107 * @return array<int, array<string, mixed>>
108 */
109 private static function getResponseTimeRatingField(): array
110 {
111 return [[
112 'id' => 6,
113 'fieldIndex' => 3,
114 'type' => 'rating',
115 'label' => BackendStrings::getTemplateStrings()['response_time'],
116 'required' => true,
117 'defaultValue' => '',
118 'placeholder' => '',
119 'position' => 3,
120 'labelPosition' => 'default',
121 'ratingIcon' => 'star',
122 'fieldOptions' => self::getStandardRatingOptions(6),
123 'showValues' => false,
124 'showRatingText' => true,
125 ]];
126 }
127
128 /**
129 * What could be improved? (checkbox, optional)
130 *
131 * @return array<int, array<string, mixed>>
132 */
133 private static function getImprovementsCheckboxField(): array
134 {
135 return [[
136 'id' => 12,
137 'fieldIndex' => 4,
138 'type' => 'checkbox',
139 'label' => BackendStrings::getTemplateStrings()['what_could_be_improved'],
140 'required' => false,
141 'parentId' => null,
142 'defaultValue' => '',
143 'placeholder' => '',
144 'position' => 4,
145 'fieldOptions' => [
146 [
147 'id' => 7,
148 'label' => BackendStrings::getTemplateStrings()['faster_response'],
149 'value' => 'faster_response',
150 'isDefault' => false,
151 'position' => 1,
152 ],
153 [
154 'id' => 8,
155 'label' => BackendStrings::getTemplateStrings()['clearer_communication'],
156 'value' => 'clearer_communication',
157 'isDefault' => false,
158 'position' => 2,
159 ],
160 [
161 'id' => 9,
162 'label' => BackendStrings::getTemplateStrings()['better_problem_resolution'],
163 'value' => 'better_problem_resolution',
164 'isDefault' => false,
165 'position' => 3,
166 ],
167 [
168 'id' => 10,
169 'label' => BackendStrings::getTemplateStrings()['friendliness'],
170 'value' => 'friendliness',
171 'isDefault' => false,
172 'position' => 4,
173 ],
174 [
175 'id' => 11,
176 'label' => BackendStrings::getTemplateStrings()['no_improvements_needed'],
177 'value' => 'no_improvements_needed',
178 'isDefault' => false,
179 'position' => 5,
180 ],
181 ]
182 ]];
183 }
184
185 /**
186 * Additional comments (textarea, optional)
187 *
188 * @return array<int, array<string, mixed>>
189 */
190 private static function getAdditionalCommentsTextareaField(): array
191 {
192 return [[
193 'id' => 13,
194 'fieldIndex' => 5,
195 'type' => 'textarea',
196 'label' => BackendStrings::getTemplateStrings()['additional_comments'],
197 'placeholder' => BackendStrings::getTemplateStrings()['additional_comments_placeholder'],
198 'required' => false,
199 'parentId' => null,
200 'defaultValue' => '',
201 'position' => 5,
202 'labelPosition' => 'default',
203 ]];
204 }
205
206 /**
207 * Follow-up email (email, optional)
208 *
209 * @return array<int, array<string, mixed>>
210 */
211 private static function getFollowUpEmailField(): array
212 {
213 return [[
214 'id' => 14,
215 'fieldIndex' => 6,
216 'type' => 'email',
217 'label' => BackendStrings::getTemplateStrings()['follow_up_email'],
218 'placeholder' => BackendStrings::getTemplateStrings()['follow_up_email_placeholder'],
219 'required' => false,
220 'parentId' => null,
221 'defaultValue' => '',
222 'position' => 6,
223 ]];
224 }
225
226 /**
227 * Standard rating options (1-5)
228 *
229 * @return array<int, array<string, mixed>>
230 */
231 private static function getStandardRatingOptions(int $startId): array
232 {
233 return [
234 [
235 'id' => $startId,
236 'label' => BackendStrings::getNewFormStrings()['good'],
237 'value' => '1',
238 'isDefault' => false,
239 'position' => 1
240 ],
241 [
242 'id' => $startId + 1,
243 'label' => BackendStrings::getNewFormStrings()['nice'],
244 'value' => '2',
245 'isDefault' => false,
246 'position' => 2
247 ],
248 [
249 'id' => $startId + 2,
250 'label' => BackendStrings::getNewFormStrings()['very_good'],
251 'value' => '3',
252 'isDefault' => false,
253 'position' => 3
254 ],
255 [
256 'id' => $startId + 3,
257 'label' => BackendStrings::getNewFormStrings()['awesome'],
258 'value' => '4',
259 'isDefault' => false,
260 'position' => 4
261 ],
262 [
263 'id' => $startId + 4,
264 'label' => BackendStrings::getNewFormStrings()['amazing'],
265 'value' => '5',
266 'isDefault' => false,
267 'position' => 5
268 ],
269 ];
270 }
271 }
272