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

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

358 lines 13.1 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 WarehouseLogisticsWorkerApplicationFormTemplate
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' => 'warehouse_logistics_worker_application_form',
18 'name' => BackendStrings::getTemplateStrings()['warehouse_logistics_worker_application_form'],
19 'description' => BackendStrings::getTemplateStrings()['warehouse_logistics_worker_application_form_desc'],
20 'category' => 'application-forms',
21 'subcategory' => 'employment-application-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'warehouse-logistics-worker-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()['warehouse_logistics_worker_application_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getApplicantInformationFields(),
45 self::getWorkExperienceFields(),
46 self::getEmploymentDetailsFields(),
47 self::getDocumentsAndContactFields()
48 ),
49 'settings' => [],
50 ],
51 ]
52 );
53 }
54
55 /**
56 * Get applicant information fields
57 *
58 * @return array<int, array<string, mixed>>
59 */
60 private static function getApplicantInformationFields(): array
61 {
62 return [
63 [
64 'id' => 1,
65 'fieldIndex' => 1,
66 'type' => 'name',
67 'label' => BackendStrings::getTemplateStrings()['full_name'],
68 'parentId' => null,
69 'defaultValue' => '',
70 'placeholder' => '',
71 'required' => true,
72 'readonly' => false,
73 'position' => 1,
74 ],
75 [
76 'id' => 2,
77 'type' => 'text',
78 'label' => BackendStrings::getNewFormStrings()['first_name'],
79 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
80 'required' => true,
81 'parentId' => 1,
82 'fieldIndex' => 1,
83 'defaultValue' => '',
84 'position' => 1,
85 'optionHide' => false,
86 'description' => '',
87 'settings' => json_encode(['nameFieldType' => 'nameField1']),
88 ],
89 [
90 'id' => 3,
91 'type' => 'text',
92 'label' => BackendStrings::getNewFormStrings()['last_name'],
93 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
94 'required' => true,
95 'parentId' => 1,
96 'fieldIndex' => 1,
97 'defaultValue' => '',
98 'position' => 2,
99 'optionHide' => false,
100 'description' => '',
101 'settings' => json_encode(['nameFieldType' => 'nameField2']),
102 ],
103 [
104 'id' => 4,
105 'fieldIndex' => 2,
106 'type' => 'email',
107 'label' => BackendStrings::getTemplateStrings()['email_address'],
108 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_email_address'],
109 'required' => true,
110 'parentId' => null,
111 'defaultValue' => '',
112 'position' => 2,
113 ],
114 [
115 'id' => 5,
116 'fieldIndex' => 3,
117 'type' => 'phone',
118 'label' => BackendStrings::getTemplateStrings()['phone_number'],
119 'placeholder' => '+1 (_) _-_',
120 'required' => true,
121 'parentId' => null,
122 'defaultValue' => '',
123 'position' => 3,
124 'phoneAutoDetect' => true,
125 ],
126 ];
127 }
128
129 /**
130 * Get work experience fields
131 *
132 * @return array<int, array<string, mixed>>
133 */
134 private static function getWorkExperienceFields(): array
135 {
136 return [
137 [
138 'id' => 6,
139 'fieldIndex' => 4,
140 'type' => 'textarea',
141 'label' => BackendStrings::getTemplateStrings()['work_experience_in_logistics'],
142 'placeholder' => BackendStrings::getTemplateStrings()['enter_work_experience_in_logistics'],
143 'required' => true,
144 'parentId' => null,
145 'defaultValue' => '',
146 'position' => 4,
147 'rows' => 3,
148 ],
149 [
150 'id' => 7,
151 'fieldIndex' => 5,
152 'type' => 'radio',
153 'label' => BackendStrings::getTemplateStrings()['forklift_license'],
154 'required' => true,
155 'parentId' => null,
156 'defaultValue' => '',
157 'placeholder' => '',
158 'position' => 5,
159 'fieldOptions' => [
160 [
161 'id' => 8,
162 'label' => BackendStrings::getTemplateStrings()['yes'],
163 'value' => 'Yes',
164 'isDefault' => false,
165 'position' => 1,
166 ],
167 [
168 'id' => 9,
169 'label' => BackendStrings::getTemplateStrings()['no'],
170 'value' => 'No',
171 'isDefault' => false,
172 'position' => 2,
173 ],
174 ],
175 ],
176 [
177 'id' => 10,
178 'fieldIndex' => 6,
179 'type' => 'file-upload',
180 'label' => BackendStrings::getTemplateStrings()['safety_certifications'],
181 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
182 'required' => false,
183 'parentId' => null,
184 'defaultValue' => '',
185 'position' => 6,
186 'maxFileSizeMb' => 999,
187 'saveUploadsTo' => 'ivyforms',
188 'allowedFileExtensions' => [],
189 'allowMultiple' => false,
190 'maxUploadCount' => 0,
191 ],
192 [
193 'id' => 11,
194 'fieldIndex' => 7,
195 'type' => 'checkbox',
196 'label' => BackendStrings::getTemplateStrings()['physical_capability_confirmation'],
197 'placeholder' => '',
198 'required' => true,
199 'parentId' => null,
200 'defaultValue' => '',
201 'position' => 7,
202 'fieldOptions' => [
203 [
204 'id' => 12,
205 'label' => BackendStrings::getTemplateStrings()['physical_capability_confirmation_option'],
206 'value' => 'confirmed',
207 'isDefault' => false,
208 'position' => 1,
209 ],
210 ],
211 ],
212 ];
213 }
214
215 /**
216 * Get employment details fields
217 *
218 * @return array<int, array<string, mixed>>
219 */
220 private static function getEmploymentDetailsFields(): array
221 {
222 return [
223 [
224 'id' => 13,
225 'fieldIndex' => 8,
226 'type' => 'select',
227 'label' => BackendStrings::getTemplateStrings()['shift_availability'],
228 'placeholder' => BackendStrings::getTemplateStrings()['select_shift_availability'],
229 'required' => true,
230 'parentId' => null,
231 'defaultValue' => '',
232 'position' => 8,
233 'fieldOptions' => [
234 [
235 'id' => 14,
236 'label' => BackendStrings::getTemplateStrings()['morning_shift'],
237 'value' => 'Morning',
238 'isDefault' => false,
239 'position' => 1,
240 ], [
241 'id' => 15,
242 'label' => BackendStrings::getTemplateStrings()['afternoon_shift'],
243 'value' => 'Afternoon',
244 'isDefault' => false,
245 'position' => 2,
246 ], [
247 'id' => 16,
248 'label' => BackendStrings::getTemplateStrings()['night_shift'],
249 'value' => 'Night',
250 'isDefault' => false,
251 'position' => 3,
252 ], [
253 'id' => 17,
254 'label' => BackendStrings::getTemplateStrings()['flexible_shift'],
255 'value' => 'Flexible',
256 'isDefault' => false,
257 'position' => 4,
258 ]
259 ],
260 ],
261 [
262 'id' => 18,
263 'fieldIndex' => 9,
264 'type' => 'radio',
265 'label' => BackendStrings::getTemplateStrings()['heavy_lifting_experience'],
266 'required' => true,
267 'parentId' => null,
268 'defaultValue' => '',
269 'placeholder' => '',
270 'position' => 9,
271 'fieldOptions' => [
272 [
273 'id' => 19,
274 'label' => BackendStrings::getTemplateStrings()['yes'],
275 'value' => 'Yes',
276 'isDefault' => false,
277 'position' => 1,
278 ],
279 [
280 'id' => 20,
281 'label' => BackendStrings::getTemplateStrings()['no'],
282 'value' => 'No',
283 'isDefault' => false,
284 'position' => 2,
285 ],
286 ],
287 ],
288 [
289 'id' => 21,
290 'fieldIndex' => 10,
291 'type' => 'textarea',
292 'label' => BackendStrings::getTemplateStrings()['previous_employers'],
293 'placeholder' => BackendStrings::getTemplateStrings()['enter_previous_employers'],
294 'required' => false,
295 'parentId' => null,
296 'defaultValue' => '',
297 'position' => 10,
298 'rows' => 3,
299 ],
300 ];
301 }
302
303 /**
304 * Get documents and contact fields
305 *
306 * @return array<int, array<string, mixed>>
307 */
308 private static function getDocumentsAndContactFields(): array
309 {
310 return [
311 [
312 'id' => 22,
313 'fieldIndex' => 11,
314 'type' => 'file-upload',
315 'label' => BackendStrings::getTemplateStrings()['cv_upload'],
316 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
317 'required' => true,
318 'parentId' => null,
319 'defaultValue' => '',
320 'position' => 11,
321 'maxFileSizeMb' => 999,
322 'saveUploadsTo' => 'ivyforms',
323 'allowedFileExtensions' => [],
324 'allowMultiple' => false,
325 'maxUploadCount' => 0,
326 ],
327 [
328 'id' => 23,
329 'fieldIndex' => 12,
330 'type' => 'file-upload',
331 'label' => BackendStrings::getTemplateStrings()['id_document_upload'],
332 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
333 'required' => true,
334 'parentId' => null,
335 'defaultValue' => '',
336 'position' => 12,
337 'maxFileSizeMb' => 999,
338 'saveUploadsTo' => 'ivyforms',
339 'allowedFileExtensions' => [],
340 'allowMultiple' => false,
341 'maxUploadCount' => 0,
342 ],
343 [
344 'id' => 24,
345 'fieldIndex' => 13,
346 'type' => 'textarea',
347 'label' => BackendStrings::getTemplateStrings()['emergency_contact'],
348 'placeholder' => BackendStrings::getTemplateStrings()['enter_emergency_contact'],
349 'required' => true,
350 'parentId' => null,
351 'defaultValue' => '',
352 'position' => 13,
353 'rows' => 3,
354 ],
355 ];
356 }
357 }
358