Proyectos de Subversion LeadersLinked - Backend

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16701 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\FastSurvey;
6
 
7
use Laminas\Form\Form;
8
use LeadersLinked\Model\FastSurvey;
9
 
10
 
11
class FastSurveyForm extends Form
12
{
13
 
14
    public function __construct()
15
    {
16
        parent::__construct();
17
        $this->setInputFilter(new FastSurveyFilter());
18
 
19
 
20
        $this->add([
21
            'name' => 'question',
22
            'type' => \Laminas\Form\Element\TextArea::class,
23
            'attributes' => [
24
                'maxlength' 	=> 1024,
25
                'id' 			=> 'question',
26
            ]
27
        ]);
28
 
29
 
30
 
31
        $this->add([
32
            'name' => 'number_of_answers',
33
            'type' => \Laminas\Form\Element\Select::class,
34
            'attributes' => [
35
                'id' => 'number_of_answers',
36
            ],
37
            'options' => [
38
                'value_options' => [
39
                    2 => '2',
40
                    3 => '3',
41
                    4 => '4',
42
                    5 => '5'
43
                ]
44
            ]
45
        ]);
46
 
47
        $this->add([
48
            'name' => 'answer1',
49
            'type' => \Laminas\Form\Element\Text::class,
50
            'attributes' => [
51
                'maxlength' 	=> 100,
52
                'id' 			=> 'answer1',
53
            ]
54
        ]);
55
 
56
        $this->add([
57
            'name' => 'answer2',
58
            'type' => \Laminas\Form\Element\Text::class,
59
            'attributes' => [
60
                'maxlength' 	=> 100,
61
                'id' 			=> 'answer2',
62
            ]
63
        ]);
64
 
65
        $this->add([
66
            'name' => 'answer3',
67
            'type' => \Laminas\Form\Element\Text::class,
68
            'attributes' => [
69
                'maxlength' 	=> 100,
70
                'id' 			=> 'answer3',
71
            ]
72
        ]);
73
 
74
 
75
        $this->add([
76
            'name' => 'answer4',
77
            'type' => \Laminas\Form\Element\Text::class,
78
            'attributes' => [
79
                'maxlength' 	=> 100,
80
                'id' 			=> 'answer4',
81
            ]
82
        ]);
83
 
84
        $this->add([
85
            'name' => 'answer5',
86
            'type' => \Laminas\Form\Element\Text::class,
87
            'attributes' => [
88
                'maxlength' 	=> 100,
89
                'id' 			=> 'answer5',
90
            ]
91
        ]);
92
 
93
 
94
        $this->add([
95
            'name' => 'privacy',
96
            'type' => \Laminas\Form\Element\Select::class,
97
            'attributes' => [
98
                'id' => 'privacy',
99
            ],
100
            'options' => [
101
                'value_options' => [
102
                    FastSurvey::PRIVACY_COMPANY => 'LABEL_COMPANY',
103
                    FastSurvey::PRIVACY_PUBLIC => 'LABEL_PUBLIC',
104
                ]
105
            ]
106
        ]);
107
 
108
        $this->add([
109
            'name' => 'result_type',
110
            'type' => \Laminas\Form\Element\Select::class,
111
            'attributes' => [
112
                'id' => 'result_type',
113
            ],
114
            'options' => [
115
                'value_options' => [
116
                    FastSurvey::RESULT_TYPE_PRIVATE => 'LABEL_PRIVATE',
117
                    FastSurvey::RESULT_TYPE_PUBLIC => 'LABEL_PUBLIC',
118
                ]
119
            ]
120
        ]);
121
 
122
 
123
        $this->add([
124
            'name' => 'duration_days',
125
            'type' => \Laminas\Form\Element\Number::class,
126
            'attributes' => [
127
                'min' 	=> 1,
128
                'max'   => 29,
129
                'step'  => 1,
130
                'id'    => 'duration_days',
131
            ]
132
        ]);
133
 
134
        $this->add([
135
            'name' => 'duration_hours',
136
            'type' => \Laminas\Form\Element\Number::class,
137
            'attributes' => [
138
                'min' 	=> 0,
139
                'max'   => 23,
140
                'step'  => 1,
141
                'id'    => 'duration_hours',
142
            ]
143
        ]);
144
 
145
        $this->add([
146
            'name' => 'duration_minutes',
147
            'type' => \Laminas\Form\Element\Number::class,
148
            'attributes' => [
149
                'min' 	=> 0,
150
                'max'   => 59,
151
                'step'  => 1,
152
                'id'    => 'duration_minutes',
153
            ]
154
        ]);
155
    }
156
}