PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
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 / SkilledTradeEmploymentApplicationFormTemplate.php

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

230 lines 8.6 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 SkilledTradeEmploymentApplicationFormTemplate
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' => 'skilled_trade_employment_application_form',
18 'name' => BackendStrings::getTemplateStrings()['skilled_trade_employment_application_form'],
19 'description' => BackendStrings::getTemplateStrings()['skilled_trade_employment_application_form_desc'],
20 'category' => 'application-forms',
21 'subcategory' => 'employment-application-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'skilled-trade-employment-application-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()['skilled_trade_employment_application_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getApplicantInformationFields(),
45 self::getTradeAndCertificationFields()
46 ),
47 'settings' => [],
48 ],
49 ]
50 );
51 }
52
53 /**
54 * Get applicant information fields
55 *
56 * @return array<int, array<string, mixed>>
57 */
58 private static function getApplicantInformationFields(): array
59 {
60 return [
61 [
62 'id' => 1,
63 'fieldIndex' => 1,
64 'type' => 'name',
65 'label' => BackendStrings::getTemplateStrings()['name'],
66 'parentId' => null,
67 'defaultValue' => '',
68 'placeholder' => '',
69 'required' => true,
70 'readonly' => false,
71 'position' => 1,
72 ],
73 [
74 'id' => 2,
75 'type' => 'text',
76 'label' => BackendStrings::getNewFormStrings()['first_name'],
77 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
78 'required' => true,
79 'parentId' => 1,
80 'fieldIndex' => 1,
81 'defaultValue' => '',
82 'position' => 1,
83 'optionHide' => false,
84 'description' => '',
85 'settings' => json_encode(['nameFieldType' => 'nameField1']),
86 ],
87 [
88 'id' => 3,
89 'type' => 'text',
90 'label' => BackendStrings::getNewFormStrings()['last_name'],
91 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
92 'required' => true,
93 'parentId' => 1,
94 'fieldIndex' => 1,
95 'defaultValue' => '',
96 'position' => 2,
97 'optionHide' => false,
98 'description' => '',
99 'settings' => json_encode(['nameFieldType' => 'nameField2']),
100 ],
101 [
102 'id' => 4,
103 'fieldIndex' => 2,
104 'type' => 'email',
105 'label' => BackendStrings::getTemplateStrings()['email_address'],
106 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_email_address'],
107 'required' => true,
108 'parentId' => null,
109 'defaultValue' => '',
110 'position' => 2,
111 ],
112 ];
113 }
114
115 /**
116 * Get trade and certification fields
117 *
118 * @return array<int, array<string, mixed>>
119 */
120 private static function getTradeAndCertificationFields(): array
121 {
122 return [
123 [
124 'id' => 5,
125 'fieldIndex' => 3,
126 'type' => 'select',
127 'label' => BackendStrings::getTemplateStrings()['trade_skill_type'],
128 'placeholder' => BackendStrings::getTemplateStrings()['select_trade_skill_type'],
129 'required' => true,
130 'parentId' => null,
131 'defaultValue' => '',
132 'position' => 3,
133 'fieldOptions' => [
134 [
135 'id' => 6,
136 'label' => BackendStrings::getTemplateStrings()['electrician'],
137 'value' => 'Electrician',
138 'isDefault' => false,
139 'position' => 1,
140 ], [
141 'id' => 7,
142 'label' => BackendStrings::getTemplateStrings()['plumber'],
143 'value' => 'Plumber',
144 'isDefault' => false,
145 'position' => 2,
146 ], [
147 'id' => 8,
148 'label' => BackendStrings::getTemplateStrings()['carpenter'],
149 'value' => 'Carpenter',
150 'isDefault' => false,
151 'position' => 3,
152 ], [
153 'id' => 9,
154 'label' => BackendStrings::getTemplateStrings()['welder'],
155 'value' => 'Welder',
156 'isDefault' => false,
157 'position' => 4,
158 ], [
159 'id' => 10,
160 'label' => BackendStrings::getTemplateStrings()['mechanic'],
161 'value' => 'Mechanic',
162 'isDefault' => false,
163 'position' => 5,
164 ]
165 ],
166 ],
167 [
168 'id' => 11,
169 'fieldIndex' => 4,
170 'type' => 'file-upload',
171 'label' => BackendStrings::getTemplateStrings()['certifications'],
172 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
173 'required' => true,
174 'parentId' => null,
175 'defaultValue' => '',
176 'position' => 4,
177 'maxFileSizeMb' => 999,
178 'saveUploadsTo' => 'ivyforms',
179 'allowedFileExtensions' => [],
180 'allowMultiple' => false,
181 'maxUploadCount' => 0,
182 ],
183 [
184 'id' => 12,
185 'fieldIndex' => 5,
186 'type' => 'file-upload',
187 'label' => BackendStrings::getTemplateStrings()['work_experience_proof'],
188 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
189 'required' => false,
190 'parentId' => null,
191 'defaultValue' => '',
192 'position' => 5,
193 'maxFileSizeMb' => 999,
194 'saveUploadsTo' => 'ivyforms',
195 'allowedFileExtensions' => [],
196 'allowMultiple' => false,
197 'maxUploadCount' => 0,
198 ],
199 [
200 'id' => 13,
201 'fieldIndex' => 6,
202 'type' => 'file-upload',
203 'label' => BackendStrings::getTemplateStrings()['safety_training_certificates'],
204 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
205 'required' => false,
206 'parentId' => null,
207 'defaultValue' => '',
208 'position' => 6,
209 'maxFileSizeMb' => 999,
210 'saveUploadsTo' => 'ivyforms',
211 'allowedFileExtensions' => [],
212 'allowMultiple' => false,
213 'maxUploadCount' => 0,
214 ],
215 [
216 'id' => 14,
217 'fieldIndex' => 7,
218 'type' => 'textarea',
219 'label' => BackendStrings::getTemplateStrings()['notes'],
220 'placeholder' => BackendStrings::getTemplateStrings()['enter_notes'],
221 'required' => false,
222 'parentId' => null,
223 'defaultValue' => '',
224 'position' => 7,
225 'rows' => 3,
226 ],
227 ];
228 }
229 }
230