PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.28
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.28
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / templates / class-template-employee-information.php

class-template-employee-information.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.28, at includes/templates/class-template-employee-information.php

248 lines 9.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Blank form template
5 */
6 class WeForms_Template_Employee_Information extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = class_exists( 'WeForms_Pro' );
12 $this->title = __( 'Employee Information', 'weforms' );
13 $this->description = __( 'Keep a record of your employee’s information with this form. This includes personal information, job information and emergency contact information sections.', 'weforms' );
14 $this->category = 'default';
15 $this->image = WEFORMS_ASSET_URI . '/images/form-template/employee_information.png';
16 $this->category = 'employment';
17 }
18
19 /**
20 * Get the form fields
21 *
22 * @return array
23 */
24 public function get_form_fields() {
25 $all_fields = $this->get_available_fields();
26
27 $form_fields = [
28 array_merge( $all_fields['step_start']->get_field_props(), [
29 'label' => __( 'Personal Information', 'weforms' ),
30 'name' => 'personal_information',
31 'step_start' => [
32 'prev_button_text' => __( 'Previous', 'weforms' ),
33 'next_button_text' => __( 'Next', 'weforms' ),
34 ],
35 ] ),
36
37 array_merge( $all_fields['name_field']->get_field_props(), [
38 'required' => 'yes',
39 'format' => 'first-middle-last',
40 'first_name' => [
41 'placeholder' => '',
42 'default' => '',
43 'sub' => __( 'First', 'weforms' ),
44 ],
45
46 'middle_name' => [
47 'placeholder' => '',
48 'default' => '',
49 'sub' => __( 'Middle', 'weforms' ),
50 ],
51 'last_name' => [
52 'placeholder' => '',
53 'default' => '',
54 'sub' => __( 'Last', 'weforms' ),
55 ],
56 'hide_subs' => false,
57 'name' => 'format',
58 ] ),
59
60 array_merge( $all_fields['address_field']->get_field_props(), [
61 'required' => 'yes',
62 'label' => 'Address',
63 'name' => 'address',
64 ] ),
65
66 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
67 'required' => 'yes',
68 'label' => __( 'Phone Number', 'weforms' ),
69 'name' => 'phone_number',
70 ] ),
71
72 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
73 'label' => __( 'Alt. Phone Number', 'weforms' ),
74 'name' => 'alt_phone_number',
75 ] ),
76
77 array_merge( $all_fields['email_address']->get_field_props(), [
78 'label' => __( 'Email Address', 'weforms' ),
79 'name' => 'email_address',
80 ] ),
81
82 array_merge( $all_fields['date_field']->get_field_props(), [
83 'label' => __( 'Birth Date', 'weforms' ),
84 'name' => 'birth_date',
85 ] ),
86
87 array_merge( $all_fields['dropdown_field']->get_field_props(), [
88 'label' => __( 'Marital Status', 'weforms' ),
89 'name' => 'marital_status',
90 'options' => [
91 'single' => __( 'Single', 'weforms' ),
92 'married' => __( 'Married', 'weforms' ),
93 'widowed' => __( 'Widowed', 'weforms' ),
94 'divorced' => __( 'Divorced', 'weforms' ),
95 ],
96
97 'first' => ' ',
98 ] ),
99
100 array_merge( $all_fields['name_field']->get_field_props(), [
101 'label' => __( 'Spouse\'s Name', 'weforms' ),
102 'format' => 'first-last',
103 'first_name' => [
104 'placeholder' => '',
105 'default' => '',
106 'sub' => __( 'First', 'weforms' ),
107 ],
108 'last_name' => [
109 'placeholder' => '',
110 'default' => '',
111 'sub' => __( 'Last', 'weforms' ),
112 ],
113 'hide_subs' => false,
114 'name' => 'spause_name',
115 ] ),
116
117 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
118 'label' => __( 'Spouse\' s Work Phone', 'weforms' ),
119 'name' => 'spouse_work_phone_number',
120 ] ),
121
122 array_merge( $all_fields['step_start']->get_field_props(), [
123 'label' => __( 'Job Information', 'weforms' ),
124 'name' => 'job_information',
125 'step_start' => [
126 'prev_button_text' => __( 'Previous', 'weforms' ),
127 'next_button_text' => __( 'Next', 'weforms' ),
128 ],
129 ] ),
130
131 array_merge( $all_fields['text_field']->get_field_props(), [
132 'label' => __( 'Title', 'weforms' ),
133 'name' => 'title',
134 ] ),
135
136 array_merge( $all_fields['text_field']->get_field_props(), [
137 'label' => __( 'Employee ID', 'weforms' ),
138 'name' => 'employee_id',
139 ] ),
140
141 array_merge( $all_fields['text_field']->get_field_props(), [
142 'label' => __( 'Supervisor', 'weforms' ),
143 'name' => 'supervisor',
144 ] ),
145
146 array_merge( $all_fields['text_field']->get_field_props(), [
147 'label' => __( 'Department', 'weforms' ),
148 'name' => 'department',
149 ] ),
150
151 array_merge( $all_fields['text_field']->get_field_props(), [
152 'label' => __( 'Work Location', 'weforms' ),
153 'name' => 'work_location',
154 ] ),
155
156 array_merge( $all_fields['email_address']->get_field_props(), [
157 'label' => __( 'Email Address', 'weforms' ),
158 'name' => 'work_email_address',
159 ] ),
160
161 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
162 'label' => __( 'Work Number', 'weforms' ),
163 'name' => 'work_number',
164 ] ),
165
166 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
167 'label' => __( 'Cell Phone', 'weforms' ),
168 'name' => 'cell_phone',
169 ] ),
170
171 array_merge( $all_fields['date_field']->get_field_props(), [
172 'label' => __( 'Start Date', 'weforms' ),
173 'name' => 'start_date',
174 ] ),
175
176 array_merge( $all_fields['text_field']->get_field_props(), [
177 'label' => __( 'Salary', 'weforms' ),
178 'name' => 'salary',
179 'placeholder' => '$',
180 ] ),
181
182 array_merge( $all_fields['step_start']->get_field_props(), [
183 'label' => __( 'Emergency Contact information', 'weforms' ),
184 'name' => 'emergency_contact_information',
185 'step_start' => [
186 'prev_button_text' => __( 'Previous', 'weforms' ),
187 'next_button_text' => __( 'Next', 'weforms' ),
188 ],
189 ] ),
190
191 array_merge( $all_fields['name_field']->get_field_props(), [
192 'format' => 'first-last',
193 'first_name' => [
194 'placeholder' => '',
195 'default' => '',
196 'sub' => __( 'First', 'weforms' ),
197 ],
198
199 'last_name' => [
200 'placeholder' => '',
201 'default' => '',
202 'sub' => __( 'Last', 'weforms' ),
203 ],
204 'hide_subs' => false,
205 'name' => 'emargency_person_name',
206 ] ),
207
208 array_merge( $all_fields['name_field']->get_field_props(), [
209 'label' => __( 'Address', 'weforms' ),
210 'name' => 'emargency_address',
211 ] ),
212
213 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
214 'label' => 'Phone Number',
215 'name' => 'ematgency_phone_number',
216 ] ),
217
218 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
219 'label' => 'Alt. Phone Number',
220 'name' => 'alt_ematgency_phone_number',
221 ] ),
222
223 array_merge( $all_fields['text_field']->get_field_props(), [
224 'label' => 'Relationship',
225 'name' => 'relationship',
226 ] ),
227 ];
228
229 return $form_fields;
230 }
231
232 /**
233 * Get the form settings
234 *
235 * @return array
236 */
237 public function get_form_settings() {
238 $defaults = $this->get_default_settings();
239
240 return array_merge( $defaults, [
241 'submit_text' => __( 'Submit', 'weforms' ),
242 'label_position' => 'above',
243 'enable_multistep' => true,
244 'multistep_progressbar_type' => 'step_by_step',
245 ] );
246 }
247 }
248