Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4131 | Rev 5878 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4131 efrain 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
     */
5876 anderson 25
    public function __construct()
4131 efrain 26
    {
27
        parent::__construct();
5876 anderson 28
 
4131 efrain 29
        $this->setInputFilter(new ZoomAddFilter());
5876 anderson 30
 
31
 
4131 efrain 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',
5876 anderson 46
                    120 => 'LABEL_120_MINUTES',
4131 efrain 47
 
48
                ]
49
            ],
50
            'attributes' => [
51
                'id' => 'duration',
52
            ]
53
        ]);
5876 anderson 54
 
4131 efrain 55
        $this->add([
56
            'name' => 'password',
57
            'type' => \Laminas\Form\Element\Text::class,
58
            'attributes' => [
5876 anderson 59
                'maxlength'     => 6,
60
                'id'             => 'password',
4131 efrain 61
            ]
62
        ]);
5876 anderson 63
 
4131 efrain 64
        $this->add([
65
            'name' => 'type',
66
            'type' => \Laminas\Form\Element\Select::class,
67
            'options' => [
68
                'value_options' => [
69
                    ZoomMeeting::TYPE_INSTANT => 'LABEL_ZOOM_MEETING_TYPE_INSTANT',
70
                    ZoomMeeting::TYPE_SCHEDULED => 'LABEL_ZOOM_MEETING_TYPE_SCHEDULED',
71
                ]
72
            ],
73
            'attributes' => [
74
                'id' => 'type',
75
            ]
76
        ]);
5876 anderson 77
 
4131 efrain 78
        $this->add([
79
            'name' => 'title',
80
            'type' => \Laminas\Form\Element\Text::class,
81
            'attributes' => [
5876 anderson 82
                'maxlength'     => 128,
83
                'id'             => 'title',
4131 efrain 84
            ]
85
        ]);
5876 anderson 86
 
4131 efrain 87
        $this->add([
88
            'name' => 'description',
89
            'type' => \Laminas\Form\Element\Textarea::class,
90
            'attributes' => [
5876 anderson 91
                'id'             => 'description',
4131 efrain 92
            ]
93
        ]);
5876 anderson 94
 
4131 efrain 95
        $this->add([
96
            'name' => 'date',
97
            'type' => \Laminas\Form\Element\Text::class,
98
            'attributes' => [
5876 anderson 99
                'maxlength'     => 10,
100
                'id'             => 'date',
4131 efrain 101
            ]
102
        ]);
5876 anderson 103
 
4131 efrain 104
        $this->add([
105
            'name' => 'time',
106
            'type' => \Laminas\Form\Element\Text::class,
107
            'attributes' => [
5876 anderson 108
                'maxlength'     => 10,
109
                'id'             => 'time',
4131 efrain 110
            ]
111
        ]);
5876 anderson 112
    }
4131 efrain 113
 
114
 
115
    /**
116
     *
117
     * @return array
118
     */
119
    private function optionsTimezone()
120
    {
5876 anderson 121
 
4131 efrain 122
        $records = Functions::getAllTimeZones();
5876 anderson 123
 
4131 efrain 124
        $items = [];
5876 anderson 125
        foreach ($records as $record) {
4131 efrain 126
            $items[$record] = $record;
127
        }
5876 anderson 128
 
4131 efrain 129
        return $items;
130
    }
5876 anderson 131
}