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

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

288 lines 9.5 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 OngoingClientFeedbackFormTemplate
8 {
9 /**
10 * Get the Ongoing Client Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'ongoing_client_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['ongoing_client_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['ongoing_client_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'client-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'ongoing-client-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['ongoing_client_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getLengthOfCollaborationRadioField(),
32 self::getOverallSatisfactionRatingField(),
33 self::getCommunicationResponsivenessRatingField(),
34 self::getServicesUsedCheckboxField(),
35 self::getSuggestionsForImprovementParagraphField(),
36 self::getPhoneNumberField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Length of collaboration radio field
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getLengthOfCollaborationRadioField(): array
49 {
50 return [[
51 'id' => 5,
52 'fieldIndex' => 1,
53 'type' => 'radio',
54 'label' => BackendStrings::getTemplateStrings()['length_of_collaboration'],
55 'required' => true,
56 'parentId' => null,
57 'defaultValue' => '',
58 'placeholder' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'id' => 1,
63 'label' => BackendStrings::getTemplateStrings()['less_than_3_months'],
64 'value' => 'less_than_3_months',
65 'isDefault' => false,
66 'position' => 1
67 ],
68 [
69 'id' => 2,
70 'label' => BackendStrings::getTemplateStrings()['three_to_six_months'],
71 'value' => '3_6_months',
72 'isDefault' => false,
73 'position' => 2
74 ],
75 [
76 'id' => 3,
77 'label' => BackendStrings::getTemplateStrings()['six_to_twelve_months'],
78 'value' => '6_12_months',
79 'isDefault' => false,
80 'position' => 3
81 ],
82 [
83 'id' => 4,
84 'label' => BackendStrings::getTemplateStrings()['more_than_1_year'],
85 'value' => 'more_than_1_year',
86 'isDefault' => false,
87 'position' => 4
88 ],
89 ]
90 ]];
91 }
92
93 /**
94 * Overall satisfaction rating field
95 *
96 * @return array<int, array<string, mixed>>
97 */
98 private static function getOverallSatisfactionRatingField(): array
99 {
100 return [[
101 'id' => 6,
102 'fieldIndex' => 2,
103 'type' => 'rating',
104 'label' => BackendStrings::getTemplateStrings()['overall_satisfaction'],
105 'required' => true,
106 'defaultValue' => '',
107 'placeholder' => '',
108 'position' => 2,
109 'labelPosition' => 'default',
110 'ratingIcon' => 'star',
111 'fieldOptions' => self::getStandardRatingOptions(5),
112 'showValues' => false,
113 'showRatingText' => true,
114 ]];
115 }
116
117 /**
118 * Communication & responsiveness rating field
119 *
120 * @return array<int, array<string, mixed>>
121 */
122 private static function getCommunicationResponsivenessRatingField(): array
123 {
124 return [[
125 'id' => 7,
126 'fieldIndex' => 3,
127 'type' => 'rating',
128 'label' => BackendStrings::getTemplateStrings()['communication_responsiveness'],
129 'required' => true,
130 'defaultValue' => '',
131 'placeholder' => '',
132 'position' => 3,
133 'labelPosition' => 'default',
134 'ratingIcon' => 'star',
135 'fieldOptions' => self::getStandardRatingOptions(10),
136 'showValues' => false,
137 'showRatingText' => true,
138 ]];
139 }
140
141 /**
142 * Services used checkbox field
143 *
144 * @return array<int, array<string, mixed>>
145 */
146 private static function getServicesUsedCheckboxField(): array
147 {
148 return [[
149 'id' => 13,
150 'fieldIndex' => 4,
151 'type' => 'checkbox',
152 'label' => BackendStrings::getTemplateStrings()['services_used'],
153 'required' => false,
154 'parentId' => null,
155 'defaultValue' => '',
156 'placeholder' => '',
157 'position' => 4,
158 'fieldOptions' => [
159 [
160 'id' => 8,
161 'label' => BackendStrings::getTemplateStrings()['strategy_planning'],
162 'value' => 'strategy_planning',
163 'isDefault' => false,
164 'position' => 1
165 ],
166 [
167 'id' => 9,
168 'label' => BackendStrings::getTemplateStrings()['ongoing_support'],
169 'value' => 'ongoing_support',
170 'isDefault' => false,
171 'position' => 2
172 ],
173 [
174 'id' => 10,
175 'label' => BackendStrings::getTemplateStrings()['maintenance'],
176 'value' => 'maintenance',
177 'isDefault' => false,
178 'position' => 3
179 ],
180 [
181 'id' => 11,
182 'label' => BackendStrings::getTemplateStrings()['consulting'],
183 'value' => 'consulting',
184 'isDefault' => false,
185 'position' => 4
186 ],
187 [
188 'id' => 12,
189 'label' => BackendStrings::getTemplateStrings()['reporting_analytics'],
190 'value' => 'reporting_analytics',
191 'isDefault' => false,
192 'position' => 5
193 ],
194 ]
195 ]];
196 }
197
198 /**
199 * Suggestions for improvement paragraph field
200 *
201 * @return array<int, array<string, mixed>>
202 */
203 private static function getSuggestionsForImprovementParagraphField(): array
204 {
205 return [[
206 'id' => 14,
207 'fieldIndex' => 5,
208 'type' => 'textarea',
209 'label' => BackendStrings::getTemplateStrings()['suggestions_for_improvement'],
210 'placeholder' => BackendStrings::getTemplateStrings()['suggestions_for_improvement_placeholder'],
211 'required' => false,
212 'parentId' => null,
213 'defaultValue' => '',
214 'position' => 5,
215 'labelPosition' => 'default',
216 ]];
217 }
218
219 /**
220 * Phone number field
221 *
222 * @return array<int, array<string, mixed>>
223 */
224 private static function getPhoneNumberField(): array
225 {
226 return [[
227 'id' => 15,
228 'fieldIndex' => 6,
229 'type' => 'phone',
230 'label' => BackendStrings::getTemplateStrings()['phone_number'],
231 'placeholder' => '+1 (_) _-_',
232 'description' => BackendStrings::getTemplateStrings()['phone_follow_up_description'],
233 'required' => false,
234 'parentId' => null,
235 'defaultValue' => '',
236 'position' => 6,
237 'labelPosition' => 'default',
238 'phoneAutoDetect' => true,
239 ]];
240 }
241
242 /**
243 * Standard rating options
244 *
245 * @return array<int, array<string, mixed>>
246 */
247 private static function getStandardRatingOptions(int $startId): array
248 {
249 return [
250 [
251 'id' => $startId,
252 'label' => BackendStrings::getNewFormStrings()['good'],
253 'value' => '1',
254 'isDefault' => false,
255 'position' => 1
256 ],
257 [
258 'id' => $startId + 1,
259 'label' => BackendStrings::getNewFormStrings()['nice'],
260 'value' => '2',
261 'isDefault' => false,
262 'position' => 2
263 ],
264 [
265 'id' => $startId + 2,
266 'label' => BackendStrings::getNewFormStrings()['very_good'],
267 'value' => '3',
268 'isDefault' => false,
269 'position' => 3
270 ],
271 [
272 'id' => $startId + 3,
273 'label' => BackendStrings::getNewFormStrings()['awesome'],
274 'value' => '4',
275 'isDefault' => false,
276 'position' => 4
277 ],
278 [
279 'id' => $startId + 4,
280 'label' => BackendStrings::getNewFormStrings()['amazing'],
281 'value' => '5',
282 'isDefault' => false,
283 'position' => 5
284 ],
285 ];
286 }
287 }
288