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

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

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