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

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

678 lines 23.7 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 HRInterviewFeedbackFormTemplate
13 {
14 /**
15 * Get the HR interview feedback form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'hr_interview_feedback_form',
23 'name' => BackendStrings::getTemplateStrings()['hr_interview_feedback_form'],
24 'description' => BackendStrings::getTemplateStrings()['hr_interview_feedback_form_desc'],
25 'category' => 'feedback-forms',
26 'subcategory' => 'interview-feedback-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'hr-interview-feedback-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['hr_interview_feedback_form'],
31 'published' => 1,
32 'showTitle' => 1,
33 'storeEntries' => 1,
34 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
35 'fields' => array_merge(
36 self::getCandidateInformationFields(),
37 self::getRatingFields(),
38 self::getBehavioralAssessmentFields(),
39 self::getInterviewerInformationFields()
40 ),
41 'settings' => []
42 ]
43 ];
44 }
45
46 /**
47 * Get candidate information fields
48 *
49 * @return array<int, array<string, mixed>>
50 */
51 private static function getCandidateInformationFields(): array
52 {
53 return [
54 // Candidate Full Name
55 [
56 'id' => 1,
57 'fieldIndex' => 1,
58 'type' => 'name',
59 'label' => BackendStrings::getTemplateStrings()['candidate_full_name'],
60 'parentId' => null,
61 'defaultValue' => '',
62 'placeholder' => '',
63 'required' => true,
64 'readonly' => false,
65 'position' => 1,
66 ],
67 // First Name - Child of Name Field
68 [
69 'id' => 2,
70 'type' => 'text',
71 'label' => BackendStrings::getNewFormStrings()['first_name'],
72 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
73 'required' => true,
74 'parentId' => 1,
75 'fieldIndex' => 1,
76 'defaultValue' => '',
77 'position' => 1,
78 'optionHide' => false,
79 'description' => '',
80 'settings' => json_encode(['nameFieldType' => 'nameField1']),
81 ],
82 // Last Name - Child of Name Field
83 [
84 'id' => 3,
85 'type' => 'text',
86 'label' => BackendStrings::getNewFormStrings()['last_name'],
87 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
88 'required' => true,
89 'parentId' => 1,
90 'fieldIndex' => 1,
91 'defaultValue' => '',
92 'position' => 2,
93 'optionHide' => false,
94 'description' => '',
95 'settings' => json_encode(['nameFieldType' => 'nameField2']),
96 ],
97 // Role Applied For
98 [
99 'id' => 10,
100 'fieldIndex' => 2,
101 'type' => 'select',
102 'label' => BackendStrings::getTemplateStrings()['role_applied_for'],
103 'placeholder' => BackendStrings::getTemplateStrings()['select_role_applied_for'],
104 'required' => true,
105 'parentId' => null,
106 'defaultValue' => '',
107 'position' => 2,
108 'fieldOptions' => [
109 [
110 'id' => 4,
111 'label' => BackendStrings::getTemplateStrings()['software_engineer'],
112 'value' => 'Software Engineer',
113 'isDefault' => false,
114 'position' => 1
115 ],
116 [
117 'id' => 5,
118 'label' => BackendStrings::getTemplateStrings()['product_manager'],
119 'value' => 'Product Manager',
120 'isDefault' => false,
121 'position' => 2
122 ],
123 [
124 'id' => 6,
125 'label' => BackendStrings::getTemplateStrings()['designer'],
126 'value' => 'Designer',
127 'isDefault' => false,
128 'position' => 3
129 ],
130 [
131 'id' => 7,
132 'label' => BackendStrings::getTemplateStrings()['marketing_specialist'],
133 'value' => 'Marketing Specialist',
134 'isDefault' => false,
135 'position' => 4
136 ],
137 [
138 'id' => 8,
139 'label' => BackendStrings::getTemplateStrings()['sales_representative'],
140 'value' => 'Sales Representative',
141 'isDefault' => false,
142 'position' => 5
143 ],
144 [
145 'id' => 9,
146 'label' => BackendStrings::getTemplateStrings()['other'],
147 'value' => 'Other',
148 'isDefault' => false,
149 'position' => 6
150 ],
151 ]
152 ],
153 // Interview Stage(s)
154 [
155 'id' => 16,
156 'fieldIndex' => 3,
157 'type' => 'checkbox',
158 'label' => BackendStrings::getTemplateStrings()['interview_stages'],
159 'required' => true,
160 'parentId' => null,
161 'defaultValue' => '',
162 'placeholder' => '',
163 'position' => 3,
164 'fieldOptions' => [
165 [
166 'id' => 11,
167 'label' => BackendStrings::getTemplateStrings()['initial_hr_screening'],
168 'value' => 'Initial HR screening',
169 'isDefault' => false,
170 'position' => 1
171 ],
172 [
173 'id' => 12,
174 'label' => BackendStrings::getTemplateStrings()['behavioral_interview'],
175 'value' => 'Behavioral interview',
176 'isDefault' => false,
177 'position' => 2
178 ],
179 [
180 'id' => 13,
181 'label' => BackendStrings::getTemplateStrings()['culture_fit_interview'],
182 'value' => 'Culture fit interview',
183 'isDefault' => false,
184 'position' => 3
185 ],
186 [
187 'id' => 14,
188 'label' => BackendStrings::getTemplateStrings()['final_interview'],
189 'value' => 'Final interview',
190 'isDefault' => false,
191 'position' => 4
192 ],
193 [
194 'id' => 15,
195 'label' => BackendStrings::getTemplateStrings()['panel_interview'],
196 'value' => 'Panel interview',
197 'isDefault' => false,
198 'position' => 5
199 ],
200 ]
201 ],
202 ];
203 }
204
205 /**
206 * Get rating fields
207 *
208 * @return array<int, array<string, mixed>>
209 */
210 private static function getRatingFields(): array
211 {
212 return array_merge(
213 self::getCommunicationSkillsRating(),
214 self::getCulturalFitValuesAlignmentRating(),
215 self::getMotivationEngagementRating(),
216 self::getProfessionalismAttitudeRating()
217 );
218 }
219
220 /**
221 * Get communication skills rating
222 *
223 * @return array<int, array<string, mixed>>
224 */
225 private static function getCommunicationSkillsRating(): array
226 {
227 return [[
228 'id' => 17,
229 'fieldIndex' => 4,
230 'type' => 'rating',
231 'label' => BackendStrings::getTemplateStrings()['communication_skills'],
232 'required' => true,
233 'defaultValue' => '',
234 'placeholder' => '',
235 'position' => 4,
236 'labelPosition' => 'default',
237 'ratingIcon' => 'star',
238 'description' => BackendStrings::getTemplateStrings()['communication_skills_desc'],
239 'fieldOptions' => self::getStandardRatingOptions(7),
240 'showValues' => false,
241 'showRatingText' => false,
242 ]];
243 }
244
245 /**
246 * Get cultural fit and values alignment rating
247 *
248 * @return array<int, array<string, mixed>>
249 */
250 private static function getCulturalFitValuesAlignmentRating(): array
251 {
252 return [[
253 'id' => 18,
254 'fieldIndex' => 5,
255 'type' => 'rating',
256 'label' => BackendStrings::getTemplateStrings()['cultural_fit_values_alignment'],
257 'required' => true,
258 'defaultValue' => '',
259 'placeholder' => '',
260 'position' => 5,
261 'labelPosition' => 'default',
262 'ratingIcon' => 'star',
263 'description' => BackendStrings::getTemplateStrings()['cultural_fit_values_alignment_desc'],
264 'fieldOptions' => self::getStandardRatingOptions(12),
265 'showValues' => false,
266 'showRatingText' => false,
267 ]];
268 }
269
270 /**
271 * Get motivation and engagement rating
272 *
273 * @return array<int, array<string, mixed>>
274 */
275 private static function getMotivationEngagementRating(): array
276 {
277 return [[
278 'id' => 19,
279 'fieldIndex' => 6,
280 'type' => 'rating',
281 'label' => BackendStrings::getTemplateStrings()['motivation_engagement'],
282 'required' => true,
283 'defaultValue' => '',
284 'placeholder' => '',
285 'position' => 6,
286 'labelPosition' => 'default',
287 'ratingIcon' => 'star',
288 'description' => BackendStrings::getTemplateStrings()['motivation_engagement_desc'],
289 'fieldOptions' => self::getStandardRatingOptions(17),
290 'showValues' => false,
291 'showRatingText' => false,
292 ]];
293 }
294
295 /**
296 * Get professionalism and attitude rating
297 *
298 * @return array<int, array<string, mixed>>
299 */
300 private static function getProfessionalismAttitudeRating(): array
301 {
302 return [[
303 'id' => 20,
304 'fieldIndex' => 7,
305 'type' => 'rating',
306 'label' => BackendStrings::getTemplateStrings()['professionalism_attitude'],
307 'required' => true,
308 'defaultValue' => '',
309 'placeholder' => '',
310 'position' => 7,
311 'labelPosition' => 'default',
312 'ratingIcon' => 'star',
313 'description' => BackendStrings::getTemplateStrings()['professionalism_attitude_desc'],
314 'fieldOptions' => self::getStandardRatingOptions(22),
315 'showValues' => false,
316 'showRatingText' => false,
317 ]];
318 }
319
320 /**
321 * Get standard rating options
322 *
323 * @return array<int, array<string, mixed>>
324 */
325 private static function getStandardRatingOptions(int $startId): array
326 {
327 return [
328 [
329 'id' => $startId,
330 'label' => BackendStrings::getNewFormStrings()['good'],
331 'value' => '1',
332 'isDefault' => false,
333 'position' => 1
334 ],
335 [
336 'id' => $startId + 1,
337 'label' => BackendStrings::getNewFormStrings()['nice'],
338 'value' => '2',
339 'isDefault' => false,
340 'position' => 2
341 ],
342 [
343 'id' => $startId + 2,
344 'label' => BackendStrings::getNewFormStrings()['very_good'],
345 'value' => '3',
346 'isDefault' => false,
347 'position' => 3
348 ],
349 [
350 'id' => $startId + 3,
351 'label' => BackendStrings::getNewFormStrings()['awesome'],
352 'value' => '4',
353 'isDefault' => false,
354 'position' => 4
355 ],
356 [
357 'id' => $startId + 4,
358 'label' => BackendStrings::getNewFormStrings()['amazing'],
359 'value' => '5',
360 'isDefault' => false,
361 'position' => 5
362 ],
363 ];
364 }
365
366 /**
367 * Get behavioral assessment fields
368 *
369 * @return array<int, array<string, mixed>>
370 */
371 private static function getBehavioralAssessmentFields(): array
372 {
373 return array_merge(
374 self::getStrengthsDemonstratedField(),
375 self::getBehavioralConcernsField(),
376 self::getBehavioralExamplesNotesField(),
377 self::getOverallBehavioralAssessmentField(),
378 self::getHRRecommendationField()
379 );
380 }
381
382 /**
383 * Get strengths demonstrated field
384 *
385 * @return array<int, array<string, mixed>>
386 */
387 private static function getStrengthsDemonstratedField(): array
388 {
389 return [[
390 'id' => 32,
391 'fieldIndex' => 8,
392 'type' => 'checkbox',
393 'label' => BackendStrings::getTemplateStrings()['strengths_demonstrated'],
394 'required' => false,
395 'parentId' => null,
396 'defaultValue' => '',
397 'placeholder' => '',
398 'position' => 8,
399 'fieldOptions' => [
400 [
401 'id' => 26,
402 'label' => BackendStrings::getTemplateStrings()['clear_confident_communication'],
403 'value' => 'Clear and confident communication',
404 'isDefault' => false,
405 'position' => 1
406 ],
407 [
408 'id' => 27,
409 'label' => BackendStrings::getTemplateStrings()['team_oriented_mindset'],
410 'value' => 'Team-oriented mindset',
411 'isDefault' => false,
412 'position' => 2
413 ],
414 [
415 'id' => 28,
416 'label' => BackendStrings::getTemplateStrings()['adaptability_flexibility'],
417 'value' => 'Adaptability and flexibility',
418 'isDefault' => false,
419 'position' => 3
420 ],
421 [
422 'id' => 29,
423 'label' => BackendStrings::getTemplateStrings()['ownership_accountability'],
424 'value' => 'Ownership and accountability',
425 'isDefault' => false,
426 'position' => 4
427 ],
428 [
429 'id' => 30,
430 'label' => BackendStrings::getTemplateStrings()['leadership_potential'],
431 'value' => 'Leadership potential',
432 'isDefault' => false,
433 'position' => 5
434 ],
435 [
436 'id' => 31,
437 'label' => BackendStrings::getTemplateStrings()['positive_attitude'],
438 'value' => 'Positive attitude',
439 'isDefault' => false,
440 'position' => 6
441 ],
442 ]
443 ]];
444 }
445
446 /**
447 * Get behavioral concerns field
448 *
449 * @return array<int, array<string, mixed>>
450 */
451 private static function getBehavioralConcernsField(): array
452 {
453 return [[
454 'id' => 38,
455 'fieldIndex' => 9,
456 'type' => 'checkbox',
457 'label' => BackendStrings::getTemplateStrings()['behavioral_concerns'],
458 'required' => false,
459 'parentId' => null,
460 'defaultValue' => '',
461 'placeholder' => '',
462 'position' => 9,
463 'fieldOptions' => [
464 [
465 'id' => 33,
466 'label' => BackendStrings::getTemplateStrings()['poor_communication'],
467 'value' => 'Poor communication',
468 'isDefault' => false,
469 'position' => 1
470 ],
471 [
472 'id' => 34,
473 'label' => BackendStrings::getTemplateStrings()['lack_of_motivation'],
474 'value' => 'Lack of motivation',
475 'isDefault' => false,
476 'position' => 2
477 ],
478 [
479 'id' => 35,
480 'label' => BackendStrings::getTemplateStrings()['resistance_to_feedback'],
481 'value' => 'Resistance to feedback',
482 'isDefault' => false,
483 'position' => 3
484 ],
485 [
486 'id' => 36,
487 'label' => BackendStrings::getTemplateStrings()['misalignment_with_values'],
488 'value' => 'Misalignment with values',
489 'isDefault' => false,
490 'position' => 4
491 ],
492 [
493 'id' => 37,
494 'label' => BackendStrings::getTemplateStrings()['unrealistic_expectations'],
495 'value' => 'Unrealistic expectations',
496 'isDefault' => false,
497 'position' => 5
498 ],
499 ]
500 ]];
501 }
502
503 /**
504 * Get behavioral examples and notes field
505 *
506 * @return array<int, array<string, mixed>>
507 */
508 private static function getBehavioralExamplesNotesField(): array
509 {
510 return [[
511 'id' => 39,
512 'fieldIndex' => 10,
513 'type' => 'textarea',
514 'label' => BackendStrings::getTemplateStrings()['behavioral_examples_notes'],
515 'placeholder' => BackendStrings::getTemplateStrings()['behavioral_examples_notes_placeholder'],
516 'required' => false,
517 'parentId' => null,
518 'defaultValue' => '',
519 'position' => 10,
520 'rows' => 3,
521 ]];
522 }
523
524 /**
525 * Get overall behavioral assessment field
526 *
527 * @return array<int, array<string, mixed>>
528 */
529 private static function getOverallBehavioralAssessmentField(): array
530 {
531 return [[
532 'id' => 44,
533 'fieldIndex' => 11,
534 'type' => 'radio',
535 'label' => BackendStrings::getTemplateStrings()['overall_behavioral_assessment'],
536 'required' => true,
537 'parentId' => null,
538 'defaultValue' => '',
539 'placeholder' => '',
540 'position' => 11,
541 'fieldOptions' => [
542 [
543 'id' => 40,
544 'label' => BackendStrings::getTemplateStrings()['excellent_fit'],
545 'value' => 'Excellent fit',
546 'isDefault' => false,
547 'position' => 1
548 ],
549 [
550 'id' => 41,
551 'label' => BackendStrings::getTemplateStrings()['good_fit'],
552 'value' => 'Good fit',
553 'isDefault' => false,
554 'position' => 2
555 ],
556 [
557 'id' => 42,
558 'label' => BackendStrings::getTemplateStrings()['partial_fit'],
559 'value' => 'Partial fit',
560 'isDefault' => false,
561 'position' => 3
562 ],
563 [
564 'id' => 43,
565 'label' => BackendStrings::getTemplateStrings()['poor_fit'],
566 'value' => 'Poor fit',
567 'isDefault' => false,
568 'position' => 4
569 ],
570 ]
571 ]];
572 }
573
574 /**
575 * Get HR recommendation field
576 *
577 * @return array<int, array<string, mixed>>
578 */
579 private static function getHRRecommendationField(): array
580 {
581 return [[
582 'id' => 49,
583 'fieldIndex' => 12,
584 'type' => 'radio',
585 'label' => BackendStrings::getTemplateStrings()['hr_recommendation'],
586 'required' => true,
587 'parentId' => null,
588 'defaultValue' => '',
589 'placeholder' => '',
590 'position' => 12,
591 'fieldOptions' => [
592 [
593 'id' => 45,
594 'label' => BackendStrings::getTemplateStrings()['strong_hire'],
595 'value' => 'Strong hire',
596 'isDefault' => false,
597 'position' => 1
598 ],
599 [
600 'id' => 46,
601 'label' => BackendStrings::getTemplateStrings()['hire'],
602 'value' => 'Hire',
603 'isDefault' => false,
604 'position' => 2
605 ],
606 [
607 'id' => 47,
608 'label' => BackendStrings::getTemplateStrings()['proceed_with_caution'],
609 'value' => 'Proceed with caution',
610 'isDefault' => false,
611 'position' => 3
612 ],
613 [
614 'id' => 48,
615 'label' => BackendStrings::getTemplateStrings()['do_not_proceed'],
616 'value' => 'Do not proceed',
617 'isDefault' => false,
618 'position' => 4
619 ],
620 ]
621 ]];
622 }
623
624 /**
625 * Get interviewer information fields
626 *
627 * @return array<int, array<string, mixed>>
628 */
629 private static function getInterviewerInformationFields(): array
630 {
631 return [
632 // HR Interviewer Name
633 [
634 'id' => 50,
635 'fieldIndex' => 13,
636 'type' => 'name',
637 'label' => BackendStrings::getTemplateStrings()['hr_interviewer_name'],
638 'parentId' => null,
639 'defaultValue' => '',
640 'placeholder' => '',
641 'required' => false,
642 'readonly' => false,
643 'position' => 13,
644 ],
645 // First Name - Child of Name Field
646 [
647 'id' => 51,
648 'type' => 'text',
649 'label' => BackendStrings::getNewFormStrings()['first_name'],
650 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
651 'required' => false,
652 'parentId' => 13,
653 'fieldIndex' => 13,
654 'defaultValue' => '',
655 'position' => 1,
656 'optionHide' => false,
657 'description' => '',
658 'settings' => json_encode(['nameFieldType' => 'nameField1']),
659 ],
660 // Last Name - Child of Name Field
661 [
662 'id' => 52,
663 'type' => 'text',
664 'label' => BackendStrings::getNewFormStrings()['last_name'],
665 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
666 'required' => false,
667 'parentId' => 13,
668 'fieldIndex' => 13,
669 'defaultValue' => '',
670 'position' => 2,
671 'optionHide' => false,
672 'description' => '',
673 'settings' => json_encode(['nameFieldType' => 'nameField2']),
674 ],
675 ];
676 }
677 }
678