PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.1
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 / CandidateEvaluationFormTemplate.php

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

720 lines 24.2 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 CandidateEvaluationFormTemplate
8 {
9 /**
10 * Get template metadata (without form_data)
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplateMeta(): array
15 {
16 return [
17 'id' => 'candidate_evaluation_form',
18 'name' => BackendStrings::getTemplateStrings()['candidate_evaluation_form'],
19 'description' => BackendStrings::getTemplateStrings()['candidate_evaluation_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'interview-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'candidate-evaluation-form.svg',
24 ];
25 }
26
27 /**
28 * Get the full template including form data
29 *
30 * @return array<string, mixed>
31 */
32 public static function getTemplate(): array
33 {
34 return array_merge(
35 self::getTemplateMeta(),
36 [
37 'form_data' => [
38 'name' => BackendStrings::getTemplateStrings()['candidate_evaluation_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getCandidateInformationFields(),
45 self::getRatingFields(),
46 self::getEvaluationAssessmentFields(),
47 self::getInterviewerInformationFields()
48 ),
49 'settings' => []
50 ]
51 ]
52 );
53 }
54
55 /**
56 * Get candidate information fields
57 *
58 * @return array<int, array<string, mixed>>
59 */
60 private static function getCandidateInformationFields(): array
61 {
62 return array_merge(
63 self::getCandidateFullNameField(),
64 self::getCandidateEmailField(),
65 self::getRoleAppliedForField(),
66 self::getInterviewStagesField()
67 );
68 }
69
70 /**
71 * Get candidate full name field with children
72 *
73 * @return array<int, array<string, mixed>>
74 */
75 private static function getCandidateFullNameField(): array
76 {
77 return [
78 [
79 'id' => 1,
80 'fieldIndex' => 1,
81 'type' => 'name',
82 'label' => BackendStrings::getTemplateStrings()['candidate_full_name'],
83 'parentId' => null,
84 'defaultValue' => '',
85 'placeholder' => '',
86 'required' => true,
87 'readonly' => false,
88 'position' => 1,
89 ],
90 [
91 'id' => 2,
92 'type' => 'text',
93 'label' => BackendStrings::getNewFormStrings()['first_name'],
94 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
95 'required' => true,
96 'parentId' => 1,
97 'fieldIndex' => 1,
98 'defaultValue' => '',
99 'position' => 1,
100 'optionHide' => false,
101 'description' => '',
102 'settings' => json_encode(['nameFieldType' => 'nameField1']),
103 ],
104 [
105 'id' => 3,
106 'type' => 'text',
107 'label' => BackendStrings::getNewFormStrings()['last_name'],
108 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
109 'required' => true,
110 'parentId' => 1,
111 'fieldIndex' => 1,
112 'defaultValue' => '',
113 'position' => 2,
114 'optionHide' => false,
115 'description' => '',
116 'settings' => json_encode(['nameFieldType' => 'nameField2']),
117 ],
118 ];
119 }
120
121 /**
122 * Get candidate email field
123 *
124 * @return array<int, array<string, mixed>>
125 */
126 private static function getCandidateEmailField(): array
127 {
128 return [[
129 'id' => 4,
130 'fieldIndex' => 2,
131 'type' => 'email',
132 'label' => BackendStrings::getNewFormStrings()['email'],
133 'placeholder' => BackendStrings::getNewFormStrings()['enter_email_address'],
134 'required' => false,
135 'parentId' => null,
136 'defaultValue' => '',
137 'position' => 2,
138 ]];
139 }
140
141 /**
142 * Get role applied for field
143 *
144 * @return array<int, array<string, mixed>>
145 */
146 private static function getRoleAppliedForField(): array
147 {
148 return [[
149 'id' => 11,
150 'fieldIndex' => 3,
151 'type' => 'select',
152 'label' => BackendStrings::getTemplateStrings()['role_applied_for'],
153 'placeholder' => BackendStrings::getTemplateStrings()['select_role_applied_for'],
154 'required' => true,
155 'parentId' => null,
156 'defaultValue' => '',
157 'position' => 3,
158 'fieldOptions' => [
159 [
160 'id' => 5,
161 'label' => BackendStrings::getTemplateStrings()['software_engineer'],
162 'value' => 'Software Engineer',
163 'isDefault' => false,
164 'position' => 1
165 ],
166 [
167 'id' => 6,
168 'label' => BackendStrings::getTemplateStrings()['product_manager'],
169 'value' => 'Product Manager',
170 'isDefault' => false,
171 'position' => 2
172 ],
173 [
174 'id' => 7,
175 'label' => BackendStrings::getTemplateStrings()['designer'],
176 'value' => 'Designer',
177 'isDefault' => false,
178 'position' => 3
179 ],
180 [
181 'id' => 8,
182 'label' => BackendStrings::getTemplateStrings()['marketing_specialist'],
183 'value' => 'Marketing Specialist',
184 'isDefault' => false,
185 'position' => 4
186 ],
187 [
188 'id' => 9,
189 'label' => BackendStrings::getTemplateStrings()['sales_representative'],
190 'value' => 'Sales Representative',
191 'isDefault' => false,
192 'position' => 5
193 ],
194 [
195 'id' => 10,
196 'label' => BackendStrings::getTemplateStrings()['other'],
197 'value' => 'Other',
198 'isDefault' => false,
199 'position' => 6
200 ],
201 ]
202 ]];
203 }
204
205 /**
206 * Get interview stages field
207 *
208 * @return array<int, array<string, mixed>>
209 */
210 private static function getInterviewStagesField(): array
211 {
212 return [[
213 'id' => 18,
214 'fieldIndex' => 4,
215 'type' => 'checkbox',
216 'label' => BackendStrings::getTemplateStrings()['interview_stages'],
217 'required' => true,
218 'parentId' => null,
219 'defaultValue' => '',
220 'placeholder' => '',
221 'position' => 4,
222 'fieldOptions' => [
223 [
224 'id' => 12,
225 'label' => BackendStrings::getTemplateStrings()['initial_screening'],
226 'value' => 'Initial screening',
227 'isDefault' => false,
228 'position' => 1
229 ],
230 [
231 'id' => 13,
232 'label' => BackendStrings::getTemplateStrings()['technical_interview'],
233 'value' => 'Technical interview',
234 'isDefault' => false,
235 'position' => 2
236 ],
237 [
238 'id' => 14,
239 'label' => BackendStrings::getTemplateStrings()['hr_behavioral_interview'],
240 'value' => 'HR / Behavioral interview',
241 'isDefault' => false,
242 'position' => 3
243 ],
244 [
245 'id' => 15,
246 'label' => BackendStrings::getTemplateStrings()['case_study_task'],
247 'value' => 'Case study or task',
248 'isDefault' => false,
249 'position' => 4
250 ],
251 [
252 'id' => 16,
253 'label' => BackendStrings::getTemplateStrings()['final_interview'],
254 'value' => 'Final interview',
255 'isDefault' => false,
256 'position' => 5
257 ],
258 [
259 'id' => 17,
260 'label' => BackendStrings::getTemplateStrings()['panel_interview'],
261 'value' => 'Panel interview',
262 'isDefault' => false,
263 'position' => 6
264 ],
265 ]
266 ]];
267 }
268
269 /**
270 * Get rating fields
271 *
272 * @return array<int, array<string, mixed>>
273 */
274 private static function getRatingFields(): array
275 {
276 return array_merge(
277 self::getRoleSpecificSkillsRating(),
278 self::getCommunicationSkillsRating(),
279 self::getProblemSolvingRating(),
280 self::getCulturalFitRating()
281 );
282 }
283
284 /**
285 * Get role-specific skills rating field
286 *
287 * @return array<int, array<string, mixed>>
288 */
289 private static function getRoleSpecificSkillsRating(): array
290 {
291 return [[
292 'id' => 19,
293 'fieldIndex' => 5,
294 'type' => 'rating',
295 'label' => BackendStrings::getTemplateStrings()['role_specific_technical_skills'],
296 'required' => true,
297 'defaultValue' => '',
298 'placeholder' => '',
299 'position' => 5,
300 'labelPosition' => 'default',
301 'ratingIcon' => 'star',
302 'description' => BackendStrings::getTemplateStrings()['role_specific_technical_skills_desc'],
303 'fieldOptions' => self::getStandardRatingOptions(13),
304 'showValues' => false,
305 'showRatingText' => false,
306 ]];
307 }
308
309 /**
310 * Get communication skills rating field
311 *
312 * @return array<int, array<string, mixed>>
313 */
314 private static function getCommunicationSkillsRating(): array
315 {
316 return [[
317 'id' => 20,
318 'fieldIndex' => 6,
319 'type' => 'rating',
320 'label' => BackendStrings::getTemplateStrings()['communication_skills'],
321 'required' => true,
322 'defaultValue' => '',
323 'placeholder' => '',
324 'position' => 6,
325 'labelPosition' => 'default',
326 'ratingIcon' => 'star',
327 'description' => BackendStrings::getTemplateStrings()['communication_skills_desc'],
328 'fieldOptions' => self::getStandardRatingOptions(18),
329 'showValues' => false,
330 'showRatingText' => false,
331 ]];
332 }
333
334 /**
335 * Get problem-solving rating field
336 *
337 * @return array<int, array<string, mixed>>
338 */
339 private static function getProblemSolvingRating(): array
340 {
341 return [[
342 'id' => 21,
343 'fieldIndex' => 7,
344 'type' => 'rating',
345 'label' => BackendStrings::getTemplateStrings()['problem_solving_critical_thinking'],
346 'required' => true,
347 'defaultValue' => '',
348 'placeholder' => '',
349 'position' => 7,
350 'labelPosition' => 'default',
351 'ratingIcon' => 'star',
352 'description' => BackendStrings::getTemplateStrings()['problem_solving_critical_thinking_desc'],
353 'fieldOptions' => self::getStandardRatingOptions(23),
354 'showValues' => false,
355 'showRatingText' => false,
356 ]];
357 }
358
359 /**
360 * Get cultural fit rating field
361 *
362 * @return array<int, array<string, mixed>>
363 */
364 private static function getCulturalFitRating(): array
365 {
366 return [[
367 'id' => 22,
368 'fieldIndex' => 8,
369 'type' => 'rating',
370 'label' => BackendStrings::getTemplateStrings()['cultural_fit_attitude'],
371 'required' => true,
372 'defaultValue' => '',
373 'placeholder' => '',
374 'position' => 8,
375 'labelPosition' => 'default',
376 'ratingIcon' => 'star',
377 'description' => BackendStrings::getTemplateStrings()['cultural_fit_attitude_desc'],
378 'fieldOptions' => self::getStandardRatingOptions(28),
379 'showValues' => false,
380 'showRatingText' => false,
381 ]];
382 }
383
384 /**
385 * Get standard 5-star rating options
386 *
387 * @return array<int, array<string, mixed>>
388 */
389 private static function getStandardRatingOptions(int $startId): array
390 {
391 return [
392 [
393 'id' => $startId,
394 'label' => BackendStrings::getNewFormStrings()['good'],
395 'value' => '1',
396 'isDefault' => false,
397 'position' => 1
398 ],
399 [
400 'id' => $startId + 1,
401 'label' => BackendStrings::getNewFormStrings()['nice'],
402 'value' => '2',
403 'isDefault' => false,
404 'position' => 2
405 ],
406 [
407 'id' => $startId + 2,
408 'label' => BackendStrings::getNewFormStrings()['very_good'],
409 'value' => '3',
410 'isDefault' => false,
411 'position' => 3
412 ],
413 [
414 'id' => $startId + 3,
415 'label' => BackendStrings::getNewFormStrings()['awesome'],
416 'value' => '4',
417 'isDefault' => false,
418 'position' => 4
419 ],
420 [
421 'id' => $startId + 4,
422 'label' => BackendStrings::getNewFormStrings()['amazing'],
423 'value' => '5',
424 'isDefault' => false,
425 'position' => 5
426 ],
427 ];
428 }
429
430 /**
431 * Get evaluation assessment fields
432 *
433 * @return array<int, array<string, mixed>>
434 */
435 private static function getEvaluationAssessmentFields(): array
436 {
437 return array_merge(
438 self::getKeyStrengthsObservedField(),
439 self::getAreasOfConcernField(),
440 self::getAdditionalInterviewerNotesField(),
441 self::getOverallHiringRecommendationField(),
442 self::getJustificationForRecommendationField()
443 );
444 }
445
446 /**
447 * Get key strengths observed field
448 *
449 * @return array<int, array<string, mixed>>
450 */
451 private static function getKeyStrengthsObservedField(): array
452 {
453 return [[
454 'id' => 34,
455 'fieldIndex' => 9,
456 'type' => 'checkbox',
457 'label' => BackendStrings::getTemplateStrings()['key_strengths_observed'],
458 'required' => false,
459 'parentId' => null,
460 'defaultValue' => '',
461 'placeholder' => '',
462 'position' => 9,
463 'fieldOptions' => [
464 [
465 'id' => 28,
466 'label' => BackendStrings::getTemplateStrings()['strong_technical_foundation'],
467 'value' => 'Strong technical foundation',
468 'isDefault' => false,
469 'position' => 1
470 ],
471 [
472 'id' => 29,
473 'label' => BackendStrings::getTemplateStrings()['excellent_communication'],
474 'value' => 'Excellent communication',
475 'isDefault' => false,
476 'position' => 2
477 ],
478 [
479 'id' => 30,
480 'label' => BackendStrings::getTemplateStrings()['fast_learner'],
481 'value' => 'Fast learner',
482 'isDefault' => false,
483 'position' => 3
484 ],
485 [
486 'id' => 31,
487 'label' => BackendStrings::getTemplateStrings()['relevant_prior_experience'],
488 'value' => 'Relevant prior experience',
489 'isDefault' => false,
490 'position' => 4
491 ],
492 [
493 'id' => 32,
494 'label' => BackendStrings::getTemplateStrings()['leadership_potential'],
495 'value' => 'Leadership potential',
496 'isDefault' => false,
497 'position' => 5
498 ],
499 [
500 'id' => 33,
501 'label' => BackendStrings::getTemplateStrings()['collaborative_mindset'],
502 'value' => 'Collaborative mindset',
503 'isDefault' => false,
504 'position' => 6
505 ],
506 ]
507 ]];
508 }
509
510 /**
511 * Get areas of concern field
512 *
513 * @return array<int, array<string, mixed>>
514 */
515 private static function getAreasOfConcernField(): array
516 {
517 return [[
518 'id' => 40,
519 'fieldIndex' => 10,
520 'type' => 'checkbox',
521 'label' => BackendStrings::getTemplateStrings()['areas_of_concern'],
522 'required' => false,
523 'parentId' => null,
524 'defaultValue' => '',
525 'placeholder' => '',
526 'position' => 10,
527 'fieldOptions' => [
528 [
529 'id' => 35,
530 'label' => BackendStrings::getTemplateStrings()['skill_gaps'],
531 'value' => 'Skill gaps',
532 'isDefault' => false,
533 'position' => 1
534 ],
535 [
536 'id' => 36,
537 'label' => BackendStrings::getTemplateStrings()['limited_experience'],
538 'value' => 'Limited experience',
539 'isDefault' => false,
540 'position' => 2
541 ],
542 [
543 'id' => 37,
544 'label' => BackendStrings::getTemplateStrings()['communication_challenges'],
545 'value' => 'Communication challenges',
546 'isDefault' => false,
547 'position' => 3
548 ],
549 [
550 'id' => 38,
551 'label' => BackendStrings::getTemplateStrings()['lack_domain_knowledge'],
552 'value' => 'Lack of domain knowledge',
553 'isDefault' => false,
554 'position' => 4
555 ],
556 [
557 'id' => 39,
558 'label' => BackendStrings::getTemplateStrings()['cultural_misalignment'],
559 'value' => 'Cultural misalignment',
560 'isDefault' => false,
561 'position' => 5
562 ],
563 ]
564 ]];
565 }
566
567 /**
568 * Get additional interviewer notes field
569 *
570 * @return array<int, array<string, mixed>>
571 */
572 private static function getAdditionalInterviewerNotesField(): array
573 {
574 return [[
575 'id' => 41,
576 'fieldIndex' => 11,
577 'type' => 'textarea',
578 'label' => BackendStrings::getTemplateStrings()['additional_interviewer_notes'],
579 'placeholder' => BackendStrings::getTemplateStrings()['additional_interviewer_notes_placeholder'],
580 'required' => false,
581 'parentId' => null,
582 'defaultValue' => '',
583 'position' => 11,
584 'rows' => 3,
585 ]];
586 }
587
588 /**
589 * Get overall hiring recommendation field
590 *
591 * @return array<int, array<string, mixed>>
592 */
593 private static function getOverallHiringRecommendationField(): array
594 {
595 return [[
596 'id' => 47,
597 'fieldIndex' => 12,
598 'type' => 'radio',
599 'label' => BackendStrings::getTemplateStrings()['overall_hiring_recommendation'],
600 'required' => true,
601 'parentId' => null,
602 'defaultValue' => '',
603 'placeholder' => '',
604 'position' => 12,
605 'fieldOptions' => [
606 [
607 'id' => 42,
608 'label' => BackendStrings::getTemplateStrings()['strong_hire'],
609 'value' => 'Strong hire',
610 'isDefault' => false,
611 'position' => 1
612 ],
613 [
614 'id' => 43,
615 'label' => BackendStrings::getTemplateStrings()['hire'],
616 'value' => 'Hire',
617 'isDefault' => false,
618 'position' => 2
619 ],
620 [
621 'id' => 44,
622 'label' => BackendStrings::getTemplateStrings()['consider_for_another_role'],
623 'value' => 'Consider for another role',
624 'isDefault' => false,
625 'position' => 3
626 ],
627 [
628 'id' => 45,
629 'label' => BackendStrings::getTemplateStrings()['hold_for_future'],
630 'value' => 'Hold for future',
631 'isDefault' => false,
632 'position' => 4
633 ],
634 [
635 'id' => 46,
636 'label' => BackendStrings::getTemplateStrings()['do_not_hire'],
637 'value' => 'Do not hire',
638 'isDefault' => false,
639 'position' => 5
640 ],
641 ]
642 ]];
643 }
644
645 /**
646 * Get justification for recommendation field
647 *
648 * @return array<int, array<string, mixed>>
649 */
650 private static function getJustificationForRecommendationField(): array
651 {
652 return [[
653 'id' => 48,
654 'fieldIndex' => 13,
655 'type' => 'textarea',
656 'label' => BackendStrings::getTemplateStrings()['justification_for_recommendation'],
657 'placeholder' => BackendStrings::getTemplateStrings()['justification_for_recommendation_placeholder'],
658 'required' => false,
659 'parentId' => null,
660 'defaultValue' => '',
661 'position' => 13,
662 'rows' => 3,
663 ]];
664 }
665
666 /**
667 * Get interviewer information fields
668 *
669 * @return array<int, array<string, mixed>>
670 */
671 private static function getInterviewerInformationFields(): array
672 {
673 return [
674 // Interviewer Name
675 [
676 'id' => 49,
677 'fieldIndex' => 14,
678 'type' => 'name',
679 'label' => BackendStrings::getTemplateStrings()['interviewer_name'],
680 'parentId' => null,
681 'defaultValue' => '',
682 'placeholder' => '',
683 'required' => false,
684 'readonly' => false,
685 'position' => 14,
686 ],
687 // First Name - Child of Name Field
688 [
689 'id' => 50,
690 'type' => 'text',
691 'label' => BackendStrings::getNewFormStrings()['first_name'],
692 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
693 'required' => false,
694 'parentId' => 14,
695 'fieldIndex' => 14,
696 'defaultValue' => '',
697 'position' => 1,
698 'optionHide' => false,
699 'description' => '',
700 'settings' => json_encode(['nameFieldType' => 'nameField1']),
701 ],
702 // Last Name - Child of Name Field
703 [
704 'id' => 51,
705 'type' => 'text',
706 'label' => BackendStrings::getNewFormStrings()['last_name'],
707 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
708 'required' => false,
709 'parentId' => 14,
710 'fieldIndex' => 14,
711 'defaultValue' => '',
712 'position' => 2,
713 'optionHide' => false,
714 'description' => '',
715 'settings' => json_encode(['nameFieldType' => 'nameField2']),
716 ],
717 ];
718 }
719 }
720