PluginProbe
The Innovative Form Builder – IvyForms / 0.9
The Innovative Form Builder – IvyForms v0.9
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 / ConferenceRoomBookingFormTemplate.php

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

293 lines 10.5 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 // phpcs:disable PSR1.Files.SideEffects
6 if (!defined('ABSPATH')) {
7 exit; // Exit if accessed directly
8 }
9
10 use IvyForms\Services\Translations\BackendStrings;
11
12 /**
13 * Conference Room Booking Form Template
14 */
15 class ConferenceRoomBookingFormTemplate
16 {
17 /**
18 * Get the template configuration
19 *
20 * @return array<string, mixed>
21 */
22 public static function getTemplate(): array
23 {
24 return [
25 'id' => 'conference_room_booking_form',
26 'name' => BackendStrings::getTemplateStrings()['conference_room_booking_form'],
27 'description' => BackendStrings::getTemplateStrings()[
28 'conference_room_booking_form_description'
29 ],
30 'category' => 'booking-forms',
31 'subcategory' => 'appointment-booking-forms',
32 'is_pro' => false,
33 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'conference-room-booking-form.svg',
34 'form_data' => [
35 'name' => BackendStrings::getTemplateStrings()['conference_room_booking_form'],
36 'published' => 1,
37 'showTitle' => 1,
38 'storeEntries' => 1,
39 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
40 'fields' => array_merge(
41 self::getContactInformationFields(),
42 self::getBookingDetailsFields(),
43 self::getAdditionalInformationFields()
44 ),
45 'settings' => []
46 ]
47 ];
48 }
49
50 /**
51 * Contact information fields (name, email, phone)
52 *
53 * @return array<int, array<string, mixed>>
54 */
55 private static function getContactInformationFields(): array
56 {
57 return [
58 // Full Name - Parent
59 [
60 'id' => 1,
61 'fieldIndex' => 1,
62 'type' => 'name',
63 'label' => BackendStrings::getTemplateStrings()['full_name'],
64 'parentId' => null,
65 'defaultValue' => '',
66 'placeholder' => '',
67 'required' => true,
68 'readonly' => false,
69 'position' => 1,
70 ],
71 // First Name - Child of Name Field
72 [
73 'id' => 2,
74 'type' => 'text',
75 'label' => BackendStrings::getTemplateStrings()['first_name'],
76 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
77 'required' => true,
78 'parentId' => 1,
79 'fieldIndex' => 1,
80 'defaultValue' => '',
81 'position' => 1,
82 'optionHide' => false,
83 'description' => '',
84 'settings' => json_encode(['nameFieldType' => 'nameField1']),
85 ],
86 // Last Name - Child of Name Field
87 [
88 'id' => 3,
89 'type' => 'text',
90 'label' => BackendStrings::getTemplateStrings()['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 // Email Address
102 [
103 'id' => 4,
104 'fieldIndex' => 2,
105 'type' => 'email',
106 'label' => BackendStrings::getTemplateStrings()['email_address'],
107 'placeholder' => BackendStrings::getTemplateStrings()['email_placeholder'],
108 'required' => true,
109 'parentId' => null,
110 'defaultValue' => '',
111 'position' => 2,
112 ],
113 // Phone Number
114 [
115 'id' => 5,
116 'fieldIndex' => 3,
117 'type' => 'phone',
118 'label' => BackendStrings::getTemplateStrings()['phone_number'],
119 'placeholder' => BackendStrings::getTemplateStrings()['phone_placeholder'],
120 'required' => false,
121 'parentId' => null,
122 'defaultValue' => '',
123 'position' => 3,
124 ],
125 ];
126 }
127
128 /**
129 * Booking details fields (department, date, time, attendees)
130 *
131 * @return array<int, array<string, mixed>>
132 */
133 private static function getBookingDetailsFields(): array
134 {
135 return [
136 // Department/Organization
137 [
138 'id' => 10,
139 'fieldIndex' => 4,
140 'type' => 'select',
141 'label' => BackendStrings::getTemplateStrings()['department_organization'],
142 'placeholder' => BackendStrings::getTemplateStrings()['select_department_organization'],
143 'required' => true,
144 'parentId' => null,
145 'defaultValue' => '',
146 'position' => 4,
147 'fieldOptions' => [
148 [
149 'id' => 6,
150 'label' => BackendStrings::getTemplateStrings()['hr'],
151 'value' => 'hr',
152 'isDefault' => false,
153 'position' => 1
154 ],
155 [
156 'id' => 7,
157 'label' => BackendStrings::getTemplateStrings()['marketing'],
158 'value' => 'marketing',
159 'isDefault' => false,
160 'position' => 2
161 ],
162 [
163 'id' => 8,
164 'label' => BackendStrings::getTemplateStrings()['it'],
165 'value' => 'it',
166 'isDefault' => false,
167 'position' => 3
168 ],
169 [
170 'id' => 9,
171 'label' => BackendStrings::getTemplateStrings()['other'],
172 'value' => 'other',
173 'isDefault' => false,
174 'position' => 4
175 ],
176 ]
177 ],
178 // Booking Date
179 [
180 'id' => 11,
181 'fieldIndex' => 5,
182 'type' => 'date',
183 'label' => BackendStrings::getTemplateStrings()['booking_date'],
184 'placeholder' => BackendStrings::getTemplateStrings()['select_booking_date'],
185 'required' => true,
186 'parentId' => null,
187 'defaultValue' => '',
188 'position' => 5,
189 'dateFieldType' => 'picker',
190 'dateFormat' => 'MM/DD/YYYY',
191 ],
192 // Start Time
193 [
194 'id' => 12,
195 'fieldIndex' => 6,
196 'type' => 'time',
197 'label' => BackendStrings::getTemplateStrings()['start_time'],
198 'placeholder' => BackendStrings::getTemplateStrings()['select_start_time'],
199 'required' => true,
200 'parentId' => null,
201 'defaultValue' => '',
202 'position' => 6,
203 ],
204 // End Time
205 [
206 'id' => 13,
207 'fieldIndex' => 7,
208 'type' => 'time',
209 'label' => BackendStrings::getTemplateStrings()['end_time'],
210 'placeholder' => BackendStrings::getTemplateStrings()['select_end_time'],
211 'required' => true,
212 'parentId' => null,
213 'defaultValue' => '',
214 'position' => 7,
215 ],
216 // Number of Attendees
217 [
218 'id' => 14,
219 'fieldIndex' => 8,
220 'type' => 'number',
221 'label' => BackendStrings::getTemplateStrings()['number_of_attendees'],
222 'placeholder' => BackendStrings::getTemplateStrings()['enter_number_of_attendees'],
223 'required' => true,
224 'parentId' => null,
225 'defaultValue' => '',
226 'position' => 8,
227 'minValue' => 1,
228 'maxValue' => 100,
229 ],
230 ];
231 }
232
233 /**
234 * Additional information fields (equipment, special requests)
235 *
236 * @return array<int, array<string, mixed>>
237 */
238 private static function getAdditionalInformationFields(): array
239 {
240 return [
241 // Equipment Needed
242 [
243 'id' => 18,
244 'fieldIndex' => 9,
245 'type' => 'checkbox',
246 'label' => BackendStrings::getTemplateStrings()['equipment_needed'],
247 'placeholder' => '',
248 'required' => false,
249 'parentId' => null,
250 'defaultValue' => '',
251 'position' => 9,
252 'fieldOptions' => [
253 [
254 'id' => 15,
255 'label' => BackendStrings::getTemplateStrings()['projector'],
256 'value' => 'projector',
257 'isDefault' => false,
258 'position' => 1
259 ],
260 [
261 'id' => 16,
262 'label' => BackendStrings::getTemplateStrings()['microphone'],
263 'value' => 'microphone',
264 'isDefault' => false,
265 'position' => 2
266 ],
267 [
268 'id' => 17,
269 'label' => BackendStrings::getTemplateStrings()['whiteboard'],
270 'value' => 'whiteboard',
271 'isDefault' => false,
272 'position' => 3
273 ],
274 ]
275 ],
276 // Special Requests / Notes
277 [
278 'id' => 19,
279 'fieldIndex' => 10,
280 'type' => 'textarea',
281 'label' => BackendStrings::getTemplateStrings()['special_requests_notes'],
282 'placeholder' => BackendStrings::getTemplateStrings()[
283 'special_requests_notes_placeholder'
284 ],
285 'required' => false,
286 'parentId' => null,
287 'defaultValue' => '',
288 'position' => 10,
289 ],
290 ];
291 }
292 }
293