Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16785 efrain 1
<?php
2
declare(strict_types=1);
3
 
4
namespace LeadersLinked\Form\Planning;
5
 
6
use Laminas\Form\Form;
7
 
8
class PlanningPeriodForm extends Form
9
{
10
 
11
    public function __construct()
12
    {
13
        parent::__construct();
14
 
15
        $this->setInputFilter(new PlanningPeriodFilter());
16
 
17
        $this->add([
18
            'name' => 'title',
19
            'type' => \Laminas\Form\Element\Text::class,
20
            'attributes' => [
21
                'maxlength' 	=> 128,
22
                'id' 			=> 'title',
23
            ]
24
        ]);
25
 
26
        $this->add([
27
            'name' => 'description',
28
            'type' => \Laminas\Form\Element\Textarea::class,
29
            'attributes' => [
30
                'id'    => 'description',
31
                'maxlength' 	=> 1024,
32
                'rows' => 5,
33
            ]
34
        ]);
35
 
36
 
37
        $this->add([
38
            'name' => 'progress',
39
            'type' => \Laminas\Form\Element\Number::class,
40
            'attributes' => [
41
                'min' => 0,
42
                'max' => 100,
43
                'step' => 1,
44
                'id' => 'progress',
45
            ]
46
        ]);
47
 
48
 
49
        $this->add([
50
            'name' => 'status',
51
            'type' => \Laminas\Form\Element\Checkbox::class,
52
            'attributes' => [
53
                'id' 			=> 'status',
54
            ],
55
            'options' => [
56
                'use_hidden_element' => false,
57
                'unchecked_value' => \LeadersLinked\Model\PlanningPeriod::STATUS_INACTIVE,
58
                'checked_value'=> \LeadersLinked\Model\PlanningPeriod::STATUS_ACTIVE,
59
            ]
60
        ]);
61
 
62
        $this->add([
63
            'name' => 'date_range',
64
            'type' => \Laminas\Form\Element\Text::class,
65
            'attributes' => [
66
                'id'    => 'date_range',
67
            ]
68
        ]);
69
 
70
        $this->add([
71
            'name' => 'start',
72
            'type' => \Laminas\Form\Element\Hidden::class,
73
            'attributes' => [
74
                'id'    => 'start',
75
            ],
76
        ]);
77
 
78
        $this->add([
79
            'name' => 'end',
80
            'type' => \Laminas\Form\Element\Hidden::class,
81
            'attributes' => [
82
                'id'    => 'end',
83
            ],
84
        ]);
85
 
86
        $this->add([
87
            'name' => 'budget',
88
            'type' => \Laminas\Form\Element\Number::class,
89
            'attributes' => [
90
                'id'    => 'budget',
91
                'step' => 0.01,
92
                'min' => 0,
93
                'max' => 999999999999.99
94
            ],
95
        ]);
96
 
97
 
98
 
99
        $this->add([
100
            'name' => 'cost',
101
            'type' => \Laminas\Form\Element\Number::class,
102
            'attributes' => [
103
                'id'    => 'cost',
104
                'readonly' => 'readonly'
105
            ],
106
        ]);
107
 
108
 
109
    }
110
 
111
}