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 / ServiceSpecificClientFeedbackFormTemplate.php

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

329 lines 10.9 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 ServiceSpecificClientFeedbackFormTemplate
8 {
9 /**
10 * Get the Service-Specific Client Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'service_specific_client_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['service_specific_client_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['service_specific_client_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'client-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'service-specific-client-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['service_specific_client_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getServiceReceivedDropdownField(),
32 self::getServiceMeetNeedsRadioField(),
33 self::getServiceQualityRatingField(),
34 self::getValueForMoneyRatingField(),
35 self::getServiceStrengthsCheckboxField(),
36 self::getAdditionalCommentsParagraphField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Service received dropdown field
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getServiceReceivedDropdownField(): array
49 {
50 return [[
51 'id' => 7,
52 'fieldIndex' => 1,
53 'type' => 'select',
54 'label' => BackendStrings::getTemplateStrings()['service_received'],
55 'placeholder' => BackendStrings::getTemplateStrings()['select_service'],
56 'required' => true,
57 'parentId' => null,
58 'defaultValue' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'id' => 1,
63 'label' => BackendStrings::getTemplateStrings()['consulting'],
64 'value' => 'consulting',
65 'isDefault' => false,
66 'position' => 1
67 ],
68 [
69 'id' => 2,
70 'label' => BackendStrings::getTemplateStrings()['design'],
71 'value' => 'design',
72 'isDefault' => false,
73 'position' => 2
74 ],
75 [
76 'id' => 3,
77 'label' => BackendStrings::getTemplateStrings()['development'],
78 'value' => 'development',
79 'isDefault' => false,
80 'position' => 3
81 ],
82 [
83 'id' => 4,
84 'label' => BackendStrings::getTemplateStrings()['marketing'],
85 'value' => 'marketing',
86 'isDefault' => false,
87 'position' => 4
88 ],
89 [
90 'id' => 5,
91 'label' => BackendStrings::getTemplateStrings()['support'],
92 'value' => 'support',
93 'isDefault' => false,
94 'position' => 5
95 ],
96 [
97 'id' => 6,
98 'label' => BackendStrings::getTemplateStrings()['other'],
99 'value' => 'other',
100 'isDefault' => false,
101 'position' => 6
102 ],
103 ]
104 ]];
105 }
106
107 /**
108 * Service meet needs radio field
109 *
110 * @return array<int, array<string, mixed>>
111 */
112 private static function getServiceMeetNeedsRadioField(): array
113 {
114 return [[
115 'id' => 12,
116 'fieldIndex' => 2,
117 'type' => 'radio',
118 'label' => BackendStrings::getTemplateStrings()['did_service_meet_needs'],
119 'required' => true,
120 'parentId' => null,
121 'defaultValue' => '',
122 'placeholder' => '',
123 'position' => 2,
124 'fieldOptions' => [
125 [
126 'id' => 8,
127 'label' => BackendStrings::getTemplateStrings()['fully'],
128 'value' => 'fully',
129 'isDefault' => false,
130 'position' => 1
131 ],
132 [
133 'id' => 9,
134 'label' => BackendStrings::getTemplateStrings()['mostly'],
135 'value' => 'mostly',
136 'isDefault' => false,
137 'position' => 2
138 ],
139 [
140 'id' => 10,
141 'label' => BackendStrings::getTemplateStrings()['partially'],
142 'value' => 'partially',
143 'isDefault' => false,
144 'position' => 3
145 ],
146 [
147 'id' => 11,
148 'label' => BackendStrings::getTemplateStrings()['not_at_all'],
149 'value' => 'not_at_all',
150 'isDefault' => false,
151 'position' => 4
152 ],
153 ]
154 ]];
155 }
156
157 /**
158 * Service quality rating field
159 *
160 * @return array<int, array<string, mixed>>
161 */
162 private static function getServiceQualityRatingField(): array
163 {
164 return [[
165 'id' => 13,
166 'fieldIndex' => 3,
167 'type' => 'rating',
168 'label' => BackendStrings::getTemplateStrings()['service_quality'],
169 'required' => true,
170 'defaultValue' => '',
171 'placeholder' => '',
172 'position' => 3,
173 'labelPosition' => 'default',
174 'ratingIcon' => 'star',
175 'fieldOptions' => self::getStandardRatingOptions(11),
176 'showValues' => false,
177 'showRatingText' => true,
178 ]];
179 }
180
181 /**
182 * Value for money rating field
183 *
184 * @return array<int, array<string, mixed>>
185 */
186 private static function getValueForMoneyRatingField(): array
187 {
188 return [[
189 'id' => 14,
190 'fieldIndex' => 4,
191 'type' => 'rating',
192 'label' => BackendStrings::getTemplateStrings()['value_for_money'],
193 'required' => true,
194 'defaultValue' => '',
195 'placeholder' => '',
196 'position' => 4,
197 'labelPosition' => 'default',
198 'ratingIcon' => 'star',
199 'fieldOptions' => self::getStandardRatingOptions(16),
200 'showValues' => false,
201 'showRatingText' => true,
202 ]];
203 }
204
205 /**
206 * Service strengths checkbox field
207 *
208 * @return array<int, array<string, mixed>>
209 */
210 private static function getServiceStrengthsCheckboxField(): array
211 {
212 return [[
213 'id' => 20,
214 'fieldIndex' => 5,
215 'type' => 'checkbox',
216 'label' => BackendStrings::getTemplateStrings()['strengths_of_service'],
217 'required' => false,
218 'parentId' => null,
219 'defaultValue' => '',
220 'placeholder' => '',
221 'position' => 5,
222 'fieldOptions' => [
223 [
224 'id' => 15,
225 'label' => BackendStrings::getTemplateStrings()['expertise'],
226 'value' => 'expertise',
227 'isDefault' => false,
228 'position' => 1
229 ],
230 [
231 'id' => 16,
232 'label' => BackendStrings::getTemplateStrings()['communication'],
233 'value' => 'communication',
234 'isDefault' => false,
235 'position' => 2
236 ],
237 [
238 'id' => 17,
239 'label' => BackendStrings::getTemplateStrings()['speed'],
240 'value' => 'speed',
241 'isDefault' => false,
242 'position' => 3
243 ],
244 [
245 'id' => 18,
246 'label' => BackendStrings::getTemplateStrings()['flexibility'],
247 'value' => 'flexibility',
248 'isDefault' => false,
249 'position' => 4
250 ],
251 [
252 'id' => 19,
253 'label' => BackendStrings::getTemplateStrings()['results'],
254 'value' => 'results',
255 'isDefault' => false,
256 'position' => 5
257 ],
258 ]
259 ]];
260 }
261
262 /**
263 * Additional comments paragraph field
264 *
265 * @return array<int, array<string, mixed>>
266 */
267 private static function getAdditionalCommentsParagraphField(): array
268 {
269 return [[
270 'id' => 21,
271 'fieldIndex' => 6,
272 'type' => 'textarea',
273 'label' => BackendStrings::getTemplateStrings()['additional_comments'],
274 'placeholder' => BackendStrings::getTemplateStrings()['additional_comments_placeholder'],
275 'required' => false,
276 'parentId' => null,
277 'defaultValue' => '',
278 'position' => 6,
279 'labelPosition' => 'default',
280 ]];
281 }
282
283 /**
284 * Standard rating options
285 *
286 * @return array<int, array<string, mixed>>
287 */
288 private static function getStandardRatingOptions(int $startId): array
289 {
290 return [
291 [
292 'id' => $startId,
293 'label' => BackendStrings::getNewFormStrings()['good'],
294 'value' => '1',
295 'isDefault' => false,
296 'position' => 1
297 ],
298 [
299 'id' => $startId + 1,
300 'label' => BackendStrings::getNewFormStrings()['nice'],
301 'value' => '2',
302 'isDefault' => false,
303 'position' => 2
304 ],
305 [
306 'id' => $startId + 2,
307 'label' => BackendStrings::getNewFormStrings()['very_good'],
308 'value' => '3',
309 'isDefault' => false,
310 'position' => 3
311 ],
312 [
313 'id' => $startId + 3,
314 'label' => BackendStrings::getNewFormStrings()['awesome'],
315 'value' => '4',
316 'isDefault' => false,
317 'position' => 4
318 ],
319 [
320 'id' => $startId + 4,
321 'label' => BackendStrings::getNewFormStrings()['amazing'],
322 'value' => '5',
323 'isDefault' => false,
324 'position' => 5
325 ],
326 ];
327 }
328 }
329