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

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

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