Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
7241 nelberth 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form;
6
 
7
use Laminas\Form\Form;
8
use Laminas\Db\Adapter\AdapterInterface;
9
use Laminas\Log\LoggerInterface;
10
use LeadersLinked\Model\HighPerformanceTeamsGroups;
11
use Laminas\Form\Element;
12
 
7273 nelberth 13
use LeadersLinked\Mapper\UserMapper;
14
 
15
use LeadersLinked\Mapper\CompanyUserMapper;
16
 
7241 nelberth 17
class HighPerformanceTeamsGroupsForm extends Form
18
{
19
 
7270 nelberth 20
    public function __construct($adapter, $company_id){
7241 nelberth 21
        parent::__construct();
7270 nelberth 22
        $this->setInputFilter(new HighPerformanceTeamsGroupsFilter($adapter));
7241 nelberth 23
 
24
        $this->add([
25
            'name' => 'title',
26
            'type' => \Laminas\Form\Element\Text::class,
27
            'attributes' => [
28
                'maxlength' 	=> 128,
29
                'id' 			=> 'title',
30
            ]
31
        ]);
32
 
33
 
34
        $this->add([
35
            'name' => 'description',
36
            'type' => \Laminas\Form\Element\Textarea::class,
37
            'attributes' => [
38
                'id'    => 'description',
39
            ]
40
        ]);
7297 nelberth 41
/*
7241 nelberth 42
        $this->add([
7270 nelberth 43
            'name' => 'members',
44
            'type' => \Laminas\Form\Element\Select::class,
45
            'attributes' => [
46
                'required'=> true,
47
                'multiple' 	=> 'yes',
48
                'id' => 'members'
49
            ],
50
            'options' => [
51
                'disable_inarray_validator' => true,
52
                'value_options' => $this->getSelectOptions($adapter,$company_id)
53
            ]
7297 nelberth 54
        ]);*/
7270 nelberth 55
        $this->add([
7241 nelberth 56
            'name' => 'status',
57
            'type' => \Laminas\Form\Element\Checkbox::class,
58
            'attributes' => [
59
                'id' 			=> 'status',
60
            ],
61
            'options' => [
16766 efrain 62
                'use_hidden_element' => false,
7241 nelberth 63
                'unchecked_value' => \LeadersLinked\Model\HighPerformanceTeamsGroups::STATUS_INACTIVE,
64
                'checked_value'=> \LeadersLinked\Model\HighPerformanceTeamsGroups::STATUS_ACTIVE,
65
            ]
66
        ]);
67
    }
68
 
7297 nelberth 69
  /*  private function getSelectOptions($adapter,$company_id)
7270 nelberth 70
    {
71
            $companyUserMapper = CompanyUserMapper::getInstance($adapter);
72
            $userMapper = UserMapper::getInstance($adapter);
73
            $datosCompanyUser = $companyUserMapper->fetchAllByCompanyId($company_id);
74
            $users=[];
75
 
76
            foreach($datosCompanyUser as $record){
77
                $datosUser = $userMapper->fetchOne($record->user_id);
78
                $users[$datosUser->uuid] = $datosUser->uuid;
79
            }
80
 
81
        return $users;
7297 nelberth 82
    }*/
7270 nelberth 83
 
7241 nelberth 84
}