Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5884 | | 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' => [
5885 anderson 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',
4131 efrain 46
 
47
                ]
48
            ],
49
            'attributes' => [
50
                'id' => 'duration',
51
            ]
52
        ]);
5876 anderson 53
 
4131 efrain 54
        $this->add([
55
            'name' => 'password',
56
            'type' => \Laminas\Form\Element\Text::class,
57
            'attributes' => [
5876 anderson 58
                'maxlength'     => 6,
59
                'id'             => 'password',
4131 efrain 60
            ]
61
        ]);
5876 anderson 62
 
4131 efrain 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
        ]);
5876 anderson 76
 
4131 efrain 77
        $this->add([
78
            'name' => 'title',
79
            'type' => \Laminas\Form\Element\Text::class,
80
            'attributes' => [
5876 anderson 81
                'maxlength'     => 128,
82
                'id'             => 'title',
4131 efrain 83
            ]
84
        ]);
5876 anderson 85
 
4131 efrain 86
        $this->add([
87
            'name' => 'description',
88
            'type' => \Laminas\Form\Element\Textarea::class,
89
            'attributes' => [
5876 anderson 90
                'id'             => 'description',
4131 efrain 91
            ]
92
        ]);
5876 anderson 93
 
4131 efrain 94
        $this->add([
95
            'name' => 'date',
96
            'type' => \Laminas\Form\Element\Text::class,
97
            'attributes' => [
5876 anderson 98
                'maxlength'     => 10,
99
                'id'             => 'date',
4131 efrain 100
            ]
101
        ]);
5876 anderson 102
 
4131 efrain 103
        $this->add([
104
            'name' => 'time',
105
            'type' => \Laminas\Form\Element\Text::class,
106
            'attributes' => [
5876 anderson 107
                'maxlength'     => 10,
108
                'id'             => 'time',
4131 efrain 109
            ]
110
        ]);
5876 anderson 111
    }
4131 efrain 112
 
113
 
114
    /**
115
     *
116
     * @return array
117
     */
118
    private function optionsTimezone()
119
    {
5876 anderson 120
 
5882 anderson 121
        $records = Functions::getAllTimeZones();
5876 anderson 122
 
5882 anderson 123
        $items = [];
124
        foreach ($records as $record) {
125
            $items[$record] = $record;
126
        }
5876 anderson 127
 
5882 anderson 128
        return $items;
4131 efrain 129
    }
5876 anderson 130
}