PluginProbe
The Innovative Form Builder – IvyForms / 0.9
The Innovative Form Builder – IvyForms v0.9
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 0.9, at backend/src/Services/Template/EmployeeTrainingFeedbackFormTemplate.php

334 lines 11.0 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 // phpcs:disable PSR1.Files.SideEffects
6 if (!defined('ABSPATH')) {
7 exit; // Exit if accessed directly
8 }
9
10 use IvyForms\Services\Translations\BackendStrings;
11
12 class EmployeeTrainingFeedbackFormTemplate
13 {
14 /**
15 * Get the Employee Training Feedback Form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'employee_training_feedback_form',
23 'name' => BackendStrings::getTemplateStrings()['employee_training_feedback_form'],
24 'description' => BackendStrings::getTemplateStrings()['employee_training_feedback_form_desc'],
25 'category' => 'feedback-forms',
26 'subcategory' => 'training-feedback-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'employee-training-feedback-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['employee_training_feedback_form'],
31 'published' => 1,
32 'showTitle' => 1,
33 'storeEntries' => 1,
34 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
35 'fields' => array_merge(
36 self::getDepartmentField(),
37 self::getTrainingRelevanceField(),
38 self::getTrainingUsefulnessRatingField(),
39 self::getApplicabilityRatingField(),
40 self::getSkillsImprovedField(),
41 self::getFutureTrainingSuggestionsField()
42 ),
43 'settings' => []
44 ]
45 ];
46 }
47
48 /**
49 * Department dropdown
50 *
51 * @return array<int, array<string, mixed>>
52 */
53 private static function getDepartmentField(): array
54 {
55 return [[
56 'id' => 7,
57 'fieldIndex' => 1,
58 'type' => 'select',
59 'label' => BackendStrings::getTemplateStrings()['department'],
60 'placeholder' => BackendStrings::getTemplateStrings()['select_department'],
61 'required' => true,
62 'parentId' => null,
63 'defaultValue' => '',
64 'position' => 1,
65 'fieldOptions' => [
66 [
67 'id' => 1,
68 'label' => BackendStrings::getTemplateStrings()['engineering'],
69 'value' => 'engineering',
70 'isDefault' => false,
71 'position' => 1
72 ],
73 [
74 'id' => 2,
75 'label' => BackendStrings::getTemplateStrings()['sales'],
76 'value' => 'sales',
77 'isDefault' => false,
78 'position' => 2
79 ],
80 [
81 'id' => 3,
82 'label' => BackendStrings::getTemplateStrings()['marketing'],
83 'value' => 'marketing',
84 'isDefault' => false,
85 'position' => 3
86 ],
87 [
88 'id' => 4,
89 'label' => BackendStrings::getTemplateStrings()['hr'],
90 'value' => 'hr',
91 'isDefault' => false,
92 'position' => 4
93 ],
94 [
95 'id' => 5,
96 'label' => BackendStrings::getTemplateStrings()['operations'],
97 'value' => 'operations',
98 'isDefault' => false,
99 'position' => 5
100 ],
101 [
102 'id' => 6,
103 'label' => BackendStrings::getTemplateStrings()['other'],
104 'value' => 'other',
105 'isDefault' => false,
106 'position' => 6
107 ],
108 ]
109 ]];
110 }
111
112 /**
113 * Training relevance radio
114 *
115 * @return array<int, array<string, mixed>>
116 */
117 private static function getTrainingRelevanceField(): array
118 {
119 return [[
120 'id' => 12,
121 'fieldIndex' => 2,
122 'type' => 'radio',
123 'label' => BackendStrings::getTemplateStrings()['training_relevance_role'],
124 'required' => true,
125 'parentId' => null,
126 'defaultValue' => '',
127 'placeholder' => '',
128 'position' => 2,
129 'fieldOptions' => [
130 [
131 'id' => 8,
132 'label' => BackendStrings::getTemplateStrings()['highly_relevant'],
133 'value' => 'highly_relevant',
134 'isDefault' => false,
135 'position' => 1
136 ],
137 [
138 'id' => 9,
139 'label' => BackendStrings::getTemplateStrings()['somewhat_relevant'],
140 'value' => 'somewhat_relevant',
141 'isDefault' => false,
142 'position' => 2
143 ],
144 [
145 'id' => 10,
146 'label' => BackendStrings::getTemplateStrings()['slightly_relevant'],
147 'value' => 'slightly_relevant',
148 'isDefault' => false,
149 'position' => 3
150 ],
151 [
152 'id' => 11,
153 'label' => BackendStrings::getTemplateStrings()['not_relevant'],
154 'value' => 'not_relevant',
155 'isDefault' => false,
156 'position' => 4
157 ],
158 ]
159 ]];
160 }
161
162 /**
163 * Training usefulness rating
164 *
165 * @return array<int, array<string, mixed>>
166 */
167 private static function getTrainingUsefulnessRatingField(): array
168 {
169 return [[
170 'id' => 13,
171 'fieldIndex' => 3,
172 'type' => 'rating',
173 'label' => BackendStrings::getTemplateStrings()['training_usefulness'],
174 'required' => true,
175 'defaultValue' => '',
176 'placeholder' => '',
177 'position' => 3,
178 'labelPosition' => 'default',
179 'ratingIcon' => 'star',
180 'fieldOptions' => self::getStandardRatingOptions(11),
181 'showValues' => false,
182 'showRatingText' => false,
183 ]];
184 }
185
186 /**
187 * Applicability rating
188 *
189 * @return array<int, array<string, mixed>>
190 */
191 private static function getApplicabilityRatingField(): array
192 {
193 return [[
194 'id' => 14,
195 'fieldIndex' => 4,
196 'type' => 'rating',
197 'label' => BackendStrings::getTemplateStrings()['applicability_daily_work'],
198 'required' => true,
199 'defaultValue' => '',
200 'placeholder' => '',
201 'position' => 4,
202 'labelPosition' => 'default',
203 'ratingIcon' => 'star',
204 'fieldOptions' => self::getStandardRatingOptions(16),
205 'showValues' => false,
206 'showRatingText' => false,
207 ]];
208 }
209
210 /**
211 * Skills improved checkbox
212 *
213 * @return array<int, array<string, mixed>>
214 */
215 private static function getSkillsImprovedField(): array
216 {
217 return [[
218 'id' => 20,
219 'fieldIndex' => 5,
220 'type' => 'checkbox',
221 'label' => BackendStrings::getTemplateStrings()['skills_improved'],
222 'required' => false,
223 'parentId' => null,
224 'defaultValue' => '',
225 'placeholder' => '',
226 'position' => 5,
227 'fieldOptions' => [
228 [
229 'id' => 15,
230 'label' => BackendStrings::getTemplateStrings()['technical_skills'],
231 'value' => 'technical_skills',
232 'isDefault' => false,
233 'position' => 1
234 ],
235 [
236 'id' => 16,
237 'label' => BackendStrings::getTemplateStrings()['communication'],
238 'value' => 'communication',
239 'isDefault' => false,
240 'position' => 2
241 ],
242 [
243 'id' => 17,
244 'label' => BackendStrings::getTemplateStrings()['leadership'],
245 'value' => 'leadership',
246 'isDefault' => false,
247 'position' => 3
248 ],
249 [
250 'id' => 18,
251 'label' => BackendStrings::getTemplateStrings()['problem_solving'],
252 'value' => 'problem_solving',
253 'isDefault' => false,
254 'position' => 4
255 ],
256 [
257 'id' => 19,
258 'label' => BackendStrings::getTemplateStrings()['time_management'],
259 'value' => 'time_management',
260 'isDefault' => false,
261 'position' => 5
262 ],
263 ]
264 ]];
265 }
266
267 /**
268 * Suggestions for future trainings textarea
269 *
270 * @return array<int, array<string, mixed>>
271 */
272 private static function getFutureTrainingSuggestionsField(): array
273 {
274 return [[
275 'id' => 21,
276 'fieldIndex' => 6,
277 'type' => 'textarea',
278 'label' => BackendStrings::getTemplateStrings()['suggestions_for_future_trainings'],
279 'placeholder' => BackendStrings::getTemplateStrings()['suggestions_for_future_trainings_placeholder'],
280 'required' => false,
281 'parentId' => null,
282 'defaultValue' => '',
283 'position' => 6,
284 'rows' => 3,
285 ]];
286 }
287
288 /**
289 * Standard rating options
290 *
291 * @return array<int, array<string, mixed>>
292 */
293 private static function getStandardRatingOptions(int $startId): array
294 {
295 return [
296 [
297 'id' => $startId,
298 'label' => BackendStrings::getNewFormStrings()['good'],
299 'value' => '1',
300 'isDefault' => false,
301 'position' => 1
302 ],
303 [
304 'id' => $startId + 1,
305 'label' => BackendStrings::getNewFormStrings()['nice'],
306 'value' => '2',
307 'isDefault' => false,
308 'position' => 2
309 ],
310 [
311 'id' => $startId + 2,
312 'label' => BackendStrings::getNewFormStrings()['very_good'],
313 'value' => '3',
314 'isDefault' => false,
315 'position' => 3
316 ],
317 [
318 'id' => $startId + 3,
319 'label' => BackendStrings::getNewFormStrings()['awesome'],
320 'value' => '4',
321 'isDefault' => false,
322 'position' => 4
323 ],
324 [
325 'id' => $startId + 4,
326 'label' => BackendStrings::getNewFormStrings()['amazing'],
327 'value' => '5',
328 'isDefault' => false,
329 'position' => 5
330 ],
331 ];
332 }
333 }
334