Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16295 anderson 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\Chat;
6
 
7
use Laminas\Form\Form;
8
use Laminas\Db\Adapter\AdapterInterface;
9
use LeadersLinked\Mapper\DegreeMapper;
10
use LeadersLinked\Model\ZoomMeeting;
11
use LeadersLinked\Library\Functions;
12
use Laminas\Db\Adapter\Adapter;
13
use LeadersLinked\Model\User;
14
use LeadersLinked\Mapper\ChatUserMapper;
15
use LeadersLinked\Mapper\UserMapper;
16
 
17
class ZoomAddForm extends Form
18
{
19
 
20
    /**
21
     *
22
     * @param Adapter $adapter
23
     * @param User $user
24
     */
25
    public function __construct()
26
    {
27
        parent::__construct();
28
 
29
        $this->setInputFilter(new ZoomAddFilter());
30
        //Anderson
31
 
32
        $this->add([
33
            'name' => 'duration',
34
            'type' => \Laminas\Form\Element\Select::class,
35
            'options' => [
36
                'value_options' => [
37
                    5 => 'LABEL_5_MINUTES',
38
                    10 => 'LABEL_10_MINUTES',
39
                    15 => 'LABEL_15_MINUTES',
40
                    20 => 'LABEL_20_MINUTES',
41
                    25 => 'LABEL_25_MINUTES',
42
                    30 => 'LABEL_30_MINUTES',
43
                    35 => 'LABEL_35_MINUTES',
44
                    40 => 'LABEL_40_MINUTES',
45
                    45 => 'LABEL_45_MINUTES',
46
 
47
                ]
48
            ],
49
            'attributes' => [
50
                'id' => 'duration',
51
            ]
52
        ]);
53
 
54
        $this->add([
55
            'name' => 'password',
56
            'type' => \Laminas\Form\Element\Text::class,
57
            'attributes' => [
58
                'maxlength'     => 6,
59
                'id'             => 'password',
60
            ]
61
        ]);
62
 
63
        $this->add([
64
            'name' => 'type',
65
            'type' => \Laminas\Form\Element\Select::class,
66
            'options' => [
67
                'value_options' => [
68
                    ZoomMeeting::TYPE_INSTANT => 'LABEL_ZOOM_MEETING_TYPE_INSTANT',
69
                    ZoomMeeting::TYPE_SCHEDULED => 'LABEL_ZOOM_MEETING_TYPE_SCHEDULED',
70
                ]
71
            ],
72
            'attributes' => [
73
                'id' => 'type',
74
            ]
75
        ]);
76
 
77
        $this->add([
78
            'name' => 'title',
79
            'type' => \Laminas\Form\Element\Text::class,
80
            'attributes' => [
81
                'maxlength'     => 128,
82
                'id'             => 'title',
83
            ]
84
        ]);
85
 
86
        $this->add([
87
            'name' => 'description',
88
            'type' => \Laminas\Form\Element\Textarea::class,
89
            'attributes' => [
90
                'id'             => 'description',
91
            ]
92
        ]);
93
 
94
        $this->add([
95
            'name' => 'date',
96
            'type' => \Laminas\Form\Element\Text::class,
97
            'attributes' => [
98
                'maxlength'     => 10,
99
                'id'             => 'date',
100
            ]
101
        ]);
102
 
103
        $this->add([
104
            'name' => 'time',
105
            'type' => \Laminas\Form\Element\Text::class,
106
            'attributes' => [
107
                'maxlength'     => 10,
108
                'id'             => 'time',
109
            ]
110
        ]);
111
    }
112
 
113
 
114
    /**
115
     *
116
     * @return array
117
     */
118
    private function optionsTimezone()
119
    {
120
 
121
        $records = Functions::getAllTimeZones();
122
 
123
        $items = [];
124
        foreach ($records as $record) {
125
            $items[$record] = $record;
126
        }
127
 
128
        return $items;
129
    }
130
}