PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.1
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.1
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-leave-request.php

class-template-leave-request.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.1, at includes/templates/class-template-leave-request.php

90 lines 3.2 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_Leave_Request extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = true;
12 $this->title = __( 'Request for Leave', 'weforms' );
13 $this->description = __( 'Get an instant leave request from your employees with this easy to fill-out a request form and get details without any conflicts.', 'weforms' );
14 $this->image = WEFORMS_ASSET_URI . '/images/form-template/leave_request.png';
15 $this->category = 'employment';
16 }
17
18 /**
19 * Get the form fields
20 *
21 * @return array
22 */
23 public function get_form_fields() {
24 $all_fields = $this->get_available_fields();
25
26 $form_fields = [
27 array_merge( $all_fields['name_field']->get_field_props(), [
28 'requied' => 'yes',
29 'label' => __( 'Name', 'weforms' ),
30 'format' => 'first-last',
31 'name' => 'format',
32 ] ),
33
34 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
35 'requied' => 'yes',
36 'label' => __( 'Employee ID', 'weforms' ),
37 'name' => 'employee_id',
38 ] ),
39
40 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
41 'required' => 'yes',
42 'label' => __( 'Phone Number', 'weforms' ),
43 'name' => 'phone_number',
44 ] ),
45
46 array_merge( $all_fields['text_field']->get_field_props(), [
47 'label' => __( 'Position', 'weforms' ),
48 'name' => 'position',
49 ] ),
50
51 array_merge( $all_fields['text_field']->get_field_props(), [
52 'required' => 'yes',
53 'label' => __( 'Manager', 'weforms' ),
54 'name' => 'manager',
55 ] ),
56
57 array_merge( $all_fields['date_field']->get_field_props(), [
58 'required' => 'yes',
59 'label' => __( 'Leave Start', 'weforms' ),
60 'name' => 'leave_start',
61 ] ),
62
63 array_merge( $all_fields['date_field']->get_field_props(), [
64 'required' => 'yes',
65 'label' => __( 'Leave End', 'weforms' ),
66 'name' => 'leave_end',
67 ] ),
68
69 array_merge( $all_fields['radio_field']->get_field_props(), [
70 'required' => 'yes',
71 'label' => __( 'Leave Type', 'weforms' ),
72 'name' => 'leave_type',
73 'options' => [
74 'vacation' => 'Vacation',
75 'sick' => 'Sick',
76 'quitting' => 'Quitting',
77 'other' => 'Other',
78 ],
79 ] ),
80
81 array_merge( $all_fields['textarea_field']->get_field_props(), [
82 'label' => __( 'Comments', 'weforms' ),
83 'name' => 'comment',
84 ] ),
85 ];
86
87 return $form_fields;
88 }
89 }
90