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

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

315 lines 11.8 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 OfficeSpaceRentalApplicationFormTemplate
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' => 'office_space_rental_application_form',
18 'name' => BackendStrings::getTemplateStrings()['office_space_rental_application_form'],
19 'description' => BackendStrings::getTemplateStrings()['office_space_rental_application_form_desc'],
20 'category' => 'application-forms',
21 'subcategory' => 'tenant-application-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'office-space-rental-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()['office_space_rental_application_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getCompanyInformationFields(),
45 self::getSpaceRequirementsFields(),
46 self::getDocumentsAndReferencesFields()
47 ),
48 'settings' => [],
49 ],
50 ]
51 );
52 }
53
54 /**
55 * Get company contact fields
56 *
57 * @return array<int, array<string, mixed>>
58 */
59 private static function getCompanyInformationFields(): array
60 {
61 return [
62 [
63 'id' => 1,
64 'fieldIndex' => 1,
65 'type' => 'text',
66 'label' => BackendStrings::getTemplateStrings()['company_name'],
67 'placeholder' => BackendStrings::getTemplateStrings()['enter_company_name'],
68 'required' => true,
69 'parentId' => null,
70 'defaultValue' => '',
71 'position' => 1,
72 ],
73 [
74 'id' => 2,
75 'fieldIndex' => 2,
76 'type' => 'email',
77 'label' => BackendStrings::getTemplateStrings()['email_address'],
78 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_email_address'],
79 'required' => true,
80 'parentId' => null,
81 'defaultValue' => '',
82 'position' => 2,
83 ],
84 [
85 'id' => 3,
86 'fieldIndex' => 3,
87 'type' => 'phone',
88 'label' => BackendStrings::getTemplateStrings()['phone_number'],
89 'placeholder' => '+1 (_) _-_',
90 'required' => true,
91 'parentId' => null,
92 'defaultValue' => '',
93 'position' => 3,
94 ],
95 ];
96 }
97
98 /**
99 * Get office space requirement fields
100 *
101 * @return array<int, array<string, mixed>>
102 */
103 private static function getSpaceRequirementsFields(): array
104 {
105 return [
106 [
107 'id' => 4,
108 'fieldIndex' => 4,
109 'type' => 'select',
110 'label' => BackendStrings::getTemplateStrings()['business_type'],
111 'placeholder' => BackendStrings::getTemplateStrings()['select_business_type'],
112 'required' => true,
113 'parentId' => null,
114 'defaultValue' => '',
115 'position' => 4,
116 'fieldOptions' => [
117 [
118 'id' => 5,
119 'label' => BackendStrings::getTemplateStrings()['retail_business'],
120 'value' => 'Retail',
121 'isDefault' => false,
122 'position' => 1,
123 ],
124 [
125 'id' => 6,
126 'label' => BackendStrings::getTemplateStrings()['office_business'],
127 'value' => 'Office',
128 'isDefault' => false,
129 'position' => 2,
130 ],
131 [
132 'id' => 7,
133 'label' => BackendStrings::getTemplateStrings()['restaurant_business'],
134 'value' => 'Restaurant',
135 'isDefault' => false,
136 'position' => 3,
137 ],
138 [
139 'id' => 8,
140 'label' => BackendStrings::getTemplateStrings()['warehouse_business'],
141 'value' => 'Warehouse',
142 'isDefault' => false,
143 'position' => 4,
144 ],
145 [
146 'id' => 9,
147 'label' => BackendStrings::getTemplateStrings()['other'],
148 'value' => 'Other',
149 'isDefault' => false,
150 'position' => 5,
151 ],
152 ],
153 ],
154 [
155 'id' => 10,
156 'fieldIndex' => 5,
157 'type' => 'number',
158 'label' => BackendStrings::getTemplateStrings()['number_of_employees'],
159 'placeholder' => BackendStrings::getTemplateStrings()['enter_number_of_employees'],
160 'required' => true,
161 'parentId' => null,
162 'defaultValue' => '',
163 'position' => 5,
164 ],
165 [
166 'id' => 11,
167 'fieldIndex' => 6,
168 'type' => 'textarea',
169 'label' => BackendStrings::getTemplateStrings()['office_space_requirements'],
170 'placeholder' => BackendStrings::getTemplateStrings()['enter_office_space_requirements'],
171 'required' => true,
172 'parentId' => null,
173 'defaultValue' => '',
174 'position' => 6,
175 'rows' => 4,
176 ],
177 [
178 'id' => 12,
179 'fieldIndex' => 7,
180 'type' => 'select',
181 'label' => BackendStrings::getTemplateStrings()['desired_lease_duration'],
182 'placeholder' => BackendStrings::getTemplateStrings()['select_desired_lease_duration'],
183 'required' => true,
184 'parentId' => null,
185 'defaultValue' => '',
186 'position' => 7,
187 'fieldOptions' => [
188 [
189 'id' => 13,
190 'label' => BackendStrings::getTemplateStrings()['lease_duration_6_months'],
191 'value' => '6 months',
192 'isDefault' => false,
193 'position' => 1,
194 ],
195 [
196 'id' => 14,
197 'label' => BackendStrings::getTemplateStrings()['lease_duration_1_year'],
198 'value' => '1 year',
199 'isDefault' => false,
200 'position' => 2,
201 ],
202 [
203 'id' => 15,
204 'label' => BackendStrings::getTemplateStrings()['lease_duration_2_years'],
205 'value' => '2 years',
206 'isDefault' => false,
207 'position' => 3,
208 ],
209 [
210 'id' => 16,
211 'label' => BackendStrings::getTemplateStrings()['lease_duration_3_plus_years'],
212 'value' => '3+ years',
213 'isDefault' => false,
214 'position' => 4,
215 ],
216 ],
217 ],
218 [
219 'id' => 17,
220 'fieldIndex' => 8,
221 'type' => 'number',
222 'label' => BackendStrings::getTemplateStrings()['monthly_budget_range'],
223 'placeholder' => BackendStrings::getTemplateStrings()['enter_monthly_budget_range'],
224 'required' => true,
225 'parentId' => null,
226 'defaultValue' => '',
227 'position' => 8,
228 ],
229 ];
230 }
231
232 /**
233 * Get document upload and reference fields
234 *
235 * @return array<int, array<string, mixed>>
236 */
237 private static function getDocumentsAndReferencesFields(): array
238 {
239 return [
240 [
241 'id' => 18,
242 'fieldIndex' => 9,
243 'type' => 'file-upload',
244 'label' => BackendStrings::getTemplateStrings()['financial_statements'],
245 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
246 'required' => true,
247 'parentId' => null,
248 'defaultValue' => '',
249 'position' => 9,
250 'maxFileSizeMb' => 999,
251 'saveUploadsTo' => 'ivyforms',
252 'allowedFileExtensions' => [],
253 'allowMultiple' => false,
254 'maxUploadCount' => 0,
255 ],
256 [
257 'id' => 19,
258 'fieldIndex' => 10,
259 'type' => 'file-upload',
260 'label' => BackendStrings::getTemplateStrings()['business_registration_document'],
261 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
262 'required' => true,
263 'parentId' => null,
264 'defaultValue' => '',
265 'position' => 10,
266 'maxFileSizeMb' => 999,
267 'saveUploadsTo' => 'ivyforms',
268 'allowedFileExtensions' => [],
269 'allowMultiple' => false,
270 'maxUploadCount' => 0,
271 ],
272 [
273 'id' => 20,
274 'fieldIndex' => 11,
275 'type' => 'textarea',
276 'label' => BackendStrings::getTemplateStrings()['previous_office_rental_experience'],
277 'placeholder' => BackendStrings::getTemplateStrings()['enter_previous_office_rental_experience'],
278 'required' => false,
279 'parentId' => null,
280 'defaultValue' => '',
281 'position' => 11,
282 'rows' => 3,
283 ],
284 [
285 'id' => 21,
286 'fieldIndex' => 12,
287 'type' => 'textarea',
288 'label' => BackendStrings::getTemplateStrings()['references'],
289 'placeholder' => BackendStrings::getTemplateStrings()['enter_references'],
290 'required' => false,
291 'parentId' => null,
292 'defaultValue' => '',
293 'position' => 12,
294 'rows' => 3,
295 ],
296 [
297 'id' => 22,
298 'fieldIndex' => 13,
299 'type' => 'file-upload',
300 'label' => BackendStrings::getTemplateStrings()['id_legal_representative_document'],
301 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
302 'required' => true,
303 'parentId' => null,
304 'defaultValue' => '',
305 'position' => 13,
306 'maxFileSizeMb' => 999,
307 'saveUploadsTo' => 'ivyforms',
308 'allowedFileExtensions' => [],
309 'allowMultiple' => false,
310 'maxUploadCount' => 0,
311 ],
312 ];
313 }
314 }
315