Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17078 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17078 Rev 17178
Línea 3... Línea 3...
3
declare(strict_types=1);
3
declare(strict_types=1);
Línea 4... Línea 4...
4
 
4
 
Línea 5... Línea 5...
5
namespace LeadersLinked\Form\Microlearning;
5
namespace LeadersLinked\Form\Microlearning;
6
 
-
 
7
use Laminas\Form\Form;
-
 
8
use Laminas\Db\Adapter\AdapterInterface;
-
 
9
use Laminas\Log\LoggerInterface;
-
 
10
use LeadersLinked\Mapper\CompanySizeMapper;
-
 
11
use LeadersLinked\Mapper\IndustryMapper;
-
 
12
use LeadersLinked\Model\Feed;
-
 
13
use LeadersLinked\Model\MicrolearningTopic;
-
 
14
use LeadersLinked\Model\MicrolearningCapsule;
-
 
Línea 15... Línea 6...
15
use LeadersLinked\Model\Company;
6
 
16
 
7
use Laminas\Form\Form;
Línea 17... Línea 8...
17
 
8
 
18
class CapsuleAddForm extends Form
9
class CapsuleAddForm extends Form
19
{
10
{
20
 
11
 
21
    public function __construct($internal = false) 
-
 
Línea 22... Línea 12...
22
    {
12
    public function __construct() 
23
        parent::__construct();
13
    {
24
        $this->setInputFilter(new CapsuleAddFilter());
14
        parent::__construct();
25
 
15
        $this->setInputFilter(new CapsuleAddFilter());
Línea 45... Línea 35...
45
            'type' => \Laminas\Form\Element\Hidden::class,
35
            'type' => \Laminas\Form\Element\Hidden::class,
46
            'attributes' => [
36
            'attributes' => [
47
                'id' => 'file',
37
                'id' => 'file',
48
            ]
38
            ]
49
        ]);
39
        ]);
50
 
-
 
51
        $this->add([
-
 
52
            'name' => 'marketplace',
-
 
53
            'type' => \Laminas\Form\Element\Hidden::class,
-
 
54
            'attributes' => [
-
 
55
                'id' => 'marketplace',
-
 
56
            ]
-
 
57
        ]);
-
 
58
        
-
 
59
        $this->add([
-
 
60
            'name' => 'status',
-
 
61
            'type' => \Laminas\Form\Element\Select::class,
-
 
62
            'options' => [
-
 
63
                'empty_option' => 'LABEL_STATUS',
-
 
64
                'value_options' => [
-
 
65
                    MicrolearningCapsule::STATUS_ACTIVE => 'LABEL_ACTIVE',
-
 
66
                    MicrolearningCapsule::STATUS_INACTIVE => 'LABEL_INACTIVE',
-
 
67
                ],
-
 
68
            ],
-
 
69
            'attributes' => [
-
 
70
                'id' => 'status',
-
 
71
            ]
-
 
72
        ]);
-
 
73
        
-
 
74
        if($internal == Company::INTERNAL_YES) {
-
 
75
            $value_options = [
-
 
76
                MicrolearningCapsule::PRIVACY_PRIVATE => 'LABEL_PRIVATE',
-
 
77
                MicrolearningCapsule::PRIVACY_PUBLIC => 'LABEL_PUBLIC',
-
 
78
            ];
-
 
79
        } else {
-
 
80
            $value_options = [
-
 
81
                MicrolearningCapsule::PRIVACY_PRIVATE => 'LABEL_PRIVATE',
-
 
82
            ];
-
 
83
        }
-
 
84
        
-
 
85
        $this->add([
-
 
86
            'name' => 'privacy',
-
 
87
            'type' => \Laminas\Form\Element\Select::class,
-
 
88
            'options' => [
-
 
89
                'empty_option' => 'LABEL_PRIVACY',
-
 
90
                'value_options' => $value_options,
-
 
91
            ],
-
 
92
            'attributes' => [
-
 
93
                'id' => 'privacy',
-
 
94
            ]
-
 
95
        ]);
-
 
96
        
-
 
97
        if($internal == Company::INTERNAL_YES) {
-
 
98
            $value_options = [
-
 
99
                MicrolearningCapsule::TYPE_FREE => 'LABEL_FREE',
-
 
100
                MicrolearningCapsule::TYPE_SELLING => 'LABEL_SELLING',
-
 
101
                MicrolearningCapsule::TYPE_PRIVATE => 'LABEL_PRIVATE',
-
 
102
            ];
-
 
103
        } else {
-
 
104
            $value_options = [
-
 
105
                MicrolearningCapsule::TYPE_PRIVATE => 'LABEL_PRIVATE',
-
 
106
            ];
-
 
107
        }
-
 
108
        
-
 
109
        $this->add([
-
 
110
            'name' => 'type',
-
 
111
            'type' => \Laminas\Form\Element\Select::class,
-
 
112
            'options' => [
-
 
113
                'empty_option' => 'LABEL_TYPE',
-
 
114
                'value_options' => $value_options,
-
 
115
            ],
-
 
116
            'attributes' => [
-
 
117
                'id' => 'type',
-
 
118
            ]
-
 
119
        ]);
-
 
120
        
-
 
121
        $this->add([
-
 
122
            'name' => 'cost',
-
 
123
            'type' => \Laminas\Form\Element\Text::class,
-
 
124
            'attributes' => [
-
 
125
                'id'    => 'cost',
-
 
126
            ],
-
 
127
        ]);
-
 
128
    }
40
    }
129
}
41
}