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

EmployeeTrainingFeedbackFormTemplate.php in The Innovative Form Builder – IvyForms 1.0, at backend/src/Services/Template/EmployeeTrainingFeedbackFormTemplate.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 EmployeeTrainingFeedbackFormTemplate
8 {
9 /**
10 * Get the Employee Training Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'employee_training_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['employee_training_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['employee_training_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'training-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'employee-training-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['employee_training_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getDepartmentField(),
32 self::getTrainingRelevanceField(),
33 self::getTrainingUsefulnessRatingField(),
34 self::getApplicabilityRatingField(),
35 self::getSkillsImprovedField(),
36 self::getFutureTrainingSuggestionsField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Department dropdown
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getDepartmentField(): array
49 {
50 return [[
51 'id' => 7,
52 'fieldIndex' => 1,
53 'type' => 'select',
54 'label' => BackendStrings::getTemplateStrings()['department'],
55 'placeholder' => BackendStrings::getTemplateStrings()['select_department'],
56 'required' => true,
57 'parentId' => null,
58 'defaultValue' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'id' => 1,
63 'label' => BackendStrings::getTemplateStrings()['engineering'],
64 'value' => 'engineering',
65 'isDefault' => false,
66 'position' => 1
67 ],
68 [
69 'id' => 2,
70 'label' => BackendStrings::getTemplateStrings()['sales'],
71 'value' => 'sales',
72 'isDefault' => false,
73 'position' => 2
74 ],
75 [
76 'id' => 3,
77 'label' => BackendStrings::getTemplateStrings()['marketing'],
78 'value' => 'marketing',
79 'isDefault' => false,
80 'position' => 3
81 ],
82 [
83 'id' => 4,
84 'label' => BackendStrings::getTemplateStrings()['hr'],
85 'value' => 'hr',
86 'isDefault' => false,
87 'position' => 4
88 ],
89 [
90 'id' => 5,
91 'label' => BackendStrings::getTemplateStrings()['operations'],
92 'value' => 'operations',
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 * Training relevance radio
109 *
110 * @return array<int, array<string, mixed>>
111 */
112 private static function getTrainingRelevanceField(): array
113 {
114 return [[
115 'id' => 12,
116 'fieldIndex' => 2,
117 'type' => 'radio',
118 'label' => BackendStrings::getTemplateStrings()['training_relevance_role'],
119 'required' => true,
120 'parentId' => null,
121 'defaultValue' => '',
122 'placeholder' => '',
123 'position' => 2,
124 'fieldOptions' => [
125 [
126 'id' => 8,
127 'label' => BackendStrings::getTemplateStrings()['highly_relevant'],
128 'value' => 'highly_relevant',
129 'isDefault' => false,
130 'position' => 1
131 ],
132 [
133 'id' => 9,
134 'label' => BackendStrings::getTemplateStrings()['somewhat_relevant'],
135 'value' => 'somewhat_relevant',
136 'isDefault' => false,
137 'position' => 2
138 ],
139 [
140 'id' => 10,
141 'label' => BackendStrings::getTemplateStrings()['slightly_relevant'],
142 'value' => 'slightly_relevant',
143 'isDefault' => false,
144 'position' => 3
145 ],
146 [
147 'id' => 11,
148 'label' => BackendStrings::getTemplateStrings()['not_relevant'],
149 'value' => 'not_relevant',
150 'isDefault' => false,
151 'position' => 4
152 ],
153 ]
154 ]];
155 }
156
157 /**
158 * Training usefulness rating
159 *
160 * @return array<int, array<string, mixed>>
161 */
162 private static function getTrainingUsefulnessRatingField(): array
163 {
164 return [[
165 'id' => 13,
166 'fieldIndex' => 3,
167 'type' => 'rating',
168 'label' => BackendStrings::getTemplateStrings()['training_usefulness'],
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' => false,
178 ]];
179 }
180
181 /**
182 * Applicability rating
183 *
184 * @return array<int, array<string, mixed>>
185 */
186 private static function getApplicabilityRatingField(): array
187 {
188 return [[
189 'id' => 14,
190 'fieldIndex' => 4,
191 'type' => 'rating',
192 'label' => BackendStrings::getTemplateStrings()['applicability_daily_work'],
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' => false,
202 ]];
203 }
204
205 /**
206 * Skills improved checkbox
207 *
208 * @return array<int, array<string, mixed>>
209 */
210 private static function getSkillsImprovedField(): array
211 {
212 return [[
213 'id' => 20,
214 'fieldIndex' => 5,
215 'type' => 'checkbox',
216 'label' => BackendStrings::getTemplateStrings()['skills_improved'],
217 'required' => false,
218 'parentId' => null,
219 'defaultValue' => '',
220 'placeholder' => '',
221 'position' => 5,
222 'fieldOptions' => [
223 [
224 'id' => 15,
225 'label' => BackendStrings::getTemplateStrings()['technical_skills'],
226 'value' => 'technical_skills',
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()['leadership'],
240 'value' => 'leadership',
241 'isDefault' => false,
242 'position' => 3
243 ],
244 [
245 'id' => 18,
246 'label' => BackendStrings::getTemplateStrings()['problem_solving'],
247 'value' => 'problem_solving',
248 'isDefault' => false,
249 'position' => 4
250 ],
251 [
252 'id' => 19,
253 'label' => BackendStrings::getTemplateStrings()['time_management'],
254 'value' => 'time_management',
255 'isDefault' => false,
256 'position' => 5
257 ],
258 ]
259 ]];
260 }
261
262 /**
263 * Suggestions for future trainings textarea
264 *
265 * @return array<int, array<string, mixed>>
266 */
267 private static function getFutureTrainingSuggestionsField(): array
268 {
269 return [[
270 'id' => 21,
271 'fieldIndex' => 6,
272 'type' => 'textarea',
273 'label' => BackendStrings::getTemplateStrings()['suggestions_for_future_trainings'],
274 'placeholder' => BackendStrings::getTemplateStrings()['suggestions_for_future_trainings_placeholder'],
275 'required' => false,
276 'parentId' => null,
277 'defaultValue' => '',
278 'position' => 6,
279 'rows' => 3,
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